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

下面列出了怎么用org.eclipse.swt.widgets.Tray的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 项目: BiglyBT   文件: TraySWT.java
public Tray getSWT() {
	return tray;
}
 
 类所在包
 同包方法