com.bbn.swede.editor
Class OWLDelayedSyntaxChecker

java.lang.Object
  extended bycom.bbn.swede.editor.OWLDelayedSyntaxChecker

class OWLDelayedSyntaxChecker
extends Object

Aggregates document events for later handling. The composite event built by this class is executed if either a certain period if time goes by without a new event coming in or a new event comes in that is not adjacent to the current composite event. Composite events are handled by registered delayed document event listeners.

Author:
rblace, jlerner
See Also:
IDelayedDocumentEventListener

Constructor Summary
OWLDelayedSyntaxChecker()
          Creates a delayed syntax checker with the default timer delay.
OWLDelayedSyntaxChecker(long timerDelay)
          Creates a delayed syntax checker.
 
Method Summary
 void addDelayedDocumentEventListener(IDelayedDocumentEventListener ddel)
          Adds an IDelayedDocumentEventListener to the delayed syntax checker.
 void addDocumentEvent(DocumentEvent event)
          Add a regular document event to the delayed syntax checker.
 void cancelTimer()
          Cancels the parse timer.
 void forceRun()
          Forces the syntax checker to immediately run the current composite event.
 void removeDelayedDocumentEventListener(IDelayedDocumentEventListener ddel)
          Removes an IDelayedDocumentEventListener from the delayed syntax checker.
 void updateTimer()
          Resets the timer that controls automatic handling of composite events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLDelayedSyntaxChecker

public OWLDelayedSyntaxChecker()
Creates a delayed syntax checker with the default timer delay.


OWLDelayedSyntaxChecker

public OWLDelayedSyntaxChecker(long timerDelay)
Creates a delayed syntax checker.

Parameters:
timerDelay - The delay time for automatic composite event handling, in milliseconds.
Method Detail

addDelayedDocumentEventListener

public void addDelayedDocumentEventListener(IDelayedDocumentEventListener ddel)
Adds an IDelayedDocumentEventListener to the delayed syntax checker.

Parameters:
ddel - The listener to notify when delayed document events are fired

removeDelayedDocumentEventListener

public void removeDelayedDocumentEventListener(IDelayedDocumentEventListener ddel)
Removes an IDelayedDocumentEventListener from the delayed syntax checker. If ddel is not registered as a listener, nothing happens.

Parameters:
ddel - The listener to stop notifying when delayed document events are fired

updateTimer

public void updateTimer()
Resets the timer that controls automatic handling of composite events.


cancelTimer

public void cancelTimer()
Cancels the parse timer.


addDocumentEvent

public void addDocumentEvent(DocumentEvent event)
Add a regular document event to the delayed syntax checker. If there is currently no composite event being built, event becomes the current composite event. If there is already a composite event and event is a deletion and/or insertion that is adjacent to it, it is merged into the composite event. If there is already a composite event and event is not adjacent to it, the composite event is dispatched immediately for handling and event becomes the new composite event.

Parameters:
event - The event to be processed by the delayed syntax checker

forceRun

public void forceRun()
Forces the syntax checker to immediately run the current composite event.



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