Java Code Examples for java.awt.Component#getInputContext()
The following examples show how to use
java.awt.Component#getInputContext() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dragonwell8_jdk File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 2
Source Project: TencentKona-8 File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 3
Source Project: jdk8u60 File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 4
Source Project: openjdk-jdk8u File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 5
Source Project: openjdk-jdk8u-backup File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 6
Source Project: Bytecoder File: InputContext.java License: Apache License 2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 7
Source Project: openjdk-jdk9 File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 8
Source Project: jdk8u-jdk File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 9
Source Project: hottub File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 10
Source Project: openjdk-8-source File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 11
Source Project: openjdk-8 File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 12
Source Project: jdk8u_jdk File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 13
Source Project: jdk8u-jdk File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }
Example 14
Source Project: jdk8u-dev-jdk File: InputContext.java License: GNU General Public License v2.0 | 4 votes |
/** * @see java.awt.im.InputContext#dispatchEvent */ @SuppressWarnings("fallthrough") public void dispatchEvent(AWTEvent event) { if (event instanceof InputMethodEvent) { return; } // Ignore focus events that relate to the InputMethodWindow of this context. // This is a workaround. Should be removed after 4452384 is fixed. if (event instanceof FocusEvent) { Component opposite = ((FocusEvent)event).getOppositeComponent(); if ((opposite != null) && (getComponentWindow(opposite) instanceof InputMethodWindow) && (opposite.getInputContext() == this)) { return; } } InputMethod inputMethod = getInputMethod(); int id = event.getID(); switch (id) { case FocusEvent.FOCUS_GAINED: focusGained((Component) event.getSource()); break; case FocusEvent.FOCUS_LOST: focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); break; case KeyEvent.KEY_PRESSED: if (checkInputMethodSelectionKey((KeyEvent)event)) { // pop up the input method selection menu InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); break; } // fall through default: if ((inputMethod != null) && (event instanceof InputEvent)) { inputMethod.dispatchEvent(event); } } }