更改特殊插件向导的标志 [英] changing the logo of wizards of special plugin

查看:42
本文介绍了更改特殊插件向导的标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我为我的java插件设置logo时,eclipse的其他窗口的logo发生了变化.

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

我有一个扩展 Wizard 并实现 IObjectActionDelegate 的类.然后,我覆盖了 run 函数并在其中编写了以下代码.

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);

我已阅读 只更改特殊插件的标志.问题是我已经扩展了 Wizard 并且不能扩展 WizardDialog 代替.

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.

推荐答案

由于您是自己创建 WizardDialog,您实际上可以根据需要扩展该类.

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

Wizard 中,您可以通过调用获取当前的 Shell:

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

Shell shell = getContainer().getShell();

shell.setImage(your image);

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

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

这篇关于更改特殊插件向导的标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆