Class ShiftAction

    • Constructor Detail

      • ShiftAction

        public ShiftAction​(ResourceBundle bundle,
                           String prefix,
                           ITextEditor editor,
                           int operationCode)
        Creates and initializes the action for the given text editor and operation code. The action configures its visual representation from the given resource bundle. The action works by asking the text editor at the time for its text operation target adapter (using getAdapter(ITextOperationTarget.class). The action runs that operation with the given opcode.
        Parameters:
        bundle - the resource bundle
        prefix - a prefix to be prepended to the various resource keys (described in ResourceAction constructor), or null if none
        editor - the text editor
        operationCode - the operation code
        See Also:
        TextEditorAction(ResourceBundle, String, ITextEditor)
    • Method Detail

      • update

        public void update()
        Description copied from class: TextEditorAction
        Always enables this action if it is connected to a text editor. If the associated editor is null, the action is disabled. Subclasses may override.
        Specified by:
        update in interface IUpdate
        Overrides:
        update in class TextEditorAction
      • updateForTab

        protected void updateForTab()
        Enablement when tab key is pressed - the current selection has to be cover multiple lines.
        Since:
        3.0
      • isEnabled

        public boolean isEnabled​(boolean isWritable)
        Description copied from interface: IReadOnlyDependent
        Returns whether the actions would be enabled if its target would be enabled given the writable state described by isWritable. isEnabled() and isEnabled(boolean) holds the following invariants: isEnabled() == false, if isEnabled(true) == false || isEnabled(false) == false isEnabled() == true, if isEnabled(true) == true || isEnabled(false) == true
        Specified by:
        isEnabled in interface IReadOnlyDependent
        Parameters:
        isWritable - the writable state
        Returns:
        the hypothetical enable state of the action