-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target platform icon for "Load TP" job #1034
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder why there is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One is the "old" eclipse.ui and the other the "new" rcp E4 ... but I think the E4 one is not really completed and would need a declarative way (e4xmi) to add icons for job groups. |
||
import org.eclipse.ui.texteditor.IDocumentProvider; | ||
import org.osgi.framework.BundleContext; | ||
|
||
|
@@ -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()); | ||
Comment on lines
+222
to
+230
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't this be simply done in a static initializer in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The job lives in pde.core. The registration for the icon happens with the workbench progress service, which looks like a UI dependent class to me. I'm not sure if that service can be retrieved in the plain pde.core bundle without disturbing the workbench lifecycle. In egit we therefore even put that code into a service reacting to the application has started lifecycle. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think given the current structure, this is fine, an alternative might be to use an addon in the e4xmi but that really seems a bit overhead here... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You are right and no, I don't know better in this case. |
||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding this new API I would prefer to move
JOB_FAMILITY_ID
as public constant to an internal class, e.g.ICoreConstants
, and references it that here and int PDEPlugin.