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

The following examples show how to use org.eclipse.swt.widgets.Display#getSystemTray() . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: logbook   File: ApplicationMain.java    License: 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 Project: BiglyBT   File: TraySWT.java    License: GNU General Public License v2.0 4 votes vote down vote up
public TraySWT(Display display) {
	tray = display.getSystemTray();
}