Example usage for java.beans EventSetDescriptor EventSetDescriptor

List of usage examples for java.beans EventSetDescriptor EventSetDescriptor

Introduction

In this page you can find the example usage for java.beans EventSetDescriptor EventSetDescriptor.

Prototype

public EventSetDescriptor(String eventSetName, Class<?> listenerType, Method[] listenerMethods,
        Method addListenerMethod, Method removeListenerMethod, Method getListenerMethod)
        throws IntrospectionException 

Source Link

Document

This constructor creates an EventSetDescriptor from scratch using java.lang.reflect.Method and java.lang.Class objects.

Usage

From source file:facebean.FaceBeanBeanInfo.java

private static EventSetDescriptor[] getEdescriptor() {
    EventSetDescriptor[] eventSets = new EventSetDescriptor[13];

    try {//  w ww  .  ja v  a 2  s  .c o m
        eventSets[EVENT_ancestorListener] = new EventSetDescriptor(facebean.FaceBean.class, "ancestorListener",
                javax.swing.event.AncestorListener.class,
                new String[] { "ancestorAdded", "ancestorRemoved", "ancestorMoved" }, "addAncestorListener",
                "removeAncestorListener"); // NOI18N
        eventSets[EVENT_ancestorListener].setHidden(true);
        eventSets[EVENT_componentListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "componentListener", java.awt.event.ComponentListener.class,
                new String[] { "componentResized", "componentMoved", "componentShown", "componentHidden" },
                "addComponentListener", "removeComponentListener"); // NOI18N
        eventSets[EVENT_componentListener].setHidden(true);
        eventSets[EVENT_containerListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "containerListener", java.awt.event.ContainerListener.class,
                new String[] { "componentAdded", "componentRemoved" }, "addContainerListener",
                "removeContainerListener"); // NOI18N
        eventSets[EVENT_containerListener].setHidden(true);
        eventSets[EVENT_focusListener] = new EventSetDescriptor(facebean.FaceBean.class, "focusListener",
                java.awt.event.FocusListener.class, new String[] { "focusGained", "focusLost" },
                "addFocusListener", "removeFocusListener"); // NOI18N
        eventSets[EVENT_focusListener].setHidden(true);
        eventSets[EVENT_hierarchyBoundsListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "hierarchyBoundsListener", java.awt.event.HierarchyBoundsListener.class,
                new String[] { "ancestorMoved", "ancestorResized" }, "addHierarchyBoundsListener",
                "removeHierarchyBoundsListener"); // NOI18N
        eventSets[EVENT_hierarchyBoundsListener].setHidden(true);
        eventSets[EVENT_hierarchyListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "hierarchyListener", java.awt.event.HierarchyListener.class,
                new String[] { "hierarchyChanged" }, "addHierarchyListener", "removeHierarchyListener"); // NOI18N
        eventSets[EVENT_hierarchyListener].setHidden(true);
        eventSets[EVENT_inputMethodListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "inputMethodListener", java.awt.event.InputMethodListener.class,
                new String[] { "inputMethodTextChanged", "caretPositionChanged" }, "addInputMethodListener",
                "removeInputMethodListener"); // NOI18N
        eventSets[EVENT_inputMethodListener].setHidden(true);
        eventSets[EVENT_keyListener] = new EventSetDescriptor(facebean.FaceBean.class, "keyListener",
                java.awt.event.KeyListener.class, new String[] { "keyTyped", "keyPressed", "keyReleased" },
                "addKeyListener", "removeKeyListener"); // NOI18N
        eventSets[EVENT_keyListener].setHidden(true);
        eventSets[EVENT_mouseListener] = new EventSetDescriptor(facebean.FaceBean.class, "mouseListener",
                java.awt.event.MouseListener.class,
                new String[] { "mouseClicked", "mousePressed", "mouseReleased", "mouseEntered", "mouseExited" },
                "addMouseListener", "removeMouseListener"); // NOI18N
        eventSets[EVENT_mouseListener].setHidden(true);
        eventSets[EVENT_mouseMotionListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "mouseMotionListener", java.awt.event.MouseMotionListener.class,
                new String[] { "mouseDragged", "mouseMoved" }, "addMouseMotionListener",
                "removeMouseMotionListener"); // NOI18N
        eventSets[EVENT_mouseMotionListener].setHidden(true);
        eventSets[EVENT_mouseWheelListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "mouseWheelListener", java.awt.event.MouseWheelListener.class,
                new String[] { "mouseWheelMoved" }, "addMouseWheelListener", "removeMouseWheelListener"); // NOI18N
        eventSets[EVENT_mouseWheelListener].setHidden(true);
        eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "propertyChangeListener", java.beans.PropertyChangeListener.class,
                new String[] { "propertyChange" }, "addPropertyChangeListener", "removePropertyChangeListener"); // NOI18N
        eventSets[EVENT_propertyChangeListener].setHidden(true);
        eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor(facebean.FaceBean.class,
                "vetoableChangeListener", java.beans.VetoableChangeListener.class,
                new String[] { "vetoableChange" }, "addVetoableChangeListener", "removeVetoableChangeListener"); // NOI18N
        eventSets[EVENT_vetoableChangeListener].setHidden(true);
    } catch (IntrospectionException e) {
        e.printStackTrace();
    } //GEN-HEADEREND:Events

    // Here you can add code for customizing the event sets array.

    return eventSets;
}