info.magnolia.ui.vaadin.integration.jcr
Class JcrPropertyAdapter

java.lang.Object
  extended by info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
      extended by info.magnolia.ui.vaadin.integration.jcr.JcrPropertyAdapter
All Implemented Interfaces:
com.vaadin.data.Item, ItemAdapter, JcrItemAdapter, Serializable

public class JcrPropertyAdapter
extends AbstractJcrAdapter

Represents a JCR property as a Vaadin data Item with three fixed properties for its name, type and value.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.data.Item
com.vaadin.data.Item.Editor, com.vaadin.data.Item.PropertySetChangeEvent, com.vaadin.data.Item.PropertySetChangeListener, com.vaadin.data.Item.PropertySetChangeNotifier, com.vaadin.data.Item.Viewer
 
Field Summary
static Set<String> PROPERTY_IDS
           
static String TYPE_PROPERTY
           
static String VALUE_PROPERTY
           
 
Fields inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
UNIDENTIFIED
 
Constructor Summary
JcrPropertyAdapter(javax.jcr.Property jcrProperty)
           
 
Method Summary
 boolean addItemProperty(Object id, com.vaadin.data.Property property)
           
 javax.jcr.Property applyChanges()
          Returns the JCR Item represented by this Item with any changes applied.
 com.vaadin.data.Property getItemProperty(Object id)
           
 Collection<?> getItemPropertyIds()
           
 javax.jcr.Property getJcrItem()
          Returns the JCR Item represented by this adapter, or null in case of RepositoryException.
 boolean isNew()
           
 boolean isNode()
           
 boolean removeItemProperty(Object id)
           
protected  void updateProperty(javax.jcr.Item item, String propertyId, com.vaadin.data.Property property)
          Updates one of the three supported properties or does nothing if the given propertyId is something else.
 
Methods inherited from class info.magnolia.ui.vaadin.integration.jcr.AbstractJcrAdapter
getChangedProperties, getItemId, getRemovedProperties, getWorkspace, hasChangedProperties, initCommonAttributes, setItemId, updateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_PROPERTY

public static final String VALUE_PROPERTY
See Also:
Constant Field Values

TYPE_PROPERTY

public static final String TYPE_PROPERTY
See Also:
Constant Field Values

PROPERTY_IDS

public static final Set<String> PROPERTY_IDS
Constructor Detail

JcrPropertyAdapter

public JcrPropertyAdapter(javax.jcr.Property jcrProperty)
Method Detail

isNode

public boolean isNode()

getJcrItem

public javax.jcr.Property getJcrItem()
Description copied from interface: JcrItemAdapter
Returns the JCR Item represented by this adapter, or null in case of RepositoryException.

Specified by:
getJcrItem in interface JcrItemAdapter
Overrides:
getJcrItem in class AbstractJcrAdapter

applyChanges

public javax.jcr.Property applyChanges()
                                throws javax.jcr.RepositoryException
Description copied from interface: JcrItemAdapter
Returns the JCR Item represented by this Item with any changes applied.

Throws:
javax.jcr.RepositoryException

getItemProperty

public com.vaadin.data.Property getItemProperty(Object id)

getItemPropertyIds

public Collection<?> getItemPropertyIds()

updateProperty

protected void updateProperty(javax.jcr.Item item,
                              String propertyId,
                              com.vaadin.data.Property property)
Updates one of the three supported properties or does nothing if the given propertyId is something else.

Specified by:
updateProperty in class AbstractJcrAdapter

addItemProperty

public boolean addItemProperty(Object id,
                               com.vaadin.data.Property property)

removeItemProperty

public boolean removeItemProperty(Object id)
                           throws UnsupportedOperationException
Throws:
UnsupportedOperationException

isNew

public boolean isNew()
Returns:
true if it's a new Item (not already persisted).


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.