Skip to content

Commit

Permalink
Target platform icon for "Load TP" job
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Bananeweizen authored and laeubi committed Jan 16, 2024
1 parent 8fbf299 commit 21e6da9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,11 @@ private void resetPlatform(IProgressMonitor monitor) {
PDECore.getDefault().getFeatureModelManager().targetReloaded();
}

/**
* @since 3.17
*/
public static Object getFamily() {
return JOB_FAMILY_ID;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.pde.core.target.LoadTargetDefinitionJob;
import org.eclipse.pde.internal.core.PDEPreferencesManager;
import org.eclipse.pde.internal.ui.launcher.PDELogFileProvider;
import org.eclipse.pde.internal.ui.shared.target.RepositoryBundleContainerAdapterFactory;
Expand All @@ -42,6 +43,7 @@
import org.eclipse.ui.internal.views.log.ILogFileProvider;
import org.eclipse.ui.internal.views.log.LogFilesManager;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.osgi.framework.BundleContext;

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

TargetStatus.initializeTargetStatus();
registerProgressIcon();
}

protected void registerProgressIcon() {
if (!PlatformUI.isWorkbenchRunning()) {
return;
}
IProgressService service = PlatformUI.getWorkbench().getProgressService();
if (service == null) {
return;
}
service.registerIconForFamily(PDEPluginImages.DESC_TARGET_DEFINITION, LoadTargetDefinitionJob.getFamily());
}

@Override
Expand Down

0 comments on commit 21e6da9

Please sign in to comment.