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.
        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
        update in class TextEditorAction
      • updateForTab

        protected void updateForTab()
        Enablement when tab key is pressed - the current selection has to be cover multiple lines.
      • 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
        isWritable - the writable state
        the hypothetical enable state of the action