类org.eclipse.ui.actions.ActionFactory源码实例Demo

下面列出了怎么用org.eclipse.ui.actions.ActionFactory的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: gef   文件: FXEditorActionBarContributor.java
@Override
public void setActiveEditor(final IEditorPart activeEditor) {
	// XXX: We need to perform instance-of check here, even if
	// FXEditorActionBarContributor is bound to AbstractFXEditor alone.
	// This is because activeEditor may for instance also be of type
	// org.eclipse.ui.internal.ErrorEditorPart when the opened resource is
	// out of sync with the file system.
	if (activeEditor instanceof AbstractFXEditor) {
		registerUndoRedoActions(activeEditor);

		DeleteAction deleteAction = (DeleteAction) activeEditor
				.getAdapter(DeleteAction.class);
		if (deleteAction != null) {
			getActionBars().setGlobalActionHandler(
					ActionFactory.DELETE.getId(), deleteAction);
		}

		IAction selectAllAction = (IAction) activeEditor
				.getAdapter(SelectAllAction.class);
		if (selectAllAction != null) {
			getActionBars().setGlobalActionHandler(
					ActionFactory.SELECT_ALL.getId(), selectAllAction);
		}
	}
}
 
源代码2 项目: jbt   文件: ApplicationActionBarAdvisor.java
protected void makeActions(IWorkbenchWindow window) {
	this.window = window;

	this.saveBTAction = ActionFactory.SAVE.create(this.window);
	this.saveBTAsAction = ActionFactory.SAVE_AS.create(this.window);
	this.exportAsCppAction = new DialogExportAsCppAction(this.window);
	this.openBTAction = new DialogOpenBTAction(this.window);
	this.newBTAction = new NewBTAction();
	this.loadMMPMDomainAction = new DialogLoadMMPMDomainAction(this.window);
	this.viewsList = ContributionItemFactory.VIEWS_SHORTLIST.create(this.window);
	this.aboutAction = ActionFactory.ABOUT.create(this.window);

	/* For key bindings and for copy and paste actions... */
	this.register(this.saveBTAction);
	this.register(ActionFactory.COPY.create(this.window));
	this.register(ActionFactory.PASTE.create(this.window));
}
 
源代码3 项目: tracecompass   文件: LamiChartViewerTest.java
/**
 * Reset the current perspective
 */
@After
public void resetPerspective() {
    SWTBotView viewBot = fViewBot;
    if (viewBot != null) {
        viewBot.close();
    }
    /*
     * UI Thread executes the reset perspective action, which opens a shell
     * to confirm the action. The current thread will click on the 'Yes'
     * button
     */
    Runnable runnable = () -> SWTBotUtils.anyButtonOf(fBot, "Yes", "Reset Perspective").click();
    UIThreadRunnable.asyncExec(() -> {
        IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getWorkbenchWindows()[0];
        ActionFactory.RESET_PERSPECTIVE.create(activeWorkbenchWindow).run();
    });
    runnable.run();
}
 
源代码4 项目: birt   文件: PasteResourceAction.java
/**
 * Constructs an action for pasting resource.
 * 
 * @param page
 *            the resource explorer page
 * @param clipboard
 *            the clipboard for pasting resource
 */
public PasteResourceAction( LibraryExplorerTreeViewPage page,
		Clipboard clipboard )
{
	super( Messages.getString( "PasteLibraryAction.Text" ), page ); //$NON-NLS-1$
	this.clipboard = clipboard;
	setId( ActionFactory.PASTE.getId( ) );
	setAccelerator( SWT.CTRL | 'V' );

	setImageDescriptor( PlatformUI.getWorkbench( )
			.getSharedImages( )
			.getImageDescriptor( ISharedImages.IMG_TOOL_PASTE ) );

	setDisabledImageDescriptor( PlatformUI.getWorkbench( )
			.getSharedImages( )
			.getImageDescriptor( ISharedImages.IMG_TOOL_PASTE_DISABLED ) );
}
 
public void updateGlobalActionHandler() {
	if (actionBar == null) {
		return;
	}
	preCutAction = actionBar.getGlobalActionHandler(ActionFactory.CUT.getId());
	actionBar.setGlobalActionHandler(ActionFactory.CUT.getId(), textCutAction);
	preCopyAction = actionBar.getGlobalActionHandler(ActionFactory.COPY.getId());
	actionBar.setGlobalActionHandler(ActionFactory.COPY.getId(), textCopyAction);
	prePasteAction= actionBar.getGlobalActionHandler(ActionFactory.PASTE.getId());
	actionBar.setGlobalActionHandler(ActionFactory.PASTE.getId(), textPasteAction);
	preUndoAction = actionBar.getGlobalActionHandler(ActionFactory.UNDO.getId());
	actionBar.setGlobalActionHandler(ActionFactory.UNDO.getId(), textUndoAction);
	preRedoAction = actionBar.getGlobalActionHandler(ActionFactory.REDO.getId());
	actionBar.setGlobalActionHandler(ActionFactory.REDO.getId(), textRedoAction);
	// actionBar.setGlobalActionHandler(ActionFactory.FIND.getId(), textFindReplaceAction);
	if (viewer != null && viewer.getTextWidget().isFocusControl()) {
		updateActionsEnableState();
	} else {
		actionBar.updateActionBars();
	}
}
 
源代码6 项目: mat-calcite-plugin   文件: CalcitePane.java
private void makeActions() {
	executeQueryAction = new ExecuteQueryAction(this, null, false);
	explainQueryAction = new ExecuteQueryAction(this, null, true);
	commentLineAction = new CommentLineAction(queryString);
	IWorkbenchWindow window = this.getEditorSite().getWorkbenchWindow();
	ActionFactory.IWorkbenchAction globalAction = ActionFactory.COPY.create(window);
	this.copyQueryStringAction = new Action() {
		public void run() {
			CalcitePane.this.queryString.copy();
		}
	};
	this.copyQueryStringAction.setAccelerator(globalAction.getAccelerator());
	this.contentAssistAction = new Action() {
		@Override
		public void run() {
			queryViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
		}
	};
}
 
源代码7 项目: bonita-studio   文件: TabbedPropertySheetPage.java
@Override
public void setActionBars(IActionBars actionBars) {
	// Override the undo and redo global action handlers
	// to use the contributor action handlers
       IActionBars partActionBars = null;
	if (contributor instanceof IEditorPart) {
		IEditorPart editorPart = (IEditorPart) contributor;
           partActionBars = editorPart.getEditorSite().getActionBars();
	} else if (contributor instanceof IViewPart) {
           IViewPart viewPart = (IViewPart) contributor;
           partActionBars = viewPart.getViewSite().getActionBars();
       }

       if (partActionBars != null) {
           IAction action = partActionBars.getGlobalActionHandler(ActionFactory.UNDO
               .getId());
           if (action != null) {
               actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), action);
           }
           action = partActionBars.getGlobalActionHandler(ActionFactory.REDO
               .getId());
           if (action != null) {
               actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), action);
           }
       }
}
 
源代码8 项目: ermaster-b   文件: PasteAction.java
/**
 * �R���X�g���N�^
 *
 * @param part
 */
public PasteAction(IWorkbenchPart part) {
	super(part);

	this.setText(ResourceString.getResourceString("action.title.paste"));
	ISharedImages sharedImages = PlatformUI.getWorkbench()
			.getSharedImages();
	setImageDescriptor(sharedImages
			.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
	setDisabledImageDescriptor(sharedImages
			.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));

	this.setId(ActionFactory.PASTE.getId());

	ERDiagramEditor editor = (ERDiagramEditor) part;

	this.editor = editor;
}
 
源代码9 项目: erflute   文件: ERDiagramOutlinePage.java
private void resetAction(ActionRegistry registry) {
    if (getSite() == null) {
        return;
    }
    final IActionBars bars = getSite().getActionBars();

    String id = ActionFactory.UNDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    id = ActionFactory.REDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    id = ActionFactory.DELETE.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    bars.updateActionBars();
}
 
private void fillActionBars() {
      IActionBars actionBars = getActionBars();
actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), fRefreshSingleElementAction);
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), fRemoveFromViewAction);

      IToolBarManager toolBar = actionBars.getToolBarManager();

      fActionGroups.fillActionBars(actionBars);

      toolBar.add(fRefreshViewAction);
      toolBar.add(fCancelSearchAction);
      for (int i = 0; i < fToggleCallModeActions.length; i++) {
          toolBar.add(fToggleCallModeActions[i]);
      }
      toolBar.add(fHistoryDropDownAction);
      toolBar.add(fPinViewAction);
  }
 
源代码11 项目: ADT_Frontend   文件: CopyNameAction.java
public CopyNameAction(TreeViewer treeViewer) {
	super(Messages.AbapGitStaging_action_copy);
	updateSelection((IStructuredSelection) treeViewer.getSelection());
	setToolTipText(Messages.AbapGitStaging_action_copy);
	setActionDefinitionId(ActionFactory.COPY.getCommandId());
	setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY));

	this.treeViewer = treeViewer;
}
 
源代码12 项目: ADT_Frontend   文件: AbapGitDialogObjLog.java
private void makeActions() {
	this.actionCopy = new Action() {
		public void run() {
			copy();
		}
	};
	this.actionCopy.setText(Messages.AbapGitView_action_copy);
	this.actionCopy.setToolTipText(Messages.AbapGitView_action_copy);
	this.actionCopy.setActionDefinitionId(ActionFactory.COPY.getCommandId());
	this.actionCopy.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
}
 
源代码13 项目: tmxeditor8   文件: ApplicationActionBarAdvisor.java
protected void makeActions(final IWorkbenchWindow window) {
	// Creates the actions and registers them.
	// Registering is needed to ensure that key bindings work.
	// The corresponding commands keybindings are defined in the plugin.xml
	// file.
	// Registering also provides automatic disposal of the actions when
	// the window is closed.

	exitAction = ActionFactory.QUIT.create(window);
	register(exitAction);
	
	preferenceAction=ActionFactory.PREFERENCES.create(window);
	register(preferenceAction);
}
 
源代码14 项目: birt   文件: LibraryExplorerContextMenuProvider.java
/**
 * Handles all global actions
 */
private void handleGlobalAction( )
{
	IPageSite pageSite = page == null ? null : page.getSite( );
	IActionBars actionBars = pageSite == null ? null
			: pageSite.getActionBars( );

	if ( actionBars != null )
	{
		String copyID = ActionFactory.COPY.getId( );
		String pasteID = ActionFactory.PASTE.getId( );
		String deleteID = ActionFactory.DELETE.getId( );
		String moveID = ActionFactory.MOVE.getId( );
		String renameID = ActionFactory.RENAME.getId( );
		String refreshID = ActionFactory.REFRESH.getId( );

		actionBars.setGlobalActionHandler( copyID, copyResourceAction );
		actionBars.setGlobalActionHandler( pasteID, pasteResourceAction );
		actionBars.setGlobalActionHandler( deleteID, deleteResourceAction );
		actionBars.setGlobalActionHandler( moveID, moveResourceAction );
		actionBars.setGlobalActionHandler( renameID, renameResourceAction );
		actionBars.setGlobalActionHandler( refreshID, refreshExplorerAction );

		IMenuManager menuManager = actionBars.getMenuManager( );
		IToolBarManager toolBarManager = actionBars.getToolBarManager( );

		if ( menuManager != null )
		{
			menuManager.add( filterAction );
		}
		if ( toolBarManager != null )
		{
			toolBarManager.add( refreshExplorerAction );
		}
	}
}
 
@Override
public void dispose() {
    IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
    IActionBars bars = null;
    if(part instanceof IViewPart){
        bars = ((IViewPart)part).getViewSite().getActionBars();
        if(bars != null){
            bars.setGlobalActionHandler(ActionFactory.UNDO.getId(), null);
            bars.setGlobalActionHandler(ActionFactory.REDO.getId(), null);
        }
    }
    if(!isDisposed()){
        super.dispose();
    }
}
 
源代码16 项目: xtext-eclipse   文件: ReferenceSearchViewPage.java
protected void fillToolbar(IToolBarManager tbm) {
	tbm.appendToGroup(IContextMenuConstants.GROUP_SHOW, showNextAction);
	tbm.appendToGroup(IContextMenuConstants.GROUP_SHOW, showPreviousAction);
	IActionBars actionBars = getSite().getActionBars();
	if (actionBars != null) {
		actionBars.setGlobalActionHandler(ActionFactory.NEXT.getId(), showNextAction);
		actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), showPreviousAction);
	}
	tbm.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, expandAllAction);
	tbm.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, collapseAllAction);
}
 
源代码17 项目: xds-ide   文件: XdsConsolePage.java
protected void contextMenuAboutToShow(IMenuManager menuManager) {
    super.contextMenuAboutToShow(menuManager);
    menuManager.add(fScrollLockAction);
    XdsConsoleViewer viewer = (XdsConsoleViewer) getViewer();
    if (!viewer.isReadOnly()) {
        menuManager.remove(ActionFactory.CUT.getId());
        menuManager.remove(ActionFactory.PASTE.getId());
    }
}
 
源代码18 项目: gef   文件: AbstractFXView.java
/**
 * Create actions for this view and registers at the action bars of the
 * view's site.
 */
protected void createActions() {
	IViewSite site = getViewSite();
	IActionBars actionBars = site.getActionBars();
	undoRedoActionGroup = new UndoRedoActionGroup(getSite(),
			(IUndoContext) getAdapter(IUndoContext.class), true);
	undoRedoActionGroup.fillActionBars(actionBars);

	deleteAction = new DeleteAction();
	getContentViewer().setAdapter(deleteAction);
	actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
			deleteAction);

	selectAllAction = new SelectAllAction();
	getContentViewer().setAdapter(selectAllAction);
	actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(),
			selectAllAction);

	zoomActionGroup = new ZoomActionGroup(new FitToViewportAction());
	getContentViewer().setAdapter(zoomActionGroup);
	fitToViewportActionGroup = new FitToViewportActionGroup();
	getContentViewer().setAdapter(fitToViewportActionGroup);
	scrollActionGroup = new ScrollActionGroup();
	getContentViewer().setAdapter(scrollActionGroup);

	IToolBarManager mgr = actionBars.getToolBarManager();
	zoomActionGroup.fillActionBars(actionBars);
	mgr.add(new Separator());
	fitToViewportActionGroup.fillActionBars(actionBars);
	mgr.add(new Separator());
	scrollActionGroup.fillActionBars(actionBars);
}
 
源代码19 项目: ermasterr   文件: ERDiagramOutlinePage.java
private void resetAction(final ActionRegistry registry) {
    // アウトライン・ページで有効にするアクション
    final IActionBars bars = getSite().getActionBars();

    String id = ActionFactory.UNDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    id = ActionFactory.REDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    id = ActionFactory.DELETE.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    bars.updateActionBars();
}
 
/**
 * Sets global action handlers for: delete select all.
 *
 * @param actionBars the new action bars
 */
@Override
public void setActionBars(IActionBars actionBars) {
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), mDeleteAction);

  getSite().getSelectionProvider().addSelectionChangedListener(mDeleteAction);

  actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), mSelectAllAction);

  super.setActionBars(actionBars);
}
 
源代码21 项目: tmxeditor8   文件: ResourceMgmtActionProvider.java
public void fillActionBars(IActionBars actionBars) {
	actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction);
	// actionBars.setGlobalActionHandler(IDEActionFactory.BUILD_PROJECT.getId(), buildAction);
	actionBars.setGlobalActionHandler(IDEActionFactory.OPEN_PROJECT.getId(), openProjectAction);
	actionBars.setGlobalActionHandler(IDEActionFactory.CLOSE_PROJECT.getId(), closeProjectAction);
	// actionBars.setGlobalActionHandler(IDEActionFactory.CLOSE_UNRELATED_PROJECTS.getId(),
	// closeUnrelatedProjectsAction);
	updateActionBars();
}
 
源代码22 项目: ermaster-b   文件: CopyAction.java
/**
 * �R���X�g���N�^
 * 
 * @param part
 */
public CopyAction(IWorkbenchPart part) {
	super(part);

	this.setText(ResourceString.getResourceString("action.title.copy"));

	ISharedImages sharedImages = PlatformUI.getWorkbench()
			.getSharedImages();
	setImageDescriptor(sharedImages
			.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
	setDisabledImageDescriptor(sharedImages
			.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));

	this.setId(ActionFactory.COPY.getId());
}
 
源代码23 项目: tracecompass   文件: SDView.java
@Override
public void partActivated(IWorkbenchPart part) {
    if (part == this) {
        final Object service = PlatformUI.getWorkbench().getService(IHandlerService.class);
        fPrintHandlerActivation = ((IHandlerService) service).activateHandler(ActionFactory.PRINT.getCommandId(), fPrintActionHandler);
    }
}
 
源代码24 项目: statecharts   文件: XtextDirectEditManager.java
private void saveCurrentActions(IActionBars _actionBars) {
	copy = _actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
	paste = _actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
	delete = _actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
	selectAll = _actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
	cut = _actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
	find = _actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
	undo = _actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
	redo = _actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
}
 
源代码25 项目: statecharts   文件: XtextDirectEditManager.java
private void restoreSavedActions(IActionBars _actionBars) {
	_actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
	_actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
	_actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
	_actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
	_actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
	_actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
	_actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
	_actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
}
 
源代码26 项目: tmxeditor8   文件: RefactorActionGroup.java
public void fillActionBars(IActionBars actionBars) {

		// renameAction.setTextActionHandler(textActionHandler);
		updateActionBars();

		actionBars.setGlobalActionHandler(ActionFactory.MOVE.getId(), moveAction);
		actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
	}
 
源代码27 项目: tmxeditor8   文件: NewActionProvider.java
public void init(ICommonActionExtensionSite anExtensionSite) {

		if (anExtensionSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
			IWorkbenchWindow window = ((ICommonViewerWorkbenchSite) anExtensionSite.getViewSite()).getWorkbenchWindow();
			showDlgAction = ActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
			showDlgAction.setText(WorkbenchNavigatorMessages.actions_NewActionProvider_NewMenu_label);
			contribute = true;
		}
	}
 
源代码28 项目: olca-app   文件: RcpActionBarAdvisor.java
@Override
protected void makeActions(IWorkbenchWindow window) {
	// save
	saveAction = ActionFactory.SAVE.create(window);
	saveAction.setText(M.Save);
	saveAction.setImageDescriptor(Icon.SAVE.descriptor());
	saveAction.setDisabledImageDescriptor(Icon.SAVE_DISABLED.descriptor());

	// save as
	saveAsAction = ActionFactory.SAVE_AS.create(window);
	saveAsAction.setText(M.SaveAs);
	saveAsAction.setImageDescriptor(Icon.SAVE_AS.descriptor());
	saveAsAction.setDisabledImageDescriptor(Icon.SAVE_AS_DISABLED.descriptor());

	// save all
	saveAllAction = ActionFactory.SAVE_ALL.create(window);
	saveAllAction.setText(M.SaveAll);
	saveAllAction.setImageDescriptor(Icon.SAVE_ALL.descriptor());
	saveAllAction.setDisabledImageDescriptor(Icon.SAVE_ALL_DISABLED.descriptor());

	// close & close all
	closeAction = ActionFactory.CLOSE.create(window);
	closeAction.setText(M.Close);
	closeAllAction = ActionFactory.CLOSE_ALL.create(window);
	closeAllAction.setText(M.CloseAll);

	// preferences
	preferencesAction = ActionFactory.PREFERENCES.create(window);
	preferencesAction.setImageDescriptor(Icon.PREFERENCES.descriptor());
	preferencesAction.setText(M.Settings);

	// other
	exitAction = ActionFactory.QUIT.create(window);
	exitAction.setText(M.Exit);
	showViews = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
	aboutAction = ActionFactory.ABOUT.create(window);
	aboutAction.setText(M.AboutOpenLCA);
}
 
源代码29 项目: tmxeditor8   文件: BodyMenuConfiguration.java
private void createBodyMenu() {
	MenuManager menuMgr = new MenuManager();
	bodyMenu = menuMgr.createContextMenu(table.getShell());
	menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null,
			ActionFactory.CUT.getCommandId(), Collections.EMPTY_MAP, null, null, null, Messages
					.getString("tmxedtior.bodyMenuConfiguration.cut"), null, null,
			CommandContributionItem.STYLE_PUSH, null, false)));
	menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null,
			ActionFactory.COPY.getCommandId(), Collections.EMPTY_MAP, null, null, null, Messages
					.getString("tmxedtior.bodyMenuConfiguration.copy"), null, null,
			CommandContributionItem.STYLE_PUSH, null, false)));
	menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null,
			ActionFactory.PASTE.getCommandId(), Collections.EMPTY_MAP, null, null, null, Messages
					.getString("tmxedtior.bodyMenuConfiguration.paste"), null, null,
			CommandContributionItem.STYLE_PUSH, null, false)));
	menuMgr.add(new Separator());

	menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null,
			"net.heartsome.cat.te.tmxeditor.command.addtu", Collections.EMPTY_MAP, null, null, null, null, null,
			null, CommandContributionItem.STYLE_PUSH, null, false)));
	menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null,
			"net.heartsome.cat.te.tmxeditor.command.deletetu", Collections.EMPTY_MAP, null, null, null, null, null,
			null, CommandContributionItem.STYLE_PUSH, null, false)));
	
	menuMgr.add(new Separator());
	menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null,
			"net.heartsome.cat.te.ui.command.cleanSelectInnerTag", Collections.EMPTY_MAP, null, null, null, null, null,
			null, CommandContributionItem.STYLE_PUSH, null, false)));
}
 
源代码30 项目: uima-uimaj   文件: MultiPageEditorContributor.java
@Override
public void setActivePage(IEditorPart part) {

  IActionBars actionBars = getActionBars();
  if (actionBars != null) {

    ITextEditor textEditor = (part instanceof XMLEditor) ? (ITextEditor) part : null;

    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction1(textEditor,
            ITextEditorActionConstants.DELETE));
    actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction1(textEditor,
            ITextEditorActionConstants.UNDO));
    actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction1(textEditor,
            ITextEditorActionConstants.REDO));
    actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction1(textEditor,
            ITextEditorActionConstants.CUT));
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction1(textEditor,
            ITextEditorActionConstants.COPY));
    actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction1(textEditor,
            ITextEditorActionConstants.PASTE));
    actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction1(textEditor,
            ITextEditorActionConstants.SELECT_ALL));
    actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction1(textEditor,
            ITextEditorActionConstants.FIND));
    actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction1(textEditor,
            IDEActionFactory.BOOKMARK.getId()));
    actionBars.updateActionBars();
  }
}
 
 类所在包
 类方法
 同包方法