Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Menu.addListener()


      if (flags == SWT.CASCADE) {
        // just create a proxy for now, if the user shows it then
        // fill it in
        Menu subMenu = new Menu(parent);
        subMenu.addListener(SWT.Show, getMenuCreatorListener());
        subMenu.addListener(SWT.Hide, getMenuCreatorListener());
        mi.setMenu(subMenu);
      }

      update(null);
View Full Code Here


      if (flags == SWT.CASCADE) {
        // just create a proxy for now, if the user shows it then
        // fill it in
        Menu subMenu = new Menu(parent);
        subMenu.addListener(SWT.Show, getMenuCreatorListener());
        subMenu.addListener(SWT.Hide, getMenuCreatorListener());
        mi.setMenu(subMenu);
      }

      update(null);
View Full Code Here

      if (itemMenu != null) {
        // create a proxy for any sub menu items
        final Menu subMenu = new Menu(proxy);
        subMenu.setData(itemMenu);
        proxyItem.setMenu(subMenu);
        subMenu.addListener(SWT.Show, new Listener() {
          public void handleEvent(Event event) {
            event.widget.removeListener(SWT.Show, this);
            if (event.type == SWT.Show) {
              copyMenu(itemMenu, subMenu);
            }
View Full Code Here

            if (event.type == SWT.Show) {
              copyMenu(itemMenu, subMenu);
            }
          }
        });
        subMenu.addListener(SWT.Help, passThrough);
        subMenu.addListener(SWT.Hide, passThrough);
      }
    }
  }
 
View Full Code Here

              copyMenu(itemMenu, subMenu);
            }
          }
        });
        subMenu.addListener(SWT.Help, passThrough);
        subMenu.addListener(SWT.Hide, passThrough);
      }
    }
  }
 
  /**
 
View Full Code Here

                popupParent.addListener(SWT.MouseEnter, new Listener() {
                    public void handleEvent(Event e) {
                        if (CREATE_POPUP_PARENT_SHELL) {
                            // Install a listener to hide the (created) popup parent once the menu is
                            // dismissed. (Don't count on 0x0 sized shells to be invisible without this)
                            menu.addListener(SWT.Hide, new Listener() {
                                public void handleEvent(Event e) {
                                    if (!popupParent.isDisposed()) {
                                        // System.err.println("hiding popup parent");
                                        popupParent.setVisible(false);
                                    }
View Full Code Here

        // If parent has a menu then use that one
        Menu parentMenu = toolBar.getParent().getMenu();
        if ((parentMenu != null) && (!parentMenu.isDisposed())) {
            toolBar.setMenu(parentMenu);
            // Hook listener to remove menu once it has disapeared
            parentMenu.addListener(SWT.Hide, new Listener() {

                public void handleEvent(Event innerEvent) {
                    ToolBar innerToolBar = toolBarManager.getControl();
                    if (innerToolBar != null) {
                        innerToolBar.setMenu(null);
View Full Code Here

  }

  public Menu getMenu(Menu parent) {
    System.out.println("AccountAction getMenu(Menu)");
    final Menu menu = new Menu(parent);
    menu.addListener(SWT.Show,new Listener() {
      public void handleEvent(Event event) {
        System.out.println("Show Menu...");
        try {
          Object obj = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
          if(obj instanceof IContactListView) {
View Full Code Here

                MenuItem accountItem = new MenuItem(menu,SWT.CASCADE);
                accountItem.setText(account.name + " (" + account.jid + ")");
               
                final Menu accountMenu = new Menu(accountItem);
                accountItem.setMenu(accountMenu);
                accountMenu.addListener(SWT.Show,new Listener() {
                  public void handleEvent(Event event) {
                    Menu accMenu = listView.getActiveAccountContextMenu(acc);
                    copyMenu(accMenu,accountMenu);
                  } });
                accountMenu.addListener(SWT.Hide,new Listener() {
View Full Code Here

        System.out.println("Data: " + e.data);
      }
    });
    Menu menu = new Menu(chatHistory.getShell(),SWT.POP_UP);
    // TODO add context menu to chat history ..
    menu.addListener(SWT.Show, new Listener() {
      public void handleEvent(Event event) {
       
      }
    });
    chatHistory.setMenu(menu);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.