There are 2 code examples for org.eclipse.swt.widgets.Tray.

The API names are highlighted below. You can use suckoo button to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.

Project Name: rssowl.ui Package: org.rssowl.ui.internal

Source Code: ApplicationWorkbenchWindowAdvisor.java (Click to view .java file)

Method Code:
vote
like

public void handleEvent(Event event){
  boolean restoreOnDoubleclick=fPreferences.getBoolean(DefaultPreferences.RESTORE_TRAY_DOUBLECLICK);
  boolean isDoubleClick=(event.type == SWT.DefaultSelection);
  if (isDoubleClick)   lastDoubleClickTime=System.currentTimeMillis();
  if (!isDoubleClick && restoreOnDoubleclick && Application.IS_WINDOWS) {
    NotificationService service=Controller.getDefault().getNotificationService();
    if (service.isPopupVisible()) {
      service.closePopup();
    }
 else     if (!service.wasPopupRecentlyClosed()) {
      JobRunner.runInBackgroundThread(doubleClickTime,new Runnable(){
        public void run(){
          if (lastDoubleClickTime < System.currentTimeMillis() - doubleClickTime) {
            JobRunner.runInUIThread(tray,new Runnable(){
              public void run(){
                if (!shell.isDisposed())                 onSingleClick(shell);
              }
            }
);
          }
        }
      }
);
    }
  }
  if (restoreOnDoubleclick != isDoubleClick)   return;
  if (!shell.isVisible())   restoreFromTray(shell);
 else   if (!Application.IS_WINDOWS)   moveToTray(shell);
}
 

Project Name: rssowl.ui Package: org.rssowl.ui.internal

Source Code: ApplicationWorkbenchWindowAdvisor.java (Click to view .java file)

Method Code:
vote
like

public void run(){
  if (lastDoubleClickTime < System.currentTimeMillis() - doubleClickTime) {
    JobRunner.runInUIThread(tray,new Runnable(){
      public void run(){
        if (!shell.isDisposed())         onSingleClick(shell);
      }
    }
);
  }
}