changeset 1274:2bbfe01c80b3

RT-22083 - fix GlobalMenuAdapter so menu action doesn't fire during validation
author Morris Meyer <morris.meyer@oracle.com>
date Wed, 06 Jun 2012 19:59:00 -0400
parents 6593c5847d5b
children 2b45c041ff58
files javafx-ui-controls/src/com/sun/javafx/scene/control/GlobalMenuAdapter.java
diffstat 1 files changed, 1 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/GlobalMenuAdapter.java	Wed Jun 06 09:51:28 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/GlobalMenuAdapter.java	Wed Jun 06 19:59:00 2012 -0400
@@ -27,9 +27,9 @@
 
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
-import javafx.collections.ObservableList;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ListChangeListener.Change;
+import javafx.collections.ObservableList;
 import javafx.event.ActionEvent;
 import javafx.event.Event;
 import javafx.event.EventHandler;
@@ -170,8 +170,6 @@
         if(target != null && target.getOnMenuValidation() != null) {
             Event.fireEvent(target, new Event(target.MENU_VALIDATION_EVENT));
         }
-        if (!menu.isDisable()) menu.fire();
-        
     }
 
 
@@ -195,9 +193,7 @@
             if(target.getOnMenuValidation() != null) {
                 Event.fireEvent(target, new Event(target.MENU_VALIDATION_EVENT));
             }
-            if (!menuItem.isDisable()) menuItem.fire();
         }
-
     }
 
     private class CheckMenuItemAdapter extends CheckMenuItem implements CheckMenuItemBase {
@@ -221,9 +217,7 @@
             if(target.getOnMenuValidation() != null) {
                 Event.fireEvent(target, new Event(target.MENU_VALIDATION_EVENT));
             }
-            if (!menuItem.isDisable()) menuItem.fire();
         }
-
     }
 
     private class RadioMenuItemAdapter extends RadioMenuItem implements RadioMenuItemBase {
@@ -248,9 +242,7 @@
             if(target.getOnMenuValidation() != null) {
                 Event.fireEvent(target, new Event(target.MENU_VALIDATION_EVENT));
             }
-            if (!menuItem.isDisable()) menuItem.fire();
         }
-
     }
 
     private class SeparatorMenuItemAdapter extends SeparatorMenuItem implements SeparatorMenuItemBase {
@@ -271,9 +263,7 @@
             if(target.getOnMenuValidation() != null) {
                 Event.fireEvent(target, new Event(target.MENU_VALIDATION_EVENT));
             }
-            if (!menuItem.isDisable()) menuItem.fire();
         }
-
     }
 
     private class CustomMenuItemAdapter extends CustomMenuItem implements CustomMenuItemBase {
@@ -294,8 +284,6 @@
             if(target.getOnMenuValidation() != null) {
                 Event.fireEvent(target, new Event(target.MENU_VALIDATION_EVENT));
             }
-            if (!menuItem.isDisable()) menuItem.fire();
         }
-
     }
 }