## net.sf.colorer
Interface RegionHandler

All Known Implementing Classes:
  Outliner, ParseTreeOutliner, WorkbenchOutliner

    public interface RegionHandler

Handles parse information, passed from TextParser. TextParser class generates calls of this class methods sequentially while parsing the text from top to bottom. All enterScheme and leaveScheme calls are properly enclosed, addRegion calls can inform about regions, overlapped with each other. All handler methods are called sequentially. It means, that if one of methods is called with some line number, all other calls (before endParsing event comes) can inform about events in the same, or lower line's numbers. This makes sequential tokens processing.

Method Summary
`void` `addRegion(int lno, java.lang.String line, int sx, int ex, Region region)` Informs handler about lexical region in line.
`void` `clearLine(int lno, java.lang.String line)` Clear line event.
`void` `endParsing(int lno)` End of text parsing.
`void` `enterScheme(int lno, java.lang.String line, int sx, int ex, Region region, java.lang.String scheme)` Informs handler about entering into specified scheme.
`Region` `getFilter()` Returns filter region, used by this handler.
`void` `leaveScheme(int lno, java.lang.String line, int sx, int ex, Region region, java.lang.String scheme)` Informs handler about leaveing specified scheme.
`void` `startParsing(int lno)` Start of text parsing.

Method Detail

### getFilter

    Region getFilter()

  Returns filter region, used by this handler. This region is used internally to filter parser stream and speedup JNI switches.

### startParsing

    void startParsing(int lno)

  Start of text parsing. Called only once, when TextParser starts parsing of the specified block of text. All other event messages comes between this call and endParsing call.

  Parameters:
    `lno` - Start line number

### endParsing

    void endParsing(int lno)

  End of text parsing. Called only once, when TextParser stops parsing of the specified block of text.

  Parameters:
    `lno` - End line number

### clearLine

    void clearLine(int lno,
                   java.lang.String line)

  Clear line event. Called once for each parsed text line, when TextParser starts to parse specified line of text. This method is called before any of the region information passed, and used often to clear internal handler structure of this line before adding new one.

  Parameters:
    `lno` - Line number

### addRegion

    void addRegion(int lno,
                   java.lang.String line,
                   int sx,
                   int ex,
                   Region region)

  Informs handler about lexical region in line. This is a basic method, wich transfer information from parser to application. Positions of different passed regions can be overlapped.

  Parameters:
    `lno` - Current line number
    `sx` - Start X position of region in line
    `ex` - End X position of region in line
    `region` - Region information

### enterScheme

    void enterScheme(int lno,
                     java.lang.String line,
                     int sx,
                     int ex,
                     Region region,
                     java.lang.String scheme)

  Informs handler about entering into specified scheme. Parameter `region` is used to specify scheme background region information. If text is parsed not from the first line, this method is called with fake parameters to compensate required scheme structure.

  Parameters:
    `lno` - Current line number
    `sx` - Start X position of region in line
    `ex` - End X position of region in line
    `region` - Scheme Region information (background)
    `scheme` - Additional Scheme information

### leaveScheme

    void leaveScheme(int lno,
                     java.lang.String line,
                     int sx,
                     int ex,
                     Region region,
                     java.lang.String scheme)

  Informs handler about leaveing specified scheme. Parameter `region` is used to specify scheme background region information. If text parse process ends, but current schemes stack is not balanced (this can happends because of bad balanced structure of source text, or partial text parse) this method is not called for unbalanced levels.

  Parameters:
    `lno` - Current line number
    `sx` - Start X position of region in line
    `ex` - End X position of region in line
    `region` - Scheme Region information (background)
    `scheme` - Additional Scheme information

Copyright © 2003 Cail Lomecb. All Rights Reserved.