Example #1
0
  public void refresh() {
    this.flat = input.isFlat();
    if (flat) {
      viewer.setInput(input.getRoot());
    }
    refreshBreadCrumb();
    viewer.refresh();

    if (viewer.getInput() == input.getRoot())
      viewer.setSelection(new StructuredSelection(new Object[] {input.getRoot()}), true);

    //		if (viewer.getCloud().getItems().length > 0) {
    //			viewer.setSelection(new StructuredSelection(viewer.getCloud().getItems()[0].getData()),
    // true);
    //		}
  }
Example #2
0
 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);
 }