Module io.github.mmm.event
Package io.github.mmm.event
Interface EventSource<E,L extends EventListener<?>>
-
- All Known Subinterfaces:
BigDecimalExpression,BigIntegerExpression,BooleanExpression,ByteExpression,ChangeAwareCollection<E,M,L>,ChangeAwareContainer<E,M,L>,ChangeAwareList<E>,ChangeAwareMap<K,V>,ChangeAwareSet<E>,ComparableExpression<V>,DoubleExpression,Expression<V>,FloatExpression,InstantExpression,IntegerExpression,LocalDateExpression,LocalDateTimeExpression,LocalTimeExpression,LongExpression,NumberExpression<N>,ObservableBigDecimalValue,ObservableBigIntegerValue,ObservableBooleanValue,ObservableByteValue,ObservableCollectionValue<C,E>,ObservableContainerValue<C,E>,ObservableDoubleValue,ObservableFloatValue,ObservableInstantValue,ObservableIntegerValue,ObservableListValue<E>,ObservableLocalDateTimeValue,ObservableLocalDateValue,ObservableLocalTimeValue,ObservableLongValue,ObservableMapValue<K,V>,ObservableNumberValue<N>,ObservableObjectValue<V>,ObservableOffsetDateTimeValue,ObservableOffsetTimeValue,ObservableSetValue<E>,ObservableShortValue,ObservableSimpleValue<V>,ObservableStringValue,ObservableTemporalValue<V>,ObservableValue<V>,ObservableZonedDateTimeValue,OffsetDateTimeExpression,OffsetTimeExpression,ReadableBeanProperty<V>,ReadableBigDecimalProperty,ReadableBigIntegerProperty,ReadableBooleanProperty,ReadableByteProperty,io.github.mmm.property.container.collection.ReadableCollectionProperty<V,E>,ReadableContainerProperty<V,E>,ReadableDoubleProperty,ReadableFloatProperty,ReadableInstantProperty,ReadableIntegerProperty,ReadableListProperty<E>,ReadableLocalDateProperty,ReadableLocalDateTimeProperty,ReadableLocalTimeProperty,ReadableLongProperty,ReadableMapProperty<K,V>,ReadableNumberProperty<N>,ReadableObjectProperty<V>,ReadableOffsetDateTimeProperty,ReadableOffsetTimeProperty,ReadableProperty<V>,ReadableRangeProperty<V>,ReadableSetProperty<E>,ReadableShortProperty,ReadableSimpleProperty<V>,ReadableStringProperty,ReadableZonedDateTimeProperty,ShortExpression,StringExpression,TemporalExpression<V>,UiAbstractButton,UiAbstractButtonContainer,UiAbstractCheckbox,UiAbstractChoice<O,V>,UiAbstractCompositeInput<C,V>,UiAbstractDataTable<R>,UiAbstractDataTree<R>,UiAbstractDataWidget<R>,UiAbstractImage,UiAbstractInput<V>,UiAbstractLink,UiAbstractMenu<E>,UiAbstractMenuBar<E>,UiAbstractMenuEntry,UiAbstractMenuItem,UiAbstractMenuWithItems,UiAbstractMultiChoice<V>,UiAbstractRadioButton,UiAbstractSingleChoice<V>,UiAbstractSplitPanel,UiAbstractWindow,UiActiveWidget,UiAdvancedMenu,UiAudioPlayer,UiBarChart,UiBarChartHorizontal,UiBarChartVertical,UiBigDecimalInput,UiBigIntegerInput,UiBindableWidget<V>,UiBorderPanel,UiBreadCrumbBar,UiBreadCrumbEntry,UiButton,UiButtonPanel,UiChart<D>,UiCheckbox,UiCheckboxChoice<V>,UiChildWindow,UiClickableWidget,UiCollapsibleComposite<C>,UiCollapsiblePanel,UiColorInput,UiColumn<R,V>,UiComboBox<V>,UiComposite<C>,UiCompositeInput<V>,UiDataTable<R>,UiDataTree<R>,UiDataTreeTable<R>,UiDateInput,UiDateTimeInput,UiDoubleInput,UiExternalLink,UiFailureComposite<C>,UiFormGroup<V>,UiFormPanel<V>,UiGridPanel,UiGridRow,UiHorizontalInput<V>,UiHorizontalPanel,UiHorizontalSplitPanel,UiHtmlEditor,UiIcon,UiImage,UiInput<V>,UiInputContainer<V>,UiIntegerInput,UiIntegerSlider,UiInternalLink,UiLabel,UiLineChart,UiLongInput,UiLongSlider,UiMainWindow,UiMediaPlayer,UiMediaWidget,UiMenu,UiMenuBar,UiMenuItem,UiMenuItemCheckbox,UiMenuItemRadioButton,UiMenuItemSeparator,UiMultiComboBox<V>,UiMutableComposite<C>,UiMutablePanel,UiMutableSingleComposite<C>,UiNativeWidget,UiNativeWidgetWrapper<W>,UiNavigationBar,UiNavigationManager,UiNumberInput<V>,UiNumericInput<V>,UiPasswordInput,UiPieChart,UiPopup,UiRadioButton,UiRadioChoice<V>,UiRegularWidget,UiRemovableComposite<C>,UiResponsiveColumnPanel,UiScrollPanel,UiSingleComposite<C>,UiSlider<V>,UiSlot,UiSourceCodeViewer,UiStringInput,UiSwitchComposite<C>,UiTab,UiTabPanel,UiText,UiTextArea,UiTextInput,UiTextualInput<V>,UiTimeInput,UiValidatableWidget<V>,UiValuedComposite<C,V>,UiValuedWidget<V>,UiVerticalInput<V>,UiVerticalPanel,UiVerticalSplitPanel,UiVideoPlayer,UiWidget,UiWidgetWithSelection,UiWindow,WritableBeanProperty<V>,WritableBigDecimalProperty,WritableBigIntegerProperty,WritableBooleanProperty,WritableByteProperty,io.github.mmm.property.container.collection.WritableCollectionProperty<V,E>,WritableContainerProperty<V,E>,WritableDoubleProperty,WritableFloatProperty,WritableInstantProperty,WritableIntegerProperty,WritableListProperty<E>,WritableLocalDateProperty,WritableLocalDateTimeProperty,WritableLocalTimeProperty,WritableLongProperty,WritableMapProperty<K,V>,WritableNumberProperty<N>,WritableObjectProperty<V>,WritableObservableValue<V>,WritableOffsetDateTimeProperty,WritableOffsetTimeProperty,WritableProperty<V>,WritableRangeProperty<V>,WritableSetProperty<E>,WritableShortProperty,WritableSimpleProperty<V>,WritableStringProperty,WritableZonedDateTimeProperty,ZonedDateTimeExpression
- All Known Implementing Classes:
AbstractEventSource,AbstractObservableValue,AbstractUiCustomWidget,AbstractUiNativeWidget,AbstractUiNativeWidgetWrapper,AbstractUiNavigationManager,AbstractUiNavigationManagerImpl,AbstractUiWidget,AbstractWritableObservableValue,BeanProperty,BigDecimalBinding,BigDecimalProperty,BigIntegerBinding,BigIntegerProperty,Binding,BooleanBinding,BooleanProperty,ByteBinding,ByteProperty,io.github.mmm.property.container.collection.CollectionProperty,ContainerProperty,DoubleBinding,DoubleProperty,DurationInSecondsProperty,FloatBinding,FloatProperty,FxAbstractButton,FxAbstractChoice,FxAbstractImage,FxAbstractLink,FxAbstractWindow,FxActiveValidatableWidget,FxActiveWidget,FxBarChart,FxBarChartHorizontal,FxBarChartVertical,FxBorderPanel,FxButton,FxButtonPanel,FxChart,FxCheckbox,FxChildWindow,FxClickableWidget,FxCollapsiblePanel,FxComboBox,FxComposite,FxCompositeInput,FxDataTable,FxExternalLink,FxFailureComposite,FxFormGroup,FxFormGroup,FxFormPanel,FxFormPanel,FxGridPanel,FxGridRow,FxHorizontalInput,FxHorizontalPanel,FxHorizontalPanel,FxImage,FxInput,FxInputContainer,FxInputContainer,FxInternalLink,FxLabel,FxLineChart,FxMainWindow,FxMediaPlayer,FxMediaWidget,FxMutableComposite,FxMutableCompositePane,FxMutablePanel,FxPasswordInput,FxPieChart,FxPopup,FxRadioButton,FxRadioChoice,FxRemovableComposite,FxScrollPanel,FxSlot,FxStringInput,FxTableColumn,FxText,FxTextArea,FxTextInput,FxTextualInput,FxValuedComposite,FxVerticalPanel,FxWidget,FxWidgetNode,FxWidgetStyleable,FxWindow,IdProperty,InstantBinding,InstantProperty,IntegerBinding,IntegerProperty,LinkProperty,ListProperty,LocalDateBinding,LocalDateProperty,LocalDateTimeBinding,LocalDateTimeProperty,LocalTimeBinding,LocalTimeProperty,LongBinding,LongProperty,MapProperty,NumberBinding,NumberProperty,ObjectProperty,OffsetDateTimeBinding,OffsetDateTimeBinding,OffsetDateTimeProperty,OffsetTimeProperty,Property,RangeProperty,SetProperty,ShortBinding,ShortProperty,SimpleProperty,StringBinding,StringListProperty,StringProperty,TemporalProperty,TestAbstractButton,TestAbstractChoice,TestAbstractImage,TestAbstractLink,TestAbstractRadioButton,TestAbstractSingleChoice,TestAbstractWindow,TestActiveValidatableWidget,TestActiveWidget,TestBarChart,TestBarChartHorizontal,TestBarChartVertical,TestButton,TestButtonPanel,TestChart,TestCheckbox,TestChildWindow,TestClickableWidget,TestCollapsibleComposite,TestCollapsiblePanel,TestComboBox,TestComposite,TestDataList,TestExternalLink,TestFailureComposite,TestFormGroup,TestFormPanel,TestGridPanel,TestGridRow,TestIcon,TestImage,TestInput,TestInputContainer,TestInternalLink,TestLabel,TestLineChart,TestMainWindow,TestMutableComposite,TestMutablePanel,TestPasswordInput,TestPieChart,TestPopup,TestRadioButton,TestRadioChoice,TestRemovableComposite,TestScrollPanel,TestSelectionInput,TestSlot,TestStringInput,TestTableColumn,TestText,TestTextArea,TestTextInput,TestTextualInput,TestValuedComposite,TestValuedWidget,TestVerticalPanel,TestWidget,TestWindow,TvmAbstractButton,TvmAbstractLink,TvmAbstractTextArea,TvmActiveWidget,TvmBooleanInput,TvmBorderPanel,TvmButton,TvmButtonPanel,TvmCheckbox,TvmClickableWidget,TvmComboBoxDataList,TvmComboBoxSelect,TvmComposite,TvmExternalLink,TvmGridPanel,TvmGridRow,TvmHorizontalPanel,TvmHtmlInput,TvmHtmlSelect,TvmInput,TvmInternalLink,TvmLabel,TvmLabelledInput,TvmMutableComposite,TvmMutablePanel,TvmPasswordInput,TvmRadioButton,TvmRadioChoice,TvmRemovableComposite,TvmScrollPanel,TvmSlot,TvmStringInput,TvmText,TvmTextArea,TvmTextInput,TvmTextualInput,TvmValuedComposite,TvmVerticalPanel,TvmWidget,TvmWidgetHtmlElement,UiCustomComposite,UiCustomCompositeInput,UiCustomEditor,UiCustomEditorButtonPanel,UiCustomFormPanel,UiCustomGridPanel,UiCustomHorizontalInput,UiCustomInput,UiCustomMutableComposite,UiCustomMutablePanel,UiCustomMutableSingleComposite,UiCustomRemovableComposite,UiCustomScrollPanel,UiCustomValidatableWidget,UiCustomValuedComposite,UiCustomValuedWidget,UiCustomVerticalPanel,ZonedDateTimeBinding,ZonedDateTimeProperty
public interface EventSource<E,L extends EventListener<?>>- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddListener(L listener)Adds anEventListenerwhich will be notified whenever the an event occurs (something changes).voidaddListener(L listener, boolean weak)Adds anEventListenerwhich will be notified whenever the an event occurs (something changes).default voidaddWeakListener(L listener)booleanremoveListener(L listener)This method removes anEventListener.
-
-
-
Method Detail
-
addListener
default void addListener(L listener)
Adds anEventListenerwhich will be notified whenever the an event occurs (something changes). If the same listener is added more than once, it will be notified more than once. The sameEventListenerinstance may be registered for differentEventSources.By default the
EventSourcestores a strong reference to theEventListenerwhich will prevent the listener from being garbage collected. You then need toremovethatEventListenerafter use to avoid memory leaks. For convenience your may also useaddWeakListener(EventListener)instead to enforce that aWeakReferenceis used internally.- Parameters:
listener- theEventListenerto register.- See Also:
addListener(EventListener, boolean),removeListener(EventListener),EventListener.isMatchedUsingEquals()
-
addWeakListener
default void addWeakListener(L listener)
- Parameters:
listener- theEventListenerto register.- See Also:
addListener(EventListener, boolean)
-
addListener
void addListener(L listener, boolean weak)
Adds anEventListenerwhich will be notified whenever the an event occurs (something changes). If the same listener is added more than once, it will be notified more than once. The sameEventListenerinstance may be registered for differentEventSources.- Parameters:
listener- theEventListenerto register.weak- -trueif theEventListenermay be garbage collected without beingremovedvia aWeakReference,falseotherwise (if the listener will be associated using a strong reference). When providingtruehere (useWeakReference), you need to store a reference to your registeredEventListeneryourself in the owning parent object so it is not garbage-collected too early.- See Also:
addWeakListener(EventListener)
-
removeListener
boolean removeListener(L listener)
This method removes anEventListener. If theEventListenerwas not registered before this method does not do any change. Otherwise the first matchingEventListenerwill be removed. So if youaddedanEventListenermultiple times, only the first occurrence will be removed.
For performance reasonsEventListener.isMatchedUsingEquals()returnsfalseby default. To force the usage ofequalsinstead, ensure yourEventListenerimplementation overridesObject.equals(Object)andEventListener.isMatchedUsingEquals()returningtrue.- Parameters:
listener- is theEventListenerto unregister.- Returns:
trueif the givenlistenerhas successfully been removed,falseif thelistenerwas NOTregistered.
-
-