Eclipse RCP 系统任务栏
来源:互联网 发布:网络用语2017最新 编辑:程序博客网 时间:2024/05/21 22:35
下面给RCP应用添加系统任务栏图标和右键菜单。最小化应用时,会在系统任务栏显示这个图标。
创建新工程"jzvslm.info.rcp.intro.traytest",用"Hello RCP" 模板。创建command,id设置为"jzvslm.info.rcp.intro.traytest.exitCommand" 。按照上次创建的command的方法创建exitCommand的默认处理类。
打开类"ApplicationWorkbenchWindowAdvisor" 并填写下面的代码。
package jzvslm.info.rcp.intro.traytest;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tray;
import org.eclipse.swt.widgets.TrayItem;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
private IWorkbenchWindow window;
private TrayItem trayItem;
private Image trayImage;
private final static String COMMAND_ID = "jzvslm.info.rcp.intro.traytest.exitCommand";
public ApplicationWorkbenchWindowAdvisor(
IWorkbenchWindowConfigurer configurer) {
super(configurer);
}
public ActionBarAdvisor createActionBarAdvisor(
IActionBarConfigurer configurer) {
return new ApplicationActionBarAdvisor(configurer);
}
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(400, 300));
configurer.setShowCoolBar(false);
configurer.setShowStatusLine(false
转载请注明: Eclipse RCP 系统任务栏 | 君子?流氓?
- Eclipse RCP 系统任务栏
- Eclipse RCP及使用SWTBot测试Eclipse RCP应用系统
- 添加完整的Eclipse RCP帮助系统
- Eclipse RCP
- Eclipse RCP
- eclipse RCP
- RCP Eclipse
- eclipse rcp 插件开发 (系统学习eclipse)
- [转载]RCP开发中实用的Eclipse系统类
- Eclipse RCP二三事
- google:“eclipse rcp”
- Eclipse RCP 之 状态栏
- eclipse RCP启动修改
- 实践Eclipse RCP +Spring
- Eclipse RCP技术简介
- Eclipse RCP: Declarative Actions
- Eclipse RCP入门
- Eclipse RCP基本概念
- Web 领域那些阴魂不散的产品,技术与思想
- HDU 1083(图论,二分匹配)
- Java相对路径读取文件
- 页面中声明方式定义的用户控件与页面事件的执行顺序
- 帮帮忙
- Eclipse RCP 系统任务栏
- 最后期限摘要
- Altium Designer之模块复用——设备图表符与Snippets
- xml文件的序列化 和反序列化
- Spring简单的一个schema 介绍
- 嵌入式Linux之我行——S3C2440上MMC/SD卡驱动实例开发讲解(二)[转]
- 有关SoftICE的详细操作指导教程
- pku 1003 Hangover
- ASP.NET程序中常用的三十三种代码