@Override public void topLevelElementChanged(final boolean workingSetTopLevel) { if (actionBars != null) { final IToolBarManager toolBarManager = actionBars.getToolBarManager(); toolBarManager.remove(selectWorkingSetDelegate); toolBarManager.remove(showHiddenWorkingSetsDelegate); if (workingSetManagerBroker.isWorkingSetTopLevel()) { toolBarManager.add(selectWorkingSetDelegate); final WorkingSetManager manager = workingSetManagerBroker.getActiveManager(); if (manager != null) { WorkingSet[] allItems = manager.getAllWorkingSets(); WorkingSet[] items = manager.getWorkingSets(); updateShowHiddenAction(allItems, items); } } selectTopLevelElementAction.fillActionBars(actionBars); actionBars.updateActionBars(); } }
private void updateShowHiddenAction(final WorkingSet[] allItems, final WorkingSet[] items) { final IToolBarManager toolBarManager = actionBars.getToolBarManager(); toolBarManager.remove(showHiddenWorkingSetsDelegate); if (allItems.length > items.length) { toolBarManager.add(showHiddenWorkingSetsDelegate); } }
private void addActionToToolbar(Action action) { IActionBars actionBars = getViewSite().getActionBars(); // IMenuManager dropDownMenu = actionBars.getMenuManager(); IToolBarManager toolBar = actionBars.getToolBarManager(); // dropDownMenu.add(action); toolBar.add(action); }
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(); } }
protected void contributeToToolBar(final IManagedForm headerForm, final IToolBarManager toolBarManager) { RefreshAction refreshAction = getRefreshAction(); if (refreshAction != null) { toolBarManager.add(refreshAction); } DataModel<?, ?, ?> parentModel = getParentModel(); DataModelElementType parentModelElementType = getParentModelElementType(); if (parentModel != null && parentModelElementType != null) { final BaseControlContribution parentImageHyperlinkToolBarContribution = createImageHyperlinkToolBarContribution( "Parent Link", parentModel, parentModelElementType); if (parentImageHyperlinkToolBarContribution != null) { addImageHyperlinkToolBarContribution(headerForm, toolBarManager, parentImageHyperlinkToolBarContribution, parentModel); } } DataModel<?, ?, ?> ownerModel = getOwnerModel(); DataModelElementType ownerModelElementType = getOwnerModelElementType(); if (ownerModel != null && ownerModelElementType != null && ownerModel != parentModel) { final BaseControlContribution ownerImageHyperlinkToolBarContribution = createImageHyperlinkToolBarContribution( "Owner Link", ownerModel, ownerModelElementType); if (ownerImageHyperlinkToolBarContribution != null) { addImageHyperlinkToolBarContribution(headerForm, toolBarManager, ownerImageHyperlinkToolBarContribution, ownerModel); } } }
@Override protected void contributeToToolBar(IToolBarManager toolBarManager) { super.contributeToToolBar(toolBarManager); ControlContribution toolBarCompositeContribution = new ControlContribution(getToolBarCompositeContributionId()) { @Override protected Control createControl(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Composite toolBarComposite = toolkit.createComposite(parent); FormLayout toolBarCompositeLayout = new FormLayout(); toolBarCompositeLayout.marginTop = 0; toolBarCompositeLayout.marginBottom = 0; toolBarCompositeLayout.marginLeft = 4; toolBarCompositeLayout.marginRight = 4; toolBarCompositeLayout.spacing = 4; toolBarComposite.setLayout(toolBarCompositeLayout); _ToolBarLabel = toolkit.createLabel(toolBarComposite, "", SWT.RIGHT); FormData toolBarLabelFormData = new FormData(); toolBarLabelFormData.top = new FormAttachment(0, 0); toolBarLabelFormData.left = new FormAttachment(0, 0); toolBarLabelFormData.right = new FormAttachment(100, 0); // HACK: I really struggled to get this label to show up. toolBarLabelFormData.width = 100; _ToolBarLabel.setLayoutData(toolBarLabelFormData); return toolBarComposite; } }; toolBarManager.add(toolBarCompositeContribution); }
/** * 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$ }
@Override protected void fillCoolBar ( final ICoolBarManager coolBar ) { final IToolBarManager toolbar = new ToolBarManager ( SWT.FLAT | SWT.RIGHT ); coolBar.add ( new ToolBarContributionItem ( toolbar, "main" ) ); toolbar.add ( getAction ( ActionFactory.NEW_WIZARD_DROP_DOWN.getId () ) ); coolBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) ); }
/** * 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 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 ( "detailview-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "detailview-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "visualinterface-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "visualinterface-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "deployment-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "deployment-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "setup-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "setup-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "osgi-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "osgi-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "world-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "world-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "memory-settings" ) ); toolBarManager.add ( new Separator ( "memory-additions" ) ); }
/** * 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 ( "recipe-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "recipe-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "infrastructure-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "infrastructure-additions" ) ); //$NON-NLS-1$ }
/** * This is a callback that will allow us to create the viewer and initialize * it. */ public void createPartControl(Composite parent) { GridLayout layout = new GridLayout(); layout.numColumns = 2; parent.setLayout(layout); layoutData1 = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); layoutData1.grabExcessHorizontalSpace = true; layoutData1.grabExcessVerticalSpace = true; layoutData1.horizontalAlignment = GridData.FILL; layoutData1.verticalAlignment = GridData.FILL; layoutData1.exclude = false; this.parent = parent; viewer = new List(this.parent, SWT.SINGLE | SWT.V_SCROLL); list = new List(this.parent, SWT.SINGLE | SWT.V_SCROLL); viewer.setLayoutData(layoutData1); list.setLayoutData(layoutData1); parent.layout(); makeActions(); hookDoubleClickAction(); contributeToActionBars(); IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager(); mgr.add(selectAction); }
/** * 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 ( "item-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "item-additions" ) ); //$NON-NLS-1$ }
/** * 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 ( "configuration-settings" ) ); //$NON-NLS-1$ toolBarManager.add ( new Separator ( "configuration-additions" ) ); //$NON-NLS-1$ }
private void createToolbar() { IToolBarManager manager = getViewSite().getActionBars().getToolBarManager(); manager.add(settingsEngine); manager.add(optionsAction); manager.add(searchAction); manager.add(clearLogsAction); manager.add(scrollLockAction); }
public void createControl(Composite parent) { super.createControl(parent); labelProvider = new BashEditorOutlineLabelProvider(); 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 contributeToToolBar(IToolBarManager toolBarManager) { super.contributeToToolBar(toolBarManager); toolBarManager.add(getAction(ActionFactory.UNDO.getId())); toolBarManager.add(getAction(ActionFactory.REDO.getId())); toolBarManager.add(getAction(ActionFactory.DELETE.getId())); }
public void contributeToToolBar(IToolBarManager toolBarManager) { toolBarManager.add(getAction(ActionFactory.UNDO.getId())); toolBarManager.add(getAction(ActionFactory.REDO.getId())); toolBarManager.add(getAction(ActionFactory.DELETE.getId())); toolBarManager.add(new Separator()); toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN)); toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT)); toolBarManager.add(new ZoomComboContributionItem(getPage())); toolBarManager.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY)); toolBarManager.add(getAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY)); toolBarManager.add(getAction(ActionFactory.COPY.getId())); toolBarManager.add(getAction(ActionFactory.PASTE.getId())); toolBarManager.add(new Separator()); toolBarManager.add(getAction(ClearEdgeBendpointLayoutAction.ID)); }
private void fillLocalToolBar(IToolBarManager manager) { manager.add(collapseAllAction); manager.add(trackAction); manager.add(reloadAction); if (activePage instanceof FolderViewerPage) { manager.add(chooseFolderAction); } if (activePage instanceof PlatformViewerPage) { manager.add(showReadOnlyAction); } manager.add(viewModeAction); manager.add(addAction); manager.add(removeAction); manager.add(copyAction); }
public void contributeToToolBar(IToolBarManager toolBarManager) { toolBarManager.add(getAction(ActionFactory.DELETE.getId())); toolBarManager.add(getAction(ActionFactory.UNDO.getId())); toolBarManager.add(getAction(ActionFactory.REDO.getId())); toolBarManager.add(new Separator()); toolBarManager.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY)); toolBarManager.add(new Separator()); toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN)); toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT)); String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH }; toolBarManager.add(new ZoomComboContributionItem(getPage(), zoomStrings)); }
private void fillLocalToolBar(IToolBarManager manager) { }
private void fillCustomToolBar(IToolBarManager manager) { manager.add(actionShowHistory); }
/** * This accesses a cached version of the content outliner. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IContentOutlinePage getContentOutlinePage() { if (contentOutlinePage == null) { // The content outline is just a tree. // class MyContentOutlinePage extends ContentOutlinePage { @Override public void createControl(Composite parent) { super.createControl(parent); contentOutlineViewer = getTreeViewer(); contentOutlineViewer.addSelectionChangedListener(this); // Set up the tree viewer. // contentOutlineViewer.setUseHashlookup(true); contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); contentOutlineViewer.setInput(editingDomain.getResourceSet()); // Make sure our popups work. // createContextMenuFor(contentOutlineViewer); if (!editingDomain.getResourceSet().getResources().isEmpty()) { // Select the root object in the view. // contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); } } @Override public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { super.makeContributions(menuManager, toolBarManager, statusLineManager); contentOutlineStatusLineManager = statusLineManager; } @Override public void setActionBars(IActionBars actionBars) { super.setActionBars(actionBars); getActionBarContributor().shareGlobalActions(this, actionBars); } } contentOutlinePage = new MyContentOutlinePage(); // Listen to selection so that we can handle it is a special way. // contentOutlinePage.addSelectionChangedListener (new ISelectionChangedListener() { // This ensures that we handle selections correctly. // public void selectionChanged(SelectionChangedEvent event) { handleContentOutlineSelection(event.getSelection()); } }); } return contentOutlinePage; }
/** * This accesses a cached version of the content outliner. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IContentOutlinePage getContentOutlinePage() { if (contentOutlinePage == null) { // The content outline is just a tree. // class MyContentOutlinePage extends ContentOutlinePage { @Override public void createControl(Composite parent) { super.createControl(parent); contentOutlineViewer = getTreeViewer(); contentOutlineViewer.addSelectionChangedListener(this); // Set up the tree viewer. // contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); contentOutlineViewer.setInput(editingDomain.getResourceSet()); // Make sure our popups work. // createContextMenuFor(contentOutlineViewer); if (!editingDomain.getResourceSet().getResources().isEmpty()) { // Select the root object in the view. // contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); } } @Override public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { super.makeContributions(menuManager, toolBarManager, statusLineManager); contentOutlineStatusLineManager = statusLineManager; } @Override public void setActionBars(IActionBars actionBars) { super.setActionBars(actionBars); getActionBarContributor().shareGlobalActions(this, actionBars); } } contentOutlinePage = new MyContentOutlinePage(); // Listen to selection so that we can handle it is a special way. // contentOutlinePage.addSelectionChangedListener (new ISelectionChangedListener() { // This ensures that we handle selections correctly. // public void selectionChanged(SelectionChangedEvent event) { handleContentOutlineSelection(event.getSelection()); } }); } return contentOutlinePage; }
private void addActionToToolbar(Action action) { IActionBars actionBars = getViewSite().getActionBars(); IToolBarManager toolBar = actionBars.getToolBarManager(); toolBar.add(action); }
public void contributeToToolBar(IToolBarManager manager) { }
private void contributeGraphicalEditorToolBarAction(IToolBarManager toolBarManager) { toolBarManager.add(actionMap.get(ActionFactory.UNDO.getId())); toolBarManager.add(actionMap.get(ActionFactory.REDO.getId())); toolBarManager.add(actionMap.get(ActionFactory.DELETE.getId())); toolBarManager.add(actionMap.get(GEFActionConstants.TOGGLE_GRID_VISIBILITY)); }
protected void contributeToToolBar(IToolBarManager toolBarManager) { }
@Override public void contributeToToolBar(IToolBarManager toolBarManager) { toolBarManager.add(this.getAction(ActionFactory.REDO.getId())); toolBarManager.add(this.getAction(ActionFactory.UNDO.getId())); }