Package javax.swing.event

Examples of javax.swing.event.PopupMenuEvent


    public Object getSource() {
      return source;
    }

    private PopupMenuEvent newEvent() {
      return new PopupMenuEvent(getSource());
    }
View Full Code Here


    public Object getSource() {
      return source;
    }

    private PopupMenuEvent newEvent() {
      return new PopupMenuEvent(source);
    }
View Full Code Here

     *
     * @see #addPopupMenuListener
     */
    public void firePopupMenuWillBecomeVisible() {
        Object[] listeners = listenerList.getListenerList();
        PopupMenuEvent e = null;
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == PopupMenuListener.class) {
                if (e == null)
                    e = new PopupMenuEvent(this);
                ((PopupMenuListener) listeners[i + 1]).popupMenuWillBecomeVisible(e);
            }
        }
    }
View Full Code Here

     *
     * @see #addPopupMenuListener
     */
    public void firePopupMenuWillBecomeInvisible() {
        Object[] listeners = listenerList.getListenerList();
        PopupMenuEvent e = null;
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == PopupMenuListener.class) {
                if (e == null)
                    e = new PopupMenuEvent(this);
                ((PopupMenuListener) listeners[i + 1]).popupMenuWillBecomeInvisible(e);
            }
        }
    }
View Full Code Here

     *
     * @see #addPopupMenuListener
     */
    public void firePopupMenuCanceled() {
        Object[] listeners = listenerList.getListenerList();
        PopupMenuEvent e = null;
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == PopupMenuListener.class) {
                if (e == null)
                    e = new PopupMenuEvent(this);
                ((PopupMenuListener) listeners[i + 1]).popupMenuCanceled(e);
            }
        }
    }
View Full Code Here

        PopupMenuListener l= new PopupMenuListener() {
           
            @Override
            public void popupMenuCanceled(PopupMenuEvent e) {
                PopupMenuListener[] ls = datePicker.getPopupMenuListeners();
                PopupMenuEvent retargeted = null;
                for (PopupMenuListener listener : ls) {
                    if (retargeted == null) {
                        retargeted = new PopupMenuEvent(datePicker);
                    }
                    listener.popupMenuCanceled(retargeted);
                }
            }

            @Override
            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
                PopupMenuListener[] ls = datePicker.getPopupMenuListeners();
                PopupMenuEvent retargeted = null;
                for (PopupMenuListener listener : ls) {
                    if (retargeted == null) {
                        retargeted = new PopupMenuEvent(datePicker);
                    }
                    listener.popupMenuWillBecomeInvisible(retargeted);
                }
            }

            @Override
            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
                PopupMenuListener[] ls = datePicker.getPopupMenuListeners();
                PopupMenuEvent retargeted = null;
                for (PopupMenuListener listener : ls) {
                    if (retargeted == null) {
                        retargeted = new PopupMenuEvent(datePicker);
                    }
                    listener.popupMenuWillBecomeVisible(retargeted);
                }
            }
           
View Full Code Here

    public PopupMenuListener[] getPopupMenuListeners() {
        return listenerList.getListeners(PopupMenuListener.class);
    }

    public void firePopupMenuWillBecomeVisible() {
        PopupMenuEvent event = new PopupMenuEvent(this);
        PopupMenuListener[] listeners = getPopupMenuListeners();
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].popupMenuWillBecomeVisible(event);
        }
    }
View Full Code Here

            listeners[i].popupMenuWillBecomeVisible(event);
        }
    }

    public void firePopupMenuWillBecomeInvisible() {
        PopupMenuEvent event = new PopupMenuEvent(this);
        PopupMenuListener[] listeners = getPopupMenuListeners();
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].popupMenuWillBecomeInvisible(event);
        }
    }
View Full Code Here

            listeners[i].popupMenuWillBecomeInvisible(event);
        }
    }

    public void firePopupMenuCanceled() {
        PopupMenuEvent event = new PopupMenuEvent(this);
        PopupMenuListener[] listeners = getPopupMenuListeners();
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].popupMenuCanceled(event);
        }
    }
View Full Code Here

        final PopupMenuListener[] listeners = getPopupMenuListeners();
        if (listeners.length == 0){
            return;
        }

        final PopupMenuEvent event = new PopupMenuEvent(this);
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].popupMenuCanceled(event);
        }
    }
View Full Code Here

TOP

Related Classes of javax.swing.event.PopupMenuEvent

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.