Package org.eclipse.m2m.atl.adt.ui.text
Class AbstractScanner
java.lang.Object
org.eclipse.jface.text.rules.RuleBasedScanner
org.eclipse.m2m.atl.adt.ui.text.AbstractScanner
- All Implemented Interfaces:
org.eclipse.jface.text.rules.ICharacterScanner
,org.eclipse.jface.text.rules.ITokenScanner
- Direct Known Subclasses:
AtlCodeScanner
public abstract class AbstractScanner
extends org.eclipse.jface.text.rules.RuleBasedScanner
Its subclasses are only responsible for providing a list of preference keys based on which tokens are
generated and to use this tokens to define the rules controlling this scanner.
-
Field Summary
Fields inherited from class org.eclipse.jface.text.rules.RuleBasedScanner
fColumn, fDefaultReturnToken, fDelimiters, fDocument, fOffset, fRangeEnd, fRules, fTokenOffset, UNDEFINED
Fields inherited from interface org.eclipse.jface.text.rules.ICharacterScanner
EOF
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adaptToPreferenceChange
(org.eclipse.jface.util.PropertyChangeEvent event) boolean
affectsBehavior
(org.eclipse.jface.util.PropertyChangeEvent event) protected abstract List
Creates the list of rules controlling this scanner.protected abstract String[]
Returns a list of constants matching the token.protected AtlTextTools
protected org.eclipse.jface.text.rules.Token
Return the token matching the color value.final void
Must be called after the constructor has been called.Methods inherited from class org.eclipse.jface.text.rules.RuleBasedScanner
getColumn, getLegalLineDelimiters, getTokenLength, getTokenOffset, nextToken, read, setDefaultReturnToken, setRange, setRules, unread
-
Constructor Details
-
AbstractScanner
Creates an abstract ATL scanner. This needs to create firstable the tokens style, and afterwards associate them to their token value.
-
-
Method Details
-
adaptToPreferenceChange
public void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event) -
affectsBehavior
public boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event) -
createRules
Creates the list of rules controlling this scanner.- Returns:
- the list of rules
-
getPropertyNames
Returns a list of constants matching the token.- Returns:
- the list of constants
-
getTextTools
-
getToken
Return the token matching the color value.- Parameters:
color
- the color name of the key- Returns:
- the fetching token
-
initialize
public final void initialize()Must be called after the constructor has been called.
-