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.
-
-
Constructor Summary
Constructors Constructor Description AbstractScanner(AtlTextTools texttools)
Creates an abstract ATL scanner.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)
boolean
affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)
protected abstract java.util.List
createRules()
Creates the list of rules controlling this scanner.protected abstract java.lang.String[]
getPropertyNames()
Returns a list of constants matching the token.protected AtlTextTools
getTextTools()
protected org.eclipse.jface.text.rules.Token
getToken(java.lang.String color)
Return the token matching the color value.void
initialize()
Must be called after the constructor has been called.
-
-
-
Constructor Detail
-
AbstractScanner
public AbstractScanner(AtlTextTools texttools)
Creates an abstract ATL scanner. This needs to create firstable the tokens style, and afterwards associate them to their token value.
-
-
Method Detail
-
adaptToPreferenceChange
public void adaptToPreferenceChange(org.eclipse.jface.util.PropertyChangeEvent event)
-
affectsBehavior
public boolean affectsBehavior(org.eclipse.jface.util.PropertyChangeEvent event)
-
createRules
protected abstract java.util.List createRules()
Creates the list of rules controlling this scanner.- Returns:
- the list of rules
-
getPropertyNames
protected abstract java.lang.String[] getPropertyNames()
Returns a list of constants matching the token.- Returns:
- the list of constants
-
getTextTools
protected AtlTextTools getTextTools()
-
getToken
protected org.eclipse.jface.text.rules.Token getToken(java.lang.String color)
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.
-
-