org.netbeans.modules.lexer/2 1.39.1 1

org.netbeans.api.lexer
Enum TokenHierarchyEventType

java.lang.Object
  extended by java.lang.Enum<TokenHierarchyEventType>
      extended by org.netbeans.api.lexer.TokenHierarchyEventType
All Implemented Interfaces:
Serializable, Comparable<TokenHierarchyEventType>

public enum TokenHierarchyEventType
extends Enum<TokenHierarchyEventType>

Token hierarchy event type determines the reason why token hierarchy modification described by TokenHierarchyEvent happened.


Enum Constant Summary
ACTIVITY
          Token hierarchy became inactive (while being active before) or vice versa.
EMBEDDING_CREATED
          Custom language embedding was created by TokenSequence.createEmbedding(Language,int,int).
EMBEDDING_REMOVED
          Custom language embedding was removed by TokenSequence.removeEmbedding(Language).
LANGUAGE_PATHS
          Notification that result of TokenHierarchy.languagePaths() has changed.
MODIFICATION
          Modification (insert/remove) of the characters in the underlying character sequence was performed.
REBUILD
          Complete rebuild of the token hierarchy.
RELEX
          Explicit relexing of a part of the token hierarchy without any text modification.
 
Method Summary
static TokenHierarchyEventType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TokenHierarchyEventType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MODIFICATION

public static final TokenHierarchyEventType MODIFICATION
Modification (insert/remove) of the characters in the underlying character sequence was performed.


RELEX

public static final TokenHierarchyEventType RELEX
Explicit relexing of a part of the token hierarchy without any text modification.
This change is notified under modification lock (write lock) of the corresponding input source.
This is not actively used yet (no API support yet).


REBUILD

public static final TokenHierarchyEventType REBUILD
Complete rebuild of the token hierarchy.
This may be necessary because of any changes in input attributes that influence the lexing.
Only the removed tokens will be notified. There will be no added tokens because they will be created lazily when asked by clients.
This change is notified under modification lock (write lock) of the corresponding input source.


ACTIVITY

public static final TokenHierarchyEventType ACTIVITY
Token hierarchy became inactive (while being active before) or vice versa.
Current activity state can be determined by TokenHierarchy.isActive().
A maintainer of the given mutable input source may decide to activate/deactivate token hierarchy by using TokenHierarchyControl.setActive(boolean). For example if a Swing docuemnt is not showing and it has not been edited for a long time its token hierarchy may be deactivated to save memory. Once the hierarchy gets deactivated the clients should drop all the functionality depending on the tokens (for example not provide a token-dependent syntax highlighting).
Only the removed tokens will be notified in case the hierarchy becomes inactive.
There will be no added tokens notified in case the the hierarchy becomes active because the tokens will be created lazily when asked by clients.
This change is notified under modification lock (write lock) of the corresponding input source. Only the initial (automatic) activation of the mutable token hierarchy will happen under the read lock of the client asking for TokenHierarchy.tokenSequence() or a similar method that leads to automatic activation.


EMBEDDING_CREATED

public static final TokenHierarchyEventType EMBEDDING_CREATED
Custom language embedding was created by TokenSequence.createEmbedding(Language,int,int).
The TokenHierarchyEvent.tokenChange() contains the token where the embedding was created and the embedded change TokenChange.embeddedChange(int) that describes the added embedded language.
This change is notified under modification lock (write lock) of the corresponding input source.


EMBEDDING_REMOVED

public static final TokenHierarchyEventType EMBEDDING_REMOVED
Custom language embedding was removed by TokenSequence.removeEmbedding(Language).
The TokenHierarchyEvent.tokenChange() contains the token where the embedding was created and the embedded change TokenChange.embeddedChange(int) that describes the added embedded language.
This change is notified under modification lock (write lock) of the corresponding input source.


LANGUAGE_PATHS

public static final TokenHierarchyEventType LANGUAGE_PATHS
Notification that result of TokenHierarchy.languagePaths() has changed.
This change may be notified under both read and write lock of the corresponding input source.

Method Detail

values

public static TokenHierarchyEventType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TokenHierarchyEventType c : TokenHierarchyEventType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TokenHierarchyEventType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

org.netbeans.modules.lexer/2 1.39.1 1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.