@Override public void dispose() { if (fMatcher != null) { if (fMatcher instanceof ICharacterPairMatcherExtension && fTextListener != null) { installUninstallTextListener(false); } fMatcher.clear(); fMatcher= null; } fColor= null; fTextWidget= null; }
return; pair= fMatcher.match(document, selection.getOffset()); characterPresentAtCaretLocation= (pair != null); fMatcher.getAnchor() != fAnchor || characterPresentAtCaretLocation != fCharacterPresentAtCaretLocation) { fPairPosition.offset= pair.getOffset(); fPairPosition.length= pair.getLength(); fAnchor= fMatcher.getAnchor(); fCharacterPresentAtCaretLocation= characterPresentAtCaretLocation; fPairPosition.offset= pair.getOffset(); fPairPosition.length= pair.getLength(); fAnchor= fMatcher.getAnchor(); fCharacterPresentAtCaretLocation= characterPresentAtCaretLocation;
@Override protected IRegion findExtendedDoubleClickSelection(IDocument document, int offset) { IRegion match= characterPairMatcher.match(document, offset); if (match != null && match.getLength() >= 2) return new Region(match.getOffset() + 1, match.getLength() - 2); return findWord(document, offset); }
return; pair= fMatcher.match(document, selection.getOffset()); characterPresentAtCaretLocation= (pair != null); fMatcher.getAnchor() != fAnchor || characterPresentAtCaretLocation != fCharacterPresentAtCaretLocation) { fPairPosition.offset= pair.getOffset(); fPairPosition.length= pair.getLength(); fAnchor= fMatcher.getAnchor(); fCharacterPresentAtCaretLocation= characterPresentAtCaretLocation; fPairPosition.offset= pair.getOffset(); fPairPosition.length= pair.getLength(); fAnchor= fMatcher.getAnchor(); fCharacterPresentAtCaretLocation= characterPresentAtCaretLocation;
@Override public void run() { IXtextDocument document = editor.getDocument(); ISelection selection = editor.getSelectionProvider().getSelection(); if (selection instanceof TextSelection) { TextSelection textSelection = (TextSelection) selection; if (textSelection.getLength()==0) { IRegion region = matcher.match(document, textSelection.getOffset()); if (region != null) { if (region.getOffset()+1==textSelection.getOffset()) { editor.selectAndReveal(region.getOffset()+region.getLength(),0); } else { editor.selectAndReveal(region.getOffset()+1,0); } } } } }
@Override public void dispose() { if (fMatcher != null) { if (fMatcher instanceof ICharacterPairMatcherExtension && fTextListener != null) { installUninstallTextListener(false); } fMatcher.clear(); fMatcher= null; } fColor= null; fTextWidget= null; }