Example usage for org.eclipse.jface.action IAction setActionDefinitionId

List of usage examples for org.eclipse.jface.action IAction setActionDefinitionId

Introduction

In this page you can find the example usage for org.eclipse.jface.action IAction setActionDefinitionId.

Prototype

void setActionDefinitionId(String id);

Source Link

Document

Sets the action definition id of this action.

Usage

From source file:bisonparser.editors.BisonEditor.java

License:Open Source License

/**
 * Deals with setup for ContentAssist/*from  www  .  j a va2s.c  o m*/
 */
protected void createActions() {
    super.createActions();

    IAction a = new TextOperationAction(resourceBundle, "ContentAssistProposal.", this, //$NON-NLS-1$
            ISourceViewer.CONTENTASSIST_PROPOSALS);
    a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    setAction("ContentAssistProposal", a); //$NON-NLS-1$

    a = new TextOperationAction(resourceBundle, "ContentAssistTip.", this, //$NON-NLS-1$
            ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);
    a.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
    setAction("ContentAssistTip", a); //$NON-NLS-1$

    a = new DefineFoldingRegionAction(resourceBundle, "DefineFoldingRegion.", this); //$NON-NLS-1$
    setAction("DefineFoldingRegion", a); //$NON-NLS-1$
}

From source file:com.abstratt.mdd.internal.ui.editors.source.SourceEditor.java

License:Open Source License

@Override
protected void createActions() {
    super.createActions();

    IAction contentAssistAction = new ContentAssistAction(Messages.RESOURCE_BUNDLE, "ContentAssistProposal.",
            this);
    contentAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    setAction("ContentAssistProposal", contentAssistAction);
    markAsStateDependentAction("ContentAssistProposal", true);
}

From source file:com.aptana.editor.js.JSSourceEditor.java

License:Open Source License

@Override
protected void createActions() {
    super.createActions();
    IAction action = new OpenDeclarationAction(Messages.getResourceBundle(), this);
    action.setActionDefinitionId(IJSActions.OPEN_DECLARATION);
    setAction(IJSActions.OPEN_DECLARATION, action);
}

From source file:com.aptana.ide.editor.yml.YMLEditor.java

License:Open Source License

@Override
protected void createActions() {
    super.createActions();
    fGenerateActionGroup = new YMLActionGroup(this, ITextEditorActionConstants.GROUP_EDIT);

    getSourceViewer().setDefaultPrefixes(new String[] { "#", "" }, YMLMimeType.MimeType);
    // XXX Hack to provide hash as a comment prefix, since we can't seem to set the default prefixes returned by UnifiedConfiguration
    IAction action = new ToggleCommentAction(this) {
        @Override//ww w  .j ava2  s  . c  o  m
        protected String[] getDefaultPrefixes(SourceViewerConfiguration configuration,
                ISourceViewer sourceViewer, String type) {
            return new String[] { "#", "" }; //$NON-NLS-1$ //$NON-NLS-2$
        }

    };
    action.setActionDefinitionId("com.aptana.ide.editor.yml.toggle.comment");
    setAction("ToggleComment", action); //$NON-NLS-1$
    markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$
    configureToggleCommentAction();
}

From source file:com.aptana.rdt.internal.profiling.menu.ProfilingMenuDelegate.java

License:Open Source License

protected IAction getOpenDialogAction() {
    IAction action = new OpenProfilingConfigurations();
    action.setActionDefinitionId("com.aptana.rdt.profiling.commands.OpenProfilingConfigurations"); //$NON-NLS-1$
    return action;
}

From source file:com.bdaum.zoom.ui.internal.views.BasicView.java

License:Open Source License

protected void registerCommand(IAction action, String commandId) {
    if (action != null) {
        IHandlerService service = getSite().getService(IHandlerService.class);
        if (service != null) {
            action.setActionDefinitionId(commandId);
            activations.add(service.activateHandler(commandId, new ActionHandler(action)));
        }//from ww  w.  j  a v  a2  s.c  om
    }
}

From source file:com.bdaum.zoom.ui.internal.views.TagCloudView.java

License:Open Source License

protected void registerCommand(IAction action, String commandId) {
    IHandlerService service = getSite().getService(IHandlerService.class);
    if (service != null) {
        action.setActionDefinitionId(commandId);
        service.activateHandler(commandId, new ActionHandler(action));
    }//from   ww w. ja v  a2s. c  o m
}

From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java

License:Apache License

private IAction createOpenAction() {
    IAction action = new Action() {
        public void run() {
            if (!openApplies(getSelection()))
                return;

            for (Object item : getSelection().toList()) {
                if (!actionHandler.open((WorkflowElement) item))
                    view.expand(item);// w w  w .  ja v a 2s  . c  o m
            }
        }
    };
    action.setActionDefinitionId("org.eclipse.jdt.ui.edit.text.java.open.editor");
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "open");
    action.setText("Open");
    getActionBars().setGlobalActionHandler("org.eclipse.ui.navigator.Open", action);
    return action;
}

From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java

License:Apache License

private IAction createCopyAction() {
    IAction action = new Action() {
        public void run() {
            if (!copyApplies(getSelection()))
                return;

            view.setFocus();/*from  w ww. j  a v  a 2  s  . co m*/

            Object[] items = getSelection().toArray();
            WorkflowElement[] elements = new WorkflowElement[items.length];
            for (int i = 0; i < items.length; i++) {
                elements[i] = (WorkflowElement) items[i];
            }
            actionHandler.copy(elements, view.getClipboard());
        }
    };
    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    action.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    action.setActionDefinitionId("org.eclipse.ui.edit.copy");
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "copy");
    action.setText("Copy");
    getActionBars().setGlobalActionHandler(ActionFactory.COPY.getId(), action);
    return action;
}

From source file:com.centurylink.mdw.plugin.designer.views.ProcessExplorerActionGroup.java

License:Apache License

private IAction createPasteAction() {
    IAction action = new Action() {
        public void run() {
            if (!pasteApplies(getSelection()))
                return;

            view.setFocus();/*from  w  w w. j  a  v a2 s . c  o m*/

            actionHandler.paste(view.getClipboard(), view.getDropTarget(),
                    (WorkflowElement) getSelection().getFirstElement());
        }
    };
    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    action.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    action.setActionDefinitionId("org.eclipse.ui.edit.paste");
    action.setId(MdwMenuManager.MDW_MENU_PREFIX + "paste");
    action.setText("Paste");
    getActionBars().setGlobalActionHandler(ActionFactory.PASTE.getId(), action);
    return action;
}