Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.TextOperationAction


    // TextView Action - moving the selected text to
    // the clipboard
    // override the cut/paste/delete action to make
    // them run on read-only
    // files
    Action action = new TextOperationAction(resourceBundle, "Editor_Cut_", this, ITextOperationTarget.CUT); //$NON-NLS-1$
    action.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
    setAction(ITextEditorActionConstants.CUT, action);
    helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.CUT_ACTION);
    // TextView Action - inserting the clipboard
    // content at the current
    // position
    // override the cut/paste/delete action to make
    // them run on read-only
    // files
    action = new TextOperationAction(resourceBundle, "Editor_Paste_", this, ITextOperationTarget.PASTE); //$NON-NLS-1$
    action.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
    setAction(ITextEditorActionConstants.PASTE, action);
    helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.PASTE_ACTION);
    // TextView Action - deleting the selected text or
    // if selection is
    // empty the character at the right of the current
    // position
    // override the cut/paste/delete action to make
    // them run on read-only
    // files
    action = new TextOperationAction(resourceBundle, "Editor_Delete_", this, ITextOperationTarget.DELETE); //$NON-NLS-1$
    action.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
    setAction(ITextEditorActionConstants.DELETE, action);
    helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.DELETE_ACTION);
    // SourceView Action - requesting content assist to
    // show completetion
    // proposals for the current insert position
    action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_PROPOSALS);
    helpSystem.setHelp(action, IHelpContextIds.CONTMNU_CONTENTASSIST_HELPID);
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, true);
    // SourceView Action - requesting content assist to
    // show the content
    // information for the current insert position
    action = new TextOperationAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, true);
    // StructuredTextViewer Action - requesting format
    // of the whole
    // document
    action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT + UNDERSCORE, this, StructuredTextViewer.FORMAT_DOCUMENT);
    helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_DOC_HELPID);
    action.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
    markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
    // StructuredTextViewer Action - requesting format
    // of the active
    // elements
    action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS + UNDERSCORE, this, StructuredTextViewer.FORMAT_ACTIVE_ELEMENTS);
    helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_ELEMENTS_HELPID);
    action.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);
    markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);

    // StructuredTextEditor Action - add breakpoints (falling back to the
    // current double-click if they can't be added)
    action = new ToggleBreakpointAction(this, getVerticalRuler());
    setAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS, action);
    // StructuredTextEditor Action - manage breakpoints
    action = new ManageBreakpointAction(this, getVerticalRuler());
    setAction(ActionDefinitionIds.MANAGE_BREAKPOINTS, action);
    // StructuredTextEditor Action - edit breakpoints
    action = new EditBreakpointAction(this, getVerticalRuler());
    setAction(ActionDefinitionIds.EDIT_BREAKPOINTS, action);
    // StructuredTextViewer Action - open file on selection
    action = new OpenHyperlinkAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE + UNDERSCORE, this, getSourceViewer());
    action.setActionDefinitionId(ActionDefinitionIds.OPEN_FILE);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE, action);

    computeAndSetDoubleClickAction();
   
    //add handlers to handler service
View Full Code Here


    boolean checked = store.getBoolean(AbstractStructuredFoldingStrategy.FOLDING_ENABLED);
    fToggle.setChecked(checked);
    fToggle.setActionDefinitionId(IFoldingCommandIds.FOLDING_TOGGLE);
    editor.setAction("FoldingToggle", fToggle); //$NON-NLS-1$

    fExpand = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_Expand_", editor, ProjectionViewer.EXPAND, true); //$NON-NLS-1$
    fExpand.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND);
    editor.setAction("FoldingExpand", fExpand); //$NON-NLS-1$

    fExpandAll = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_ExpandAll_", editor, ProjectionViewer.EXPAND_ALL, true); //$NON-NLS-1$
    fExpandAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND_ALL);
    editor.setAction("FoldingExpandAll", fExpandAll); //$NON-NLS-1$

    fCollapse = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_Collapse_", editor, ProjectionViewer.COLLAPSE, true); //$NON-NLS-1$
    fCollapse.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE);
    editor.setAction("FoldingCollapse", fCollapse); //$NON-NLS-1$

    fCollapseAll = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_CollapseAll_", editor, ProjectionViewer.COLLAPSE_ALL, true); //$NON-NLS-1$
    fCollapseAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE_ALL);
    editor.setAction("FoldingCollapseAll", fCollapseAll); //$NON-NLS-1$
  }
View Full Code Here

    // TextView Action - moving the selected text to
    // the clipboard
    // override the cut/paste/delete action to make
    // them run on read-only
    // files
    Action action = new TextOperationAction(resourceBundle, "Editor_Cut_", this, ITextOperationTarget.CUT); //$NON-NLS-1$
    action.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
    setAction(ITextEditorActionConstants.CUT, action);
    helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.CUT_ACTION);
    // TextView Action - inserting the clipboard
    // content at the current
    // position
    // override the cut/paste/delete action to make
    // them run on read-only
    // files
    action = new TextOperationAction(resourceBundle, "Editor_Paste_", this, ITextOperationTarget.PASTE); //$NON-NLS-1$
    action.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
    setAction(ITextEditorActionConstants.PASTE, action);
    helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.PASTE_ACTION);
    // TextView Action - deleting the selected text or
    // if selection is
    // empty the character at the right of the current
    // position
    // override the cut/paste/delete action to make
    // them run on read-only
    // files
    action = new TextOperationAction(resourceBundle, "Editor_Delete_", this, ITextOperationTarget.DELETE); //$NON-NLS-1$
    action.setActionDefinitionId(IWorkbenchActionDefinitionIds.DELETE);
    setAction(ITextEditorActionConstants.DELETE, action);
    helpSystem.setHelp(action, IAbstractTextEditorHelpContextIds.DELETE_ACTION);
    // SourceView Action - requesting content assist to
    // show completetion
    // proposals for the current insert position
    action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_PROPOSALS);
    helpSystem.setHelp(action, IHelpContextIds.CONTMNU_CONTENTASSIST_HELPID);
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_PROPOSALS, true);
    // SourceView Action - requesting content assist to
    // show the content
    // information for the current insert position
    action = new TextOperationAction(SSEUIMessages.getResourceBundle(), StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION + UNDERSCORE, this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION);
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_CONTENTASSIST_CONTEXT_INFORMATION, true);
    // StructuredTextViewer Action - requesting format
    // of the whole
    // document
    action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT + UNDERSCORE, this, StructuredTextViewer.FORMAT_DOCUMENT);
    helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_DOC_HELPID);
    action.setActionDefinitionId(ActionDefinitionIds.FORMAT_DOCUMENT);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
    markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_DOCUMENT, true);
    // StructuredTextViewer Action - requesting format
    // of the active
    // elements
    action = new TextOperationAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS + UNDERSCORE, this, StructuredTextViewer.FORMAT_ACTIVE_ELEMENTS);
    helpSystem.setHelp(action, IHelpContextIds.CONTMNU_FORMAT_ELEMENTS_HELPID);
    action.setActionDefinitionId(ActionDefinitionIds.FORMAT_ACTIVE_ELEMENTS);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, action);
    markAsStateDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);
    markAsSelectionDependentAction(StructuredTextEditorActionConstants.ACTION_NAME_FORMAT_ACTIVE_ELEMENTS, true);

    // StructuredTextEditor Action - add breakpoints (falling back to the
    // current double-click if they can't be added)
    action = new ToggleBreakpointAction(this, getVerticalRuler());
    setAction(ActionDefinitionIds.TOGGLE_BREAKPOINTS, action);
    // StructuredTextEditor Action - manage breakpoints
    action = new ManageBreakpointAction(this, getVerticalRuler());
    setAction(ActionDefinitionIds.MANAGE_BREAKPOINTS, action);
    // StructuredTextEditor Action - edit breakpoints
    action = new EditBreakpointAction(this, getVerticalRuler());
    setAction(ActionDefinitionIds.EDIT_BREAKPOINTS, action);
    // StructuredTextViewer Action - open file on selection
    action = new OpenHyperlinkAction(resourceBundle, StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE + UNDERSCORE, this, getSourceViewer());
    action.setActionDefinitionId(ActionDefinitionIds.OPEN_FILE);
    setAction(StructuredTextEditorActionConstants.ACTION_NAME_OPEN_FILE, action);

    computeAndSetDoubleClickAction();
   
    //add handlers to handler service
View Full Code Here

    String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
    action.setActionDefinitionId(id);
    setAction(id, action);

    // Quick Outline
    action = new TextOperationAction(TextEditorMessages.getBundle(),
        "ShowOutline.", this,
        ProjectionViewerWithOutline.OPCODE_SHOW_OUTLINE, true);
    action.setActionDefinitionId(ProjectionViewerWithOutline.ACTIONID_SHOW_OUTLINE);
    setAction(ProjectionViewerWithOutline.ACTIONID_SHOW_OUTLINE, action);
  }
View Full Code Here

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

        // This action will fire a CONTENTASSIST_PROPOSALS operation
        // when executed
        IAction action = new TextOperationAction(IvyPlugin.getDefault().getResourceBundle(),
                "ContentAssistProposal", this, ISourceViewer.CONTENTASSIST_PROPOSALS);
        action.setActionDefinitionId(CONTENTASSIST_PROPOSAL_ID);

        // Tell the editor about this new action
        setAction(CONTENTASSIST_PROPOSAL_ID, action);

        // Tell the editor to execute this action
View Full Code Here

        setEnabled(isEnabled);
      }
    };
    fToggle.setChecked(true);
 
    fExpandAll = new TextOperationAction(
        QvtEditorMessages.getResourceBundle(),
        "Projection.ExpandAll.", editor, ProjectionViewer.EXPAND_ALL, true); //$NON-NLS-1$
 
    fCollapseAll = new TextOperationAction(
        QvtEditorMessages.getResourceBundle(),
        "Projection.CollapseAll.", editor, ProjectionViewer.COLLAPSE_ALL, true); //$NON-NLS-1$
  }
View Full Code Here

    super.createActions();

    // add content assist action
    IAction action;
    action =
      new TextOperationAction(
        EditorMessages.getResourceBundle(),
        "ContentAssistProposal.",
        this,
        ISourceViewer.CONTENTASSIST_PROPOSALS);
    action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
View Full Code Here

    /** For user triggered content assistance */
    protected void createActions() {
        super.createActions();

        IAction a = new TextOperationAction(RuleEditorMessages
                .getResourceBundle(), "ContentAssistProposal.", this,
                ISourceViewer.CONTENTASSIST_PROPOSALS);
        a
                .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
        setAction("ContentAssistProposal", a);

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

        a = new ToggleBreakpointAction(getSite().getPart() , null, getVerticalRuler());
        setAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, a);
View Full Code Here

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

    // Comment
    Action action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
            "Comment.", this, ITextOperationTarget.PREFIX); //$NON-NLS-1$
    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.COMMENT);
    setAction("Comment", action); //$NON-NLS-1$
    markAsStateDependentAction("Comment", true); //$NON-NLS-1$

    // Uncomment
    action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
            "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); //$NON-NLS-1$
    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.UNCOMMENT);
    setAction("Uncomment", action); //$NON-NLS-1$
    markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$

    // Toggle comment
    action = new ToggleCommentAction(DLTKEditorMessages.getBundleForConstructedKeys(),
            "ToggleComment.", this); //$NON-NLS-1$
    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.TOGGLE_COMMENT);
    setAction("ToggleComment", action); //$NON-NLS-1$
    markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$
    configureToggleCommentAction();

    action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
            "Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.FORMAT);
    setAction("Format", action); //$NON-NLS-1$
    markAsStateDependentAction("Format", true); //$NON-NLS-1$
    markAsSelectionDependentAction("Format", true); //$NON-NLS-1$
    // PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
    // IJavaHelpContextIds.FORMAT_ACTION);
View Full Code Here

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

        IAction action =
                new TextOperationAction(EditorMessages.getResourceBundle(),
                        "ApexEditor.ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); //$NON-NLS-1$
        action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
        setAction(ACTION_CONTENT_ASSIST_PROPOSAL, action);

        action =
                new TextOperationAction(EditorMessages.getResourceBundle(),
                        "ApexEditor.ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION); //$NON-NLS-1$
        action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
        setAction(ACTION_CONTENT_ASSIST_TIP, action);

        action =
                new DefineFoldingRegionAction(EditorMessages.getResourceBundle(),
                        "ApexEditor.DefineFoldingRegion.", this); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.eclipse.ui.texteditor.TextOperationAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.