Class AbstractTextAction

  • All Implemented Interfaces:
    org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2, org.eclipse.ui.IActionDelegate, org.eclipse.ui.IEditorActionDelegate, org.eclipse.ui.IViewActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate
    Direct Known Subclasses:
    AbstractReplaceAction, AbstractSortAction, Spaces

    public abstract class AbstractTextAction
    extends AbstractAction
    • Field Detail

      • ACTION_ID_CONVERT_TABS

        public static final java.lang.String ACTION_ID_CONVERT_TABS
        See Also:
        Constant Field Values
      • ACTION_ID_CONVERT_SPACES

        public static final java.lang.String ACTION_ID_CONVERT_SPACES
        See Also:
        Constant Field Values
      • ACTION_ID_UNESCAPE

        public static final java.lang.String ACTION_ID_UNESCAPE
        See Also:
        Constant Field Values
      • ACTION_ID_ENCODE

        public static final java.lang.String ACTION_ID_ENCODE
        See Also:
        Constant Field Values
      • ACTION_ID_UNICODIFY

        public static final java.lang.String ACTION_ID_UNICODIFY
        See Also:
        Constant Field Values
      • ACTION_ID_TO_UPPER

        public static final java.lang.String ACTION_ID_TO_UPPER
        See Also:
        Constant Field Values
      • ACTION_ID_TO_LOWER

        public static final java.lang.String ACTION_ID_TO_LOWER
        See Also:
        Constant Field Values
      • ACTION_ID_CAPITALIZE

        public static final java.lang.String ACTION_ID_CAPITALIZE
        See Also:
        Constant Field Values
      • ACTION_ID_CAMEL_TO_PASCAL

        public static final java.lang.String ACTION_ID_CAMEL_TO_PASCAL
        See Also:
        Constant Field Values
      • isUsedOnSave

        private boolean isUsedOnSave
    • Constructor Detail

      • AbstractTextAction

        public AbstractTextAction()
    • Method Detail

      • init

        protected final void init()
      • estimateActionRange

        protected abstract TextReplaceResultSet estimateActionRange​(org.eclipse.jface.text.IDocument doc)
      • run

        public final void run​(org.eclipse.jface.action.IAction action)
        Specified by:
        run in interface org.eclipse.ui.IActionDelegate
        Overrides:
        run in class AbstractAction
        See Also:
        IActionDelegate.run(IAction)
      • doTextOperation

        protected abstract void doTextOperation​(org.eclipse.jface.text.IDocument doc,
                                                java.lang.String actionID,
                                                TextReplaceResultSet resultSet)
                                         throws org.eclipse.jface.text.BadLocationException
        Should be invoked always after estimateActionRange() to ensure that operaton is possible
        Parameters:
        doc - cannot be null
        actionID - desired text action id
        resultSet - cannot be null
        Throws:
        org.eclipse.jface.text.BadLocationException
      • isSaveDirtyBufferEnabled

        protected static boolean isSaveDirtyBufferEnabled()
      • isUsedOnSave

        public boolean isUsedOnSave()
        Returns:
        true, only if this action is intended to be run (chained) always just before "save" operation.
      • setUsedOnSave

        public void setUsedOnSave​(boolean isUsedOnSave)
        Parameters:
        isUsedOnSave - true, only if this action is intended to be run (chained) always just before "save" operation.