extends Control {
-
-
- /* *************************************************************************
- * *
- * Static properties and methods *
- * *
- **************************************************************************/
+ /** Denotes the function that toggles this combo box popup. */
+ public static final FunctionTag TOGGLE_POPUP = new FunctionTag();
+ //CANCEL_EDIT, // TODO forwards to parent, child class logic in the base class, looks poorly thought out
/**
* Called prior to the ComboBox showing its popup/display after the user
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/Control.java b/modules/javafx.controls/src/main/java/javafx/scene/control/Control.java
index 1c0b796b63d..b2e81e23a0f 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/Control.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/Control.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,34 +31,36 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-
-import com.sun.javafx.scene.control.ControlAcceleratorSupport;
import javafx.application.Application;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ObjectPropertyBase;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.ObservableList;
+import javafx.css.CssMetaData;
import javafx.css.CssParser;
+import javafx.css.Styleable;
+import javafx.css.StyleableObjectProperty;
+import javafx.css.StyleableProperty;
+import javafx.css.StyleableStringProperty;
+import javafx.css.converter.StringConverter;
import javafx.event.EventHandler;
import javafx.scene.AccessibleAction;
import javafx.scene.AccessibleAttribute;
import javafx.scene.Node;
+import javafx.scene.control.input.FunctionTag;
+import javafx.scene.control.input.InputMap;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.layout.Region;
import com.sun.javafx.application.PlatformImpl;
-import javafx.css.CssMetaData;
import com.sun.javafx.css.StyleManager;
+import com.sun.javafx.logging.PlatformLogger;
+import com.sun.javafx.logging.PlatformLogger.Level;
import com.sun.javafx.scene.NodeHelper;
+import com.sun.javafx.scene.control.ControlAcceleratorSupport;
import com.sun.javafx.scene.control.ControlHelper;
-import javafx.css.StyleableObjectProperty;
-import javafx.css.StyleableStringProperty;
-import javafx.css.converter.StringConverter;
import com.sun.javafx.scene.control.Logging;
-import javafx.css.Styleable;
-import javafx.css.StyleableProperty;
-import com.sun.javafx.logging.PlatformLogger;
-import com.sun.javafx.logging.PlatformLogger.Level;
+import com.sun.javafx.scene.control.input.InputMapHelper;
/**
@@ -201,6 +203,7 @@ private static Class> loadClass(final String className, final Object instance)
}
};
+ private InputMap inputMap;
/* *************************************************************************
@@ -451,11 +454,6 @@ protected Control() {
// we add a listener for menu request events to show the context menu
// that may be set on the Control
this.addEventHandler(ContextMenuEvent.CONTEXT_MENU_REQUESTED, contextMenuHandler);
-
- // TODO re-enable when InputMap moves back to Node / Control
-// // Most controls need an input map, so we set this to be non-null in
-// // Control to save people from running into NPEs.
-// setInputMap(new InputMap(this));
}
@@ -466,15 +464,40 @@ protected Control() {
* *
**************************************************************************/
- // Proposed dispose() API.
- // Note that there is impl code for a dispose method in TableRowSkinBase
- // and TableCell (just search for dispose())
-// public void dispose() {
-// Skin skin = getSkin();
-// if (skin != null) {
-// skin.dispose();
-// }
-// }
+ /**
+ * Returns the {@link InputMap} for this {@code Control}.
+ *
+ * @since 999 TODO
+ * @return the input map
+ */
+ public final InputMap getInputMap() {
+ if (inputMap == null) {
+ inputMap = new InputMap(this);
+ }
+ return inputMap;
+ }
+
+ /**
+ * Executes function mapped to the {@link FunctionTag}.
+ * This method does nothing if no mapping is found.
+ *
+ * @since 999 TODO
+ * @param tag the function tag
+ */
+ public final void execute(FunctionTag tag) {
+ InputMapHelper.execute(this, getInputMap(), tag);
+ }
+
+ /**
+ * Executes the default function mapped to the specified tag.
+ * This method does nothing if no default mapping exists.
+ *
+ * @since 999 TODO
+ * @param tag the function tag
+ */
+ public final void executeDefault(FunctionTag tag) {
+ InputMapHelper.executeDefault(this, getInputMap(), tag);
+ }
/**
* Returns true
since all Controls are resizable.
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/PopupControl.java b/modules/javafx.controls/src/main/java/javafx/scene/control/PopupControl.java
index eaba3e56fe4..b31339f60e1 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/PopupControl.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/PopupControl.java
@@ -253,6 +253,7 @@ public PopupControl() {
// let the new skin modify this control
if (skin != null) {
skin.install();
+ // TODO install skin input map
}
// calling NodeHelper.reapplyCSS() as the styleable properties may now
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/Skin.java b/modules/javafx.controls/src/main/java/javafx/scene/control/Skin.java
index 10baad806bd..c169f33919d 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/Skin.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/Skin.java
@@ -26,6 +26,7 @@
package javafx.scene.control;
import javafx.scene.Node;
+import javafx.scene.control.input.SkinInputMap;
/**
* An interface for defining the visual representation of user interface controls.
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java b/modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java
index cd21a42cd70..5af05e706da 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/SkinBase.java
@@ -28,7 +28,6 @@
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
-
import javafx.beans.Observable;
import javafx.beans.value.ObservableValue;
import javafx.collections.ListChangeListener.Change;
@@ -43,9 +42,9 @@
import javafx.scene.AccessibleAction;
import javafx.scene.AccessibleAttribute;
import javafx.scene.Node;
+import javafx.scene.control.input.SkinInputMap;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Region;
-
import com.sun.javafx.scene.control.LambdaMultiplePropertyChangeListenerHandler;
import com.sun.javafx.scene.control.ListenerHelper;
@@ -161,6 +160,8 @@ protected SkinBase(final C control) {
/** {@inheritDoc} */
@Override public void dispose() {
// control.removeEventHandler(ContextMenuEvent.CONTEXT_MENU_REQUESTED, contextMenuHandler);
+ // remove behavior handlers
+ setSkinInputMap(null);
// unhook listeners
if (lambdaChangeListenerHandler != null) {
@@ -174,7 +175,18 @@ protected SkinBase(final C control) {
this.control = null;
}
-
+ /**
+ * Sets or removes the skin input map.
+ * Setting a non-null map adds all the event handlers to the control instance,
+ * setting a null map has an effect of removing any previously added event handlers.
+ *
+ * @param map the skin input map
+ */
+ protected final void setSkinInputMap(SkinInputMap map) {
+ if (control != null) {
+ control.getInputMap().setSkinInputMap(map);
+ }
+ }
/* *************************************************************************
* *
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/TabPane.java b/modules/javafx.controls/src/main/java/javafx/scene/control/TabPane.java
index 74045e7f11f..667f082ba51 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/TabPane.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/TabPane.java
@@ -49,6 +49,7 @@
import javafx.css.PseudoClass;
import javafx.css.converter.SizeConverter;
+import javafx.scene.control.input.FunctionTag;
import javafx.scene.control.skin.TabPaneSkin;
import javafx.beans.DefaultProperty;
@@ -90,6 +91,24 @@
*/
@DefaultProperty("tabs")
public class TabPane extends Control {
+ /** Identifiers for methods available for customization via the InputMap. */
+ public static final class Tag {
+ /** Selects the first tab. */
+ public static final FunctionTag SELECT_FIRST_TAB = new FunctionTag();
+ /** Selects the last tab. */
+ public static final FunctionTag SELECT_LAST_TAB = new FunctionTag();
+ /** Selects the left tab: previous in LTR mode, next in RTL mode. */
+ public static final FunctionTag SELECT_LEFT_TAB = new FunctionTag();
+ /** Selects the next tab. */
+ public static final FunctionTag SELECT_NEXT_TAB = new FunctionTag();
+ /** Selects the previous tab. */
+ public static final FunctionTag SELECT_PREV_TAB = new FunctionTag();
+ /** Selects the right tab: next in LTR mode, previous in RTL mode. */
+ public static final FunctionTag SELECT_RIGHT_TAB = new FunctionTag();
+
+ private Tag() { }
+ }
+
private static final double DEFAULT_TAB_MIN_WIDTH = 0;
private static final double DEFAULT_TAB_MAX_WIDTH = Double.MAX_VALUE;
@@ -168,6 +187,36 @@ public final ObservableList getTabs() {
return tabs;
}
+ /** Selects the first tab. */
+ public void selectFirstTab() {
+ execute(Tag.SELECT_FIRST_TAB);
+ }
+
+ /** Selects the last tab. */
+ public void selectLastTab() {
+ execute(Tag.SELECT_LAST_TAB);
+ }
+
+ /** Selects the left tab: previous in LTR mode, next in RTL mode. */
+ public void selectLeftTab() {
+ execute(Tag.SELECT_LEFT_TAB);
+ }
+
+ /** Selects the next tab. */
+ public void selectNextTab() {
+ execute(Tag.SELECT_NEXT_TAB);
+ }
+
+ /** Selects the previous tab. */
+ public void selectPreviousTab() {
+ execute(Tag.SELECT_PREV_TAB);
+ }
+
+ /** Selects the right tab: next in LTR mode, previous in RTL mode. */
+ public void selectRightTab() {
+ execute(Tag.SELECT_RIGHT_TAB);
+ }
+
/**
* The selection model used for selecting tabs. Changing the model alters
* how the tabs are selected and which tabs are first or last.
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/TextArea.java b/modules/javafx.controls/src/main/java/javafx/scene/control/TextArea.java
index 4034f9ddc63..a9baf1671cc 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/TextArea.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/TextArea.java
@@ -47,6 +47,7 @@
import com.sun.javafx.collections.ListListenerHelper;
import com.sun.javafx.collections.NonIterableChange;
import javafx.css.converter.SizeConverter;
+import javafx.scene.control.input.FunctionTag;
import javafx.scene.control.skin.TextAreaSkin;
import javafx.css.Styleable;
@@ -81,6 +82,51 @@
* @since JavaFX 2.0
*/
public class TextArea extends TextInputControl {
+ /** Denotes the function that moves the caret to the document end. */
+ public static final FunctionTag DOCUMENT_END = new FunctionTag();
+ /** Denotes the function that moves the caret to the document start. */
+ public static final FunctionTag DOCUMENT_START = new FunctionTag();
+ /** Denotes the function that moves the caret one line down. */
+ public static final FunctionTag DOWN = new FunctionTag();
+ /** Denotes the function that inserts a TAB character at the caret position. */
+ public static final FunctionTag INSERT_TAB = new FunctionTag();
+ /** Denotes the function that insert a new line at the caret position. */
+ public static final FunctionTag INSERT_NEW_LINE = new FunctionTag();
+ /** Denotes the function that moves the caret to the end of the visible line. */
+ public static final FunctionTag LINE_END = new FunctionTag();
+ /** Denotes the function that moves the caret to the start of the visible line. */
+ public static final FunctionTag LINE_START = new FunctionTag();
+ /** Denotes the function that moves the caret one paragraph down. */
+ public static final FunctionTag PARAGRAPH_DOWN = new FunctionTag();
+ /** Denotes the function that moves the caret one paragraph up. */
+ public static final FunctionTag PARAGRAPH_UP = new FunctionTag();
+ /** Denotes the function that moves the caret one page down. */
+ public static final FunctionTag PAGE_DOWN = new FunctionTag();
+ /** Denotes the function that moves the caret one page up. */
+ public static final FunctionTag PAGE_UP = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one line down. */
+ public static final FunctionTag SELECT_DOWN = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection to the end of the current paragraph. */
+ //public static final FunctionTag SELECT_END_EXTEND = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection to the start of the current paragraph. */
+ //public static final FunctionTag SELECT_HOME_EXTEND = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection to the end of the visible line. */
+ public static final FunctionTag SELECT_LINE_END = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection to the start of the visible line. */
+ public static final FunctionTag SELECT_LINE_START = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one page down. */
+ public static final FunctionTag SELECT_PAGE_DOWN = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one page up. */
+ public static final FunctionTag SELECT_PAGE_UP = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one paragraph down. */
+ public static final FunctionTag SELECT_PARAGRAPH_DOWN = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one paragraph up. */
+ public static final FunctionTag SELECT_PARAGRAPH_UP = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one line up. */
+ public static final FunctionTag SELECT_UP = new FunctionTag();
+ /** Denotes the function that moves the caret one line up. */
+ public static final FunctionTag UP = new FunctionTag();
+
// Text area content model
private static final class TextAreaContent extends ContentBase {
private final List paragraphs = new ArrayList<>();
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java b/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java
index 7ec7f3edc11..e1994df905e 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java
@@ -25,7 +25,10 @@
package javafx.scene.control;
-import com.sun.javafx.scene.control.FormatterAccessor;
+import java.text.BreakIterator;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import javafx.beans.DefaultProperty;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
@@ -57,19 +60,15 @@
import javafx.css.StyleableProperty;
import javafx.scene.AccessibleAction;
import javafx.scene.AccessibleAttribute;
+import javafx.scene.control.input.FunctionTag;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.text.Font;
-
-import java.text.BreakIterator;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import com.sun.javafx.util.Utils;
+import javafx.util.StringConverter;
import com.sun.javafx.binding.ExpressionHelper;
import com.sun.javafx.scene.NodeHelper;
-import javafx.util.StringConverter;
+import com.sun.javafx.scene.control.FormatterAccessor;
+import com.sun.javafx.util.Utils;
/**
* Abstract base class for text input controls.
@@ -77,6 +76,65 @@
*/
@DefaultProperty("text")
public abstract class TextInputControl extends Control {
+ /** Denotes the function that copies the content to the clipboard. */
+ public static final FunctionTag COPY = new FunctionTag();
+ /** Denotes the function that cuts the content to the clipboard. */
+ public static final FunctionTag CUT = new FunctionTag();
+ /** Denotes the function that deletes text from the line start. */
+ public static final FunctionTag DELETE_FROM_LINE_START = new FunctionTag();
+ /** Denotes the function that deletes the next character. */
+ public static final FunctionTag DELETE_NEXT_CHAR = new FunctionTag();
+ /** Denotes the function that deletes the next word. */
+ public static final FunctionTag DELETE_NEXT_WORD = new FunctionTag();
+ /** Denotes the function that deletes the previous character. */
+ public static final FunctionTag DELETE_PREVIOUS_CHAR = new FunctionTag();
+ /** Denotes the function that deletes the previous word. */
+ public static final FunctionTag DELETE_PREVIOUS_WORD = new FunctionTag();
+ /** Denotes the function that deselects. */
+ public static final FunctionTag DESELECT = new FunctionTag();
+ /** Denotes the function that moves the caret to the document start. */
+ public static final FunctionTag DOCUMENT_START = new FunctionTag();
+ /** Denotes the function that moves the caret to the document end. */
+ public static final FunctionTag DOCUMENT_END = new FunctionTag();
+ /** Denotes the function that moves the caret one symbol left. */
+ public static final FunctionTag LEFT = new FunctionTag();
+ /** Denotes the function that moves the caret one word left. */
+ public static final FunctionTag LEFT_WORD = new FunctionTag();
+ /** Denotes the function that pastes from the clipboard. */
+ public static final FunctionTag PASTE = new FunctionTag();
+ /** Denotes the function that redoes the last undo. */
+ public static final FunctionTag REDO = new FunctionTag();
+ /** Denotes the function that moves the caret one symbol right. */
+ public static final FunctionTag RIGHT = new FunctionTag();
+ /** Denotes the function that moves the caret one word right. */
+ public static final FunctionTag RIGHT_WORD = new FunctionTag();
+ /** Denotes the function that selects all. */
+ public static final FunctionTag SELECT_ALL = new FunctionTag();
+ /** Denotes the function that selects to after the last char of text. */
+ public static final FunctionTag SELECT_END = new FunctionTag();
+ /** Denotes the function that ?? TODO how is this different from SELECT_END?. */
+ public static final FunctionTag SELECT_END_EXTEND = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection to before the first char of text. */
+ public static final FunctionTag SELECT_HOME = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection to before the first char of text. */
+ // TODO how is this different from SELECT_HOME?
+ public static final FunctionTag SELECT_HOME_EXTEND = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one character to the left. */
+ public static final FunctionTag SELECT_LEFT = new FunctionTag();
+ /** Denotes the function that moves the caret to the beginning or end of the word to the left. */
+ // TODO explain platform-specific behavior
+ public static final FunctionTag SELECT_LEFT_WORD = new FunctionTag();
+ /** Denotes the function that moves the caret and extends selection one character to the right. */
+ public static final FunctionTag SELECT_RIGHT = new FunctionTag();
+ /** Denotes the function that moves the caret to the beginning or end of the word to the right. */
+ public static final FunctionTag SELECT_RIGHT_WORD = new FunctionTag();
+ /** Denotes the function that moves the focus to the next focusTraversable Node. */
+ public static final FunctionTag TRAVERSE_NEXT = new FunctionTag();
+ /** Denotes the function that moves the focus to the previous focusTraversable Node. */
+ public static final FunctionTag TRAVERSE_PREVIOUS = new FunctionTag();
+ /** Denotes the function that undoes the last change. */
+ public static final FunctionTag UNDO = new FunctionTag();
+
/**
* Interface representing a text input's content. Since it is an ObservableStringValue,
* you can also bind to, or observe the content.
diff --git a/modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/BehaviorBase.java b/modules/javafx.controls/src/main/java/javafx/scene/control/input/BehaviorBase.java
similarity index 97%
rename from modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/BehaviorBase.java
rename to modules/javafx.controls/src/main/java/javafx/scene/control/input/BehaviorBase.java
index d2a89947947..70477742380 100644
--- a/modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/BehaviorBase.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/input/BehaviorBase.java
@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package com.sun.jfx.incubator.scene.control.input;
+package javafx.scene.control.input;
import java.util.function.BooleanSupplier;
import javafx.event.Event;
@@ -32,9 +32,6 @@
import javafx.scene.control.Control;
import javafx.scene.input.KeyCode;
import com.sun.javafx.PlatformUtil;
-import com.sun.jfx.incubator.scene.control.input.SkinInputMap.Stateful;
-import jfx.incubator.scene.control.input.FunctionTag;
-import jfx.incubator.scene.control.input.KeyBinding;
/**
* This class provides convenient foundation for custom Control developers intended to simplify writing
@@ -62,6 +59,7 @@
* }
*
* @param the type of the control
+ * @since 999 TODO
*/
public abstract class BehaviorBase {
private final C control;
diff --git a/modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/EventCriteria.java b/modules/javafx.controls/src/main/java/javafx/scene/control/input/EventCriteria.java
similarity index 97%
rename from modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/EventCriteria.java
rename to modules/javafx.controls/src/main/java/javafx/scene/control/input/EventCriteria.java
index c31a5a4eb51..560bf4e8522 100644
--- a/modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/EventCriteria.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/input/EventCriteria.java
@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package com.sun.jfx.incubator.scene.control.input;
+package javafx.scene.control.input;
import javafx.event.Event;
import javafx.event.EventType;
@@ -31,6 +31,7 @@
* This interface enables wider control in specifying conditional matching logic when adding skin/behavior handlers.
*
* @param the type of the event
+ * @since 999 TODO
*/
public interface EventCriteria {
/**
diff --git a/modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/FunctionTag.java b/modules/javafx.controls/src/main/java/javafx/scene/control/input/FunctionTag.java
similarity index 91%
rename from modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/FunctionTag.java
rename to modules/javafx.controls/src/main/java/javafx/scene/control/input/FunctionTag.java
index 7925231a79b..c1c5f39f835 100644
--- a/modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/FunctionTag.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/input/FunctionTag.java
@@ -23,10 +23,7 @@
* questions.
*/
-package jfx.incubator.scene.control.input;
-
-import javafx.scene.control.Control;
-import com.sun.javafx.ModuleUtil;
+package javafx.scene.control.input;
/**
* A function tag is a public identifier of a method that can be mapped to a key binding by the
@@ -45,12 +42,10 @@
* ...
*
*
- * @since 24
+ * @since 999 TODO
*/
public final class FunctionTag {
/** Constructs the function tag. */
public FunctionTag() {
}
-
- static { ModuleUtil.incubatorWarning(); }
}
diff --git a/modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/InputMap.java b/modules/javafx.controls/src/main/java/javafx/scene/control/input/InputMap.java
similarity index 94%
rename from modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/InputMap.java
rename to modules/javafx.controls/src/main/java/javafx/scene/control/input/InputMap.java
index 7926c0d64ca..89cb40c45f8 100644
--- a/modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/InputMap.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/input/InputMap.java
@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package jfx.incubator.scene.control.input;
+package javafx.scene.control.input;
import java.util.HashMap;
import java.util.HashSet;
@@ -36,12 +36,10 @@
import javafx.event.EventType;
import javafx.scene.control.Control;
import javafx.scene.input.KeyEvent;
-import com.sun.javafx.ModuleUtil;
-import com.sun.jfx.incubator.scene.control.input.EventHandlerPriority;
-import com.sun.jfx.incubator.scene.control.input.InputMapHelper;
-import com.sun.jfx.incubator.scene.control.input.KeyEventMapper;
-import com.sun.jfx.incubator.scene.control.input.PHList;
-import com.sun.jfx.incubator.scene.control.input.SkinInputMap;
+import com.sun.javafx.scene.control.input.EventHandlerPriority;
+import com.sun.javafx.scene.control.input.InputMapHelper;
+import com.sun.javafx.scene.control.input.KeyEventMapper;
+import com.sun.javafx.scene.control.input.PHList;
/**
* InputMap is a property of the {@link Control} class which enables customization
@@ -74,7 +72,7 @@
*
* This mechanism allows for customizing the key mappings and the underlying functions independently and separately.
*
- * @since 24
+ * @since 999 TODO
*/
public final class InputMap {
private static final Object NULL = new Object();
@@ -90,7 +88,6 @@ public final class InputMap {
private final EventHandler eventHandler = this::handleEvent;
static {
- ModuleUtil.incubatorWarning();
initAccessor();
}
@@ -392,9 +389,7 @@ public void removeKeyBindingsFor(FunctionTag tag) {
* This method removes all the mappings from the previous skin input map, if any.
* @param m the skin input map
*/
- // TODO change to public once SkinInputMap is public
- // or add getSkinInputMap() to Skin.
- private void setSkinInputMap(SkinInputMap m) {
+ public void setSkinInputMap(SkinInputMap m) {
if (skinInputMap != null) {
// uninstall all handlers with SKIN_* priority
Iterator> it = map.entrySet().iterator();
@@ -444,12 +439,6 @@ public void executeDefault(Object source, InputMap inputMap, FunctionTag tag) {
public void execute(Object source, InputMap inputMap, FunctionTag tag) {
inputMap.execute(source, tag);
}
-
- // TODO will be unnecessary once SkinInputMap is public
- @Override
- public void setSkinInputMap(InputMap inputMap, SkinInputMap sm) {
- inputMap.setSkinInputMap(sm);
- }
});
}
}
diff --git a/modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/KeyBinding.java b/modules/javafx.controls/src/main/java/javafx/scene/control/input/KeyBinding.java
similarity index 97%
rename from modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/KeyBinding.java
rename to modules/javafx.controls/src/main/java/javafx/scene/control/input/KeyBinding.java
index 59c9ea24735..546363813d2 100644
--- a/modules/jfx.incubator.input/src/main/java/jfx/incubator/scene/control/input/KeyBinding.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/input/KeyBinding.java
@@ -23,7 +23,7 @@
* questions.
*/
-package jfx.incubator.scene.control.input;
+package javafx.scene.control.input;
import java.util.EnumSet;
import java.util.Objects;
@@ -41,11 +41,9 @@
*
* This class also provides a set of convenience methods for refering to keys found on macOS platform.
*
- * @since 24
+ * @since 999 TODO
*/
-public class KeyBinding
-//implements EventCriteria
-{
+public class KeyBinding implements EventCriteria {
/**
* Condition used to build input key mappings.
*
@@ -439,21 +437,21 @@ public String toString() {
* Returns the event type for this key binding.
* @return KeyEvent
*/
-// @Override
-// public EventType getEventType() {
-// if (isKeyPressed()) {
-// return KeyEvent.KEY_PRESSED;
-// } else if (isKeyReleased()) {
-// return KeyEvent.KEY_RELEASED;
-// } else {
-// return KeyEvent.KEY_TYPED;
-// }
-// }
-//
-// @Override
-// public boolean isEventAcceptable(KeyEvent ev) {
-// return equals(KeyBinding.from(ev));
-// }
+ @Override
+ public EventType getEventType() {
+ if (isKeyPressed()) {
+ return KeyEvent.KEY_PRESSED;
+ } else if (isKeyReleased()) {
+ return KeyEvent.KEY_RELEASED;
+ } else {
+ return KeyEvent.KEY_TYPED;
+ }
+ }
+
+ @Override
+ public boolean isEventAcceptable(KeyEvent ev) {
+ return equals(KeyBinding.from(ev));
+ }
/**
* A builder for {@code KeyBinding} objects.
diff --git a/modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/SkinInputMap.java b/modules/javafx.controls/src/main/java/javafx/scene/control/input/SkinInputMap.java
similarity index 92%
rename from modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/SkinInputMap.java
rename to modules/javafx.controls/src/main/java/javafx/scene/control/input/SkinInputMap.java
index e63de160d0c..81f240b1188 100644
--- a/modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/SkinInputMap.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/input/SkinInputMap.java
@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package com.sun.jfx.incubator.scene.control.input;
+package javafx.scene.control.input;
import java.util.HashMap;
import java.util.HashSet;
@@ -35,8 +35,9 @@
import javafx.event.EventType;
import javafx.scene.control.Control;
import javafx.scene.input.KeyCode;
-import jfx.incubator.scene.control.input.FunctionTag;
-import jfx.incubator.scene.control.input.KeyBinding;
+import com.sun.javafx.scene.control.input.EventHandlerPriority;
+import com.sun.javafx.scene.control.input.KeyEventMapper;
+import com.sun.javafx.scene.control.input.PHList;
/**
* The Input Map for use by the Skin.
@@ -46,6 +47,8 @@
*
* Skins whose behavior requires no state, or when state is fully encapsulated by the Control itself,
* could use a Stateless variant obtained with the {@link #createStateless()} method.
+ *
+ * @since 999 TODO
*/
public abstract sealed class SkinInputMap permits SkinInputMap.Stateful, SkinInputMap.Stateless {
/**
@@ -54,8 +57,7 @@ public abstract sealed class SkinInputMap permits SkinInputMap.Stateful, SkinInp
* EventType -> PHList
*/
final HashMap