@Override public void createPartControl ( final Composite parent ) { this.container = parent; createEditingDomain (); parent.setLayout ( new FillLayout () ); this.viewer = new TreeViewer ( parent ); this.viewer.setAutoExpandLevel ( 2 ); this.viewer.setContentProvider ( new AdapterFactoryContentProvider ( this.factory ) ); this.viewer.setLabelProvider ( new AdapterFactoryLabelProvider ( this.factory ) ); createContextMenuFor ( this.viewer ); new AdapterFactoryTreeEditor ( this.viewer.getTree (), this.factory ); getViewSite ().setSelectionProvider ( this.viewer ); attachSelectionService (); getViewSite ().getActionBars ().getMenuManager ().add ( new Separator ( "additions" ) ); this.actionBarContributor.init ( getViewSite ().getActionBars () ); this.actionBarContributor.setViewPart ( this ); }
protected void addImageHyperlinkToolBarContribution(final IManagedForm headerForm, final IToolBarManager toolBarManager, final BaseControlContribution baseControlContribution, final DataModel<?, ?, ?> model) { final Separator separator = new Separator(); toolBarManager.add(separator); toolBarManager.add(baseControlContribution); baseControlContribution.addControlDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { if (!model.isDestroyed()) { // Only do this clean up when the model destruction caused the widget disposal // WARNING: toolBarManager.update(true); throws a NullPointer if called during app exit. return; } toolBarManager.remove(separator); separator.dispose(); toolBarManager.remove(baseControlContribution); toolBarManager.update(true); } }); }
private void fillContextMenu(IMenuManager manager) { if (_TableViewer.getSelection().isEmpty()) { return; } manager.add(_NewZnodeAction); manager.add(new Separator()); manager.add(_OpenAction); manager.add(new Separator()); manager.add(_TableEditAction); manager.add(_TableEditChildrenAction); manager.add(new Separator()); if (_DeleteAction.isEnabled()) { manager.add(_DeleteAction); } manager.add(new Separator()); manager.add(_RefreshAction); }
@Override public void fillContextMenu(IMenuManager manager) { ZooKeeperOpenAction openAction = getOpenAction(); if (openAction != null && openAction.isEnabled()) { manager.add(openAction); } ZooKeeperDeleteAction deleteAction = getDeleteAction(); if (deleteAction != null && deleteAction.isEnabled()) { manager.add(new Separator()); manager.add(deleteAction); } RefreshAction refreshAction = getRefreshAction(); if (refreshAction != null && refreshAction.isEnabled()) { manager.add(new Separator()); manager.add(refreshAction); } }
private void fillToolbar ( final IContributionManager contributionManager ) { contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.MINUTES, "<1m>", "Scale to one minute" ) ); contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.HOURS, "<1h>", "Scale to one hour" ) ); contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.DAYS, "<1d>", "Scale to one day" ) ); contributionManager.add ( new CenterNowAction () ); contributionManager.add ( new Separator () ); contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.DAYS, "<1d", "Move back 1 day" ) ); contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.HOURS, "<1h", "Move back 1 hour" ) ); contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.MINUTES, "<1m", "Move back 1 minute" ) ); contributionManager.add ( new Separator () ); contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.MINUTES, "1m>", "Move forward 1 minute" ) ); contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.HOURS, "1h>", "Move forward 1 hour" ) ); contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.DAYS, "1d>", "Move forward 1 day" ) ); contributionManager.add ( new Separator () ); contributionManager.add ( new HelpAction () ); }
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$ contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
private void createViewMenu(MenuManager menuManager) { MenuManager viewMenu = createMenu(menuManager, MenuConstants.VIEW); menuManager.add(viewMenu); viewMenu.setVisible(true); if (actionFactory == null) { actionFactory = new ActionFactory(this); } viewMenu.add(actionFactory.getAction(GridViewAction.class.getName())); viewMenu.add(actionFactory.getAction(FormattedViewAction.class.getName())); viewMenu.add(actionFactory.getAction(UnformattedViewAction.class.getName())); viewMenu.add(new Separator()); viewMenu.add(actionFactory.getAction(ReloadAction.class.getName())); viewDataPreferencesVO = getViewDataPreferencesFromPreferenceFile(); viewMenu.add(actionFactory.getAction(PreferencesAction.class.getName())); }
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor ( StructuredViewer viewer ) { MenuManager contextMenu = new MenuManager ( "#PopUp" ); contextMenu.add ( new Separator ( "additions" ) ); contextMenu.setRemoveAllWhenShown ( true ); contextMenu.addMenuListener ( this ); Menu menu = contextMenu.createContextMenu ( viewer.getControl () ); viewer.getControl ().setMenu ( menu ); getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) ); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () }; viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) ); viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) ); }
/** * This inserts global actions before the "additions-end" separator. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void addGlobalActions(IMenuManager menuManager) { menuManager.insertAfter("additions-end", new Separator("ui-actions")); menuManager.insertAfter("ui-actions", showPropertiesViewAction); refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); menuManager.insertAfter("ui-actions", refreshViewerAction); super.addGlobalActions(menuManager); }
private void fillContextMenu(IMenuManager manager) { manager.add(actionRelaunch); manager.add(actionRelaunchFailed); manager.add(actionStop); manager.add(new Separator()); manager.add(actionLock); manager.add(new Separator()); // Other plug-ins can contribute their actions here manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); }
private void fillLocalToolBar(IToolBarManager manager) { manager.add(actionShowHistory); manager.add(new Separator()); manager.add(actionLock); manager.add(new Separator()); manager.add(actionRelaunch); manager.add(actionRelaunchFailed); manager.add(actionStop); }
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void createContextMenuFor(StructuredViewer viewer) { MenuManager contextMenu = new MenuManager("#PopUp"); contextMenu.add(new Separator("additions")); contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(this); Menu menu= contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
public void createControl(Composite parent) { super.createControl(parent); labelProvider = new BatchEditorOutlineLabelProvider(); TreeViewer viewer = getTreeViewer(); viewer.setContentProvider(contentProvider); viewer.addDoubleClickListener(this); viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider)); viewer.addSelectionChangedListener(this); /* it can happen that input is already updated before control created */ if (input != null) { viewer.setInput(input); } toggleLinkingAction = new ToggleLinkingAction(); toggleLinkingAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR); IActionBars actionBars = getSite().getActionBars(); IToolBarManager toolBarManager = actionBars.getToolBarManager(); toolBarManager.add(toggleLinkingAction); IMenuManager viewMenuManager = actionBars.getMenuManager(); viewMenuManager.add(new Separator("EndFilterGroup")); //$NON-NLS-1$ viewMenuManager.add(new Separator("treeGroup")); //$NON-NLS-1$ viewMenuManager.add(toggleLinkingAction); /* * when no input is set on init state - let the editor rebuild outline * (async) */ if (input == null && editor != null) { editor.rebuildOutline(); } }
@Override public void fillContextMenu(IMenuManager manager) { NewZnodeAction newZnodeAction = getNewZnodeAction(); if (newZnodeAction != null && newZnodeAction.isEnabled()) { manager.add(newZnodeAction); } ZooKeeperOpenAction openAction = getOpenAction(); if (openAction != null && openAction.isEnabled()) { manager.add(new Separator()); manager.add(openAction); } TableEditAction tableEditAction = getTableEditAction(); if (tableEditAction != null && tableEditAction.isEnabled()) { manager.add(new Separator()); manager.add(tableEditAction); } TableEditChildrenAction tableEditChildrenAction = getTableEditChildrenAction(); if (tableEditChildrenAction != null && tableEditChildrenAction.isEnabled()) { manager.add(tableEditChildrenAction); } ZooKeeperDeleteAction deleteAction = getDeleteAction(); if (deleteAction != null && deleteAction.isEnabled()) { manager.add(new Separator()); manager.add(deleteAction); } RefreshAction refreshAction = getRefreshAction(); if (refreshAction != null && refreshAction.isEnabled()) { manager.add(new Separator()); manager.add(refreshAction); } }
/** * This adds Separators for editor additions to the tool bar. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void contributeToToolBar ( IToolBarManager toolBarManager ) { toolBarManager.add ( new Separator ( "protocol-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "protocol-additions" ) ); //$NON-NLS-1$ }
/** * This inserts global actions before the "additions-end" separator. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void addGlobalActions ( IMenuManager menuManager ) { menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) ); //$NON-NLS-1$ //$NON-NLS-2$ menuManager.insertAfter ( "ui-actions", showPropertiesViewAction ); //$NON-NLS-1$ refreshViewerAction.setEnabled ( refreshViewerAction.isEnabled () ); menuManager.insertAfter ( "ui-actions", refreshViewerAction ); //$NON-NLS-1$ super.addGlobalActions ( menuManager ); }
/** * This inserts global actions before the "additions-end" separator. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void addGlobalActions(IMenuManager menuManager) { menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$ menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$ super.addGlobalActions(menuManager); }
/** * This adds Separators for editor additions to the tool bar. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void contributeToToolBar ( final IToolBarManager toolBarManager ) { toolBarManager.add ( new Separator ( "chart-settings" ) ); toolBarManager.add ( new Separator ( "chart-additions" ) ); }
/** * This inserts global actions before the "additions-end" separator. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected void addGlobalActions ( final IMenuManager menuManager ) { menuManager.insertAfter ( "additions-end", new Separator ( "ui-actions" ) ); menuManager.insertAfter ( "ui-actions", this.showPropertiesViewAction ); this.refreshViewerAction.setEnabled ( this.refreshViewerAction.isEnabled () ); menuManager.insertAfter ( "ui-actions", this.refreshViewerAction ); menuManager.insertAfter ( "ui-actions", this.saveAsAction ); super.addGlobalActions ( menuManager ); }