APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.javafx.scene

public Class InputMethodStateManager

extends Object
Class Inheritance
Imports
com.sun.javafx.scene.SceneHelper, java.lang.ref.WeakReference, java.util.LinkedList, javafx.beans.value.ChangeListener, .WeakChangeListener, javafx.event.EventHandler, javafx.scene.Node, .Scene, javafx.scene.input.InputMethodEvent, .InputMethodRequests

Used to manage a collection of scenes which must coordinate enabling input method events and retrieving InputMethodRequests. PopupWindows do not have the OS focus and rely on events being posted first to a root (non-popup) scene and then routed through the PopupWindow stack. If any PopupWindow requires input method events they must be enabled on the root scene and input method requests from that scene must be routed to the PopupWindow.

Field Summary

Modifier and TypeField and Description
private Scene
currentEventScene

The scene for which we enabled input method events.

private final ChangeListener<InputMethodRequests>
inputMethodRequestsChangedListener

We listen for changes to the input method requests configuration on every scene in the stack.

private final ChangeListener<EventHandler<? super InputMethodEvent>>
private final WeakReference<Scene>
rootScene

The root non-popup scene which the OS sends input method events to.

private final LinkedList<Scene>
scenes

The scene stack including the root.

private final WeakChangeListener<InputMethodRequests>
private final WeakChangeListener<EventHandler<? super InputMethodEvent>>

Constructor Summary

AccessConstructor and Description
public
InputMethodStateManager(Scene
the root Scene for which input methods should be enabled and disabled
scene
)

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
addScene(Scene scene)

Add a new Scene to the stack.

public void
focusOwnerChanged(Node oldFocusOwner, Node newFocusOwner)

Every Scene must call this when the focusOwner changes.

public void
focusOwnerWillChangeForScene(Scene scene)

Every Scene must call this before the focusOwner changes.

public InputMethodRequests
public Scene
public void
removeScene(Scene scene)

Remove a Scene from the stack.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentEventSceneback to summary
private Scene currentEventScene

The scene for which we enabled input method events.

inputMethodRequestsChangedListenerback to summary
private final ChangeListener<InputMethodRequests> inputMethodRequestsChangedListener

We listen for changes to the input method requests configuration on every scene in the stack.

onInputMethodTextChangedListenerback to summary
private final ChangeListener<EventHandler<? super InputMethodEvent>> onInputMethodTextChangedListener
rootSceneback to summary
private final WeakReference<Scene> rootScene

The root non-popup scene which the OS sends input method events to.

scenesback to summary
private final LinkedList<Scene> scenes

The scene stack including the root.

weakInputMethodRequestsChangedListenerback to summary
private final WeakChangeListener<InputMethodRequests> weakInputMethodRequestsChangedListener
weakOnInputMethodTextChangedListenerback to summary
private final WeakChangeListener<EventHandler<? super InputMethodEvent>> weakOnInputMethodTextChangedListener

Constructor Detail

InputMethodStateManagerback to summary
public InputMethodStateManager(Scene scene)

Constructs a new instance. Only root (non-popup) scenes should do this.

Parameters
scene:Scene

the root Scene for which input methods should be enabled and disabled

Method Detail

addSceneback to summary
public void addScene(Scene scene)

Add a new Scene to the stack.

focusOwnerChangedback to summary
public void focusOwnerChanged(Node oldFocusOwner, Node newFocusOwner)

Every Scene must call this when the focusOwner changes.

focusOwnerWillChangeForSceneback to summary
public void focusOwnerWillChangeForScene(Scene scene)

Every Scene must call this before the focusOwner changes.

getInputMethodRequestsback to summary
public InputMethodRequests getInputMethodRequests()
getRootSceneback to summary
public Scene getRootScene()
removeSceneback to summary
public void removeScene(Scene scene)

Remove a Scene from the stack.

updateInputMethodEventEnableStateback to summary
private void updateInputMethodEventEnableState()