예제 #1
0
 @Override
 public void treeExpanded(TreeExpansionEvent e) {
   if (area != null) {
     area.repaint();
   }
   DefaultMutableTreeTableNode node =
       (DefaultMutableTreeTableNode) (e.getPath().getLastPathComponent());
   Task task = (Task) node.getUserObject();
   task.setExpand(true);
   myProject.setAskForSave(true);
 }
예제 #2
0
 @Override
 protected void onSelectionChanged(List<DefaultMutableTreeTableNode> selection) {
   if (isOnTaskSelectionEventProcessing) {
     return;
   }
   List<Task> selectedTasks = Lists.newArrayList();
   for (DefaultMutableTreeTableNode node : selection) {
     if (node instanceof TaskNode) {
       selectedTasks.add((Task) node.getUserObject());
     }
   }
   mySelectionManager.setSelectedTasks(selectedTasks);
 }
예제 #3
0
 @Override
 protected void handlePopupTrigger(MouseEvent e) {
   if (e.isPopupTrigger() || e.getButton() == MouseEvent.BUTTON3) {
     TreePath selPath = getTreeTable().getTreeTable().getPathForLocation(e.getX(), e.getY());
     if (selPath != null) {
       DefaultMutableTreeTableNode treeNode =
           (DefaultMutableTreeTableNode) selPath.getLastPathComponent();
       Task task = (Task) treeNode.getUserObject();
       if (!getTaskSelectionManager().isTaskSelected(task)) {
         getTaskSelectionManager().clear();
         getTaskSelectionManager().addTask(task);
       }
     }
     createPopupMenu(e.getX(), e.getY());
     e.consume();
   }
 }
예제 #4
0
 /** @return the mother task. */
 public static DefaultMutableTreeTableNode getParentNode(DefaultMutableTreeTableNode node) {
   if (node == null) {
     return null;
   }
   return (DefaultMutableTreeTableNode) node.getParent();
 }