? last ? X.diff ? src/X.diff Index: src/org/openide/explorer/view/ListView.java =================================================================== RCS file: /cvs/openide/src/org/openide/explorer/view/ListView.java,v retrieving revision 1.59.10.2 diff -u -r1.59.10.2 ListView.java --- src/org/openide/explorer/view/ListView.java 10 Dec 2002 15:42:48 -0000 1.59.10.2 +++ src/org/openide/explorer/view/ListView.java 6 Jan 2003 15:42:50 -0000 @@ -609,7 +609,7 @@ - void createPopup(int xpos, int ypos) { + void createPopup(int xpos, int ypos, boolean contextMenu) { if (manager == null) { return; } @@ -617,8 +617,14 @@ return; } - Action[] actions = NodeOp.findActions(manager.getSelectedNodes()); - JPopupMenu popup = Utilities.actionsToPopup(actions, this); + JPopupMenu popup; + + if (contextMenu) { + popup = Utilities.actionsToPopup(manager.getExploredContext().getContextActions(), this); + } else { + Action[] actions = NodeOp.findActions(manager.getSelectedNodes()); + popup = Utilities.actionsToPopup(actions, this); + } if ((popup != null) && (popup.getSubElements().length > 0) && (TreeView.shouldPopupBeDisplayed(ListView.this))) { java.awt.Point p = getViewport().getViewPosition(); @@ -648,11 +654,17 @@ } protected void showPopup (MouseEvent e) { - int i = list.locationToIndex (new Point (e.getX (), e.getY ())); + Point p = new Point (e.getX (), e.getY ()); + int i = list.locationToIndex (p); if (!list.isSelectedIndex (i)) { list.setSelectedIndex (i); } - createPopup(e.getX(), e.getY()); + + // the area of selected + Rectangle r = list.getCellBounds(i, i); + boolean contextMenu = !r.contains (p); + + createPopup(e.getX(), e.getY(), contextMenu); } public void performAction(SystemAction act) { @@ -667,7 +679,7 @@ Point p = list.indexToLocation(i); if (p == null) return; - createPopup(p.x, p.y); + createPopup(p.x, p.y, false); } CallbackSystemAction csa;