コード例 #1
0
  private void initTree(final MyTree tree, boolean isRightTree) {
    tree.setCellRenderer(new MyTreeCellRenderer());
    tree.setRootVisible(false);
    tree.setShowsRootHandles(true);
    UIUtil.setLineStyleAngled(tree);

    TreeUtil.installActions(tree);
    SmartExpander.installOn(tree);
    EditSourceOnDoubleClickHandler.install(tree);
    new TreeSpeedSearch(tree);

    PopupHandler.installUnknownPopupHandler(
        tree, createTreePopupActions(isRightTree), ActionManager.getInstance());
  }
コード例 #2
0
  private void initTree(Tree tree) {
    tree.setCellRenderer(new MyTreeCellRenderer());
    tree.setRootVisible(false);
    tree.setShowsRootHandles(true);
    tree.setLineStyleAngled();

    TreeUtil.installActions(tree);
    SmartExpander.installOn(tree);
    new TreeSpeedSearch(tree);
    tree.addTreeWillExpandListener(
        new TreeWillExpandListener() {
          @Override
          public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
            ((PackageDependenciesNode) event.getPath().getLastPathComponent()).sortChildren();
          }

          @Override
          public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {}
        });

    PopupHandler.installUnknownPopupHandler(
        tree, createTreePopupActions(), ActionManager.getInstance());
  }