|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.ui.form.field.transformer.item.FileTransformer<T>
T
- property type used by the related field.public class FileTransformer<T extends UploadReceiver>
Implementation of a Transformer
that handle a Binary Item instead of a simple property.
Field Summary | |
---|---|
protected String |
basePropertyName
|
protected BasicUploadFieldDefinition |
definition
|
protected String |
i18NPropertyName
|
protected com.vaadin.data.Item |
relatedFormItem
|
protected Class<T> |
type
|
Constructor Summary | |
---|---|
FileTransformer(com.vaadin.data.Item relatedFormItem,
BasicUploadFieldDefinition definition,
Class<T> type)
|
Method Summary | |
---|---|
T |
createPropertyFromItem(com.vaadin.data.Item item)
|
String |
getBasePropertyName()
|
protected String |
getItemName()
Based on the i18n information, define the item name to use. |
Locale |
getLocale()
|
protected com.vaadin.data.Item |
getOrCreateFileItem()
|
protected com.vaadin.data.Property |
getOrCreateProperty(com.vaadin.data.Item item,
String propertyName,
Class<?> type)
Get the required property from the Item, or create it if it does not exist. |
protected info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter |
getRootItem()
Defines the root item used to retrieve and create child items. |
protected List<javax.jcr.Node> |
getStoredChildNodes(info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter parent)
Fetches child nodes of the given parent from JCR, filtered using the NodeUtil.MAGNOLIA_FILTER predicate. |
Class<T> |
getType()
|
protected void |
handleInvalid(T newValue,
com.vaadin.data.Item item)
Handle the related Item in case FileTransformer#isValid(Object, Item) return false. |
boolean |
hasI18NSupport()
Return true if this Property has to support i18n. |
protected T |
initializeUploadReceiver()
|
protected boolean |
isValid(T newValue,
com.vaadin.data.Item item)
|
com.vaadin.data.Item |
populateItem(T newValue,
com.vaadin.data.Item item)
Populate the related Item with the values of 'newItem' in case FileTransformer#isValid(Object, Item) return true. |
protected void |
populateStoredChildItems(info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter rootItem)
Populates the given root item with its child items. |
T |
readFromItem()
Get the stored Item, and based of this Item, return createPropertyFromItem(Item) . |
void |
setI18NPropertyName(String i18nPropertyName)
|
void |
setLocale(Locale locale)
|
void |
writeToItem(T newValue)
Base on the validity of the received property, populate or not the property to the related Item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.vaadin.data.Item relatedFormItem
protected final BasicUploadFieldDefinition definition
protected final Class<T extends UploadReceiver> type
protected String basePropertyName
protected String i18NPropertyName
Constructor Detail |
---|
@Inject public FileTransformer(com.vaadin.data.Item relatedFormItem, BasicUploadFieldDefinition definition, Class<T> type)
Method Detail |
---|
public void writeToItem(T newValue)
FileTransformer#populateItem(Object, Item)
in case FileTransformer#isValid(Object, Item)
return true. FileTransformer#handleInvalid(Object, Item)
.
writeToItem
in interface Transformer<T extends UploadReceiver>
public T readFromItem()
createPropertyFromItem(Item)
.
readFromItem
in interface Transformer<T extends UploadReceiver>
protected com.vaadin.data.Item getOrCreateFileItem()
protected String getItemName()
public T createPropertyFromItem(com.vaadin.data.Item item)
protected T initializeUploadReceiver()
protected boolean isValid(T newValue, com.vaadin.data.Item item)
FileTransformer#populateItem(Object, Item)
.public com.vaadin.data.Item populateItem(T newValue, com.vaadin.data.Item item)
FileTransformer#isValid(Object, Item)
return true.
FileTransformer#writeToItem(Object)}.
protected void handleInvalid(T newValue, com.vaadin.data.Item item)
FileTransformer#isValid(Object, Item)
return false.
FileTransformer#writeToItem(Object)}.
protected com.vaadin.data.Property getOrCreateProperty(com.vaadin.data.Item item, String propertyName, Class<?> type)
protected info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter getRootItem()
protected void populateStoredChildItems(info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter rootItem)
protected List<javax.jcr.Node> getStoredChildNodes(info.magnolia.ui.vaadin.integration.jcr.JcrNodeAdapter parent)
NodeUtil.MAGNOLIA_FILTER
predicate.
public String getBasePropertyName()
getBasePropertyName
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
public Class<T> getType()
getType
in interface Transformer<T extends UploadReceiver>
value
must be assignable
to this type.public boolean hasI18NSupport()
Transformer
hasI18NSupport
in interface Transformer<T extends UploadReceiver>
public void setLocale(Locale locale)
setLocale
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
public void setI18NPropertyName(String i18nPropertyName)
setI18NPropertyName
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
public Locale getLocale()
getLocale
in interface info.magnolia.ui.api.i18n.I18NAwareHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |