本文整理匯總了Java中java.awt.event.InputMethodEvent.getID方法的典型用法代碼示例。如果您正苦於以下問題:Java InputMethodEvent.getID方法的具體用法?Java InputMethodEvent.getID怎麽用?Java InputMethodEvent.getID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.event.InputMethodEvent
的用法示例。
在下文中一共展示了InputMethodEvent.getID方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processInputMethodEvent
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
@Override
protected void processInputMethodEvent(InputMethodEvent e) {
super.processInputMethodEvent(e);
if (!e.isConsumed()) {
switch (e.getID()) {
case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
myEditor.replaceInputMethodText(e);
// No breaks over here.
//noinspection fallthrough
case InputMethodEvent.CARET_POSITION_CHANGED:
myEditor.inputMethodCaretPositionChanged(e);
break;
}
e.consume();
}
}
示例2: processInputMethodEventImpl
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
private void processInputMethodEventImpl(InputMethodEvent e,
Collection<InputMethodListener> c) {
for (InputMethodListener listener : c) {
switch (e.getID()) {
case InputMethodEvent.CARET_POSITION_CHANGED:
listener.caretPositionChanged(e);
break;
case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
listener.inputMethodTextChanged(e);
break;
}
}
}
示例3: processInputMethodEvent
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
void processInputMethodEvent(InputMethodEvent event) {
if (event.getID() == InputMethodEvent.INPUT_METHOD_TEXT_CHANGED) {
inputMethodTextChanged(event);
} else {
caretPositionChanged(event);
}
}
示例4: processIMEvent
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
public static void processIMEvent(final InputMethodListener listener,
final InputMethodEvent e) {
if (e.getID() == InputMethodEvent.CARET_POSITION_CHANGED) {
listener.caretPositionChanged(e);
}
if (e.getID() == InputMethodEvent.INPUT_METHOD_TEXT_CHANGED) {
listener.inputMethodTextChanged(e);
}
}
示例5: processInputMethodEvent
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
@Override
protected void processInputMethodEvent(InputMethodEvent e) {
if (e.getID() == InputMethodEvent.INPUT_METHOD_TEXT_CHANGED) {
sendInputMethodEventToFX(e);
}
}
示例6: processInputMethodEvent
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
/**
* Processes input method events occurring on this component by
* dispatching them to any registered
* <code>InputMethodListener</code> objects.
* <p>
* This method is not called unless input method events
* are enabled for this component. Input method events are enabled
* when one of the following occurs:
* <p><ul>
* <li>An <code>InputMethodListener</code> object is registered
* via <code>addInputMethodListener</code>.
* <li>Input method events are enabled via <code>enableEvents</code>.
* </ul>
* <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the input method event
* @see java.awt.event.InputMethodEvent
* @see java.awt.event.InputMethodListener
* @see #addInputMethodListener
* @see #enableEvents
* @since 1.2
*/
protected void processInputMethodEvent(InputMethodEvent e) {
InputMethodListener listener = inputMethodListener;
if (listener != null) {
int id = e.getID();
switch (id) {
case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
listener.inputMethodTextChanged(e);
break;
case InputMethodEvent.CARET_POSITION_CHANGED:
listener.caretPositionChanged(e);
break;
}
}
}
示例7: processInputMethodEvent
import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
/**
* Processes input method events occurring on this component by
* dispatching them to any registered
* <code>InputMethodListener</code> objects.
* <p>
* This method is not called unless input method events
* are enabled for this component. Input method events are enabled
* when one of the following occurs:
* <ul>
* <li>An <code>InputMethodListener</code> object is registered
* via <code>addInputMethodListener</code>.
* <li>Input method events are enabled via <code>enableEvents</code>.
* </ul>
* <p>Note that if the event parameter is <code>null</code>
* the behavior is unspecified and may result in an
* exception.
*
* @param e the input method event
* @see java.awt.event.InputMethodEvent
* @see java.awt.event.InputMethodListener
* @see #addInputMethodListener
* @see #enableEvents
* @since 1.2
*/
protected void processInputMethodEvent(InputMethodEvent e) {
InputMethodListener listener = inputMethodListener;
if (listener != null) {
int id = e.getID();
switch (id) {
case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
listener.inputMethodTextChanged(e);
break;
case InputMethodEvent.CARET_POSITION_CHANGED:
listener.caretPositionChanged(e);
break;
}
}
}