-
Notifications
You must be signed in to change notification settings - Fork 78
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?
Target platform icon for "Load TP" job #1034
Conversation
Test Results 4 files - 273 4 suites - 273 6m 10s ⏱️ - 44m 50s Results for commit 21e6da9. ± Comparison against base commit 8fbf299. This pull request removes 3330 tests.
♻️ This comment has been updated with latest results. |
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.
Thanks, in general a good idea.
Just a few remarks about how to implement this.
/** | ||
* @since 3.17 | ||
*/ | ||
public static Object getFamily() { |
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why there is org.eclipse.ui.progress.IProgressService
and org.eclipse.e4.ui.progress.IProgressService
which looks very similar.
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.
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.
protected void registerProgressIcon() { | ||
if (!PlatformUI.isWorkbenchRunning()) { | ||
return; | ||
} | ||
IProgressService service = PlatformUI.getWorkbench().getProgressService(); | ||
if (service == null) { | ||
return; | ||
} | ||
service.registerIconForFamily(PDEPluginImages.DESC_TARGET_DEFINITION, LoadTargetDefinitionJob.getFamily()); |
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.
Can't this be simply done in a static initializer in LoadTargetDefinitionJob
?
This would also solve the problem where to place the job-family constant.
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.
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.
Do you know better?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know better?
You are right and no, I don't know better in this case.
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.
aaaf0f6
to
21e6da9
Compare
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.
Since we can't add the icon in the Job itself please create constant for the job-family instead of adding a new API method getFamily()
.
Besides that this change is fine.
protected void registerProgressIcon() { | ||
if (!PlatformUI.isWorkbenchRunning()) { | ||
return; | ||
} | ||
IProgressService service = PlatformUI.getWorkbench().getProgressService(); | ||
if (service == null) { | ||
return; | ||
} | ||
service.registerIconForFamily(PDEPluginImages.DESC_TARGET_DEFINITION, LoadTargetDefinitionJob.getFamily()); |
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.
Do you know better?
You are right and no, I don't know better in this case.
@Bananeweizen can you apply the suggestion from @HannesWell so we can merge this? |
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.