void notifyStopped() {
   if (embedder != null && embedder.isActive()) {
     for (int i = strokes.size() - 1; i >= 0; i--) {
       embedder.unregisterAccelerator(i);
     }
   }
 }
 void unregisterAccelerator(AWTKeyStroke stroke) {
   if (stroke == null) return;
   if (embedder != null && embedder.isActive()) {
     int index = strokes.indexOf(stroke);
     embedder.unregisterAccelerator(index);
   }
 }
 void registerAccelerator(AWTKeyStroke stroke) {
   if (stroke == null) return;
   strokes.add(stroke);
   if (embedder != null && embedder.isActive()) {
     embedder.registerAccelerator(stroke, strokes.size() - 1);
   }
 }
 protected void traverseOutBackward() {
   if (embedder != null && embedder.isActive()) {
     if (embedder.isApplicationActive()) {
       xembedLog.fine("Traversing out Backward");
       embedder.traverseOutBackward();
     }
   }
 }
 public boolean requestWindowFocus(long time, boolean timeProvided) {
   // Should check for active state of host application
   if (embedder != null && embedder.isActive()) {
     xembedLog.fine("Requesting focus from embedding host");
     return embedder.requestFocus();
   } else {
     xembedLog.fine("Requesting focus from X");
     return super.requestWindowFocus(time, timeProvided);
   }
 }
 void notifyStarted() {
   // Register accelerators
   if (embedder != null && embedder.isActive()) {
     int i = 0;
     Iterator<AWTKeyStroke> iter = strokes.iterator();
     while (iter.hasNext()) {
       embedder.registerAccelerator(iter.next(), i++);
     }
   }
   // Now we know that the the embedder is an XEmbed server, so we
   // reregister the drop target to enable XDnD protocol support via
   // XEmbed.
   updateDropTarget();
 }
 protected void requestInitialFocus() {
   if (embedder != null && supportsXEmbed()) {
     embedder.requestFocus();
   } else {
     super.requestInitialFocus();
   }
 }
 @Override
 public void dispose() {
   if (embedder != null) {
     // uninstall X11 event dispatcher
     embedder.setClient(null);
   }
   super.dispose();
 }
 void postInit(XCreateWindowParams params) {
   super.postInit(params);
   if (embedder != null) {
     // install X11 event dispatcher
     embedder.setClient(this);
     // reparent to XEmbed server
     embedder.install();
   } else if (getParentWindowHandle() != 0) {
     XToolkit.awtLock();
     try {
       XlibWrapper.XReparentWindow(
           XToolkit.getDisplay(), getWindow(), getParentWindowHandle(), 0, 0);
     } finally {
       XToolkit.awtUnlock();
     }
   }
 }
 protected boolean isEventDisabled(XEvent e) {
   if (embedder != null && embedder.isActive()) {
     switch (e.get_type()) {
       case XConstants.FocusIn:
       case XConstants.FocusOut:
         return true;
     }
   }
   return super.isEventDisabled(e);
 }
 boolean isXEmbedActive() {
   return embedder != null && embedder.isActive();
 }