只更改特殊插件的标志 [英] Only changing the logo of special plugin

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

问题描述

当我以下面的方式设置插件的标志时,所有其他窗口中eclipse的标志也发生了变化.我只想更改我的工具的徽标,而不是 eclipse 的其他窗口.

When I set the logo of my plugin in a below way, the logo of eclipse in all other windows are also changed. I would like to change only the logo of my tool, not other windows of eclipse.

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

推荐答案

正如您所见 setDefaultImage 设置用于所有窗口的默认图像.

As you have found setDefaultImage sets the default image used for all windows.

而是创建您自己的向导对话框类,扩展 WizardDialog 并覆盖 configureShell 方法.调用 Shell.setImage 方法:

Instead create your own wizard dialog class extending WizardDialog and override the configureShell method. Call the Shell.setImage method:

@Override
protected void configureShell(Shell shell) {
  super.configureShell(shell);

  shell.setImage(your image);
}

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

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