Class ListProperty<T,K>
- All Implemented Interfaces:
Iterable<T>
-
Constructor Summary
ConstructorsConstructorDescriptionListProperty(String name) Constructs a property with null valueListProperty(String name, Class<T> elementType, T... values) Constructs a property with the given name and values by specifying the type of the elements explicitly.ListProperty(String name, T... values) Constructs a property with the given name and value -
Method Summary
Modifier and TypeMethodDescriptionAdds a property value and fires a change eventAdds a property value to the end of the list and fires a change eventaddAll(Collection<? extends T> v) Adds a all properties value to the list and fires a change eventReturns a copy of the content as a new list but if the value is a PropertyBusinessObject it will be converted to a MapasList()Returns a copy of the content as a new listvoidclear()Remove all the elements from the listbooleanReturns true if the given element is contained in the list propertybooleanCompares this property to another propertyget(int offset) Gets the property valueinthashCode()Returns the internal hashcode or 0 for null propertyintReturns the index of the given element in the list propertyiterator()Iterate over the elements of the propertyremove(int offset) Removes the item at the given offsetRemoves the item with this valueremoveAll(Collection<? extends T> v) Removes from the list all values from the given collection and fires a change event if the list has changedSets the property value and potentially fires a change eventset(Collection<T> t) Sets the entire content of the propertysetList(Collection<T> t) Historical alias of set(Collection t) Sets the entire content of the propertyintsize()The size of the property listMethods inherited from class PropertyBase
addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, toString, validateCollectionTypeModifier and TypeMethodDescriptionvoidFires a notification that a property value changed to the given listenerstatic voidbindGlobalGetListener(PropertyChangeListener listener) Binds an event callback for get calls and property readsstatic voidbindGlobalSetListener(PropertyChangeListener listener) Binds an event callback for set calls and property mutationprotected voidDelivers the property change event to listeners if applicablegetClientProperty(String key) Returns the client property set to this property nameReturns the generic type of this property if it is known or nullgetLabel()The label of the property defaults to its name but can be changed to anythinggetName()The property name is immutable and can't be changed after creation it should match the parent field name by conventionvoidputClientProperty(String key, Object o) Places a property that will apply statically to all instances of this propertyvoidRemoves the property change listener from the list of listenersvoidThe label of the property defaults to its name but can be changed to anything, it can be used when binding a property to UI elementsvoidThis method will work when invoked from a propertyChanged callback and should be similar toremovePropertyChangeListener(this).toString()Default toString that provides easier debug informationprotected final voidvalidateCollectionType(Class elementType) Validates that the collection type is valid and throws an exception otherwiseMethods inherited from class Object
clone, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()final ClassgetClass()Returns the runtime class of an object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
ListProperty
-
ListProperty
Constructs a property with the given name and values by specifying the type of the elements explicitly. The element type needs to be specified if the list should contain
PropertyBusinessObjects and needs to get deserialized properly!Parameters
-
name: the name of the property -
elementType: subclass ofPropertyBusinessObject -
values: default values for the property
-
-
ListProperty
Constructs a property with null value
Parameters
name: the name of the property
-
-
Method Details
-
get
Gets the property value
Parameters
offset: the offset within the list
Returns
the property value
-
size
public int size()The size of the property list
Returns
the number of elements
- Specified by:
sizein classCollectionProperty<T,K>
-
set
-
set
Sets the entire content of the property
Parameters
t: the collection of elements to set
Returns
the parent object for chaining
- Specified by:
setin classCollectionProperty<T,K>
-
setList
Historical alias of set(Collection t) Sets the entire content of the property
Parameters
t: the collection of elements to set
Returns
the parent object for chaining
-
add
-
add
-
addAll
Adds a all properties value to the list and fires a change event
Parameters
v: the collection of values to add
- Specified by:
addAllin classCollectionProperty<T,K>
-
remove
Removes the item at the given offset
Parameters
offset: the offset
- Specified by:
removein classCollectionProperty<T,K>
-
remove
-
removeAll
Removes from the list all values from the given collection and fires a change event if the list has changed
Parameters
the: item to remove
- Specified by:
removeAllin classCollectionProperty<T,K>
-
equals
Compares this property to another property
Parameters
obj: the other property
Returns
true if they are equal in name and value
- Overrides:
equalsin classPropertyBase<T,K>
-
hashCode
public int hashCode()Returns the internal hashcode or 0 for null property
Returns
the hashcode value
- Overrides:
hashCodein classPropertyBase<T,K>
-
iterator
-
asList
-
asExplodedList
Returns a copy of the content as a new list but if the value is a PropertyBusinessObject it will be converted to a Map
Returns
a list
- Specified by:
asExplodedListin classCollectionProperty<T,K>
-
clear
public void clear()Remove all the elements from the list- Specified by:
clearin classCollectionProperty<T,K>
-
contains
Returns true if the given element is contained in the list property
Parameters
element: the element
Returns
true if the given element is contained in the list property
- Specified by:
containsin classCollectionProperty<T,K>
-
indexOf
Returns the index of the given element in the list property
Parameters
element: the element
Returns
the index of the given element in the list property
-