Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Tray


    IWorkbenchWindow primaryWindow = OwlUI.getPrimaryWindow();
    if (primaryWindow == null || !primaryWindow.equals(getWindowConfigurer().getWindow()))
      return;

    final Shell shell = primaryWindow.getShell();
    final Tray tray = shell.getDisplay().getSystemTray();

    /* Tray not support on the OS */
    if (tray == null)
      return;

View Full Code Here


    IWorkbenchWindow primaryWindow = OwlUI.getPrimaryWindow();
    if (primaryWindow == null || !primaryWindow.equals(getWindowConfigurer().getWindow()))
      return false;

    final Shell shell = primaryWindow.getShell();
    final Tray tray = shell.getDisplay().getSystemTray();

    /* Tray not support on the OS */
    if (tray == null)
      return false;

View Full Code Here

    if (primaryWindow == null || !primaryWindow.equals(getWindowConfigurer().getWindow()))
      return false;

    final Shell shell = primaryWindow.getShell();
    final int doubleClickTime = shell.getDisplay().getDoubleClickTime();
    final Tray tray = shell.getDisplay().getSystemTray();

    /* Tray not support on the OS */
    if (tray == null)
      return false;

View Full Code Here

        // button
        Button execute = new Button(shell, SWT.PUSH);
        //execute.setToolTipText("Run the command on the left (or press enter).");
        execute.setText("Parse Command");

        Tray tray = display.getSystemTray();
        if(tray != null) {
            itray = new TrayItem(tray, SWT.NONE);
            itray.setToolTipText("No");
            itray.setImage(smlcon);
        }
View Full Code Here

  /**
   * @return The single instance of the system tray
   */
  protected Tray systemTray() {
    Tray tray = syncExec(SWTUtils.display(), new WidgetResult<Tray>() {
      public Tray run() {
        return SWTUtils.display().getSystemTray();
      }
    });
    if (tray == null) {
View Full Code Here

  /**
   * @return The single instance of the system tray
   */
  protected Tray systemTray() {
    Tray tray = syncExec(SWTUtils.display(), new WidgetResult<Tray>() {
      public Tray run() {
        return SWTUtils.display().getSystemTray();
      }
    });
    if (tray == null) {
View Full Code Here

    if(formToolkit == null) formToolkit = new FormToolkit(display);
    return formToolkit;
  }
  public TrayItem getTrayItem() { return trayItem; }
  public void openTrayIcon() {
    final Tray tray = PlatformUI.getWorkbench().getDisplay().getSystemTray();
    if(tray == null) {
      logger.finest("System tray not available."); return;
    }
    trayItem = new TrayItem(tray,SWT.NONE);
    trayItem.setToolTipText("Gamers Own Instant Messenger");
    trayItem.setImage(GOIMIcons.getImage(GOIMIcons.TRAY_ICON_DEFAULT));

    final MenuManager trayMenu = new MenuManager("TrayMenu");
    trayMenu.createContextMenu(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
   
    trayMenu.add(new StartFirstStartWizard());
   
//    MenuItem exit = new MenuItem(trayMenu,SWT.PUSH);
//    exit.setText("Exit");
//   
//    exit.addListener(SWT.Selection,new Listener() {
//      public void handleEvent(Event event) {
//        PlatformUI.getWorkbench().close();
//      }
//    });
   
    GOIMGlobalMenu globalMenu = new GOIMGlobalMenu(trayMenu);
    globalMenu.createDefaultMenuItems(trayMenu);

    trayItem.addListener(SWT.MenuDetect,new Listener() {
      public void handleEvent(Event event) {
        trayMenu.setVisible(true);
      }
    });
    trayItem.addListener(SWT.DefaultSelection,new Listener() {
      public void handleEvent(Event event) {
        Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        shell.setVisible(true);
        shell.setMinimized(false);
        shell.forceActive();
        shell.forceFocus();
      }});
    trayItem.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event event) {
        Boolean makeVisible = null;
        IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
        for(IWorkbenchWindow window : windows) {
          boolean containsOnlyContactList = true;
          IWorkbenchPage[] pages = window.getPages();
          lookForContactList:
            for(IWorkbenchPage page : pages) {
              IViewReference[] refs = page.getViewReferences();
              for(IViewReference ref : refs) {
                if(!(ref.getView(false) instanceof IContactListView)) {
                  containsOnlyContactList = false;
                  break lookForContactList;
                }
              }
            }
          if(containsOnlyContactList) {
            Shell shell = window.getShell();
            if(makeVisible == null)
              makeVisible = !shell.getVisible();
            shell.setVisible(makeVisible);
            if(makeVisible.booleanValue()) {
              shell.setMinimized(false);
              shell.forceActive();
              shell.forceFocus();
            }
          }
        }
//        Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
//        boolean visible = !shell.getVisible();
//        shell.setVisible(visible);
//        if(visible) {
//          shell.setMinimized(false);
//          shell.forceActive();
//          shell.forceFocus();
//        }
      }});
        // register listener to handle menu requests
    trayItem.addListener(SWT.MenuDetect, new Listener() {
      public void handleEvent(Event event) {
        Shell hiddenShell = new Shell(trayItem.getDisplay());
        Menu menu = trayMenu.createContextMenu(hiddenShell);
        menu.setLocation(trayItem.getDisplay().getCursorLocation());
        menu.setVisible(true);
      }
    });
    trayItem.addListener(SWT.MouseDown,new Listener() {
      public void handleEvent(Event event) {
        if(event.button == 3) {
          logger.finest("second");
        }
      } });
    GOIMAccountList list = getAccountList();
    final SpheneListener<StatusChangedEvent> presenceListener = new SpheneListener<StatusChangedEvent>() {
      public void handleEvent(StatusChangedEvent event) {
        tray.getDisplay().asyncExec(new Runnable() {
          public void run() {
            trayItem.setImage(GOIMIcons.getImageForPresence(null,getGlobalPresence()));
          }
        });
      }
View Full Code Here

  /**
   * Initializes the tray icon.
   */
  private static void initTray() {
    Tray sysTray = main.getDisplay().getSystemTray();
    if (sysTray != null) {
      TrayItem item = new TrayItem(sysTray, SWT.NONE);
      item.setToolTipText(KEllyBot.VERSION);
      try {
        Image image = new Image(main.getDisplay(), "icon.png");
View Full Code Here

    private void createContents() {
      createTrayNotifier();
    }
   
  private void createTrayNotifier() {
    Tray tray = parent.getDisplay().getSystemTray();
       
        TrayItem trayItem = new TrayItem(tray, SWT.TRANSPARENCY_ALPHA);
        trayItem.setImage(new Image(parent.getDisplay(), "img/at.png"));

        String message = "Existem novas atualiza��es do Gerente Digital\n disponiveis para download.";
View Full Code Here

      }
    });
  }

  private TrayItem initTaskItem(IWorkbenchWindow window) {
    final Tray tray = window.getShell().getDisplay().getSystemTray();
    TrayItem trayItem = new TrayItem(tray, SWT.NONE);
    trayImage = AbstractUIPlugin.imageDescriptorFromPlugin(
        "de.toaot", "/icons/16-16/logo.png")
        .createImage();
    trayItem.setImage(trayImage);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Tray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.