Interface MethodEventSource
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbsoluteLayout
,AbstractClientConnector
,AbstractColorPicker
,AbstractComponent
,AbstractComponentContainer
,AbstractEmbedded
,AbstractExtension
,AbstractField
,AbstractFocusable
,AbstractJavaScriptComponent
,AbstractJavaScriptExtension
,AbstractJavaScriptRenderer
,AbstractLayout
,AbstractMedia
,AbstractOrderedLayout
,AbstractSelect
,AbstractSingleComponentContainer
,AbstractSplitPanel
,AbstractTextField
,Accordion
,Audio
,BrowserFrame
,BrowserWindowOpener
,Button
,ButtonRenderer
,Calendar
,CheckBox
,ClickableRenderer
,ColorPicker
,ColorPickerArea
,ColorPickerGradient
,ColorPickerGrid
,ColorPickerHistory
,ColorPickerPopup
,ColorPickerPreview
,ColorPickerSelect
,ComboBox
,CssLayout
,CustomComponent
,CustomField
,CustomLayout
,DateField
,DateRenderer
,DragAndDropWrapper
,Embedded
,EventRouter
,FileDownloader
,Flash
,Form
,FormLayout
,Grid
,Grid.AbstractGridExtension
,Grid.AbstractRenderer
,Grid.AbstractSelectionModel
,Grid.DetailComponentManager
,Grid.MultiSelectionModel
,Grid.NoSelectionModel
,Grid.SingleSelectionModel
,GridLayout
,HorizontalLayout
,HorizontalSplitPanel
,HtmlRenderer
,Image
,ImageRenderer
,InlineDateField
,JavaScript
,Label
,LegacyWindow
,Link
,ListSelect
,LoginForm
,MenuBar
,NativeButton
,NativeSelect
,Navigator.EmptyView
,NumberRenderer
,OptionGroup
,Panel
,PasswordField
,PopupDateField
,PopupView
,ProgressBar
,ProgressBarRenderer
,ProgressIndicator
,Responsive
,RichTextArea
,RpcDataProviderExtension
,Select
,Slider
,Table
,TabSheet
,TextArea
,TextField
,TextRenderer
,Tree
,TreeTable
,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 Modifier and Type Method Description void
addListener(Class<?> eventType, Object object, Method method)
Registers a new event listener with the specified activation method to listen events generated by this component.void
addListener(Class<?> eventType, Object object, String methodName)
Registers a new listener with the specified activation method to listen events generated by this component.void
removeListener(Class<?> eventType, Object target)
Removes all registered listeners matching the given parameters.void
removeListener(Class<?> eventType, Object target, Method method)
Removes one registered listener method.void
removeListener(Class<?> eventType, Object target, String methodName)
Removes one registered listener method.
-
-
-
Method Detail
-
addListener
void addListener(Class<?> eventType, Object object, 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.object
- the object instance who owns the activation method.method
- the activation method.- Throws:
IllegalArgumentException
- unlessmethod
has exactly one match inobject
-
addListener
void addListener(Class<?> eventType, Object object, 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
addListener
gets the name of the activation method as a parameter. The actual method is reflected fromobject
, and unless exactly one match is found,java.lang.IllegalArgumentException
is 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.- Throws:
IllegalArgumentException
- unlessmethod
has exactly one match inobject
-
removeListener
void removeListener(Class<?> eventType, Object target)
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 typeeventType
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 theobject
listens to.target
- the target object that has registered to listen to events of typeeventType
with one or more methods.
-
removeListener
void removeListener(Class<?> eventType, Object target, Method 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 theobject
listens 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
void removeListener(Class<?> eventType, Object target, String methodName)
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
removeListener
gets 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.IllegalArgumentException
is thrown.For more information on the inheritable event mechanism see the
com.vaadin.event package documentation
.- Parameters:
eventType
- the exact event type theobject
listens to.target
- the target object that has registered to listen to events of typeeventType
with one or more methods.methodName
- the name of the method owned bytarget
that's registered to listen to events of typeeventType
.
-
-