类org.eclipse.swt.widgets.TrayItem源码实例Demo

下面列出了怎么用org.eclipse.swt.widgets.TrayItem的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: logbook   文件: ApplicationMain.java
/**
 * Open the window.
 */
public void open() {
    try {
        Display display = Display.getDefault();
        this.createContents();
        this.shell.open();
        this.shell.layout();
        while (!this.shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    } finally {
        Tray tray = Display.getDefault().getSystemTray();
        if (tray != null) {
            for (TrayItem item : tray.getItems()) {
                item.dispose();
            }
        }
    }
}
 
源代码2 项目: logbook   文件: ApplicationMain.java
/**
 * トレイアイコンを追加します
 *
 * @param display
 * @return
 */
private TrayItem addTrayItem(final Display display) {
    // トレイアイコンを追加します
    Tray tray = display.getSystemTray();
    TrayItem item = new TrayItem(tray, SWT.NONE);
    Image image = display.getSystemImage(SWT.ICON_INFORMATION);
    item.setImage(image);
    item.setToolTipText(AppConstants.NAME + AppConstants.VERSION);
    item.addListener(SWT.Selection, new TraySelectionListener(this.shell));
    item.addMenuDetectListener(new TrayItemMenuListener(this.getShell()));
    return item;
}
 
源代码3 项目: tuxguitar   文件: TGTray.java
public void removeTray(){
	if (this.tray != null) {
		setVisible(true);
		TrayItem items[] = this.tray.getItems();
		for(int i = 0; i < items.length; i ++){
			items[i].dispose();
		}
		this.menu.dispose();
	}
}
 
源代码4 项目: BiglyBT   文件: TrayItemSWT.java
public TrayItemSWT(TrayDelegate tray, int style) {
	item = new TrayItem(((TraySWT) tray).getSWT(), style);
}
 
源代码5 项目: logbook   文件: ApplicationMain.java
/**
 * @return トレイアイコン
 */
public TrayItem getTrayItem() {
    return this.trayItem;
}
 
源代码6 项目: tuxguitar   文件: TGTrayIcon.java
public void setItem(TrayItem item){
	this.item = item;
}
 
 类所在包
 类方法
 同包方法