private Menu createRootPopupMenu( Tree tree ) { if ( rootMenu == null ) { rootMenu = new Menu( tree ); MenuItem menuItem = new MenuItem( rootMenu, SWT.NONE ); menuItem.setText( BaseMessages.getString( PKG, "RunConfigurationPopupMenuExtension.MenuItem.New" ) ); menuItem.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { runConfigurationDelegate.create(); } } ); } return rootMenu; }
helperMenu = new Menu( shell, SWT.POP_UP ); } else { for ( MenuItem item : helperMenu.getItems() ) {
private Menu createItemPopupMenu( Tree tree ) { if ( itemMenu == null ) { itemMenu = new Menu( tree ); MenuItem editMenuItem = new MenuItem( itemMenu, SWT.NONE ); editMenuItem.setText( BaseMessages.getString( PKG, "RunConfigurationPopupMenuExtension.MenuItem.Edit" ) ); editMenuItem.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { runConfigurationDelegate.edit( runConfigurationManager.load( runConfiguration ) ); } } ); MenuItem deleteMenuItem = new MenuItem( itemMenu, SWT.NONE ); deleteMenuItem.setText( BaseMessages.getString( PKG, "RunConfigurationPopupMenuExtension.MenuItem.Delete" ) ); deleteMenuItem.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { runConfigurationDelegate.delete( runConfigurationManager.load( runConfiguration ) ); } } ); } return itemMenu; } }
final Menu menu = new Menu( text ); MenuItem item = new MenuItem( menu, SWT.NONE ); item.setText( BaseMessages.getString( PKG, "LogBrowser.CopySelectionToClipboard.MenuItem" ) );
@Override public void widgetSelected( SelectionEvent e ) { Menu menu = new Menu( shell ); for ( final PerspectiveData perspectiveData : perspectiveList ) { MenuItem item = new MenuItem( menu, SWT.CHECK ); if ( perspectiveData.isHidden() ) { item.setEnabled( false ); } if ( activePerspective.getId().equals( perspectiveData.getId() ) ) { item.setSelection( true ); } item.setText( perspectiveData.getName() ); item.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { Spoon.getInstance().loadPerspective( perspectiveData.getId() ); swtToolbar.forceFocus(); } } ); } ToolItem item = (ToolItem) e.widget; Rectangle rect = item.getBounds(); Point pt = item.getParent().toDisplay( new Point( rect.x, rect.y + rect.height ) ); menu.setLocation( pt.x, pt.y ); menu.setVisible( true ); } } );
Menu menu = new Menu( canvas ); for ( final StreamInterface stream : streams ) { MenuItem item = new MenuItem( menu, SWT.NONE );
@Override public void menuDetected( MenuDetectEvent event ) { if ( tree.getSelectionCount() < 1 ) { return; } TreeItem treeItem = tree.getSelection()[0]; if ( treeItem != null ) { String[] labels = ConstUI.getTreeStrings( treeItem ); int depth = ConstUI.getTreeLevel( treeItem ); if ( depth == 3 ) { final String metaStoreName = labels[0]; final String namespace = labels[1]; final String elementTypeName = labels[2]; final String elementName = labels[3]; Menu menu = new Menu( tree ); MenuItem removeItem = new MenuItem( menu, SWT.POP_UP ); removeItem.setText( "Remove element" ); removeItem.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent arg0 ) { removeElement( metaStoreName, namespace, elementTypeName, elementName ); } } ); tree.setMenu( menu ); menu.setVisible( true ); } } } } );
@Override public void widgetSelected( SelectionEvent e ) { if ( e.detail == SWT.DROP_DOWN ) { Menu menu = new Menu( shell, SWT.POP_UP ); MenuItem item1 = new MenuItem( menu, SWT.PUSH ); item1.setText( BaseMessages.getString( PKG, "Spoon.Menu.StopTranformation" ) ); item1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e1 ) { stopTransformation(); } } ); MenuItem item2 = new MenuItem( menu, SWT.PUSH ); item2.setText( BaseMessages.getString( PKG, "Spoon.Menu.SafeStopTranformation" ) ); item2.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e2 ) { safeStop(); } } ); menu.setLocation( shell.getDisplay().map( mainComposite.getParent(), null, mainComposite.getLocation() ) ); menu.setVisible( true ); } else { stopTransformation(); } } } );
@Override public void widgetSelected( SelectionEvent e ) { if ( e.detail == SWT.DROP_DOWN ) { Menu menu = new Menu( shell, SWT.POP_UP ); MenuItem item1 = new MenuItem( menu, SWT.PUSH ); item1.setText( BaseMessages.getString( PKG, "Spoon.Run.Run" ) ); item1.setAccelerator( SWT.F9 ); item1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e1 ) { runJob(); } } ); MenuItem item2 = new MenuItem( menu, SWT.PUSH ); item2.setText( BaseMessages.getString( PKG, "Spoon.Run.RunOptions" ) ); item2.setAccelerator( SWT.F8 ); item2.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e2 ) { runOptionsJob(); } } ); menu.setLocation( shell.getDisplay().map( mainComposite.getParent(), null, mainComposite.getLocation() ) ); menu.setVisible( true ); } else { runJob(); } } } );
@Override public void widgetSelected( SelectionEvent e ) { if ( e.detail == SWT.DROP_DOWN ) { Menu menu = new Menu( shell, SWT.POP_UP ); MenuItem item1 = new MenuItem( menu, SWT.PUSH ); item1.setText( BaseMessages.getString( PKG, "Spoon.Run.Run" ) ); item1.setAccelerator( SWT.F9 ); item1.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e1 ) { runTransformation(); } } ); MenuItem item2 = new MenuItem( menu, SWT.PUSH ); item2.setText( BaseMessages.getString( PKG, "Spoon.Run.RunOptions" ) ); item2.setAccelerator( SWT.F8 ); item2.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e2 ) { runOptionsTransformation(); } } ); menu.setLocation( shell.getDisplay().map( mainComposite.getParent(), null, mainComposite.getLocation() ) ); menu.setVisible( true ); } else { runTransformation(); } } } );
final CTabItem item = cTabFolder.getItem( point ); if ( item != null ) { Menu menu = new Menu( cTabFolder ); MenuItem closeItem = new MenuItem( menu, SWT.NONE ); closeItem.setText( BaseMessages.getString( PKG, "Spoon.Tab.Close" ) );
redoStack = new LinkedList<UndoRedoStack>(); styledText = new StyledText( this, args ); styledTextPopupmenu = new Menu( parent.getShell(), SWT.POP_UP ); xParent = parent; this.strTabName = strTabName;
private void initMenuMulti() { menu_Multi = new Menu(shell);
@Override public void widgetSelected( SelectionEvent event ) { final Menu connectionMenu = new Menu( toolBar.getShell() ); if ( repositoriesMeta != null ) { for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) {
private void initMenu() { menu = new Menu(tabFolder.getShell());
private void initMenuNull() { menu_null = new Menu(shell);
mTree = new Menu( wTree );
private void initMenuData() { menu_key = new Menu(shell);
private Menu initMenuTableServer() { Menu menu_server_1 = new Menu(shell);