Index: graph/lib/apichanges.xml =================================================================== RCS file: /cvs/graph/lib/apichanges.xml,v retrieving revision 1.23 diff -u -r1.23 apichanges.xml --- graph/lib/apichanges.xml 25 Jun 2007 14:10:16 -0000 1.23 +++ graph/lib/apichanges.xml 18 Jul 2007 13:16:25 -0000 @@ -330,6 +330,20 @@ + + + + Popup menu action could be invoked by Shift+F10 key + + + + + + Popup menu action (created by ActionFactory.createPopupMenuAction method) could be invoked by an user using Shift+F10 key. + + + + Index: graph/lib/manifest.mf =================================================================== RCS file: /cvs/graph/lib/manifest.mf,v retrieving revision 1.13 diff -u -r1.13 manifest.mf --- graph/lib/manifest.mf 25 Jun 2007 14:10:16 -0000 1.13 +++ graph/lib/manifest.mf 18 Jul 2007 13:16:25 -0000 @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.visual OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visual/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 2.5 +OpenIDE-Module-Specification-Version: 2.6 Index: graph/lib/src/org/netbeans/api/visual/action/ActionFactory.java =================================================================== RCS file: /cvs/graph/lib/src/org/netbeans/api/visual/action/ActionFactory.java,v retrieving revision 1.24 diff -u -r1.24 ActionFactory.java --- graph/lib/src/org/netbeans/api/visual/action/ActionFactory.java 5 Jun 2007 08:43:25 -0000 1.24 +++ graph/lib/src/org/netbeans/api/visual/action/ActionFactory.java 18 Jul 2007 13:16:25 -0000 @@ -167,7 +167,7 @@ /** * Creates a add-remove control point action with a default sensitivity. The action is assigned to a FreeConnectionWidget. - * @return the add-remove control point action +f * @return the add-remove control point action */ public static WidgetAction createAddRemoveControlPointAction () { return createAddRemoveControlPointAction (3.0, 5.0); Index: graph/lib/src/org/netbeans/api/visual/action/PopupMenuProvider.java =================================================================== RCS file: /cvs/graph/lib/src/org/netbeans/api/visual/action/PopupMenuProvider.java,v retrieving revision 1.4 diff -u -r1.4 PopupMenuProvider.java --- graph/lib/src/org/netbeans/api/visual/action/PopupMenuProvider.java 14 Nov 2006 10:04:13 -0000 1.4 +++ graph/lib/src/org/netbeans/api/visual/action/PopupMenuProvider.java 18 Jul 2007 13:16:25 -0000 @@ -36,7 +36,7 @@ * no popup menu will be displayed if this PopupMenuAction gets * a valid popup trigger on the given Widget. * @param widget the widget - * @param localLocation the local location where the popup menu was invoked + * @param localLocation the local location where the popup menu was invoked; if null, then popup menu is invoked by a keyboard * @return The JPopupMenu to display for the given Widget. * May be null. */ Index: graph/lib/src/org/netbeans/modules/visual/action/PopupMenuAction.java =================================================================== RCS file: /cvs/graph/lib/src/org/netbeans/modules/visual/action/PopupMenuAction.java,v retrieving revision 1.5 diff -u -r1.5 PopupMenuAction.java --- graph/lib/src/org/netbeans/modules/visual/action/PopupMenuAction.java 14 Nov 2006 10:04:22 -0000 1.5 +++ graph/lib/src/org/netbeans/modules/visual/action/PopupMenuAction.java 18 Jul 2007 13:16:25 -0000 @@ -25,6 +25,8 @@ import javax.swing.*; import java.awt.*; +import java.awt.event.KeyEvent; +import java.awt.event.InputEvent; /** * @author William Headrick, David Kaspar @@ -91,6 +93,21 @@ Scene scene = widget.getScene (); Point point = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ())); popupMenu.show (scene.getView (), point.x, point.y); + } + return State.CONSUMED; + } + return State.REJECTED; + } + + public State keyPressed (Widget widget, WidgetKeyEvent event) { + if ((event.getModifiers () & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK && event.getKeyCode () == KeyEvent.VK_F10) { + JPopupMenu popupMenu = provider.getPopupMenu (widget, null); + if (popupMenu != null) { + JComponent view = widget.getScene ().getView (); + if (view != null) { + Rectangle visibleRect = view.getVisibleRect (); + popupMenu.show (view, visibleRect.x + 10, visibleRect.y + 10); + } } return State.CONSUMED; }