public class PropertysetItem extends Object implements Item, Item.PropertySetChangeNotifier, Cloneable
MapItem
can be referenced using locally unique identifiers.
The class supports listeners who are interested in changes to the Property
set managed by the class.Item.Editor, Item.PropertySetChangeListener, Item.PropertySetChangeNotifier, Item.Viewer
Constructor and Description |
---|
PropertysetItem() |
Modifier and Type | Method and Description |
---|---|
boolean |
addItemProperty(Object id,
Property property)
Tries to add a new Property into the Item.
|
void |
addListener(Item.PropertySetChangeListener listener)
Deprecated.
As of 7.0, replaced by
addPropertySetChangeListener(Item.PropertySetChangeListener) |
void |
addPropertySetChangeListener(Item.PropertySetChangeListener listener)
Registers a new property set change listener for this Item.
|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
equals(Object obj) |
Property |
getItemProperty(Object id)
Gets the Property corresponding to the given Property ID stored in the
Item.
|
Collection<?> |
getItemPropertyIds()
Gets the collection of IDs of all Properties stored in the Item.
|
Collection<?> |
getListeners(Class<?> eventType) |
int |
hashCode() |
boolean |
removeItemProperty(Object id)
Removes the Property identified by ID from the Item.
|
void |
removeListener(Item.PropertySetChangeListener listener)
Deprecated.
As of 7.0, replaced by
removePropertySetChangeListener(Item.PropertySetChangeListener) |
void |
removePropertySetChangeListener(Item.PropertySetChangeListener listener)
Removes a previously registered property set change listener.
|
String |
toString()
Gets the
String representation of the contents of the Item. |
public Property getItemProperty(Object id)
null
is
returned.getItemProperty
in interface Item
id
- the identifier of the Property to get.null
public Collection<?> getItemPropertyIds()
getItemPropertyIds
in interface Item
public boolean removeItemProperty(Object id)
false
.removeItemProperty
in interface Item
id
- the ID of the Property to be removed.true
if the operation succeeded false
if notpublic boolean addItemProperty(Object id, Property property)
addItemProperty
in interface Item
id
- the ID of the new Property.property
- the Property to be added and associated with the id.true
if the operation succeeded, false
if notpublic String toString()
String
representation of the contents of the Item.
The format of the string is a space separated catenation of the
String
representations of the Properties contained by the
Item.public void addPropertySetChangeListener(Item.PropertySetChangeListener listener)
addPropertySetChangeListener
in interface Item.PropertySetChangeNotifier
listener
- the new Listener to be registered.@Deprecated public void addListener(Item.PropertySetChangeListener listener)
addPropertySetChangeListener(Item.PropertySetChangeListener)
addListener
in interface Item.PropertySetChangeNotifier
public void removePropertySetChangeListener(Item.PropertySetChangeListener listener)
removePropertySetChangeListener
in interface Item.PropertySetChangeNotifier
listener
- the Listener to be removed.@Deprecated public void removeListener(Item.PropertySetChangeListener listener)
removePropertySetChangeListener(Item.PropertySetChangeListener)
removeListener
in interface Item.PropertySetChangeNotifier
public Collection<?> getListeners(Class<?> eventType)
public Object clone() throws CloneNotSupportedException
The method clone
performs a shallow copy of the
PropertysetItem
.
Note : All arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment, the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation.
clone
in class Object
CloneNotSupportedException
- if the object's class does not support the Cloneable
interface.Object.clone()
Copyright © 2019 Vaadin Ltd. All rights reserved.