简体   繁体   English

更改特殊插件向导的徽标

[英]changing the logo of wizards of special plugin

When I set the logo for my java plugin, the logo of other windows of eclipse are changed. 当我为Java插件设置徽标时,其他eclipse窗口的徽标也会更改。

I have a class which extends Wizard and implements IObjectActionDelegate . 我有一个扩展Wizard并实现IObjectActionDelegate Then, I have override the run function and write the below code in it. 然后,我重写了run函数,并在其中编写了以下代码。

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. 问题是我已经扩展了Wizard而不能扩展WizardDialog

Since you are creating WizardDialog yourself you can actually extend that class if you want. 由于您自己创建的WizardDialog您实际上可以根据需要扩展该类。

In a Wizard you can get the current Shell by calling: Wizard ,可以通过调用以下命令获取当前的命令行管理Shell

Shell shell = getContainer().getShell();

shell.setImage(your image);

It looks like the wizard addPages method would be suitable for this code. 看来向导的addPages方法适用于此代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM