changing the logo of wizards of special plugin

懵懂的女人 提交于 2019-12-25 00:53:23

问题


When I set the logo for my java plugin, the logo of other windows of eclipse are changed.

I have a class which extends Wizard and implements IObjectActionDelegate. Then, I have override the run function and write the below code in it.

wizard = new StartWizard();
dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
Bundle bundle = Platform.getBundle("Plugin");
URL url = FileLocator.find(bundle, new Path("icon/Logo.png"), null);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
Image image = desc.createImage();
WizardDialog.setDefaultImage(image);

I have read the solution set forth to the similar post on Only changing the logo of special plugin. The problem is that I have extended Wizard and cannot extend WizardDialog instead.


回答1:


Since you are creating WizardDialog yourself you can actually extend that class if you want.

In a Wizard you can get the current Shell by calling:

Shell shell = getContainer().getShell();

shell.setImage(your image);

It looks like the wizard addPages method would be suitable for this code.



来源:https://stackoverflow.com/questions/55878345/changing-the-logo-of-wizards-of-special-plugin

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