ChangeSupport is responsible to notifies registered listeners upon changes made
to a StateObject, those changes are either a property has changed (IPropertyChangeListener)
or the content of a list has changed (IListChangeListener).
| Modifier and Type | Field and Description |
|---|---|
| private Map | listChangeListeners
The list of registered |
| private Map | propertyChangeListeners
The list of registered |
| private StateObject | source
The object for which this object will take care of notifying the listeners upon changes made to the object's internal state. |
| Access | Constructor and Description |
|---|---|
| public | ChangeSupport(StateObject
The object for which this object will take care of notifying the listeners upon
changes made to the object's internal state source)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public < The type of the items T> void | addItem(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of to which the child is added items, String The name associated with the list listName, T The child to become a child of this one item)Adds the given item as a child to the given list. |
| public < The type of the items T> void | addItems(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of items to which the child is added list, String The name associated with the list listName, List<? extends T> The child to become children of this one items)Adds the given items as children to the given list. |
| public void | addListChangeListener(String
The name of the list for which the listener will be notified when the content
of the list has changed listName, IListChangeListener<?> The listener to be notified upon changes listener)Registers the given |
| protected <T> void | addListener(Map<String, List<T>>
The list of listeners from which the given listener is added listeners, Class<?> The type of the listener, which is only used in the exception's message listenerType, String The name of the event for which the listener is registered name, T The listener to register listener)Registers the given list for the specified name. |
| public void | addPropertyChangeListener(String
The name of the property for which the listener was registered propertyName, IPropertyChangeListener<?> The listener to be notified upon changes listener)Registers the given |
| public <T> boolean | Returns: true if the object can be moved down by one unit; false
otherwiseThe list used to determine if the given item can be moved down in that list list, T The item that could potentially be moved down stateObject)Determines whether the given item can be moved down by one position in the list owned by its parent. |
| public <T> boolean | Returns: true if the object can be moved up by one unit; false
otherwiseThe list used to determine if the given item can be moved up in that list list, T The item that could potentially be moved up item)Determines whether the given item can be moved up by one position in the list owned by its parent. |
| protected <T> void | |
| public void | firePropertyChanged(String
The name of the property associated with the property change propertyName, Object The old value of the property that changed oldValue, Object The new value of the property that changed newValue)Notifies the |
| public boolean | Returns: true if listeners have been registered for the given list name;
false otherwiseThe name of the list to check if it has registered listeners listName)Determines whether there are at least one |
| protected boolean | Returns: true if listeners have been registered for the given name;
false otherwiseThe name of the property or list to check if it has registered listeners name)Determines whether there are at least one listener registered. |
| public boolean | Returns: true if listeners have been registered for the given property name;
false otherwiseThe name of the property to check if it has registered listeners propertyName)Determines whether there are at least one |
| protected void | initialize(StateObject
The object for which this object will take care of notifying the listeners upon
changes made to the object's internal state source)Initializes this |
| protected <T> ListIterable | |
| public < The type of the items T> void | moveDown(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of items to which the child is moved down items, String The name associated with the list listName, T The child to move down within the list item)Moves the given |
| protected < The type of the items T> void | moveItem(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of items to which the child is moved items, IListChangeEvent.The type describing how the item was moved (up or down) eventType,The name associated with the list listName, T The child to move within the list item, int The current position of the item to move oldIndex, int The new position within the list newIndex)Moves the given item from its current position to a new position in the list owned by its parent. |
| public < The type of the items T> void | moveUp(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of items to which the child is moved up items, String The name associated with the list listName, T The child to move up within the list item)Moves the given item up by one position in the list owned by its parent. |
| protected ListIterable | |
| public < The type of the items T> void | removeItem(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of item to which the child is removed items, String The name associated with the list listName, T The child to removed from the list item)Removes the given item from the list of children. |
| public < The type of the items T> void | removeItems(ListHolderStateObject<T>
The source, List<? extends T> ListHolderStateObject from where the change is comingThe list of items to which the child is removed list, String The name associated with the list listName, Collection<? extends T> The items to removed from the list items)Removes the given items from the list of children. |
| public void | removeListChangeListener(String
The name of the list for which the listener was registered listName, IListChangeListener<?> The listener to unregister listener)Unregisters the given |
| protected <T> void | removeListener(Map<String, List<T>>
The list of listeners from which the given listener is removed listeners, Class<?> The type of the listener, which is only used in the exception's message listenerType, String The name of the event for which the listener was registered name, T The listener to unregister listener)Unregisters the given listener that was registered for the specified name. |
| public void | removePropertyChangeListener(String
The name of the property for which the listener was registered propertyName, IPropertyChangeListener<?> The listener to unregister listener)Unregisters the given |
| public < The type of the items T> void | replaceItem(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of items to which a child is replaced items, String The name associated with the list listName, int The position of the item to replace index, T The item to replace the one at the given position item)Replaces the item at the given position by a new one. |
| public < The type of the items T> void | replaceItems(ListHolderStateObject<T>
The source, List<T> ListHolderStateObject from where the change is comingThe list of items to which the child is removed items, String The name associated with the list listName, List<T> The items to removed from the list newItems)Replaces the given list by removing any existing items and adding the items contained in the second list. |
| listChangeListeners | back to summary |
|---|---|
| private Map<String, List<IListChangeListener<?>>> listChangeListeners The list of registered | |
| propertyChangeListeners | back to summary |
|---|---|
| private Map<String, List<IPropertyChangeListener<?>>> propertyChangeListeners The list of registered | |
| source | back to summary |
|---|---|
| private StateObject source The object for which this object will take care of notifying the listeners upon changes made to the object's internal state. | |
| ChangeSupport | back to summary |
|---|---|
| public ChangeSupport(StateObject source) Creates a new
| |
| addItem | back to summary |
|---|---|
| public <T> void addItem(ListHolderStateObject<T> source, List<T> items, String listName, T item) Adds the given item as a child to the given list.
| |
| addItems | back to summary |
|---|---|
| public <T> void addItems(ListHolderStateObject<T> source, List<T> list, String listName, List<? extends T> items) Adds the given items as children to the given list.
| |
| addListChangeListener | back to summary |
|---|---|
| public void addListChangeListener(String listName, IListChangeListener<?> listener) Registers the given
| |
| addListener | back to summary |
|---|---|
| protected <T> void addListener(Map<String, List<T>> listeners, Class<?> listenerType, String name, T listener) Registers the given list for the specified name. The listener will be notified upon changes.
| |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(String propertyName, IPropertyChangeListener<?> listener) Registers the given
| |
| canMoveDown | back to summary |
|---|---|
| public <T> boolean canMoveDown(List<T> list, T stateObject) Determines whether the given item can be moved down by one position in the list owned by its parent.
| |
| canMoveUp | back to summary |
|---|---|
| public <T> boolean canMoveUp(List<T> list, T item) Determines whether the given item can be moved up by one position in the list owned by its parent.
| |
| fireListChangeEvent | back to summary |
|---|---|
| protected <T> void fireListChangeEvent(IListChangeEvent<T> event) | |
| firePropertyChanged | back to summary |
|---|---|
| public void firePropertyChanged(String propertyName, Object oldValue, Object newValue) Notifies the
| |
| hasListChangeListeners | back to summary |
|---|---|
| public boolean hasListChangeListeners(String listName) Determines whether there are at least one
| |
| hasListeners | back to summary |
|---|---|
| protected boolean hasListeners(Map<String, ?> listeners, String name) Determines whether there are at least one listener registered.
| |
| hasPropertyChangeListeners | back to summary |
|---|---|
| public boolean hasPropertyChangeListeners(String propertyName) Determines whether there are at least one
| |
| initialize | back to summary |
|---|---|
| protected void initialize(StateObject source) Initializes this
| |
| listChangeListeners | back to summary |
|---|---|
protected <T> ListIterable
| |
| moveDown | back to summary |
|---|---|
| public <T> void moveDown(ListHolderStateObject<T> source, List<T> items, String listName, T item) Moves the given
| |
| moveItem | back to summary |
|---|---|
| protected <T> void moveItem(ListHolderStateObject<T> source, List<T> items, IListChangeEvent. Moves the given item from its current position to a new position in the list owned by its parent.
| |
| moveUp | back to summary |
|---|---|
| public <T> void moveUp(ListHolderStateObject<T> source, List<T> items, String listName, T item) Moves the given item up by one position in the list owned by its parent.
| |
| propertyChangeListeners | back to summary |
|---|---|
| protected ListIterable | |
| removeItem | back to summary |
|---|---|
| public <T> void removeItem(ListHolderStateObject<T> source, List<T> items, String listName, T item) Removes the given item from the list of children.
| |
| removeItems | back to summary |
|---|---|
| public <T> void removeItems(ListHolderStateObject<T> source, List<? extends T> list, String listName, Collection<? extends T> items) Removes the given items from the list of children.
| |
| removeListChangeListener | back to summary |
|---|---|
| public void removeListChangeListener(String listName, IListChangeListener<?> listener) Unregisters the given
| |
| removeListener | back to summary |
|---|---|
| protected <T> void removeListener(Map<String, List<T>> listeners, Class<?> listenerType, String name, T listener) Unregisters the given listener that was registered for the specified name. The listener will no longer be notified upon changes.
| |
| removePropertyChangeListener | back to summary |
|---|---|
| public void removePropertyChangeListener(String propertyName, IPropertyChangeListener<?> listener) Unregisters the given
| |
| replaceItem | back to summary |
|---|---|
| public <T> void replaceItem(ListHolderStateObject<T> source, List<T> items, String listName, int index, T item) Replaces the item at the given position by a new one.
| |
| replaceItems | back to summary |
|---|---|
| public <T> void replaceItems(ListHolderStateObject<T> source, List<T> items, String listName, List<T> newItems) Replaces the given list by removing any existing items and adding the items contained in the second list.
| |