apps/scenebuilder/SceneBuilderApp/src/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

@@ -68,11 +68,10 @@
 import com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument;
 import com.oracle.javafx.scenebuilder.kit.fxom.FXOMNodes;
 import com.oracle.javafx.scenebuilder.kit.fxom.FXOMObject;
 import com.oracle.javafx.scenebuilder.kit.library.Library;
 import com.oracle.javafx.scenebuilder.kit.library.user.UserLibrary;
-import com.sun.javafx.scene.control.behavior.KeyBinding;
 
 import java.io.File;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;

@@ -235,11 +234,11 @@
     private static List<String> imageExtensions;
     private static List<String> audioExtensions;
     private static List<String> videoExtensions;
     private static List<String> mediaExtensions;
 
-    private final EventHandler<KeyEvent> mainKeyEventFilter = event -> {
+    private final EventHandler<KeyEvent> mainKeyEventFilter = (KeyEvent event) -> {
         //------------------------------------------------------------------
         // TEXT INPUT CONTROL
         //------------------------------------------------------------------
         // Common editing actions handled natively and defined as application accelerators
         // 

@@ -256,23 +255,24 @@
         //
         final Node focusOwner = getScene().getFocusOwner();
         final KeyCombination accelerator = getAccelerator(event);
         if (isTextInputControlEditing(focusOwner) == true 
                 && accelerator != null) {
-            for (KeyBinding binding : SBTextInputControlBindings.getBindings()) {
-                // The event is handled natively
-                if (binding.getSpecificity(null, event) > 0) {
-                    // 
-                    // When using system menu bar, the event is handled natively 
-                    // before the application receives it : we just consume the event 
-                    // so the editing action is not performed a second time by the app.
-                    if (menuBarController.getMenuBar().isUseSystemMenuBar()) {
-                        event.consume();
-                    }
-                    break;
-                }
-            }
+
+//            focusOwner.getInputMap()
+//                      .lookupMapping(KeyBinding.toKeyBinding(event))
+//                      .ifPresent(mapping -> {
+//                          // The event is handled natively
+//                          if (mapping.getSpecificity(event) > 0) {
+//                              // When using system menu bar, the event is handled natively
+//                              // before the application receives it : we just consume the event
+//                              // so the editing action is not performed a second time by the app.
+//                              if (menuBarController.getMenuBar().isUseSystemMenuBar()) {
+//                                  event.consume();
+//                              }
+//                          }
+//                      });
         }
 
         //------------------------------------------------------------------
         // Hierarchy TreeView + select all
         //------------------------------------------------------------------

@@ -2153,19 +2153,19 @@
             errorDialog.showAndWait();
         }
     }
 }
 
-/**
- * This class setup key bindings for the TextInputControl type classes and
- * provide a way to access the key binding list.
- */
-class SBTextInputControlBindings extends com.sun.javafx.scene.control.behavior.TextInputControlBindings {
-
-    private SBTextInputControlBindings() {
-        assert false;
-    }
-
-    public static List<KeyBinding> getBindings() {
-        return BINDINGS;
-    }
-}
+///**
+// * This class setup key bindings for the TextInputControl type classes and
+// * provide a way to access the key binding list.
+// */
+//class SBTextInputControlBindings extends TextInputControlBindings {
+//
+//    private SBTextInputControlBindings() {
+//        assert false;
+//    }
+//
+//    public static List<KeyBinding> getBindings() {
+//        return BINDINGS;
+//    }
+//}