< prev index next >
src/java.desktop/share/classes/java/beans/EventSetDescriptor.java
Print this page
*** 52,71 ****
private boolean unicast;
private boolean inDefaultEventSet = true;
/**
! * Creates an <TT>EventSetDescriptor</TT> assuming that you are
* following the most simple standard design pattern where a named
! * event "fred" is (1) delivered as a call on the single method of
* interface FredListener, (2) has a single argument of type FredEvent,
* and (3) where the FredListener may be registered with a call on an
* addFredListener method of the source component and removed with a
* call on a removeFredListener method.
*
* @param sourceClass The class firing the event.
! * @param eventSetName The programmatic name of the event. E.g. "fred".
* Note that this should normally start with a lower-case character.
* @param listenerType The target interface that events
* will get delivered to.
* @param listenerMethodName The method that will get called when the event gets
* delivered to its target listener interface.
--- 52,71 ----
private boolean unicast;
private boolean inDefaultEventSet = true;
/**
! * Creates an {@code EventSetDescriptor} assuming that you are
* following the most simple standard design pattern where a named
! * event "fred" is (1) delivered as a call on the single method of
* interface FredListener, (2) has a single argument of type FredEvent,
* and (3) where the FredListener may be registered with a call on an
* addFredListener method of the source component and removed with a
* call on a removeFredListener method.
*
* @param sourceClass The class firing the event.
! * @param eventSetName The programmatic name of the event. E.g. "fred".
* Note that this should normally start with a lower-case character.
* @param listenerType The target interface that events
* will get delivered to.
* @param listenerMethodName The method that will get called when the event gets
* delivered to its target listener interface.
*** 98,108 ****
String className = cls.getName();
return className.substring(className.lastIndexOf('.') + 1);
}
/**
! * Creates an <TT>EventSetDescriptor</TT> from scratch using
* string names.
*
* @param sourceClass The class firing the event.
* @param eventSetName The programmatic name of the event set.
* Note that this should normally start with a lower-case character.
--- 98,108 ----
String className = cls.getName();
return className.substring(className.lastIndexOf('.') + 1);
}
/**
! * Creates an {@code EventSetDescriptor} from scratch using
* string names.
*
* @param sourceClass The class firing the event.
* @param eventSetName The programmatic name of the event set.
* Note that this should normally start with a lower-case character.
*** 197,208 ****
}
return method;
}
/**
! * Creates an <TT>EventSetDescriptor</TT> from scratch using
! * <TT>java.lang.reflect.Method</TT> and <TT>java.lang.Class</TT> objects.
*
* @param eventSetName The programmatic name of the event set.
* @param listenerType The Class for the listener interface.
* @param listenerMethods An array of Method objects describing each
* of the event handling methods in the target listener.
--- 197,208 ----
}
return method;
}
/**
! * Creates an {@code EventSetDescriptor} from scratch using
! * {@code java.lang.reflect.Method} and {@code java.lang.Class} objects.
*
* @param eventSetName The programmatic name of the event set.
* @param listenerType The Class for the listener interface.
* @param listenerMethods An array of Method objects describing each
* of the event handling methods in the target listener.
*** 265,276 ****
setListenerType(info.getListenerType());
setUnicast(info.isUnicast());
}
/**
! * Creates an <TT>EventSetDescriptor</TT> from scratch using
! * <TT>java.lang.reflect.MethodDescriptor</TT> and <TT>java.lang.Class</TT>
* objects.
*
* @param eventSetName The programmatic name of the event set.
* @param listenerType The Class for the listener interface.
* @param listenerMethodDescriptors An array of MethodDescriptor objects
--- 265,276 ----
setListenerType(info.getListenerType());
setUnicast(info.isUnicast());
}
/**
! * Creates an {@code EventSetDescriptor} from scratch using
! * {@code java.lang.reflect.MethodDescriptor} and {@code java.lang.Class}
* objects.
*
* @param eventSetName The programmatic name of the event set.
* @param listenerType The Class for the listener interface.
* @param listenerMethodDescriptors An array of MethodDescriptor objects
*** 297,307 ****
setRemoveListenerMethod(removeListenerMethod);
setListenerType(listenerType);
}
/**
! * Gets the <TT>Class</TT> object for the target interface.
*
* @return The Class object for the target interface that will
* get invoked when the event is fired.
*/
public Class<?> getListenerType() {
--- 297,307 ----
setRemoveListenerMethod(removeListenerMethod);
setListenerType(listenerType);
}
/**
! * Gets the {@code Class} object for the target interface.
*
* @return The Class object for the target interface that will
* get invoked when the event is fired.
*/
public Class<?> getListenerType() {
*** 315,325 ****
}
/**
* Gets the methods of the target listener interface.
*
! * @return An array of <TT>Method</TT> objects for the target methods
* within the target listener interface that will get called when
* events are fired.
*/
public synchronized Method[] getListenerMethods() {
Method[] methods = getListenerMethods0();
--- 315,325 ----
}
/**
* Gets the methods of the target listener interface.
*
! * @return An array of {@code Method} objects for the target methods
* within the target listener interface that will get called when
* events are fired.
*/
public synchronized Method[] getListenerMethods() {
Method[] methods = getListenerMethods0();
*** 353,365 ****
? this.listenerMethodsRef.get()
: null;
}
/**
! * Gets the <code>MethodDescriptor</code>s of the target listener interface.
*
! * @return An array of <code>MethodDescriptor</code> objects for the target methods
* within the target listener interface that will get called when
* events are fired.
*/
public synchronized MethodDescriptor[] getListenerMethodDescriptors() {
return (this.listenerMethodDescriptors != null)
--- 353,365 ----
? this.listenerMethodsRef.get()
: null;
}
/**
! * Gets the {@code MethodDescriptor}s of the target listener interface.
*
! * @return An array of {@code MethodDescriptor} objects for the target methods
* within the target listener interface that will get called when
* events are fired.
*/
public synchronized MethodDescriptor[] getListenerMethodDescriptors() {
return (this.listenerMethodDescriptors != null)
*** 440,473 ****
/**
* Normally event sources are multicast. However there are some
* exceptions that are strictly unicast.
*
! * @return <TT>true</TT> if the event set is unicast.
! * Defaults to <TT>false</TT>.
*/
public boolean isUnicast() {
return unicast;
}
/**
! * Marks an event set as being in the "default" set (or not).
! * By default this is <TT>true</TT>.
*
! * @param inDefaultEventSet <code>true</code> if the event set is in
! * the "default" set,
! * <code>false</code> if not
*/
public void setInDefaultEventSet(boolean inDefaultEventSet) {
this.inDefaultEventSet = inDefaultEventSet;
}
/**
! * Reports if an event set is in the "default" set.
*
! * @return <TT>true</TT> if the event set is in
! * the "default" set. Defaults to <TT>true</TT>.
*/
public boolean isInDefaultEventSet() {
return inDefaultEventSet;
}
--- 440,473 ----
/**
* Normally event sources are multicast. However there are some
* exceptions that are strictly unicast.
*
! * @return {@code true} if the event set is unicast.
! * Defaults to {@code false}.
*/
public boolean isUnicast() {
return unicast;
}
/**
! * Marks an event set as being in the "default" set (or not).
! * By default this is {@code true}.
*
! * @param inDefaultEventSet {@code true} if the event set is in
! * the "default" set,
! * {@code false} if not
*/
public void setInDefaultEventSet(boolean inDefaultEventSet) {
this.inDefaultEventSet = inDefaultEventSet;
}
/**
! * Reports if an event set is in the "default" set.
*
! * @return {@code true} if the event set is in
! * the "default" set. Defaults to {@code true}.
*/
public boolean isInDefaultEventSet() {
return inDefaultEventSet;
}
< prev index next >