Package sun.awt

Examples of sun.awt.EventListenerAggregate


      // Call two argument add method.
      addPropertyChangeListener(proxy.getPropertyName(),
                    (PropertyChangeListener)proxy.getListener());
  } else {
      if (listeners == null) {
    listeners = new EventListenerAggregate(PropertyChangeListener.class);
      }
      listeners.add(listener);
  }
    }
View Full Code Here


        if (listener == null) {
            return;
        }
        if (flavorListeners == null) {
            currentDataFlavors = getAvailableDataFlavorSet();
            flavorListeners = new EventListenerAggregate(FlavorListener.class);
        }
        flavorListeners.add(listener);
    }
View Full Code Here

            PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listener;
            // Call two argument add method.
            addPropertyChangeListener(proxy.getPropertyName(), (PropertyChangeListener) proxy.getListener());
        } else {
            if (listeners == null)
                listeners = new EventListenerAggregate(PropertyChangeListener.class);

            listeners.add(listener);
        }
    }
View Full Code Here

        if (listener == null) {
            return;
        }
        if (flavorListeners == null) {
            currentDataFlavors = getAvailableDataFlavorSet();
            flavorListeners = new EventListenerAggregate(FlavorListener.class);
        }
        flavorListeners.add(listener);
    }
View Full Code Here

    public synchronized void addFlavorListener(FlavorListener listener) {
        if (listener == null) {
            return;
        }
        AppContext appContext = AppContext.getAppContext();
        EventListenerAggregate contextFlavorListeners = (EventListenerAggregate)
                appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY);
        if (contextFlavorListeners == null) {
            contextFlavorListeners = new EventListenerAggregate(FlavorListener.class);
            appContext.put(CLIPBOARD_FLAVOR_LISTENER_KEY, contextFlavorListeners);
        }
        contextFlavorListeners.add(listener);

        if (numberOfFlavorListeners++ == 0) {
            long[] currentFormats = null;
            try {
                openClipboard(null);
View Full Code Here

    public synchronized void removeFlavorListener(FlavorListener listener) {
        if (listener == null) {
            return;
        }
        AppContext appContext = AppContext.getAppContext();
        EventListenerAggregate contextFlavorListeners = (EventListenerAggregate)
                appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY);
        if (contextFlavorListeners == null){
            //else we throw NullPointerException, but it is forbidden
            return;
        }
        if (contextFlavorListeners.remove(listener) &&
                --numberOfFlavorListeners == 0) {
            unregisterClipboardViewerChecked();
            currentDataFlavors = null;
        }
    }
View Full Code Here

            currentDataFlavors = null;
        }
    }

    public synchronized FlavorListener[] getFlavorListeners() {
        EventListenerAggregate contextFlavorListeners = (EventListenerAggregate)
                AppContext.getAppContext().get(CLIPBOARD_FLAVOR_LISTENER_KEY);
        return contextFlavorListeners == null ? new FlavorListener[0] :
                (FlavorListener[])contextFlavorListeners.getListenersCopy();
    }
View Full Code Here

        for (Iterator it = AppContext.getAppContexts().iterator(); it.hasNext();) {
            AppContext appContext = (AppContext)it.next();
            if (appContext == null || appContext.isDisposed()) {
                continue;
            }
            EventListenerAggregate flavorListeners = (EventListenerAggregate)
                    appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY);
            if (flavorListeners != null) {
                FlavorListener[] flavorListenerArray =
                        (FlavorListener[])flavorListeners.getListenersInternal();
                for (int i = 0; i < flavorListenerArray.length; i++) {
                    SunToolkit.postEvent(appContext, new PeerEvent(this,
                            new SunFlavorChangeNotifier(flavorListenerArray[i]),
                            PeerEvent.PRIORITY_EVENT));
                }
View Full Code Here

TOP

Related Classes of sun.awt.EventListenerAggregate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.