if (realSelection instanceof ITextSelection) {
ITextSelection textSelection = (ITextSelection) realSelection;
FuzzyXMLDocument document = getHtmlXmlDocument(refreshModel);
if (document != null) {
FuzzyXMLElement element = document.getElementByOffset(textSelection.getOffset());
BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
wodElement = WodHtmlUtils.getWodElement(element, buildProperties, resolveWodElement, cache);
}
}
else if (realSelection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) realSelection;
Object obj = structuredSelection.getFirstElement();
if (obj instanceof FuzzyXMLElement) {
FuzzyXMLElement element = (FuzzyXMLElement) obj;
BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
wodElement = WodHtmlUtils.getWodElement(element, buildProperties, resolveWodElement, cache);
}
}
}
return wodElement;