org.eclipse.xtext.ui.editor.doubleClicking
Class LexerTokenAndCharacterPairAwareStrategy
java.lang.Object
org.eclipse.jface.text.DefaultTextDoubleClickStrategy
org.eclipse.xtext.ui.editor.doubleClicking.AbstractWordAwareDoubleClickStrategy
org.eclipse.xtext.ui.editor.doubleClicking.LexerTokenAndCharacterPairAwareStrategy
- All Implemented Interfaces:
- org.eclipse.jface.text.ITextDoubleClickStrategy
public class LexerTokenAndCharacterPairAwareStrategy
- extends AbstractWordAwareDoubleClickStrategy
This implementation uses the tokens
of an Xtext document to identify
words in the document. Thereby it recognizes keywords that consist only of characters
that are no letters, e.g. +=
or ?=
. Furthermore it will select
the contents of a brace pair if the opening or closing peer is clicked.
Tokens with a length of one character have a lower priority in case a token boundary is selected.
- Author:
- Sebastian Zarnekow - Initial contribution and API
Method Summary |
protected org.eclipse.jface.text.IRegion |
findExtendedDoubleClickSelection(org.eclipse.jface.text.IDocument document,
int offset)
|
protected org.eclipse.jface.text.IRegion |
findWord(org.eclipse.jface.text.IDocument document,
int offset)
|
protected org.eclipse.jface.text.source.ICharacterPairMatcher |
getCharacterPairMatcher()
|
Methods inherited from class org.eclipse.jface.text.DefaultTextDoubleClickStrategy |
doubleClicked |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LexerTokenAndCharacterPairAwareStrategy
public LexerTokenAndCharacterPairAwareStrategy()
findWord
protected org.eclipse.jface.text.IRegion findWord(org.eclipse.jface.text.IDocument document,
int offset)
- Overrides:
findWord
in class AbstractWordAwareDoubleClickStrategy
findExtendedDoubleClickSelection
protected org.eclipse.jface.text.IRegion findExtendedDoubleClickSelection(org.eclipse.jface.text.IDocument document,
int offset)
- Overrides:
findExtendedDoubleClickSelection
in class org.eclipse.jface.text.DefaultTextDoubleClickStrategy
getCharacterPairMatcher
protected org.eclipse.jface.text.source.ICharacterPairMatcher getCharacterPairMatcher()