public class EventSetDescriptor extends FeatureDescriptor
给定的事件组都作为方法调用在一个单一的事件侦听器接口上,一个事件侦听器对象可以通过调用事件源提供的注册方法进行注册。
| Constructor and Description |
|---|
EventSetDescriptor(类<?> sourceClass, String eventSetName, 类<?> listenerType, String listenerMethodName)
创建一个
EventSetDescriptor假设你是以下最简单的标准设计模式在命名事件“弗莱德”(1)对界面FredListener单一方法调用传递,(2)有一个类型参数的FredEvent,和(3)在fredlistener可能与一个源组件addfredlistener方法调用注册并在removefredlistener调用删除方法。
|
EventSetDescriptor(类<?> sourceClass, String eventSetName, 类<?> listenerType, String[] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName)
创建一个
EventSetDescriptor从头开始使用字符串名称。
|
EventSetDescriptor(类<?> sourceClass, String eventSetName, 类<?> listenerType, String[] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName, String getListenerMethodName)
此构造函数创建一个eventsetdescriptor从头开始使用字符串名称。
|
EventSetDescriptor(String eventSetName, 类<?> listenerType, 方法[] listenerMethods, 方法 addListenerMethod, 方法 removeListenerMethod)
创建使用
java.lang.reflect.Method和
java.lang.Class物体划伤
EventSetDescriptor。
|
EventSetDescriptor(String eventSetName, 类<?> listenerType, 方法[] listenerMethods, 方法 addListenerMethod, 方法 removeListenerMethod, 方法 getListenerMethod)
此构造函数创建使用java.lang.reflect.method和java.lang.class物体划伤eventsetdescriptor。
|
EventSetDescriptor(String eventSetName, 类<?> listenerType, MethodDescriptor[] listenerMethodDescriptors, 方法 addListenerMethod, 方法 removeListenerMethod)
创建使用
java.lang.reflect.MethodDescriptor和
java.lang.Class物体划伤
EventSetDescriptor。
|
| Modifier and Type | Method and Description |
|---|---|
方法 |
getAddListenerMethod()
获取用于添加事件侦听器的方法。
|
方法 |
getGetListenerMethod()
获取用于访问注册事件侦听器的方法。
|
MethodDescriptor[] |
getListenerMethodDescriptors()
得到目标的
MethodDescriptors监听器接口。
|
方法[] |
getListenerMethods()
获取目标侦听器接口的方法。
|
类<?> |
getListenerType()
获取为目标的
类对象接口。
|
方法 |
getRemoveListenerMethod()
获取用于删除事件侦听器的方法。
|
boolean |
isInDefaultEventSet()
报告,如果一个事件集是在“默认”设置。
|
boolean |
isUnicast()
通常事件源是多播。
|
void |
setInDefaultEventSet(boolean inDefaultEventSet)
标记设置为“默认”设置(或不)的事件集。
|
void |
setUnicast(boolean unicast)
标记一个设置为单播的事件(或不)。
|
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toStringpublic EventSetDescriptor(类<?> sourceClass, String eventSetName, 类<?> listenerType, String listenerMethodName) throws IntrospectionException
sourceClass -类射击事件。
eventSetName -事件的程序名称。“弗莱德”。请注意,这应该通常开始与一个较低的情况下字符。
listenerType,事件会传递到目标接口。
listenerMethodName的方法将被调用时传递给它的目标得到的事件监听器接口。
IntrospectionException -如果在反思发生异常。
public EventSetDescriptor(类<?> sourceClass, String eventSetName, 类<?> listenerType, String[] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName) throws IntrospectionException
sourceClass -类射击事件。
eventSetName -事件的程序集名称。请注意,这应该通常开始与一个较低的情况下字符。
listenerType -目标接口的类的事件将收到。
listenerMethodNames -姓名的方法将被调用时传递给它的目标得到的事件监听器接口。
addListenerMethodName -名字的方法对事件源可以用来登记一个事件侦听器的对象。
removeListenerMethodName -名称的方法对事件源可以去登记一个事件侦听器的对象。
IntrospectionException -如果在反思发生异常。
public EventSetDescriptor(类<?> sourceClass, String eventSetName, 类<?> listenerType, String[] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName, String getListenerMethodName) throws IntrospectionException
sourceClass -类射击事件。
eventSetName -事件的程序集名称。请注意,这应该通常开始与一个较低的情况下字符。
listenerType -目标接口的类的事件将收到。
listenerMethodNames -姓名的方法将被调用时传递给它的目标得到的事件监听器接口。
addListenerMethodName -名字的方法对事件源可以用来登记一个事件侦听器的对象。
removeListenerMethodName -名称的方法对事件源可以去登记一个事件侦听器的对象。
getListenerMethodName -事件源可用于访问事件监听器对象数组的方法。
IntrospectionException -如果在反思发生异常。
public EventSetDescriptor(String eventSetName, 类<?> listenerType, 方法[] listenerMethods, 方法 addListenerMethod, 方法 removeListenerMethod) throws IntrospectionException
eventSetName -事件的程序集名称。
listenerType -监听器接口的类。
listenerMethods -方法对象描述每个事件在目标听众处理数组。
addListenerMethod -事件源可以用来登记一个事件监听器对象的方法。
removeListenerMethod的方法对事件源可以去登记一个事件侦听器的对象。
IntrospectionException -如果在反思发生异常。
public EventSetDescriptor(String eventSetName, 类<?> listenerType, 方法[] listenerMethods, 方法 addListenerMethod, 方法 removeListenerMethod, 方法 getListenerMethod) throws IntrospectionException
eventSetName -事件的程序集名称。
listenerType -监听器接口的类。
listenerMethods -方法对象描述每个事件在目标听众处理数组。
addListenerMethod -事件源可以用来登记一个事件监听器对象的方法。
removeListenerMethod的方法对事件源可以去登记一个事件侦听器的对象。
getListenerMethod -事件源可用于访问事件监听器对象数组的方法。
IntrospectionException -如果在反思发生异常。
public EventSetDescriptor(String eventSetName, 类<?> listenerType, MethodDescriptor[] listenerMethodDescriptors, 方法 addListenerMethod, 方法 removeListenerMethod) throws IntrospectionException
eventSetName -事件的程序集名称。
listenerType -监听器接口的类。
listenerMethodDescriptors - methoddescriptor对象描述每个事件在目标听众处理数组。
addListenerMethod -事件源可以用来登记一个事件监听器对象的方法。
removeListenerMethod的方法对事件源可以去登记一个事件侦听器的对象。
IntrospectionException -如果在反思发生异常。
public 类<?> getListenerType()
public 方法[] getListenerMethods()
public MethodDescriptor[] getListenerMethodDescriptors()
MethodDescriptors监听器接口。
MethodDescriptor物体为目标的方法在目标听众的界面,就当事件被解雇了。
public 方法 getAddListenerMethod()
public 方法 getRemoveListenerMethod()
public 方法 getGetListenerMethod()
public void setUnicast(boolean unicast)
unicast -如果事件是单播。
public boolean isUnicast()
public void setInDefaultEventSet(boolean inDefaultEventSet)
inDefaultEventSet -
true如果事件集是“默认”,如果不
false
public boolean isInDefaultEventSet()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.