changeset 238:42d3501de782 2.1-b08

Automated merge with ssh://jpgodine@jfxsrc.us.oracle.com//javafx/2.1/MASTER/jfx/rt
author jpgodine@JPGODINE-LAP.st-users.us.oracle.com
date Tue, 10 Jan 2012 10:58:12 -0800
parents 93219a930ca6 6e9c0e567a9b
children ce1592dd4a9b 297acda36ed2 f5523d287d74
files
diffstat 3 files changed, 32 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/GlobalMenuAdapter.java	Tue Jan 10 12:16:18 2012 -0500
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/GlobalMenuAdapter.java	Tue Jan 10 10:58:12 2012 -0800
@@ -30,6 +30,9 @@
 import javafx.collections.ObservableList;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ListChangeListener.Change;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
 import javafx.scene.Node;
 import javafx.scene.control.CheckMenuItem;
 import javafx.scene.control.CustomMenuItem;
@@ -80,10 +83,16 @@
             }
         });
 
-        onShowingProperty().bind(menu.onShowingProperty());
-        onShownProperty().bind(menu.onShownProperty());
-        onHidingProperty().bind(menu.onHidingProperty());
-        onHiddenProperty().bind(menu.onHiddenProperty());
+        EventHandler<Event> showHideHandler = new EventHandler<Event>() {
+            public void handle(Event ev) {
+                Event.fireEvent(menu, new Event(ev.getEventType()));
+            }
+        };
+
+        setOnShowing(showHideHandler);
+        setOnShown(showHideHandler);
+        setOnHiding(showHideHandler);
+        setOnHidden(showHideHandler);
 
         menu.getItems().addListener(new ListChangeListener<MenuItem>() {
             @Override public void onChanged(Change<? extends MenuItem> c) {
@@ -123,15 +132,20 @@
     }
 
 
-    private static void bindMenuItemProperties(MenuItem adapter, MenuItem menuItem) {
+    private static void bindMenuItemProperties(MenuItem adapter, final MenuItem menuItem) {
         adapter.idProperty().bind(menuItem.idProperty());
         adapter.textProperty().bind(menuItem.textProperty());
         adapter.graphicProperty().bind(menuItem.graphicProperty());
-        adapter.onActionProperty().bind(menuItem.onActionProperty());
         adapter.disableProperty().bind(menuItem.disableProperty());
         adapter.visibleProperty().bind(menuItem.visibleProperty());
         adapter.acceleratorProperty().bind(menuItem.acceleratorProperty());
         adapter.mnemonicParsingProperty().bind(menuItem.mnemonicParsingProperty());
+
+        adapter.setOnAction(new EventHandler<ActionEvent>() {
+            public void handle(ActionEvent ev) {
+                menuItem.fire();
+            }
+        });
     }
 
 
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubStage.java	Tue Jan 10 12:16:18 2012 -0500
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubStage.java	Tue Jan 10 10:58:12 2012 -0800
@@ -173,4 +173,10 @@
 
     public void ungrabFocus() {
     }
+
+    public void setMinimumSize(int minWidth, int minHeight) {
+    }
+
+    public void setMaximumSize(int maxWidth, int maxHeight) {
+    }
 }
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubToolkit.java	Tue Jan 10 12:16:18 2012 -0500
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubToolkit.java	Tue Jan 10 10:58:12 2012 -0800
@@ -100,6 +100,7 @@
 import com.sun.javafx.tk.TKScene;
 import com.sun.javafx.tk.TKScreenConfigurationListener;
 import com.sun.javafx.tk.TKStage;
+import com.sun.javafx.tk.TKSystemMenu;
 import com.sun.javafx.tk.TextHelper;
 import com.sun.javafx.tk.Toolkit;
 import com.sun.prism.BasicStroke;
@@ -178,6 +179,11 @@
     }
 
     @Override
+    public TKSystemMenu getSystemMenu() {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    @Override
     public void startup(Runnable runnable) {
         runnable.run();
     }