Only changing the logo of special plugin

落爺英雄遲暮 提交于 2020-01-16 17:01:04

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!