Class ContextBasedFormattingStrategy

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void format()
      Formats the region with the properties indicated in the formatting context previously supplied by formatterStarts(IFormattingContext).
      java.lang.String format​(java.lang.String content, boolean start, java.lang.String indentation, int[] positions)
      Formats the given string.
      void formatterStarts​(java.lang.String indentation)
      Informs the strategy about the start of a formatting process in which it will participate.
      void formatterStarts​(IFormattingContext context)
      Informs the strategy about the start of a formatting process in which it will participate.
      void formatterStops()
      Informs the strategy that the formatting process in which it has participated has been finished.
      java.util.Map<java.lang.String,​java.lang.String> getPreferences()
      Returns the preferences used for the current formatting step.
      • Methods inherited from class java.lang.Object

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

      • ContextBasedFormattingStrategy

        public ContextBasedFormattingStrategy()
    • Method Detail

      • format

        public java.lang.String format​(java.lang.String content,
                                       boolean start,
                                       java.lang.String indentation,
                                       int[] positions)
        Description copied from interface: IFormattingStrategy
        Formats the given string. During the formatting process this strategy must update the given character positions according to the changes applied to the given string.
        Specified by:
        format in interface IFormattingStrategy
        Parameters:
        content - the initial string to be formatted
        start - indicates whether the beginning of content is a line start in its document
        indentation - the indentation string to be used
        positions - the character positions to be updated
        Returns:
        the formatted string
      • formatterStarts

        public void formatterStarts​(java.lang.String indentation)
        Description copied from interface: IFormattingStrategy
        Informs the strategy about the start of a formatting process in which it will participate.
        Specified by:
        formatterStarts in interface IFormattingStrategy
        Parameters:
        indentation - the indent string of the first line at which the overall formatting process starts.
      • getPreferences

        public final java.util.Map<java.lang.String,​java.lang.String> getPreferences()
        Returns the preferences used for the current formatting step.
        Returns:
        The preferences for the current formatting step