Search in sources :

Example 6 with GeneralPairMatcher

use of org.eclipse.titan.designer.editors.GeneralPairMatcher in project titan.EclipsePlug-ins by eclipse.

the class ASN1DoubleClickStrategy method doubleClicked.

@Override
public final void doubleClicked(final ITextViewer part) {
    int pos = part.getSelectedRange().x;
    fText = part;
    if (fText.getDocument().getLength() < pos) {
        return;
    }
    if (pos < 0) {
        return;
    }
    GeneralPairMatcher pairMatcher = new PairMatcher();
    IRegion region = pairMatcher.match(fText.getDocument(), pos);
    if (region != null) {
        fText.setSelectedRange(region.getOffset() + 1, region.getLength() - 2);
        return;
    }
    selectWord(pos);
}
Also used : GeneralPairMatcher(org.eclipse.titan.designer.editors.GeneralPairMatcher) GeneralPairMatcher(org.eclipse.titan.designer.editors.GeneralPairMatcher) IRegion(org.eclipse.jface.text.IRegion)

Aggregations

GeneralPairMatcher (org.eclipse.titan.designer.editors.GeneralPairMatcher)6 BadLocationException (org.eclipse.jface.text.BadLocationException)4 Reference (org.eclipse.titan.designer.AST.Reference)4 IRegion (org.eclipse.jface.text.IRegion)2 TTCN3ReferenceAnalyzer (org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReferenceAnalyzer)2