public String getText(Object element) { String text = ""; if (element instanceof TagTreeItem) { TagTreeItem tti = (TagTreeItem) element; text = tti.getName(); if (isHierarchical()) { int dot = text.lastIndexOf('.'); if (dot > 0 && dot < text.length() - 1) { text = text.substring(dot + 1); } } text += "(" + tti.getWaypointCount() + ")"; if (tti.hasChildren()) { text += "+"; } } return text; }
private void refreshBreadCrumb() { String linkText = ""; TagTreeItem current = (TagTreeItem) viewer.getInput(); int parentNum = 0; while (current != null) { String text = current.getName(); int dot = text.lastIndexOf('.'); if (dot > 0 && dot < text.length() - 1) { text = text.substring(dot + 1); } linkText = "<a href=\"" + parentNum + "\">" + text + "</a>" + linkText; if (current.getParent() != null && current.getParent() != input.getRoot()) { linkText = "." + linkText; } else { linkText = " " + linkText; } current = current.getParent(); parentNum++; } formText.setText("<form><p>" + linkText + "</p></form>", true, false); }