| java.lang.Object de.uka.ilkd.key.ocl.gf.Linearization
Linearization | class Linearization (Code) | | Encapsulates everything that has to do with the linearization.
It is parsed here, and also the indices for click-in for pure text and HTML
are managed here. They get calculated in GfCapsule.
The result can be directly displayed, and this class has methods to translate
the indices back to the respective tree positions.
author: daniels |
Method Summary | |
Vector | calculateHighlights(LinPosition focusPosition) Goes through the list of MarkedAreas and creates MarkedAreaHighlightingStatus
objects for them, which contain fields for incorrect constraints
and if they belong to the selected subtree. | String | getLanguageForPos(int pos, boolean htmlClicked) Takes the index of a caret position in the linearization area
and returns the language of the clicked linearization. | HashMap | getLinearizations() | String | getSelectedLinearization(String language, LinPosition focusPosition) | String | markedAreaForPosHtml(int start, int end) The user has either just clicked in the linearization area,
which means start == end, or he has selected a text, so that
start < end. | String | markedAreaForPosPureText(int start, int end) The user has either just clicked in the linearization area,
which means start == end, or he has selected a text, so that
start < end. | void | parseLin(LanguageManager langMan) | void | reset() resets the output mechanism. | void | setLinearization(String linearization) | static String | unescapeTextFromGF(String string) |
logger | protected static Logger logger(Code) | | linearization marking debug messages
|
Linearization | public Linearization(Display display)(Code) | | Initializes this object and binds it to the given Display
Parameters: display - The display, that the editor uses |
calculateHighlights | Vector calculateHighlights(LinPosition focusPosition)(Code) | | Goes through the list of MarkedAreas and creates MarkedAreaHighlightingStatus
objects for them, which contain fields for incorrect constraints
and if they belong to the selected subtree.
Parameters: focusPosition - The AST position of the selected node a Vector of MarkedAreaHighlightingStatus |
getLanguageForPos | String getLanguageForPos(int pos, boolean htmlClicked)(Code) | | Takes the index of a caret position in the linearization area
and returns the language of the clicked linearization.
GF lists the different concrete languages one after the other,
and this method looks at the linearization snipplets to get
the language.
If somehow no language can be found out, 'Abstract' is returned
Parameters: pos - The index of the caret position Parameters: htmlClicked - If the HTML JTextPane has been clicked,false for the JTextArea the name of the concrete grammar (language) or Abstract(see above). |
getLinearizations | HashMap getLinearizations()(Code) | | Returns the linearizations. |
getSelectedLinearization | String getSelectedLinearization(String language, LinPosition focusPosition)(Code) | | Parameters: language - The concrete language of choice The linearization of the subtree starting with the currentlyselected node in the given language. |
markedAreaForPosHtml | String markedAreaForPosHtml(int start, int end)(Code) | | The user has either just clicked in the linearization area,
which means start == end, or he has selected a text, so that
start < end.
This method figures out the smallest subtree whose linearization
completely encompasses the area from start to end.
This method is for the HTML linearization area.
Parameters: start - The index of the caret position at the begin of the selection Parameters: end - The index of the caret position at the end of the selection The 'root' of the subtree described above |
markedAreaForPosPureText | String markedAreaForPosPureText(int start, int end)(Code) | | The user has either just clicked in the linearization area,
which means start == end, or he has selected a text, so that
start < end.
This method figures out the smallest subtree whose linearization
completely encompasses the area from start to end.
This method is for the pure text linearization area.
Parameters: start - The index of the caret position at the begin of the selection Parameters: end - The index of the caret position at the end of the selection The 'root' of the subtree described above |
parseLin | void parseLin(LanguageManager langMan)(Code) | | Parses the linearization XML and calls outputAppend
Parameters: langMan - The LangMenuModel, but that is an inner class and onlythe methods in the Interface LanguageManager are used here. |
reset | void reset()(Code) | | resets the output mechanism.
|
setLinearization | void setLinearization(String linearization)(Code) | | Parameters: linearization - The linearization to set. |
unescapeTextFromGF | static String unescapeTextFromGF(String string)(Code) | | Replaces a number of escaped characters by an unescaped version
of the same length
Parameters: string - The String with '\' as the escape character the same String, but with escaped characters removed |
|
|