IndentAction (jEdit API Documentation)
Date: 2017-03-18

org.gjt.sp.jedit.indent

## Interface IndentAction

- All Known Implementing Classes:
    IndentAction.AlignOffset, IndentAction.AlignParameter, IndentAction.Collapse, IndentAction.Decrease, IndentAction.Increase, IndentAction.NoIncrease, IndentAction.Reset

      public interface IndentAction

  Abstract Indentation Action

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `IndentAction.AlignOffset`
    `static class` | `IndentAction.AlignParameter` Indent action used for deep indent.
    `static class` | `IndentAction.Collapse` See comments for each instance of this class below.
    `static class` | `IndentAction.Decrease`
    `static class` | `IndentAction.Increase`
    `static class` | `IndentAction.NoIncrease` Used to cancel increases in indentation.
    `static class` | `IndentAction.Reset`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static IndentAction.Collapse` | `PrevCollapse` This handles the following Java code: if(something) { // no indentation on this line, even though previous matches a rule
    `static IndentAction.Collapse` | `PrevPrevCollapse` This handles cases like: if (foo) bar; for (something; condition; action) { } Without this the "for" line would be incorrectly indented.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `calculateIndent(JEditBuffer buffer, int line, int oldIndent, int newIndent)`
    `boolean` | `keepChecking()`

- - ### Field Detail

    - #### PrevCollapse

          static final IndentAction.Collapse PrevCollapse

      This handles the following Java code: if(something) { // no indentation on this line, even though previous matches a rule

    - #### PrevPrevCollapse

          static final IndentAction.Collapse PrevPrevCollapse

      This handles cases like: if (foo) bar; for (something; condition; action) { } Without this the "for" line would be incorrectly indented.

  - ### Method Detail

    - #### calculateIndent

          int calculateIndent(JEditBuffer buffer,
                              int line,
                              int oldIndent,
                              int newIndent)

      Parameters:
        `buffer` - The buffer
        `line` - The line number that matched the rule; not necessarily the line being indented.
        `oldIndent` - Original indent.
        `newIndent` - The new indent -- ie, indent returned by previous indent action.

    - #### keepChecking

          boolean keepChecking()

      Returns:
        true if the indent engine should keep processing after this rule.