void unregisterAccelerator(AWTKeyStroke stroke) {
   if (stroke == null) return;
   if (embedder != null && embedder.isActive()) {
     int index = strokes.indexOf(stroke);
     embedder.unregisterAccelerator(index);
   }
 }
 void notifyStopped() {
   if (embedder != null && embedder.isActive()) {
     for (int i = strokes.size() - 1; i >= 0; i--) {
       embedder.unregisterAccelerator(i);
     }
   }
 }
 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();
     }
   }
 }
 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);
 }
 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();
 }
 boolean isXEmbedActive() {
   return embedder != null && embedder.isActive();
 }