-
- Type Parameters:
E- the type of thehandledevents.
- All Known Subinterfaces:
ChangeAwareListEventListener<E>,ChangeAwareMapEventListener<K,V>,ChangeAwareObservableEventListener<V>,ChangeAwareSetEventListener<E>,CollectionChangeListener<C>,ContainerChangeListener<C>,ListChangeListener<E>,MapChangeListener<K,V>,ObservableEventListener<V>,SetChangeListener<E>,UiAction,UiActionApply,UiActionApprove,UiActionCancel,UiActionClose,UiActionConfirm,UiActionDelete,UiActionDiscard,UiActionEdit,UiActionNavigate,UiActionNext,UiActionNo,UiActionOk,UiActionOpen,UiActionPrevious,UiActionRemove,UiActionReset,UiActionSave,UiActionSearch,UiActionSubmit,UiActionYes,UiClickEventListener,UiEventListener,UiFocusEventListener,UiNavigationEventListener,UiSelectionEventListener,UiValueChangeEventListener,UiVisibilityEventListener
- All Known Implementing Classes:
BidirectionalBinding,BindingListener,ObservableEventReceiver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface EventListener<E>
Interface for a generic event listener.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanisMatchedUsingEquals()voidonEvent(E event)This method is called if an event occurred.
-
-
-
Method Detail
-
isMatchedUsingEquals
default boolean isMatchedUsingEquals()
- Returns:
trueif to match usingequals,falseto match via object identity (compared using==). For better performance the default isfalse. If you implement this interface as a class overridingequalsin order to being able toremovetheEventListenerwithout keeping its reference by creating a newequalEventListenerinstance, then you simply need to override this method returningtrue.
-
onEvent
void onEvent(E event)
This method is called if an event occurred.
WARNING:
Depending on the implementation ofEventSourceit may NOT be legal toaddorremovelisteners during the call of this method as this may lead to a dead-lock.- Parameters:
event- is the event that notifies about something that happened.
-
-