List of usage examples for org.eclipse.jface.action Separator Separator
public Separator(String groupName)
From source file:ac.soton.fmusim.components.presentation.ComponentsActionBarContributor.java
License:Open Source License
/** * This adds Separators for editor additions to the tool bar. * <!-- begin-user-doc -->//w w w .j a v a 2s. c o m * <!-- end-user-doc --> * @generated */ @Override public void contributeToToolBar(IToolBarManager toolBarManager) { toolBarManager.add(new Separator("components-settings")); toolBarManager.add(new Separator("components-additions")); }
From source file:ac.soton.fmusim.components.presentation.ComponentsActionBarContributor.java
License:Open Source License
/** * This adds to the menu bar a menu and some separators for editor additions, * as well as the sub-menus for object creation items. * <!-- begin-user-doc -->/*from w w w . j a va 2 s .co m*/ * <!-- end-user-doc --> * @generated */ @Override public void contributeToMenu(IMenuManager menuManager) { super.contributeToMenu(menuManager); IMenuManager submenuManager = new MenuManager( ComponentsEditorPlugin.INSTANCE.getString("_UI_ComponentsEditor_menu"), "ac.soton.fmusim.componentsMenuID"); menuManager.insertAfter("additions", submenuManager); submenuManager.add(new Separator("settings")); submenuManager.add(new Separator("actions")); submenuManager.add(new Separator("additions")); submenuManager.add(new Separator("additions-end")); // Prepare for CreateChild item addition or removal. // createChildMenuManager = new MenuManager( ComponentsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); submenuManager.insertBefore("additions", createChildMenuManager); // Prepare for CreateSibling item addition or removal. // createSiblingMenuManager = new MenuManager( ComponentsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); submenuManager.insertBefore("additions", createSiblingMenuManager); // Force an update because Eclipse hides empty menus now. // submenuManager.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager menuManager) { menuManager.updateAll(true); } }); addGlobalActions(submenuManager); }
From source file:ac.soton.fmusim.components.presentation.ComponentsActionBarContributor.java
License:Open Source License
/** * This inserts global actions before the "additions-end" separator. * <!-- begin-user-doc -->//from ww w .j av a 2 s . c om * <!-- 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); }
From source file:ac.soton.fmusim.components.presentation.ComponentsEditor.java
License:Open Source License
/** * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. * <!-- begin-user-doc -->/*w w w . jav a 2 s . c om*/ * <!-- 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() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); }
From source file:ac.soton.xeventb.ui.AbstractXEventBActionProvider.java
License:Open Source License
/** * Adds the following to the input context menu. * <ul>/* w ww .ja v a 2s . c o m*/ * <li>GROUP_NEW Separator * * <li>GROUP_OPEN Separator * * <li>OPEN Action to GROUP_OPEN. * </ul> * * @param menu * The input menu manager. */ @Override public void fillContextMenu(final IMenuManager menu) { super.fillContextMenu(menu); final ICommonActionExtensionSite site = this.getActionSite(); Separator _separator = new Separator(ICommonMenuConstants.GROUP_NEW); menu.add(_separator); menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, this.getOpenAction(site)); menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, this.getDeleteAction(site)); }
From source file:ar.com.tadp.xml.rinzo.core.XMLEditorConfiguration.java
License:Open Source License
public void editorContextMenuAboutToShow(IMenuManager menu) { Separator item = new Separator("rinzoAdditions"); menu.appendToGroup("group.save", item); menu.add(item);/* w ww . ja v a 2 s. c o m*/ }
From source file:at.bitandart.zoubek.mervin.model.modelreview.presentation.ModelReviewActionBarContributor.java
License:Open Source License
/** * This adds Separators for editor additions to the tool bar. <!-- * begin-user-doc --> <!-- end-user-doc --> * /*from w w w . j a va 2 s.com*/ * @generated */ @Override public void contributeToToolBar(IToolBarManager toolBarManager) { toolBarManager.add(new Separator("modelreview-settings")); toolBarManager.add(new Separator("modelreview-additions")); }
From source file:at.bitandart.zoubek.mervin.model.modelreview.presentation.ModelReviewActionBarContributor.java
License:Open Source License
/** * This adds to the menu bar a menu and some separators for editor * additions, as well as the sub-menus for object creation items. <!-- * begin-user-doc --> <!-- end-user-doc --> * //from w ww . j a v a 2 s . com * @generated */ @Override public void contributeToMenu(IMenuManager menuManager) { super.contributeToMenu(menuManager); IMenuManager submenuManager = new MenuManager( MervinModelReviewEditorPlugin.INSTANCE.getString("_UI_ModelReviewEditor_menu"), "at.bitandart.zoubek.mervin.model.modelreviewMenuID"); menuManager.insertAfter("additions", submenuManager); submenuManager.add(new Separator("settings")); submenuManager.add(new Separator("actions")); submenuManager.add(new Separator("additions")); submenuManager.add(new Separator("additions-end")); // Prepare for CreateChild item addition or removal. // createChildMenuManager = new MenuManager( MervinModelReviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); submenuManager.insertBefore("additions", createChildMenuManager); // Prepare for CreateSibling item addition or removal. // createSiblingMenuManager = new MenuManager( MervinModelReviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); submenuManager.insertBefore("additions", createSiblingMenuManager); // Force an update because Eclipse hides empty menus now. // submenuManager.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager menuManager) { menuManager.updateAll(true); } }); addGlobalActions(submenuManager); }
From source file:at.bitandart.zoubek.mervin.model.modelreview.presentation.ModelReviewEditor.java
License:Open Source License
/** * 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 -->//from w ww . j a v a 2 s .c om * * @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)); }
From source file:at.medevit.elexis.gdt.ui.GDTProtokollView.java
License:Open Source License
@Override public void createPartControl(Composite parent) { initTableViewer(parent);// new TableViewerBuilder(parent); ColumnBuilder messageDirection = createColumn(""); messageDirection.bindToProperty("messageDirection"); messageDirection.format(new ICellFormatter() { @Override/* w w w . j a v a2 s . c o m*/ public void formatCell(ViewerCell cell, Object value) { String direction = (String) value; cell.setText(""); if (direction.equalsIgnoreCase(GDTProtokoll.MESSAGE_DIRECTION_IN)) { cell.setImage( ResourceManager.getPluginImage("at.medevit.elexis.gdt", "rsc/icons/incoming.png")); } else if (direction.equalsIgnoreCase(GDTProtokoll.MESSAGE_DIRECTION_OUT)) { cell.setImage( ResourceManager.getPluginImage("at.medevit.elexis.gdt", "rsc/icons/outgoing.png")); } } }); messageDirection.setPixelWidth(23); messageDirection.build(); ColumnBuilder entryTime = createColumn("Datum/Uhrzeit"); entryTime.bindToProperty("entryTime"); entryTime.format(new IValueFormatter<TimeTool, String>() { @Override public String format(TimeTool obj) { return obj.toString(TimeTool.FULL_GER); } @Override public TimeTool parse(String obj) { return new TimeTool(obj); } }); entryTime.setPercentWidth(15); entryTime.useAsDefaultSortColumn(); entryTime.build(); ColumnBuilder gdtSatz = createColumn("Satzart"); gdtSatz.bindToValue(new BaseValue<GDTProtokoll>() { @Override public Object get(GDTProtokoll entry) { return entry.get(GDTProtokoll.FLD_MESSAGE_TYPE); } }); gdtSatz.setPercentWidth(5); gdtSatz.build(); ColumnBuilder bezeichnung = createColumn("Bezeichnung"); bezeichnung.bindToProperty("bezeichnung"); bezeichnung.makeEditable(); bezeichnung.setPercentWidth(25); bezeichnung.build(); ColumnBuilder bemerkungen = createColumn("Bemerkungen"); bemerkungen.bindToProperty("bemerkungen"); bemerkungen.makeEditable(); bemerkungen.setPercentWidth(25); bemerkungen.build(); ColumnBuilder patient = createColumn("Patient"); patient.bindToProperty("entryRelatedPatient"); patient.format(new IValueFormatter<Patient, String>() { @Override public String format(Patient obj) { return obj.getLabel(); } @Override public Patient parse(String obj) { return null; } }); patient.setPercentWidth(10); patient.build(); ColumnBuilder gegenstelle = createColumn("Gegenstelle"); gegenstelle.bindToProperty("gegenstelle"); gegenstelle.setPercentWidth(15); gegenstelle.build(); tableViewer.setContentProvider(ArrayContentProvider.getInstance()); tableViewer.setInput(null); MenuManager menuManager = new MenuManager(); menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); table.setMenu(menuManager.createContextMenu(table)); getSite().registerContextMenu(menuManager, tableViewer); getSite().setSelectionProvider(tableViewer); }