updateBreadcrumb();
}
public void updateBreadcrumb() {
try {
WodParserCache cache = _editor.getParserCache();
Point selectionRange = _editor.getSelectedRange();
FuzzyXMLElement element = null;
FuzzyXMLDocument document = cache.getHtmlEntry().getModel();
if (document != null) {
element = document.getElementByOffset(selectionRange.x);
}
Control[] children = getChildren();
for (int i = children.length - 1; i >= 0; i--) {
children[i].dispose();
}
boolean emptyBreadcrumb = true;
if (element != null) {
List<FuzzyXMLNode> elementStack = new LinkedList<FuzzyXMLNode>();
FuzzyXMLNode currentNode = element;
do {
elementStack.add(currentNode);
currentNode = currentNode.getParentNode();
} while (currentNode != null);
for (int i = elementStack.size() - 2; i >= 0; i--) {
FuzzyXMLNode stackNode = elementStack.get(i);
if (stackNode instanceof FuzzyXMLElement) {
emptyBreadcrumb = false;
FuzzyXMLElement stackElement = (FuzzyXMLElement) stackNode;
FuzzyXMLElementWithWodElement data;
String tagName = stackElement.getName();
boolean isWOTag = WodHtmlUtils.isWOTag(tagName);
String displayName = null;
if (isWOTag) {
BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
IWodElement wodElement = WodHtmlUtils.getWodElement(stackElement, buildProperties, true, cache);
if (wodElement != null) {
displayName = wodElement.getElementType();
}
data = new FuzzyXMLElementWithWodElement(stackElement, wodElement);