更改特殊插件向导的徽标

问题描述 投票:0回答:1

当我为我的java插件设置徽标时,更改了eclipse的其他窗口的徽标。

我有一个类扩展Wizard并实现IObjectActionDelegate。然后,我重写了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);

我已经阅读了Only changing the logo of special plugin上类似帖子中提出的解决方案。问题是我扩展了Wizard而不能扩展WizardDialog

java eclipse swt
1个回答
1
投票

由于您自己创建WizardDialog,因此您可以根据需要扩展该类。

Wizard中,您可以通过以下方式获取当前的Shell

Shell shell = getContainer().getShell();

shell.setImage(your image);

看起来向导addPages方法适合此代码。

© www.soinside.com 2019 - 2024. All rights reserved.