Пример #1
0
 public void run() {
   for (XClipboard clpbrd : targetsAtom2Clipboard.values()) {
     clpbrd.getTargetsDelayed();
   }
   synchronized (XClipboard.classLock) {
     if (targetsAtom2Clipboard != null && !targetsAtom2Clipboard.isEmpty()) {
       XToolkit.schedule(this, XClipboard.getPollInterval());
     }
   }
 }
Пример #2
0
  protected void registerClipboardViewerChecked() {
    // for XConvertSelection() to be called for the first time in getTargetsDelayed()
    isSelectionNotifyProcessed = true;

    boolean mustSchedule = false;
    synchronized (XClipboard.classLock) {
      if (targetsAtom2Clipboard == null) {
        targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2);
      }
      mustSchedule = targetsAtom2Clipboard.isEmpty();
      targetsAtom2Clipboard.put(getTargetsPropertyAtom().getAtom(), this);
      if (mustSchedule) {
        XToolkit.addEventDispatcher(
            XWindow.getXAWTRootWindow().getWindow(), new SelectionNotifyHandler());
      }
    }
    if (mustSchedule) {
      XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval());
    }
  }