예제 #1
0
    // {{{ mousePressed() method
    @Override
    public void mousePressed(MouseEvent evt) {
      if (evt.isConsumed()) return;

      TreePath path1 = resultTree.getPathForLocation(evt.getX(), evt.getY());
      if (path1 == null) return;

      resultTree.setSelectionPath(path1);
      if (GUIUtilities.isPopupTrigger(evt)) showPopupMenu(evt);
      else {
        goToSelectedNode(M_OPEN);
      }
    } // }}}
예제 #2
0
    @Override
    public void mouseReleased(MouseEvent evt) {
      if (evt.getClickCount() % 2 != 0 && !GUIUtilities.isMiddleButton(evt.getModifiers())) return;

      int row = parentDirectories.locationToIndex(evt.getPoint());
      if (row != -1) {
        Object obj = parentDirectories.getModel().getElementAt(row);
        if (obj instanceof VFSFile) {
          VFSFile dirEntry = (VFSFile) obj;
          if (!GUIUtilities.isPopupTrigger(evt)) {
            browser.setDirectory(dirEntry.getPath());
            if (browser.getMode() == VFSBrowser.BROWSER) focusOnFileView();
          }
        }
      }
    }
예제 #3
0
 @Override
 public void mousePressed(MouseEvent evt) {
   int row = parentDirectories.locationToIndex(evt.getPoint());
   if (row != -1) {
     Object obj = parentDirectories.getModel().getElementAt(row);
     if (obj instanceof VFSFile) {
       VFSFile dirEntry = (VFSFile) obj;
       if (GUIUtilities.isPopupTrigger(evt)) {
         if (popup != null && popup.isVisible()) {
           popup.setVisible(false);
           popup = null;
         } else {
           parentDirectories.setSelectedIndex(row);
           showFilePopup(new VFSFile[] {dirEntry}, parentDirectories, evt.getPoint());
         }
       }
     }
   }
 }
예제 #4
0
    // {{{ mousePressed() method
    @Override
    public void mousePressed(MouseEvent evt) {
      Point p = evt.getPoint();
      if (evt.getSource() != table) {
        p.x -= table.getX();
        p.y -= table.getY();
      }

      int row = table.rowAtPoint(p);
      int column = table.columnAtPoint(p);
      if (column == 0 && row != -1) {
        VFSDirectoryEntryTableModel.Entry entry =
            (VFSDirectoryEntryTableModel.Entry) table.getModel().getValueAt(row, 0);
        if (FileCellRenderer.ExpansionToggleBorder.isExpansionToggle(entry.level, p.x)) {
          table.toggleExpanded(row);
          return;
        }
      }

      if (GUIUtilities.isMiddleButton(evt.getModifiers())) {
        if (row == -1) /* nothing */ ;
        else if (evt.isShiftDown()) table.getSelectionModel().addSelectionInterval(row, row);
        else table.getSelectionModel().setSelectionInterval(row, row);
      } else if (GUIUtilities.isPopupTrigger(evt)) {
        if (popup != null && popup.isVisible()) {
          popup.setVisible(false);
          popup = null;
          return;
        }

        if (row == -1) showFilePopup(null, table, evt.getPoint());
        else {
          if (!table.getSelectionModel().isSelectedIndex(row))
            table.getSelectionModel().setSelectionInterval(row, row);
          showFilePopup(getSelectedFiles(), table, evt.getPoint());
        }
      }
    } // }}}
예제 #5
0
 // {{{ mouseReleased() method
 @Override
 public void mouseReleased(MouseEvent evt) {
   if (!GUIUtilities.isPopupTrigger(evt) && table.getSelectedRow() != -1) {
     browser.filesSelected();
   }
 } // }}}