net.sf.colorer.eclipse.outline
Class ParseTreeOutliner

java.lang.Object
  extended by net.sf.colorer.eclipse.outline.ParseTreeOutliner
All Implemented Interfaces:
IWorkbenchOutlineSource, EditorListener, IOutlineSource, RegionHandler

public class ParseTreeOutliner
extends java.lang.Object
implements IWorkbenchOutlineSource, RegionHandler, EditorListener

Object used to store parse tree and showup it in Outline view


Constructor Summary
ParseTreeOutliner()
           
 
Method Summary
 void addListener(OutlineListener listener)
           
 void addRegion(int lno, java.lang.String line, int sx, int ex, Region region)
          Informs handler about lexical region in line.
 void attachOutliner(TextColorer editor)
          Attaches the outliner, specified by this interface to the editor, causing this outliner to recieve parse information.
 void clear()
          Cleans out current outline elements.
 void clear(java.util.Vector list, int topLine)
           
 void clearLine(int lno, java.lang.String line)
          Clear line event.
 void detachOutliner(TextColorer editor)
          Detaches the outliner, specified by this interface
 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.
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 java.lang.Object[] getChildren(java.lang.Object o)
           
 Region getFilter()
          Returns filter region, used by this handler.
 ImageDescriptor getImageDescriptor(java.lang.Object object)
           
 java.lang.String getLabel(java.lang.Object o)
           
 java.lang.Object getParent(java.lang.Object o)
           
 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 modifyEvent(int topLine)
          Informs EditorListener object about text modification event.
protected  void notifyUpdate()
           
 void removeListener(OutlineListener listener)
           
 void setHierarchy(boolean hierarchy)
           
 void setSorting(boolean sorting)
           
 void startParsing(int lno)
          Start of text parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseTreeOutliner

public ParseTreeOutliner()
Method Detail

getFilter

public Region getFilter()
Description copied from interface: RegionHandler
Returns filter region, used by this handler. This region is used internally to filter parser stream and speedup JNI switches.

Specified by:
getFilter in interface RegionHandler

clear

public void clear()
Description copied from interface: IWorkbenchOutlineSource
Cleans out current outline elements.

Specified by:
clear in interface IWorkbenchOutlineSource

clear

public void clear(java.util.Vector list,
                  int topLine)

startParsing

public void startParsing(int lno)
Description copied from interface: RegionHandler
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.

Specified by:
startParsing in interface RegionHandler
Parameters:
lno - Start line number

endParsing

public void endParsing(int lno)
Description copied from interface: RegionHandler
End of text parsing. Called only once, when TextParser stops parsing of the specified block of text.

Specified by:
endParsing in interface RegionHandler
Parameters:
lno - End line number

clearLine

public void clearLine(int lno,
                      java.lang.String line)
Description copied from interface: RegionHandler
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.

Specified by:
clearLine in interface RegionHandler
Parameters:
lno - Line number

addRegion

public void addRegion(int lno,
                      java.lang.String line,
                      int sx,
                      int ex,
                      Region region)
Description copied from interface: RegionHandler
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.

Specified by:
addRegion in interface RegionHandler
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

public void enterScheme(int lno,
                        java.lang.String line,
                        int sx,
                        int ex,
                        Region region,
                        java.lang.String scheme)
Description copied from interface: RegionHandler
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.

Specified by:
enterScheme in interface RegionHandler
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

public void leaveScheme(int lno,
                        java.lang.String line,
                        int sx,
                        int ex,
                        Region region,
                        java.lang.String scheme)
Description copied from interface: RegionHandler
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.

Specified by:
leaveScheme in interface RegionHandler
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

modifyEvent

public void modifyEvent(int topLine)
Description copied from interface: EditorListener
Informs EditorListener object about text modification event. All the text becomes invalid after the specified line.

Specified by:
modifyEvent in interface EditorListener
Parameters:
topLine - Topmost modified line of text.

getChildren

public java.lang.Object[] getChildren(java.lang.Object o)

getImageDescriptor

public ImageDescriptor getImageDescriptor(java.lang.Object object)

getLabel

public java.lang.String getLabel(java.lang.Object o)

getParent

public java.lang.Object getParent(java.lang.Object o)

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)

setHierarchy

public void setHierarchy(boolean hierarchy)
Specified by:
setHierarchy in interface IWorkbenchOutlineSource

setSorting

public void setSorting(boolean sorting)
Specified by:
setSorting in interface IWorkbenchOutlineSource

attachOutliner

public void attachOutliner(TextColorer editor)
Description copied from interface: IWorkbenchOutlineSource
Attaches the outliner, specified by this interface to the editor, causing this outliner to recieve parse information.

Specified by:
attachOutliner in interface IWorkbenchOutlineSource

detachOutliner

public void detachOutliner(TextColorer editor)
Description copied from interface: IWorkbenchOutlineSource
Detaches the outliner, specified by this interface

Specified by:
detachOutliner in interface IWorkbenchOutlineSource

addListener

public void addListener(OutlineListener listener)
Specified by:
addListener in interface IOutlineSource

removeListener

public void removeListener(OutlineListener listener)
Specified by:
removeListener in interface IOutlineSource

notifyUpdate

protected void notifyUpdate()


Copyright © 2003 Cail Lomecb. All Rights Reserved.