changeset 6478:8ca3ec4ca878

RT-36111: move firing of ON_SHOWING event to doShow method to pair with firing of ON_SHOWN
author David Grieve<david.grieve@oracle.com>
date Thu, 13 Mar 2014 21:50:28 -0400
parents 102deeb4dcaa
children cd116a725b95
files modules/controls/src/main/java/javafx/scene/control/ContextMenu.java
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/ContextMenu.java	Thu Mar 13 21:50:27 2014 -0400
+++ b/modules/controls/src/main/java/javafx/scene/control/ContextMenu.java	Thu Mar 13 21:50:28 2014 -0400
@@ -243,7 +243,6 @@
     // TODO provide more detail
      public void show(Node anchor, Side side, double dx, double dy) {
         if (anchor == null) return;
-        Event.fireEvent(this, new Event(Menu.ON_SHOWING));
         if (getItems().size() == 0) return;
 
         getScene().setNodeOrientation(anchor.getEffectiveNodeOrientation());
@@ -269,14 +268,13 @@
      */
     public void show(Node anchor, double screenX, double screenY) {
         if (anchor == null) return;
-        Event.fireEvent(this, new Event(Menu.ON_SHOWING));
         if (getItems().size() == 0) return;
-
         getScene().setNodeOrientation(anchor.getEffectiveNodeOrientation());
         doShow(anchor, screenX, screenY);
     }
 
     private void doShow(Node anchor, double screenX, double screenY) {
+        Event.fireEvent(this, new Event(Menu.ON_SHOWING));
         if(isImpl_showRelativeToWindow()) {
             final Scene scene = (anchor == null) ? null : anchor.getScene();
             final Window win = (scene == null) ? null : scene.getWindow();