org.eclipse.jface.action.Separator Java Examples

The following examples show how to use org.eclipse.jface.action.Separator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EditTemplateDialog.java    From typescript.java with MIT License 6 votes vote down vote up
private void fillContextMenu(IMenuManager menu) {
	menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_UNDO));
	menu.appendToGroup(ITextEditorActionConstants.GROUP_UNDO,
			(IAction) fGlobalActions.get(ITextEditorActionConstants.UNDO));

	menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
	menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
			(IAction) fGlobalActions.get(ITextEditorActionConstants.CUT));
	menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
			(IAction) fGlobalActions.get(ITextEditorActionConstants.COPY));
	menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
			(IAction) fGlobalActions.get(ITextEditorActionConstants.PASTE));
	menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
			(IAction) fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));

	menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE));
	menu.appendToGroup(IContextMenuConstants.GROUP_GENERATE, (IAction) fGlobalActions.get("ContentAssistProposal")); //$NON-NLS-1$
}
 
Example #2
Source File: ComponentEditor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 NOT
 */
protected void createContextMenuFor ( final StructuredViewer viewer )
{
    final MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
    contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
    contextMenu.setRemoveAllWhenShown ( true );
    contextMenu.addMenuListener ( this );
    final Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
    viewer.getControl ().setMenu ( menu );
    getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );

    final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
    final Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance (), ItemTransfer.getInstance () };
    viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
    viewer.addDropSupport ( dndOperations, transfers, new DropAdapterExtension ( this.editingDomain, viewer ) );
}
 
Example #3
Source File: SDView.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Creates the menu group.
 */
protected void createMenuGroup() {
    IActionBars bar = getViewSite().getActionBars();
    if (bar == null) {
        return;
    }
    bar.getToolBarManager().add(new Separator(UML2SD_VIEW_MODES_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_WORKING_SET_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_SORTING_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_FILTERING_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_VIEW_LAYOUT_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_LINK_EDITOR_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_OTHER_COMMANDS_SEPARATOR));
    bar.getToolBarManager().add(new Separator(UML2SD_OTHER_PLUGINS_COMMANDS_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_VIEW_MODES_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_WORKING_SET_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_SORTING_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_FILTERING_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_VIEW_LAYOUT_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_LINK_EDITOR_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_OTHER_COMMANDS_SEPARATOR));
    bar.getMenuManager().add(new Separator(UML2SD_OTHER_PLUGINS_COMMANDS_SEPARATOR));
}
 
Example #4
Source File: VisualInterfaceEditor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 ) );
}
 
Example #5
Source File: JavaSearchResultPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void init(IPageSite site) {
	super.init(site);
	IMenuManager menuManager = site.getActionBars().getMenuManager();
	menuManager.insertBefore(IContextMenuConstants.GROUP_PROPERTIES, new Separator(GROUP_FILTERING));
	fActionGroup.fillActionBars(site.getActionBars());
	menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new Action(SearchMessages.JavaSearchResultPage_preferences_label) {
		@Override
		public void run() {
			String pageId= "org.eclipse.search.preferences.SearchPreferencePage"; //$NON-NLS-1$
			String[] displayedPages= { pageId,
					"org.eclipse.ui.editors.preferencePages.Annotations", //$NON-NLS-1$
					"org.eclipse.ui.preferencePages.ColorsAndFonts" //$NON-NLS-1$
			};
			PreferencesUtil.createPreferenceDialogOn(JavaPlugin.getActiveWorkbenchShell(), pageId, displayedPages, null).open();
		}
	});
}
 
Example #6
Source File: PortingActionProvider.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
private void addExportMenu(IMenuManager aMenu) {

		exportWizardActionGroup.setContext(getContext());
		if (exportWizardActionGroup.getWizardActionIds().length == 0) {
			aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction);
			return;
		}
		IMenuManager submenu = new MenuManager(
				WorkbenchNavigatorMessages.PortingActionProvider_ExportResourcesMenu_label,
				COMMON_NAVIGATOR_EXPORT_MENU);
		exportWizardActionGroup.fillContextMenu(submenu);

		submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
		submenu.add(new Separator());
		submenu.add(exportAction);
		aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu);
	}
 
Example #7
Source File: SvnPropertiesView.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * fill the popup menu for the table
 */
private void fillTableMenu(IMenuManager manager) {
	manager.add(getRefreshAction());

	Action action = getAddPropertyAction();
	try { 		
		if (resource != null)
			action.setEnabled(resource.isManaged());
		else
			action.setEnabled(false);
	} catch (SVNException e) {
		action.setEnabled(false);
	}
	manager.add(action);

	manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
Example #8
Source File: ProfileEditor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 ) );
}
 
Example #9
Source File: CallHierarchyViewPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
protected void fillCallHierarchyViewerContextMenu(IMenuManager menu) {
      JavaPlugin.createStandardGroups(menu);

menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, fRefreshSingleElementAction);
      menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, new Separator(GROUP_FOCUS));

      if (fFocusOnSelectionAction.canActionBeAdded()) {
          menu.appendToGroup(GROUP_FOCUS, fFocusOnSelectionAction);
      }
      if (fExpandWithConstructorsAction.canActionBeAdded()) {
      	menu.appendToGroup(GROUP_FOCUS, fExpandWithConstructorsAction);
      }
      
      if (fRemoveFromViewAction.canActionBeAdded()){
      	menu.appendToGroup(GROUP_FOCUS, fRemoveFromViewAction);
      }

      fActionGroups.setContext(new ActionContext(getSelection()));
      fActionGroups.fillContextMenu(menu);
      fActionGroups.setContext(null);

if (fCopyAction.canActionBeAdded()) {
	menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, fCopyAction);
}
  }
 
Example #10
Source File: DataSetNodeProvider.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates the context menu for the given object. Gets the action from the
 * actionRegistry and adds the action to the menu.
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
		IMenuManager menu )
{
	super.createContextMenu( sourceViewer, object, menu );

	menu.insertBefore( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", //$NON-NLS-1$
			new ShowPropertyAction( object ) );

	menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", new Separator( ) ); //$NON-NLS-1$
	IAction action = new RefreshAction( sourceViewer );
	if (action.isEnabled( ))
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", action ); //$NON-NLS-1$
	}
}
 
Example #11
Source File: ViewMenus.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
private void fillContextMenu(IMenuManager manager, List<IContributionItem> contributionItems){
	manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
	for (IContributionItem contributionItem : contributionItems) {
		if (contributionItem == null) {
			manager.add(new Separator());
			continue;
		} else if (contributionItem instanceof ActionContributionItem) {
			ActionContributionItem ac = (ActionContributionItem) contributionItem;
			if (ac.getAction() instanceof RestrictedAction) {
				((RestrictedAction) ac.getAction()).reflectRight();
			}
		}
		contributionItem.update();
		manager.add(contributionItem);
	}
}
 
Example #12
Source File: GenerateActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private int fillViewSubMenu(IMenuManager source) {
	int added= 0;
	source.add(new Separator(GROUP_COMMENT));
	added+= addAction(source, fAddJavaDocStub);
	source.add(new Separator(GROUP_EDIT));
	added+= addAction(source, fFormatAll);
	source.add(new Separator(GROUP_IMPORT));
	added+= addAction(source, fAddImport);
	added+= addAction(source, fOrganizeImports);
	added+= addAction(source, fSortMembers);
	added+= addAction(source, fCleanUp);
	source.add(new Separator(GROUP_GENERATE));
	added+= addAction(source, fOverrideMethods);
	added+= addAction(source, fAddGetterSetter);
	added+= addAction(source, fAddDelegateMethods);
	added+= addAction(source, fHashCodeEquals);
	added+= addAction(source, fToString);
	added+= addAction(source, fGenerateConstructorUsingFields);
	added+= addAction(source, fAddUnimplementedConstructors);
	source.add(new Separator(GROUP_CODE));
	source.add(new Separator(GROUP_EXTERNALIZE));
	added+= addAction(source, fExternalizeStrings);
	added+= addAction(source, fFindNLSProblems);
	return added;
}
 
Example #13
Source File: AbapGitStagingObjectMenuFactory.java    From ADT_Frontend with MIT License 6 votes vote down vote up
private void buildContextMenu(IMenuManager menuManager) {
	TreeSelection selection = (TreeSelection) this.treeViewer.getSelection();

	//open object action
	this.menuManager.add(this.openAction);
	this.menuManager.add(new Separator());
	if (this.unstaged) {
		//stage objects action
		this.menuManager.add(this.stageAction);
	} else {
		//unstage objects action
		this.menuManager.add(this.unstageAction);
	}
	//TODO: remove this check after the 2002 upgrade
	if (this.stagingService.isFileCompareSupported(selection.getFirstElement())) {
		//file compare
		this.menuManager.add(this.compareAction);
	}
	if (selection.size() == 1) {
		this.menuManager.add(new Separator());
		//copy name to clipboard action
		this.menuManager.add(this.copyAction);
	}
}
 
Example #14
Source File: ReferencesSearchGroup.java    From typescript.java with MIT License 6 votes vote down vote up
public void fillContextMenu(IMenuManager manager) {
	MenuManager javaSearchMM = new MenuManager(getName(), IContextMenuConstants.GROUP_SEARCH);
	// addAction(fFindReferencesAction, javaSearchMM);
	addAction(fFindReferencesInProjectAction, javaSearchMM);
	// addAction(fFindReferencesInHierarchyAction, javaSearchMM);

	javaSearchMM.add(new Separator());
	//
	// Iterator iter= SearchUtil.getLRUWorkingSets().sortedIterator();
	// while (iter.hasNext()) {
	// addWorkingSetAction((IWorkingSet[]) iter.next(), javaSearchMM);
	// }
	// addAction(fFindReferencesInWorkingSetAction, javaSearchMM);

	if (!javaSearchMM.isEmpty())
		manager.appendToGroup(fGroupId, javaSearchMM);
}
 
Example #15
Source File: FlameChartView.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * @since 1.2
 */
@Override
protected void fillLocalToolBar(@Nullable IToolBarManager manager) {
    if (manager == null) {
        return;
    }
    makeActions();
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getConfigureSymbolsAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getShowFilterDialogAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getResetScaleAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getPreviousEventAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getNextEventAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getToggleBookmarkAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getPreviousMarkerAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getNextMarkerAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fPreviousItemAction);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fNextItemAction);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getZoomInAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getZoomOutAction());
}
 
Example #16
Source File: ApplicationActionBarAdvisor.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 创建帮助菜单
 * @return 返回帮助菜单的 menu manager;
 */
private MenuManager createHelpMenu() {
	MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.help"),
			IWorkbenchActionConstants.M_HELP);
	// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
	menu.add(helpAction);
	// menu.add(helpSearchAction);
	// menu.add(dynamicHelpAction);
	// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
	menu.add(new GroupMarker("help.keyAssist"));
	menu.add(new Separator());
	menu.add(new GroupMarker("help.updatePlugin"));
	menu.add(new Separator());
	menu.add(new GroupMarker("help.license"));
	// 关于菜单需要始终显示在最底端
	menu.add(new GroupMarker("group.about"));
	// ActionContributionItem aboutItem = new ActionContributionItem(aboutAction);
	// aboutItem.setVisible(!Util.isMac());
	// menu.add(aboutItem);
	return menu;
}
 
Example #17
Source File: GlobalizeEditor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 ) );
}
 
Example #18
Source File: ChartConfiguratorView.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@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 );
}
 
Example #19
Source File: LaunchConfigurationContent.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
private void createContextMenu() {
  MenuManager menuMgr = new MenuManager("#PopupMenu");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener() {
    @Override
    public void menuAboutToShow(IMenuManager manager) {
      populateBrowserActions(launchConfiguration, manager);
      manager.add(new Separator());

      manager.add(new Action("&Copy") {
        @Override
        public void run() {
          copySelectionToClipboard();
        }
      });
    }
  });
  Menu menu = menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);
}
 
Example #20
Source File: ProtocolEditor.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * 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 ) );
}
 
Example #21
Source File: ImplementorsSearchGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void fillContextMenu(IMenuManager manager) {
	MenuManager javaSearchMM= new MenuManager(MENU_TEXT, IContextMenuConstants.GROUP_SEARCH);
	addAction(fFindImplementorsAction, javaSearchMM);
	addAction(fFindImplementorsInProjectAction, javaSearchMM);

	javaSearchMM.add(new Separator());

	Iterator<IWorkingSet[]> iter= SearchUtil.getLRUWorkingSets().sortedIterator();
	while (iter.hasNext()) {
		addWorkingSetAction(iter.next(), javaSearchMM);
	}
	addAction(fFindImplementorsInWorkingSetAction, javaSearchMM);

	if (!javaSearchMM.isEmpty())
		manager.appendToGroup(fGroupId, javaSearchMM);
}
 
Example #22
Source File: RcpActionBarAdvisor.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
private void fillFileMenu(IMenuManager menuBar) {
	MenuManager menu = new MenuManager(
			M.File, IWorkbenchActionConstants.M_FILE);
	menu.add(saveAction);
	menu.add(saveAsAction);
	menu.add(saveAllAction);
	menu.add(new Separator());
	menu.add(closeAction);
	menu.add(closeAllAction);
	menu.add(new Separator());
	menu.add(preferencesAction);
	menu.add(new Separator());
	menu.add(new ImportAction());
	menu.add(new ExportAction());
	menu.add(new Separator());
	menu.add(exitAction);
	menuBar.add(menu);
}
 
Example #23
Source File: AbstractChartView.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
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 () );
}
 
Example #24
Source File: FaelleComposite.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
public FaelleComposite(Composite parent, int style){
	super(parent, style);
	setLayout(new GridLayout(1, false));
	tableViewerFaelle = new TableViewer(this, SWT.None);
	tableViewerFaelle.getTable().setBackground(UiDesk.getColor(UiDesk.COL_WHITE));
	tableViewerFaelle.getTable().setLayoutData(
		new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	tableViewerFaelle.setLabelProvider(new FaelleLabelProvider());
	tableViewerFaelle.setContentProvider(new FaelleContentProvider());
	MenuManager menuManager = new MenuManager();
	menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
	
	tableViewerFaelle.getTable().setMenu(
		menuManager.createContextMenu(tableViewerFaelle.getTable()));
	menuManager.add(GlobalActions.openFallaction);
	menuManager.add(GlobalActions.makeBillAction);
	menuManager.add(GlobalActions.delFallAction);
	menuManager.add(GlobalActions.reopenFallAction);
	
	tableViewerFaelle.addSelectionChangedListener(new FallSelectionChangedToEventDispatcher());
}
 
Example #25
Source File: ApplicationActionBarAdvisor.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 创建文件菜单
 * @return 返回文件菜单的 menu manager;
 */
private MenuManager createFileMenu() {
	MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.file"),
			IWorkbenchActionConstants.M_FILE); // &File
	menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
	// 添加 new.ext group,这样 IDE 中定义的 Open File... 可以显示在最顶端
	// menu.add(newAction);
	menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
	menu.add(new Separator());
	menu.add(closeAction);
	menu.add(closeAllAction);
	menu.add(refreshAction);
	// menu.add(new Separator("net.heartsome.cat.ts.ui.menu.file.separator"));
	menu.add(new GroupMarker("xliff.switch"));
	menu.add(new GroupMarker("rtf.switch"));
	menu.add(new GroupMarker("xliff.split"));
	menu.add(new Separator());
	// 设置保存文件记录条数为 5 条
	WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 5);
	// 添加文件访问列表
	ContributionItemFactory REOPEN_EDITORS = new ContributionItemFactory("reopenEditors") { //$NON-NLS-1$
		/* (non-javadoc) method declared on ContributionItemFactory */
		public IContributionItem create(IWorkbenchWindow window) {
			if (window == null) {
				throw new IllegalArgumentException();
			}
			return new ReopenEditorMenu(window, getId(), false);
		}
	};
	menu.add(REOPEN_EDITORS.create(window));

	menu.add(exitAction);
	menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
	return menu;
}
 
Example #26
Source File: AnnotationEditor.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
@Override
protected void editorContextMenuAboutToShow(IMenuManager menu) {
  super.editorContextMenuAboutToShow(menu);

  // Add Annotate action
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getAction(SmartAnnotateAction.ID));
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getAction(QuickAnnotateAction.ID));
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getAction(IWorkbenchActionDefinitionIds.DELETE));
  
  TypeSystem typeSystem = getDocument().getCAS().getTypeSystem();

  // mode menu
  MenuManager modeMenuManager = new MenuManager("Mode");
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, modeMenuManager);

  ModeMenu modeMenu = new ModeMenu(typeSystem, this);
  modeMenu.addListener(new IModeMenuListener(){

  @Override
  public void modeChanged(Type newMode) {
    IAction actionToExecute = new ChangeModeAction(newMode, newMode.getShortName(),
            AnnotationEditor.this);

    actionToExecute.run();
  }});

  modeMenuManager.add(modeMenu);

  // annotation menu
  MenuManager showAnnotationMenu = new MenuManager("Show Annotations");
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, showAnnotationMenu);
  showAnnotationMenu.add(mShowAnnotationsMenu);
  
  // view menu
  MenuManager casViewMenuManager = new MenuManager("CAS Views");
  menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, casViewMenuManager);
  CasViewMenu casViewMenu = new CasViewMenu(this);
  casViewMenuManager.add(casViewMenu);
}
 
Example #27
Source File: LogViewer.java    From LogViewer with Eclipse Public License 2.0 5 votes vote down vote up
private void fillContextMenu(IMenuManager manager) {
    manager.add(refreshCurrentFileAction);
    manager.add(startTailOnCurrentFile);
    manager.add(stopTailOnCurrentFile);
    manager.add(fileCloseAction);
    manager.add(fileClearAction);
    manager.add(new Separator());
    manager.add(fileEncodingAction);
    manager.add(tabRenameAction);
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
Example #28
Source File: WorldActionBarContributor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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$
}
 
Example #29
Source File: OsgiActionBarContributor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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$
}
 
Example #30
Source File: FilteredTypesSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void fillViewMenu(IMenuManager menuManager) {
	super.fillViewMenu(menuManager);

	if (! BUG_184693) {
		fShowContainerForDuplicatesAction= new ShowContainerForDuplicatesAction();
		menuManager.add(fShowContainerForDuplicatesAction);
	}
	if (fAllowScopeSwitching) {
		fFilterActionGroup= new WorkingSetFilterActionGroup(getShell(), JavaPlugin.getActivePage(), new IPropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent event) {
				IWorkingSet ws= (IWorkingSet) event.getNewValue();
				if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
					setSearchScope(SearchEngine.createWorkspaceScope());
					setSubtitle(null);
				} else {
					setSearchScope(JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true));
					setSubtitle(ws.getLabel());
				}

				applyFilter();
			}
		});
		fFilterActionGroup.fillViewMenu(menuManager);
	}

	menuManager.add(new Separator());
	menuManager.add(new TypeFiltersPreferencesAction());
}