问题
When I set the logo of my plugin in a below way, the logo of eclipse
in all other windows are also changed. I would like to change only the logo of my tool, not other windows of eclipse
.
dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
Bundle bundle = Platform.getBundle("MyPlugin");
URL url = FileLocator.find(bundle, new Path("icon/MyLogo.png"), null);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
Image image = desc.createImage();
dialog.setDefaultImage(image);
回答1:
As you have found setDefaultImage
sets the default image used for all windows.
Instead create your own wizard dialog class extending WizardDialog
and override the configureShell
method. Call the Shell.setImage
method:
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setImage(your image);
}
来源:https://stackoverflow.com/questions/48165110/only-changing-the-logo-of-special-plugin