/** * Switch the keyboard language to the specified language type. We do * not distinguish between multiple bidi or multiple non-bidi languages, so * set the keyboard to the first language of the given type. * <p> * * @param language integer representing language. One of * KEYBOARD_BIDI, KEYBOARD_NON_BIDI. */ public static void setKeyboardLanguage(int language) { if (language == getKeyboardLanguage()) return; boolean bidi = language == KEYBOARD_BIDI; int /*long*/[] list = getKeyboardLanguageList(); for (int i=0; i<list.length; i++) { if (bidi == isBidiLang(list[i])) { OS.ActivateKeyboardLayout(list[i], 0); return; } } } /**
public void run() { int direction = BidiUtil.getKeyboardLanguage() == BidiUtil.KEYBOARD_BIDI ? SWT.RIGHT : SWT.LEFT; if (direction == caretDirection) return; if (getCaret() != defaultCaret) return; Point newCaretPos = getPointAtOffset(caretOffset); setCaretLocation(newCaretPos, direction); } };
@Override public void run() { int direction = BidiUtil.getKeyboardLanguage() == BidiUtil.KEYBOARD_BIDI ? SWT.RIGHT : SWT.LEFT; if (direction == caretDirection) return; if (getCaret() != defaultCaret) return; Point newCaretPos = getPointAtOffset(caretOffset); setCaretLocation(newCaretPos, direction); } };
@Override public void run() { int direction = BidiUtil.getKeyboardLanguage() == BidiUtil.KEYBOARD_BIDI ? SWT.RIGHT : SWT.LEFT; if (direction == caretDirection) return; if (getCaret() != defaultCaret) return; Point newCaretPos = getPointAtOffset(caretOffset); setCaretLocation(newCaretPos, direction); } };
@Override public void run() { int direction = BidiUtil.getKeyboardLanguage() == BidiUtil.KEYBOARD_BIDI ? SWT.RIGHT : SWT.LEFT; if (direction == caretDirection) return; if (getCaret() != defaultCaret) return; Point newCaretPos = getPointAtOffset(caretOffset); setCaretLocation(newCaretPos, direction); } };
@Override public void run() { int direction = BidiUtil.getKeyboardLanguage() == BidiUtil.KEYBOARD_BIDI ? SWT.RIGHT : SWT.LEFT; if (direction == caretDirection) return; if (getCaret() != defaultCaret) return; Point newCaretPos = getPointAtOffset(caretOffset); setCaretLocation(newCaretPos, direction); } };