Package fr.soleil.comete.widget

Examples of fr.soleil.comete.widget.ITangoWidgetListener


        if (listener != null) {
            ArrayList<WeakReference<ITangoWidgetListener>> toRemove = new ArrayList<WeakReference<ITangoWidgetListener>>();
            boolean canAdd = true;
            synchronized (listeners) {
                for (WeakReference<ITangoWidgetListener> ref : listeners) {
                    ITangoWidgetListener temp = ref.get();
                    if (temp == null) {
                        toRemove.add(ref);
                    }
                    else if (temp.equals(listener)) {
                        canAdd = false;
                    }
                    temp = null;
                }
                listeners.removeAll(toRemove);
View Full Code Here


    public void removeTangoWidgetListener(ITangoWidgetListener listener) {
        if (listener != null) {
            ArrayList<WeakReference<ITangoWidgetListener>> toRemove = new ArrayList<WeakReference<ITangoWidgetListener>>();
            synchronized (listeners) {
                for (WeakReference<ITangoWidgetListener> ref : listeners) {
                    ITangoWidgetListener temp = ref.get();
                    if ((temp == null) || temp.equals(listener)) {
                        toRemove.add(ref);
                    }
                    temp = null;
                }
                listeners.removeAll(toRemove);
View Full Code Here

        if (listener != null) {
            ArrayList<WeakReference<ITangoWidgetListener>> toRemove = new ArrayList<WeakReference<ITangoWidgetListener>>();
            boolean canAdd = true;
            synchronized (listeners) {
                for (WeakReference<ITangoWidgetListener> ref : listeners) {
                    ITangoWidgetListener temp = ref.get();
                    if (temp == null) {
                        toRemove.add(ref);
                    }
                    else if (temp.equals(listener)) {
                        canAdd = false;
                    }
                    temp = null;
                }
                listeners.removeAll(toRemove);
View Full Code Here

    public void removeTangoWidgetListener(ITangoWidgetListener listener) {
        if (listener != null) {
            ArrayList<WeakReference<ITangoWidgetListener>> toRemove = new ArrayList<WeakReference<ITangoWidgetListener>>();
            synchronized (listeners) {
                for (WeakReference<ITangoWidgetListener> ref : listeners) {
                    ITangoWidgetListener temp = ref.get();
                    if ((temp == null) || temp.equals(listener)) {
                        toRemove.add(ref);
                    }
                    temp = null;
                }
                listeners.removeAll(toRemove);
View Full Code Here

    public static <T> void fireDataChange(T data,
            List<WeakReference<ITangoWidgetListener>> listeners) {

        if (data != null && listeners != null && !listeners.isEmpty()) {
            Iterator<WeakReference<ITangoWidgetListener>> iterator = listeners.iterator();
            ITangoWidgetListener widgetListener = null;
            while (iterator.hasNext()) {
                widgetListener = iterator.next().get();
                if (widgetListener != null) {
                    if (Number.class.isAssignableFrom(data.getClass())) {
                        widgetListener.fireNumberDataChange((Number) data);
                    }
                    else if (String.class.isAssignableFrom(data.getClass())) {
                        widgetListener.fireStringDataChange((String) data);
                    }
                    else if (Boolean.class.isAssignableFrom(data.getClass())) {
                        widgetListener.fireBooleanDataChange((Boolean) data);
                    }
                }
            }
        }
    }
View Full Code Here

    public static <T> void fireValueChange(T data,
            List<WeakReference<ITangoWidgetListener>> listeners) {

        if (data != null && listeners != null && !listeners.isEmpty()) {
            Iterator<WeakReference<ITangoWidgetListener>> iterator = listeners.iterator();
            ITangoWidgetListener widgetListener = null;
            while (iterator.hasNext()) {
                widgetListener = iterator.next().get();
                if (widgetListener != null) {
                    if (Boolean.class.isAssignableFrom(data.getClass())) {
                        widgetListener.fireBooleanValueChange((Boolean) data);
                    }
                    else if (Number.class.isAssignableFrom(data.getClass())) {
                        widgetListener.fireNumberValueChange((Number) data);
                    }
                    else if (String.class.isAssignableFrom(data.getClass())) {
                        widgetListener.fireStringValueChange((String) data);
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of fr.soleil.comete.widget.ITangoWidgetListener

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.