Package org.eclipse.swt.widgets

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


    dropDownItem.setImage(dropDownImage);
    final Menu menu = new Menu(dropDownBar);
    dropDownItem.addDisposeListener(new DisposeListener() {

      public void widgetDisposed(DisposeEvent e) {
        menu.dispose();
      }
    });
    dropDownItem.addSelectionListener(new SelectionAdapter() {

      public void widgetSelected(SelectionEvent e) {
View Full Code Here


        .getImage("IMG_LCL_RENDERED_VIEW_MENU")); //$NON-NLS-1$
    final Menu menu = new Menu(dropDownBar);
    dropDownItem.addDisposeListener(new DisposeListener() {

      public void widgetDisposed(DisposeEvent e) {
        menu.dispose();
      }
    });
    MenuItem preferencesItem = new MenuItem(menu, SWT.PUSH);
    preferencesItem.setText(UIText.CommitDialog_ConfigureLink);
    preferencesItem.addSelectionListener(new SelectionAdapter() {
View Full Code Here

    public void setMenu(Menu menu) {
        Menu currentMenu = super.getMenu();
        if (currentMenu != null && INTERNAL_MENU.equals(currentMenu.getData())) {
            // internal menu set
            if (menu != null) {
                currentMenu.dispose();
                super.setMenu(menu);
            }
        } else
            super.setMenu(menu);
    }
View Full Code Here

        {
            @Override
            public void widgetDisposed(DisposeEvent e)
            {
                if (!contextMenu.isDisposed())
                    contextMenu.dispose();
            }
        });
    }
}
View Full Code Here

        menu.setVisible(true);
        while (!menu.isDisposed() && menu.isVisible()) {
          if (!display.readAndDispatch())
            display.sleep();
        }
        menu.dispose();
      }
    });
  }

  private void addSubMenus() {
View Full Code Here

  }

  private static void registerDefaultPopupMenu(final Browser browser) {
    Menu oldMenu = browser.getMenu();
    if(oldMenu != null) {
      oldMenu.dispose();
    }
    if(!"mozilla".equals(browser.getBrowserType())) {
      browser.setMenu(null);
      return;
    }
View Full Code Here

      if(isDefaultPopupMenuRegistered) {
        registerDefaultPopupMenu(browser);
      } else {
        Menu oldMenu = browser.getMenu();
        if(oldMenu != null) {
          oldMenu.dispose();
        }
        final Menu menu = new Menu(browser.getShell(), SWT.POP_UP);
        menu.addMenuListener(new MenuAdapter() {
          @Override
          public void menuShown(MenuEvent e) {
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.