Methods Summary |
---|
public java.text.AttributedCharacterIterator | cancelLatestCommittedText(java.text.AttributedCharacterIterator.Attribute[] attributes)
return getIMRequests().cancelLatestCommittedText(attributes);
|
private void | closeIM(java.awt.im.spi.InputMethod im)
if (im == null) {
return;
}
if (im.isCompositionEnabled()) {
im.endComposition();
}
im.deactivate(true);
im.hideWindows();
|
public void | dispatchInputMethodEvent(int id, java.text.AttributedCharacterIterator text, int committedCharacterCount, java.awt.font.TextHitInfo caret, java.awt.font.TextHitInfo visiblePosition)
if (client == null) {
return;
}
//???AWT
/*
InputMethodEvent ime = new InputMethodEvent(client, id, text,
committedCharacterCount,
caret, visiblePosition);
if ((client.getInputMethodRequests() != null) &&
!IMManager.belowTheSpot()) {
client.dispatchEvent(ime);
} else {
// show/hide composition window if necessary
if (committedCharacterCount < text.getEndIndex()) {
IMManager.showCompositionWindow(getCompositionWindow());
} else {
getCompositionWindow().hide();
}
composeWindow.getActiveClient().dispatchEvent(ime);
}
*/
|
public void | dispose()
if (inputMethod != null) {
closeIM(inputMethod);
inputMethod.dispose();
}
notifyIM.clear();
super.dispose();
|
public void | enableClientWindowNotification(java.awt.im.spi.InputMethod inputMethod, boolean enable)
if (enable) {
notifyIM.add(inputMethod);
//???AWT
/*
if (client != null) {
notifyClientWindowChange(IMManager.getWindow(client).getBounds());
} else {
pendingClientNotify = true;
}
*/
} else {
notifyIM.remove(inputMethod);
}
|
public void | endComposition()
if (inputMethod != null) {
inputMethod.endComposition();
}
super.endComposition();
|
public final java.awt.Component | getClient()
return client;
|
public java.text.AttributedCharacterIterator | getCommittedText(int beginIndex, int endIndex, java.text.AttributedCharacterIterator.Attribute[] attributes)
return getIMRequests().getCommittedText(beginIndex, endIndex,
attributes);
|
public int | getCommittedTextLength()
return getIMRequests().getCommittedTextLength();
|
private java.awt.im.spi.InputMethod | getIMInstance(java.util.Iterator descriptors, java.util.Locale locale)Gets input method instance for the given
locale from the given list of descriptors
while (descriptors.hasNext()) {
InputMethodDescriptor desc = descriptors.next();
Locale[] locs = desc.getAvailableLocales();
for (Locale element : locs) {
if (locale.equals(element)) {
return getIMInstance(desc);
}
}
}
return null;
|
private java.awt.im.spi.InputMethod | getIMInstance(java.awt.im.spi.InputMethodDescriptor imd)
InputMethod im = imInstances.get(imd);
if (im == null) {
im = imd.createInputMethod();
im.setInputMethodContext(this);
imInstances.put(imd, im);
}
return im;
|
private java.awt.im.InputMethodRequests | getIMRequests()Gets input method requests for the current client
irrespective of input style.
InputMethodRequests imRequests = null;
if (client != null) {
imRequests = client.getInputMethodRequests();
//???AWT
/*
if (imRequests == null) {
imRequests = getCompositionWindow().getInputMethodRequests();
}
*/
}
return imRequests;
|
public final java.awt.im.spi.InputMethod | getInputMethod()
return inputMethod;
|
public java.lang.Object | getInputMethodControlObject()
if (inputMethod != null) {
return inputMethod.getControlObject();
}
return super.getInputMethodControlObject();
|
public int | getInsertPositionOffset()
return getIMRequests().getInsertPositionOffset();
|
public java.util.Locale | getLocale()
if (inputMethod != null) {
return inputMethod.getLocale();
}
return super.getLocale();
|
public java.awt.font.TextHitInfo | getLocationOffset(int x, int y)
InputMethodRequests imr = getStyleIMRequests();
if (imr != null) {
return imr.getLocationOffset(x, y);
}
return null;
|
public final org.apache.harmony.awt.wtk.NativeIM | getNativeIM()
return nativeIM;
|
public java.text.AttributedCharacterIterator | getSelectedText(java.text.AttributedCharacterIterator.Attribute[] attributes)
return getIMRequests().getSelectedText(attributes);
|
private java.awt.im.InputMethodRequests | getStyleIMRequests()Gets input method requests for the current client & input style.
//???AWT
/*
if (IMManager.belowTheSpot()) {
return getCompositionWindow().getInputMethodRequests();
}
*/
return getIMRequests();
|
public java.awt.Rectangle | getTextLocation(java.awt.font.TextHitInfo offset)
return getStyleIMRequests().getTextLocation(offset);
|
private void | initIM(java.awt.im.spi.InputMethod im, java.util.Locale locale)
if (im == null) {
return;
}
im.setLocale(locale);
im.setCharacterSubsets(null);
//???AWT: activateIM(im);
try {
im.setCompositionEnabled(inputMethod != null ?
inputMethod.isCompositionEnabled() : true);
} catch (UnsupportedOperationException uoe) {
}
|
public boolean | isCompositionEnabled()
if (inputMethod != null) {
return inputMethod.isCompositionEnabled();
}
return super.isCompositionEnabled();
|
public void | notifyClientWindowChange(java.awt.Rectangle bounds)To be called by AWT when client Window's bounds/visibility/state
change
if (notifyIM.contains(inputMethod)) {
inputMethod.notifyClientWindowChange(bounds);
}
pendingClientNotify = false;
|
public void | reconvert()
if (inputMethod != null) {
inputMethod.reconvert();
}
super.reconvert();
|
void | selectIM(java.awt.im.spi.InputMethodDescriptor imd, java.util.Locale locale)Is called when IM is selected from UI
try {
switchToIM(locale, getIMInstance(imd));
} catch (Exception e) {
e.printStackTrace();
}
|
public boolean | selectInputMethod(java.util.Locale locale)
if ((inputMethod != null) && inputMethod.setLocale(locale)) {
return true;
}
// first
// take last user-selected IM for locale
InputMethod newIM = localeIM.get(locale);
// if not found search through IM descriptors
// and take already created instance if exists
// or create, store new IM instance in descriptor->instance map
//???AWT
/*
if (newIM == null) {
try {
newIM = getIMInstance(IMManager.getIMDescriptors().iterator(),
locale);
} catch (Exception e) {
// ignore exceptions - just return false
}
}
*/
return switchToIM(locale, newIM);
|
public void | setCharacterSubsets(java.lang.Character.Subset[] subsets)
if (inputMethod != null) {
inputMethod.setCharacterSubsets(subsets);
}
super.setCharacterSubsets(subsets);
|
public void | setCompositionEnabled(boolean enable)
if (inputMethod != null) {
inputMethod.setCompositionEnabled(enable);
}
super.setCompositionEnabled(enable);
|
private boolean | switchToIM(java.util.Locale locale, java.awt.im.spi.InputMethod newIM)
//???AWT
/*
if (newIM != null) {
closeIM(inputMethod);
client = KeyboardFocusManager.
getCurrentKeyboardFocusManager().getFocusOwner();
initIM(newIM, locale);
inputMethod = newIM;
return true;
}
*/
return false;
|