[英]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.