public class ObservableList extends Object implements List
// skip all properties whose value is a closure
def map = new ObservableList( {!(it instanceof Closure)} )
// skip all properties whose name matches a regex
def map = new ObservableList( { name, value -> !(name =˜ /[A-Z+]/) } )
The current implementation will trigger specialized events in the following scenarios, you need
not register a different listener as those events extend from PropertyChangeEvent
Bound properties
| Modifier and Type | Class and Description |
|---|---|
static class |
ObservableList.ChangeType |
static class |
ObservableList.ElementAddedEvent |
static class |
ObservableList.ElementClearedEvent |
static class |
ObservableList.ElementEvent |
static class |
ObservableList.ElementRemovedEvent |
static class |
ObservableList.ElementUpdatedEvent |
static class |
ObservableList.MultiElementAddedEvent |
static class |
ObservableList.MultiElementRemovedEvent |
protected class |
ObservableList.ObservableIterator |
protected class |
ObservableList.ObservableListIterator |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_PROPERTY |
static String |
SIZE_PROPERTY |
| Constructor and Description |
|---|
ObservableList() |
ObservableList(Closure test) |
ObservableList(List delegate) |
ObservableList(List delegate,
Closure test) |
public static final String SIZE_PROPERTY
public static final String CONTENT_PROPERTY
public ObservableList()
public ObservableList(List delegate)
public ObservableList(Closure test)
public List getContent()
protected List getDelegateList()
protected Closure getTest()
protected void fireElementAddedEvent(int index,
Object element)
protected void fireMultiElementAddedEvent(int index,
List values)
protected void fireElementClearedEvent(List values)
protected void fireElementRemovedEvent(int index,
Object element)
protected void fireMultiElementRemovedEvent(List values)
protected void fireElementUpdatedEvent(int index,
Object oldValue,
Object newValue)
protected void fireElementEvent(ObservableList.ElementEvent event)
protected void fireSizeChangedEvent(int oldValue,
int newValue)
public boolean add(Object o)
add in interface Collectionadd in interface Listpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Listpublic boolean addAll(int index,
Collection c)
public void clear()
clear in interface Collectionclear in interface Listpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Listpublic boolean equals(Object o)
public int hashCode()
public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Listpublic Iterator iterator()
public int lastIndexOf(Object o)
lastIndexOf in interface Listpublic ListIterator listIterator()
listIterator in interface Listpublic ListIterator listIterator(int index)
listIterator in interface Listpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Listpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Listpublic int size()
size in interface Collectionsize in interface Listpublic int getSize()
public Object[] toArray()
toArray in interface CollectiontoArray in interface Listpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface Listpublic void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
public PropertyChangeListener[] getPropertyChangeListeners()
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
public boolean hasListeners(String propertyName)