Java 类com.intellij.ui.treeStructure.treetable.ListTreeTableModel 实例源码

项目:ultimate-pastebin-intellij-plugin    文件:ToolWindowServiceImpl.java   
public ToolWindowServiceImpl() {
  pasteBinService = ServiceManager.getService(PasteBinService.class);
  pasteBinConfigurationService = ServiceManager.getService(PasteBinConfigurationService.class);

  DefaultMutableTreeNode root = new DefaultMutableTreeNode();
  this.userNode = new DefaultMutableTreeNode(new UserNode(null));
  this.trendsNode = new DefaultMutableTreeNode(new TrendPasteNode());

  // This nodes always will be present
  root.add(userNode);
  root.add(trendsNode);

  // Initialize the tree
  this.tree = new Tree(new ListTreeTableModel(root, null));

  // Disable root node
  // and show the root children
  this.tree.setRootVisible(false);
  this.tree.setShowsRootHandles(true);

  // Enable speed search for tree of paste notes
  new TreeSpeedSearch(tree);

  // Tree render for putting icons
  this.tree.setCellRenderer(new PasteTreeRenderer());

  // Sets the right click context menu
  CustomizationUtil.installPopupHandler(tree, "ultimatepastebin.ToolwindowPopupMenu", ActionPlaces.TFS_TREE_POPUP);
}