Interface MethodEventSource
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbsoluteLayout,AbstractClientConnector,AbstractColorPicker,AbstractComponent,AbstractComponentContainer,AbstractDateField,AbstractEmbedded,AbstractExtension,AbstractField,AbstractFocusable,AbstractJavaScriptComponent,AbstractJavaScriptExtension,AbstractJavaScriptRenderer,AbstractLayout,AbstractListing,AbstractListing.AbstractListingExtension,AbstractLocalDateField,AbstractLocalDateTimeField,AbstractMedia,AbstractMultiSelect,AbstractOrderedLayout,AbstractRenderer,AbstractSelectionModel,AbstractSingleComponentContainer,AbstractSingleSelect,AbstractSplitPanel,AbstractTextField,Accordion,Audio,BrowserFrame,BrowserWindowOpener,Button,ButtonRenderer,CheckBox,CheckBoxGroup,ClickableRenderer,ColorPicker,ColorPickerArea,ColorPickerGradient,ColorPickerGrid,ColorPickerHistory,ColorPickerPopup,ColorPickerPreview,ColorPickerSelect,ComboBox,ComponentRenderer,Composite,CssLayout,CustomComponent,CustomField,CustomLayout,DataCommunicator,DateField,DateRenderer,DateTimeField,DragAndDropWrapper,DragSourceExtension,DropTargetExtension,EditorImpl,Embedded,EventRouter,FileDownloader,FileDropTarget,FormLayout,Grid,Grid.AbstractGridExtension,Grid.Column,Grid.DetailsManager,GridDragSource,GridDropTarget,GridLayout,HierarchicalDataCommunicator,HorizontalLayout,HorizontalSplitPanel,HtmlRenderer,Image,ImageRenderer,InlineDateField,InlineDateTimeField,JavaScript,Label,LegacyWindow,Link,ListSelect,LocalDateRenderer,LocalDateTimeRenderer,LoginForm,MenuBar,MultiSelectionModelImpl,NativeButton,NativeSelect,Navigator.EmptyView,NoSelectionModel,Notification,NumberRenderer,Panel,PasswordField,PopupView,ProgressBar,ProgressBarRenderer,RadioButtonGroup,Responsive,RichTextArea,SingleSelectionModelImpl,Slider,TabSheet,TextArea,TextField,TextRenderer,Tree,Tree.TreeMultiSelectionModel,Tree.TreeRenderer,TreeGrid,TreeGridDragSource,TreeGridDropTarget,TwinColSelect,UI,Upload,VerticalLayout,VerticalSplitPanel,Video,Window
public interface MethodEventSource extends Serializable
Interface for classes supporting registration of methods as event receivers.
For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Since:
- 3.0
- Author:
- Vaadin Ltd.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description RegistrationaddListener(Class<?> eventType, SerializableEventListener listener, Method method)Registers a new event listener with the specified activation method to listen events generated by this component.RegistrationaddListener(Class<?> eventType, SerializableEventListener listener, String methodName)Registers a new listener with the specified activation method to listen events generated by this component.RegistrationaddListener(Class<?> eventType, Object object, Method method)Deprecated.RegistrationaddListener(Class<?> eventType, Object object, String methodName)Deprecated.voidremoveListener(Class<?> eventType, SerializableEventListener listener)Removes all registered listeners matching the given parameters.voidremoveListener(Class<?> eventType, Object target)Deprecated.voidremoveListener(Class<?> eventType, Object target, Method method)Deprecated.use aRegistrationreturned byaddListener(Class, Object, Method)voidremoveListener(Class<?> eventType, Object target, String methodName)Deprecated.use aRegistrationreturned byaddListener(Class, Object, String)
-
-
-
Method Detail
-
addListener
@Deprecated Registration addListener(Class<?> eventType, Object object, Method method)
Deprecated.Registers a new event listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the type of the listened event. Events of this type or its subclasses activate the listener.object- the object instance who owns the activation method.method- the activation method.- Returns:
- a registration object for removing the listener
- Throws:
IllegalArgumentException- unlessmethodhas exactly one match inobjectNullPointerException- ifobjectisnull- Since:
- 8.0
-
addListener
Registration addListener(Class<?> eventType, SerializableEventListener listener, Method method)
Registers a new event listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the type of the listened event. Events of this type or its subclasses activate the listener.listener- the listener instance who owns the activation method.method- the activation method.- Returns:
- a registration object for removing the listener
- Throws:
IllegalArgumentException- unlessmethodhas exactly one match inobjectNullPointerException- ifobjectisnull- Since:
- 8.12
-
addListener
@Deprecated Registration addListener(Class<?> eventType, Object object, String methodName)
Deprecated.Registers a new listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.This version of
addListenergets the name of the activation method as a parameter. The actual method is reflected fromobject, and unless exactly one match is found,java.lang.IllegalArgumentExceptionis thrown.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the type of the listened event. Events of this type or its subclasses activate the listener.object- the object instance who owns the activation method.methodName- the name of the activation method.- Returns:
- a registration object for removing the listener
- Throws:
IllegalArgumentException- unlessmethodhas exactly one match inobjectNullPointerException- ifobjectisnull- Since:
- 8.0
-
addListener
Registration addListener(Class<?> eventType, SerializableEventListener listener, String methodName)
Registers a new listener with the specified activation method to listen events generated by this component. If the activation method does not have any arguments the event object will not be passed to it when it's called.This version of
addListenergets the name of the activation method as a parameter. The actual method is reflected fromlistener, and unless exactly one match is found,java.lang.IllegalArgumentExceptionis thrown.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the type of the listened event. Events of this type or its subclasses activate the listener.listener- the listener instance who owns the activation method.methodName- the name of the activation method.- Returns:
- a registration object for removing the listener
- Throws:
IllegalArgumentException- unlessmethodhas exactly one match inobjectNullPointerException- ifobjectisnull- Since:
- 8.12
-
removeListener
@Deprecated void removeListener(Class<?> eventType, Object target)
Deprecated.Removes all registered listeners matching the given parameters. Since this method receives the event type and the listener object as parameters, it will unregister allobject's methods that are registered to listen to events of typeeventTypegenerated by this component.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the exact event type theobjectlistens to.target- the target object that has registered to listen to events of typeeventTypewith one or more methods.
-
removeListener
void removeListener(Class<?> eventType, SerializableEventListener listener)
Removes all registered listeners matching the given parameters. Since this method receives the event type and the listener object as parameters, it will unregister allobject's methods that are registered to listen to events of typeeventTypegenerated by this component.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the exact event type theobjectlistens to.listener- the listener that has registered to listen to events of typeeventTypewith one or more methods.- Since:
- 8.12
-
removeListener
@Deprecated void removeListener(Class<?> eventType, Object target, Method method)
Deprecated.use aRegistrationreturned byaddListener(Class, Object, Method)Removes one registered listener method. The given method owned by the given object will no longer be called when the specified events are generated by this component.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the exact event type theobjectlistens to.target- the target object that has registered to listen to events of type eventType with one or more methods.method- the method owned by the target that's registered to listen to events of type eventType.
-
removeListener
@Deprecated void removeListener(Class<?> eventType, Object target, String methodName)
Deprecated.use aRegistrationreturned byaddListener(Class, Object, String)Removes one registered listener method. The given method owned by the given object will no longer be called when the specified events are generated by this component.This version of
removeListenergets the name of the activation method as a parameter. The actual method is reflected from the target, and unless exactly one match is found,java.lang.IllegalArgumentExceptionis thrown.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation.- Parameters:
eventType- the exact event type theobjectlistens to.target- the target object that has registered to listen to events of typeeventTypewith one or more methods.methodName- the name of the method owned bytargetthat's registered to listen to events of typeeventType.
-
-