Class DefaultIndentLineAutoEditStrategy

  • All Implemented Interfaces:
    IAutoEditStrategy
    Direct Known Subclasses:
    DefaultAutoIndentStrategy

    public class DefaultIndentLineAutoEditStrategy
    extends java.lang.Object
    implements IAutoEditStrategy
    This strategy always copies the indentation of the previous line.

    This class is not intended to be subclassed.

    Since:
    3.1
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultIndentLineAutoEditStrategy()
      Creates a new indent line auto edit strategy which can be installed on text viewers.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void customizeDocumentCommand​(IDocument d, DocumentCommand c)
      Allows the strategy to manipulate the document command.
      protected int findEndOfWhiteSpace​(IDocument document, int offset, int end)
      Returns the first offset greater than offset and smaller than end whose character is not a space or tab character.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultIndentLineAutoEditStrategy

        public DefaultIndentLineAutoEditStrategy()
        Creates a new indent line auto edit strategy which can be installed on text viewers.
    • Method Detail

      • findEndOfWhiteSpace

        protected int findEndOfWhiteSpace​(IDocument document,
                                          int offset,
                                          int end)
                                   throws BadLocationException
        Returns the first offset greater than offset and smaller than end whose character is not a space or tab character. If no such offset is found, end is returned.
        Parameters:
        document - the document to search in
        offset - the offset at which searching start
        end - the offset at which searching stops
        Returns:
        the offset in the specified range whose character is not a space or tab
        Throws:
        BadLocationException - if position is an invalid range in the given document