Class CmsHookList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,Deque<String>
,List<String>
,Queue<String>
- Direct Known Subclasses:
CmsHookListSearchCategory
This is intended to react on modifications on
instances
performed by List
instances
linked to them. Using normal list implementations makes it impossible to intervene in those
list modification by the widget technology.CmsWidgetDialogParameter
"Listlet" operations are operations that are triggered upon modification of this list. They are called "on<methodName(>[e]d(<peerObject>, <argList>)" where <methodName> is the name of the original list operation that took place, "[e]d" stands for the past (operation took place), <peerObject> is the given class to perform reactions on (see constructors) and <argList> are the arguments of the original list method in that order.
Currently only the operations used by
(see implementation of CmsWidgetDialog
)
are supported and sufficient for this purpose. More general usability enforces extending
the pattern shown here. CmsWidgetDialog.actionToggleElement()
- Since:
- 6.0.0
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionCmsHookList
(Object peer) Creates an empty list.CmsHookList
(Object peer, Collection<String> c) Creates a list filled with all elements of the given argument. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
void
clear()
get
(int index) iterator()
protected abstract void
React on the performed operation
by informing argument peer.List.add(int, java.lang.Object)
protected abstract void
React on the performed operation
by informing argument peer.List.add(java.lang.Object)
protected abstract void
React on the operation to come
by informing argument peer.List.clear()
protected abstract void
React on the performed operation
by informing argument peer.List.clear()
protected abstract void
React on the performed operation
by informing argument peer.List.get(int)
protected abstract void
onIteratorCall
(Object peer) React on the performed operation
by informing argument peer.List.iterator()
protected abstract void
React on the performed operation
by informing argument peer.List.remove(int)
remove
(int index) Methods inherited from class java.util.LinkedList
addAll, addAll, addFirst, addLast, clone, contains, descendingIterator, element, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
CmsHookList
Creates an empty list.Subclasses should increase "safety by design" by narrowing the type of peer.
- Parameters:
peer
- the object reactions on operations shall be made on in the "listlet" methods of subclasses
-
CmsHookList
Creates a list filled with all elements of the given argument.Subclasses should increase "safety by design" by narrowing the type of peer.
- Parameters:
peer
- the object reactions on operations shall be made on in the "listlet" methods of subclassesc
- a collection with all values for this list
-
-
Method Details
-
add
-
add
-
clear
- Specified by:
clear
in interfaceCollection<String>
- Specified by:
clear
in interfaceList<String>
- Overrides:
clear
in classLinkedList<String>
- See Also:
-
get
-
iterator
-
remove
-
onAdded
React on the performed operation
by informing argument peer.List.add(int, java.lang.Object)
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" methodindex
- the index the element was added atelement
- the element that was added
-
onAdded
React on the performed operation
by informing argument peer.List.add(java.lang.Object)
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" methodo
- the element that was successfully added
-
onClear
React on the operation to come
by informing argument peer.List.clear()
This is called before the actual clear operation takes place.
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" method
-
onCleared
React on the performed operation
by informing argument peer.List.clear()
This is called after the actual clear operation has taken place.
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" method
-
onGetCall
React on the performed operation
by informing argument peer.List.get(int)
Note that the call reult is only obtained in this instance but not given to the requesting client when this handler is invoked.
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" methodindex
- the index of the Object to get
-
onIteratorCall
React on the performed operation
by informing argument peer.List.iterator()
Note that the iterator is only obtained but not given to the requesting client when this handler is invoked.
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" method
-
onRemoved
React on the performed operation
by informing argument peer.List.remove(int)
This is only invoked if the list operation was successful.
- Parameters:
peer
- the object reactions on operations shall be made on in this "listlet" methodindex
- the index where the value has been removed
-