com.bbn.swede.editor
Class OWLDocumentPartitioner

java.lang.Object
  extended byFastPartitioner
      extended bycom.bbn.swede.editor.OWLDocumentPartitioner
All Implemented Interfaces:
IOASTChangeListener

public class OWLDocumentPartitioner
extends FastPartitioner
implements IOASTChangeListener

Partitions OWL documents with a lightweight rules-based scanner. Documents are divided into begin tag, end tag, and "everything else" partitions, with finer granularity and syntax highlighting controlled by word scanners.

Author:
jlerner
See Also:
com.bbn.swede.editor.rules, Serialized Form

Nested Class Summary
protected  class OWLDocumentPartitioner.OASTUpdater
          Updates the document's OAST to reflect changes to the document text.
 
Constructor Summary
OWLDocumentPartitioner(OAST tree)
          Creates a new OWLDocumentPartitioner associated with an OWL Abstract Syntax Tree.
 
Method Summary
 void connect(IDocument document, boolean delayInitialization)
           
 void finalize()
          Finalizes the document partitioner by disconnecting the OASTUpdater from the document.
 OAST getOAST()
          Retrieves the abstract syntax tree associated with the partitioner.
 void oastChanged(OASTEvent event)
          This method is called automatically after the OAST is changed.
(package private)  void setEditor(OWLSourceEditor editor, SourceViewer viewer)
          Sets a reference to the source editor and source viewer of the associated OWL editor.
 void updateOAST()
          Force an OAST update.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLDocumentPartitioner

public OWLDocumentPartitioner(OAST tree)
Creates a new OWLDocumentPartitioner associated with an OWL Abstract Syntax Tree.

Parameters:
tree - The OAST to associate with this partitioner
Method Detail

connect

public void connect(IDocument document,
                    boolean delayInitialization)

finalize

public void finalize()
              throws Throwable
Finalizes the document partitioner by disconnecting the OASTUpdater from the document.

Throws:
Throwable - if something goes wrong in the superclass finalize() call.

setEditor

void setEditor(OWLSourceEditor editor,
               SourceViewer viewer)
Sets a reference to the source editor and source viewer of the associated OWL editor.

Parameters:
editor - The source editor
viewer - The source viewer

updateOAST

public void updateOAST()
Force an OAST update. This ensures that the syntax tree accurately represents the current contents of the document.


getOAST

public OAST getOAST()
Retrieves the abstract syntax tree associated with the partitioner.

Returns:
The partitioner's OAST

oastChanged

public void oastChanged(OASTEvent event)
Description copied from interface: IOASTChangeListener
This method is called automatically after the OAST is changed. When this is called, the nodes in event.getRemoved() are no longer in the tree, and the nodes in event.getInserted() have been placed in the tree at their proper positions.

Specified by:
oastChanged in interface IOASTChangeListener
Parameters:
event - Describes the change that was just made to the OAST.


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.