Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Menu


        Control childControl = this.createContent( composite );
        control.setContent( composite );

        // context menu
        this.contextMenuManager = new MenuManager();
        Menu menu = this.contextMenuManager.createContextMenu( childControl );
        childControl.setMenu( menu );
    }
View Full Code Here


    /**
     * Shows the local view menu.
     */
    private void showViewMenu()
    {
        Menu aMenu = menuManager.createContextMenu( control );
        Point topLeft = new Point( 0, 0 );
        topLeft.y += menuToolBar.getBounds().height;
        topLeft = menuToolBar.toDisplay( topLeft );
        aMenu.setLocation( topLeft.x, topLeft.y );
        aMenu.setVisible( true );
    }
View Full Code Here

    public IMenuManager getContextMenuManager( TableViewer viewer )
    {
        if ( contextMenuManager == null )
        {
            contextMenuManager = new MenuManager();
            Menu menu = contextMenuManager.createContextMenu( viewer.getControl() );
            getCursor( viewer ).setMenu( menu );
        }
        return contextMenuManager;
    }
View Full Code Here

    }

    @Override
    public Menu getMenu(Control parent) {
        if (menu == null) {
            menu = new Menu(parent);
            createMenu(menu);
        }
        return menu;
    }
View Full Code Here

     */
    public void runWithEvent(Event event) {
        if (event.widget instanceof ToolItem) {
            ToolItem toolItem= (ToolItem) event.widget;
            Control control= toolItem.getParent();
            Menu menu= getMenu(control);

            Rectangle bounds= toolItem.getBounds();
            Point topLeft= new Point(bounds.x, bounds.y + bounds.height);
            menu.setLocation(control.toDisplay(topLeft));
            menu.setVisible(true);
        }
    }
View Full Code Here

        canvas = new Canvas(mapContainer, SWT.DOUBLE_BUFFERED);
        hoverShell = new HoverShell(canvas);
        MenuManager menuMgr= new MenuManager();
        menuMgr.setRemoveAllWhenShown(true);
        menuMgr.addMenuListener(menuListener);
        Menu menu = menuMgr.createContextMenu(canvas);
        canvas.setMenu(menu);
        getSite().registerContextMenu(menuMgr, theController.getSelectionProvider());       
        canvasListener = new CanvasListener(canvas);
       
        composite.layout();
View Full Code Here

    assertTrue( pageSwitcher.getItem( 0 ).isListening( SWT.Selection ) );
  }

  @Test
  public void testCreatePageSwitcher_pageSwitcherMenu() {
    Menu pageSwitcherMenu = webUI.getPageSwitcherMenu();

    assertNotNull( pageSwitcherMenu );
  }
View Full Code Here

    // don't show if the debug button is disabled.
    if (!isVisible()) {
      return;
    }

    Menu menu = manager.createContextMenu(applicationActionButton);
    applicationActionButton.setMenu(menu);

    Rectangle bounds = toolBar.getBounds();
    // Position the menu near the toolitem
    Point topRight = new Point(bounds.x + bounds.x / 10, bounds.height);
    topRight = applicationActionButton.toDisplay(topRight);
    menu.setLocation(topRight.x, topRight.y);

    menu.setVisible(true);

  }
View Full Code Here

        }

      }
    });

    Menu menu = menuManager.createContextMenu(getViewer().getControl());
    getViewer().getControl().setMenu(menu);

  }
View Full Code Here

      public void menuAboutToShow(IMenuManager manager) {
        fillApplicationsContextMenu(manager);
      }
    });

    Menu menu = menuManager.createContextMenu(applicationsViewer.getControl());
    applicationsViewer.getControl().setMenu(menu);
    editorPage.getSite().registerContextMenu(menuManager, applicationsViewer);

    Action addRemoveApplicationAction = new Action(Messages.ApplicationMasterPart_TEXT_ADD_REMOVE,
        ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_MODIFY_MODULES)) {
View Full Code Here

TOP

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

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.