站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

SyntaxUpdateTokens (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class SyntaxUpdateTokens

java.lang.Object
  extended by org.netbeans.editor.SyntaxUpdateTokens

public abstract class SyntaxUpdateTokens
extends Object

Notification about the tokens being relexed as result of a document modification.
The SPIs may use Document.putProperty(SyntaxUpdateNotify.class, inst) to assign an instance of this class to the particular document.
The client DocumentListeners can then retrieve the list of the relexed tokens of interest by using


Nested Class Summary
 class SyntaxUpdateTokens.TokenInfo
           
 
Constructor Summary
SyntaxUpdateTokens()
           
 
Method Summary
static List getTokenInfoList(Document doc)
          Create list of tokens of interest for the whole document.
static List getTokenInfoList(DocumentEvent evt)
          Retrieve unmodifiable list of relexed tokens of interest for the particular document event.
abstract  List syntaxUpdateEnd()
          Notification that updating of lexical states has ended so there will be no more tokens relexed for the modification.
abstract  void syntaxUpdateStart()
          Notification that updating of the lexical states is starting for the last performed modification.
abstract  void syntaxUpdateToken(TokenID id, TokenContextPath contextPath, int offset, int length)
          Notification that a token was found during updating of lexical states.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyntaxUpdateTokens

public SyntaxUpdateTokens()
Method Detail

getTokenInfoList

public static List getTokenInfoList(DocumentEvent evt)
Retrieve unmodifiable list of relexed tokens of interest for the particular document event.

Parameters:
evt - document event for which the list of tokens is being retrieved.
Returns:
list of SyntaxUpdateTokens.TokenInfos describing the tokens of interest that were relexed because of the document modification.

getTokenInfoList

public static List getTokenInfoList(Document doc)
Create list of tokens of interest for the whole document.
Document is readlocked during this operation.

Parameters:
doc - document for which the list of tokens is being retrieved.
Returns:
list of SyntaxUpdateTokens.TokenInfos describing the tokens of interest throughout the whole document.

syntaxUpdateStart

public abstract void syntaxUpdateStart()
Notification that updating of the lexical states is starting for the last performed modification.
The list of the token infos should be cleared here.


syntaxUpdateEnd

public abstract List syntaxUpdateEnd()
Notification that updating of lexical states has ended so there will be no more tokens relexed for the modification.
If there are any tokens of interest they should be returned from this method.

Returns:
list of tokens of interest. The returned list will be copied by the infrastructure so the originally returned instance can continue to be used.

syntaxUpdateToken

public abstract void syntaxUpdateToken(TokenID id,
                                       TokenContextPath contextPath,
                                       int offset,
                                       int length)
Notification that a token was found during updating of lexical states. If this class is interested in providing info about this token to clients then it should create


org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.