Skip to content

Commit 21e6da9

Browse files
Bananeweizenlaeubi
authored andcommitted
Target platform icon for "Load TP" job
Register the typical target platform icon for the job family of the "Loading target platform" job. That leads to the icon being shown next to the progress bar of the progress view, similar to how the build has its own icon and all egit, m2e etc. jobs have their own icon.
1 parent 8fbf299 commit 21e6da9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/core/target/LoadTargetDefinitionJob.java

+7
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,11 @@ private void resetPlatform(IProgressMonitor monitor) {
185185
PDECore.getDefault().getFeatureModelManager().targetReloaded();
186186
}
187187

188+
/**
189+
* @since 3.17
190+
*/
191+
public static Object getFamily() {
192+
return JOB_FAMILY_ID;
193+
}
194+
188195
}

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPlugin.java

+14
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.eclipse.jface.dialogs.ErrorDialog;
2727
import org.eclipse.jface.dialogs.IDialogSettings;
2828
import org.eclipse.jface.preference.IPreferenceStore;
29+
import org.eclipse.pde.core.target.LoadTargetDefinitionJob;
2930
import org.eclipse.pde.internal.core.PDEPreferencesManager;
3031
import org.eclipse.pde.internal.ui.launcher.PDELogFileProvider;
3132
import org.eclipse.pde.internal.ui.shared.target.RepositoryBundleContainerAdapterFactory;
@@ -42,6 +43,7 @@
4243
import org.eclipse.ui.internal.views.log.ILogFileProvider;
4344
import org.eclipse.ui.internal.views.log.LogFilesManager;
4445
import org.eclipse.ui.plugin.AbstractUIPlugin;
46+
import org.eclipse.ui.progress.IProgressService;
4547
import org.eclipse.ui.texteditor.IDocumentProvider;
4648
import org.osgi.framework.BundleContext;
4749

@@ -214,6 +216,18 @@ public void start(BundleContext context) throws Exception {
214216
LogFilesManager.addLogFileProvider(fLogFileProvider);
215217

216218
TargetStatus.initializeTargetStatus();
219+
registerProgressIcon();
220+
}
221+
222+
protected void registerProgressIcon() {
223+
if (!PlatformUI.isWorkbenchRunning()) {
224+
return;
225+
}
226+
IProgressService service = PlatformUI.getWorkbench().getProgressService();
227+
if (service == null) {
228+
return;
229+
}
230+
service.registerIconForFamily(PDEPluginImages.DESC_TARGET_DEFINITION, LoadTargetDefinitionJob.getFamily());
217231
}
218232

219233
@Override

0 commit comments

Comments
 (0)