當前位置: 首頁>>代碼示例>>Java>>正文


Java InputMethodEvent.getID方法代碼示例

本文整理匯總了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();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:EditorComponentImpl.java

示例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;
        }
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:14,代碼來源:Component.java

示例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);
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:8,代碼來源:CompositionAreaHandler.java

示例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);
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:10,代碼來源:TextUtils.java

示例5: processInputMethodEvent

import java.awt.event.InputMethodEvent; //導入方法依賴的package包/類
@Override
protected void processInputMethodEvent(InputMethodEvent e) {
    if (e.getID() == InputMethodEvent.INPUT_METHOD_TEXT_CHANGED) {
        sendInputMethodEventToFX(e);
    }

}
 
開發者ID:JabRef,項目名稱:jabref,代碼行數:8,代碼來源:CustomJFXPanel.java

示例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;
        }
    }
}
 
開發者ID:jgaltidor,項目名稱:VarJ,代碼行數:39,代碼來源:Component.java

示例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;
        }
    }
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:39,代碼來源:Component.java


注:本文中的java.awt.event.InputMethodEvent.getID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。