Java Code Examples for org.eclipse.swt.widgets.Display#getSystemTray()

The following examples show how to use org.eclipse.swt.widgets.Display#getSystemTray() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationMain.java    From logbook with MIT License 5 votes vote down vote up
/**
 * トレイアイコンを追加します
 *
 * @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;
}
 
Example 2
Source File: TraySWT.java    From BiglyBT with GNU General Public License v2.0 4 votes vote down vote up
public TraySWT(Display display) {
	tray = display.getSystemTray();
}