use of java.awt.peer.ComponentPeer in project jdk8u_jdk by JetBrains.
the class X11InputMethod method activate.
/**
* Activate input method.
*/
public synchronized void activate() {
clientComponentWindow = getClientComponentWindow();
if (clientComponentWindow == null)
return;
if (lastXICFocussedComponent != null) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("XICFocused {0}, AWTFocused {1}", lastXICFocussedComponent, awtFocussedComponent);
}
}
if (pData == 0) {
if (!createXIC()) {
return;
}
disposed = false;
}
/* reset input context if necessary and set the XIC focus
*/
resetXICifneeded();
ComponentPeer lastXICFocussedComponentPeer = null;
ComponentPeer awtFocussedComponentPeer = getPeer(awtFocussedComponent);
if (lastXICFocussedComponent != null) {
lastXICFocussedComponentPeer = getPeer(lastXICFocussedComponent);
}
/* If the last XIC focussed component has a different peer as the
current focussed component, change the XIC focus to the newly
focussed component.
*/
if (isLastTemporary || lastXICFocussedComponentPeer != awtFocussedComponentPeer || isLastXICActive != haveActiveClient()) {
if (lastXICFocussedComponentPeer != null) {
setXICFocus(lastXICFocussedComponentPeer, false, isLastXICActive);
}
if (awtFocussedComponentPeer != null) {
setXICFocus(awtFocussedComponentPeer, true, haveActiveClient());
}
lastXICFocussedComponent = awtFocussedComponent;
isLastXICActive = haveActiveClient();
}
resetCompositionState();
isActive = true;
}
Aggregations