CFMLPropertyManager propertyManager = new CFMLPropertyManager();
String dict = propertyManager.getCurrentDictionary(((IFileEditorInput) editor.getEditorInput()).getFile().getProject());
CFMLParser fCfmlParser = CFMLPlugin.newCFMLParser(dict);
ICFDocument cfd = (ICFDocument) this.fViewer.getDocument();
CFMLSource cfmlSource = fCfmlParser.addCFMLSource(cfd.getCFDocument().getFilename(),cfd.get());
ParserTag tag = cfmlSource.getEnclosingTag(startpos);
int start = 0;
int length = 0;
if (tag != null) {
if ((e.stateMask & SWT.SHIFT) != 0) {
start = tag.getBegin();
length = tag.getEnd() - tag.getBegin();
} else {
if (tag.getEndTagBegin() <= startpos
&& tag.getEndTagEnd() >= startpos) {
start = tag.getEndTagBegin();
length = tag.getEndTagEnd() - tag.getEndTagBegin();
} else {
start = tag.getStartTagBegin();
length = tag.getStartTagEnd() - tag.getStartTagBegin();
}
}
TextSelection newSel = new TextSelection(cfd, start, length);
this.fViewer.setSelection(newSel);