Module com.gluonhq.attach.keyboard
Package com.gluonhq.attach.keyboard.impl
Class BaseKeyboardService
java.lang.Object
com.gluonhq.attach.keyboard.impl.BaseKeyboardService
- All Implemented Interfaces:
KeyboardService
- Direct Known Subclasses:
AndroidKeyboardService,IOSKeyboardService
Base class that provides common functionality for iOS and Android implementations.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyFloatPropertyGets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanprotected static final javafx.beans.property.ReadOnlyFloatWrapper -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidadjustPosition(javafx.scene.Node node, javafx.scene.Parent parent, double kh) protected abstract voidPass to the native layer the id of the currently active node.protected abstract voidapplyKeyboardType(int nativeValue) Apply the keyboard type on the native side.voidkeepVisibilityForNode(javafx.scene.Node node) Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it.voidkeepVisibilityForNode(javafx.scene.Node node, javafx.scene.Parent parent) Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by itvoidreleaseVisibilityForNode(javafx.scene.Node node) Stops adjusting the node when the software keyboard shows up, removing the listener previously registered viaKeyboardService.keepVisibilityForNode(Node)orKeyboardService.keepVisibilityForNode(Node, Parent).voidremoveKeyboardTypeForNode(javafx.scene.Node node) Removes the keyboard type assignment and event filter previously installed viaKeyboardService.setKeyboardTypeForNode(Node, KeyboardType).voidsetKeyboardTypeForNode(javafx.scene.Node node, KeyboardType type) Assigns a keyboard type to a specific node (typically aTextInputControl).protected static StringsyntheticId(javafx.scene.Node node) Uses the node's ownidif set, otherwise falls back to an id based on its identity hash code.javafx.beans.property.ReadOnlyFloatPropertyGets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
-
Property Details
-
visibleHeight
public javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty- Specified by:
visibleHeightPropertyin interfaceKeyboardService- Returns:
- A ReadOnlyFloatProperty with the height of the soft keyboard
- See Also:
-
-
Field Details
-
VISIBLE_HEIGHT
protected static final javafx.beans.property.ReadOnlyFloatWrapper VISIBLE_HEIGHT -
debug
protected static final boolean debug
-
-
Method Details
-
keepVisibilityForNode
public void keepVisibilityForNode(javafx.scene.Node node) Description copied from interface:KeyboardServiceNode is adjusted vertically when software keyboard shows up, so it is visible and not covered by it. For that, the root parent will be moved accordingly.- Specified by:
keepVisibilityForNodein interfaceKeyboardService- Parameters:
node- the Node to adjust, so it is always visible
-
keepVisibilityForNode
public void keepVisibilityForNode(javafx.scene.Node node, javafx.scene.Parent parent) Description copied from interface:KeyboardServiceNode is adjusted vertically when software keyboard shows up, so it is visible and not covered by it- Specified by:
keepVisibilityForNodein interfaceKeyboardService- Parameters:
node- the Node to adjust, so it is always visibleparent- the Parent of the node that will be moved
-
releaseVisibilityForNode
public void releaseVisibilityForNode(javafx.scene.Node node) Description copied from interface:KeyboardServiceStops adjusting the node when the software keyboard shows up, removing the listener previously registered viaKeyboardService.keepVisibilityForNode(Node)orKeyboardService.keepVisibilityForNode(Node, Parent).- Specified by:
releaseVisibilityForNodein interfaceKeyboardService- Parameters:
node- the Node that was previously registered
-
visibleHeightProperty
public javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty()Description copied from interface:KeyboardServiceGets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.- Specified by:
visibleHeightPropertyin interfaceKeyboardService- Returns:
- the
visibleHeightproperty
-
setKeyboardTypeForNode
Description copied from interface:KeyboardServiceAssigns a keyboard type to a specific node (typically aTextInputControl). When the node gains gets activated, the keyboard type is applied automatically. When the keyboard hides, the keyboard type reverts toKeyboardType.ASCII.If nodes are registered, they default to
KeyboardType.ASCII.- Specified by:
setKeyboardTypeForNodein interfaceKeyboardService- Parameters:
node- the node (typically a text input control) to configuretype- theKeyboardTypeto use when this node is active
-
removeKeyboardTypeForNode
public void removeKeyboardTypeForNode(javafx.scene.Node node) Description copied from interface:KeyboardServiceRemoves the keyboard type assignment and event filter previously installed viaKeyboardService.setKeyboardTypeForNode(Node, KeyboardType). After this call the node will simply use the default keyboard type.- Specified by:
removeKeyboardTypeForNodein interfaceKeyboardService- Parameters:
node- the node to unregister
-
syntheticId
Uses the node's ownidif set, otherwise falls back to an id based on its identity hash code. -
adjustPosition
protected static void adjustPosition(javafx.scene.Node node, javafx.scene.Parent parent, double kh) -
applyKeyboardType
protected abstract void applyKeyboardType(int nativeValue) Apply the keyboard type on the native side.- Parameters:
nativeValue- the integer value fromKeyboardType.getValue()
-
applyActiveNodeId
Pass to the native layer the id of the currently active node.- Parameters:
id- the string id of the active node
-