public class SingleEntityToDmrBridgeImpl<T> extends Object implements EntityToDmrBridge<T>
| Modifier and Type | Field and Description |
|---|---|
protected AddressBinding |
address |
protected FormMetaData |
attributes |
protected DispatchAsync |
dispatcher |
protected T |
entity |
protected EntityAdapter<T> |
entityAdapter |
protected ApplicationMetaData |
propertyMetaData |
protected Class<? extends T> |
type |
protected FrameworkView |
view |
| Constructor and Description |
|---|
SingleEntityToDmrBridgeImpl(ApplicationMetaData propertyMetaData,
Class<? extends T> type,
FrameworkView view,
DispatchAsync dispatcher) |
| Modifier and Type | Method and Description |
|---|---|
T |
findEntity(String name)
Find the entity given its name.
|
List<T> |
getEntityList()
Get the list of all entities as of the last time loadEntities() was called.
|
String |
getName(T entity)
Get the name of the given entity.
|
String |
getNameOfLastEdited()
Get the name of the Entity just edited/added.
|
void |
loadEntities(String nameEditedOrAdded)
Query the server for the full entity list.
|
void |
loadEntities(String nameEditedOrAdded,
ModelNode baseAddress) |
T |
newEntity()
Create a new entity.
|
void |
onAdd(T entity)
Add the entity from the add form.
|
void |
onCancel()
Cancel an edit
|
void |
onEdit()
Prepare for editing.
|
void |
onRemove(T entity)
Remove the entity in the form.
|
void |
onSaveDetails(T entity,
Map<String,Object> changedValues,
ModelNode... extraSteps)
Save the edited form.
|
protected final AddressBinding address
protected final FormMetaData attributes
protected final DispatchAsync dispatcher
protected final EntityAdapter<T> entityAdapter
protected final ApplicationMetaData propertyMetaData
protected final FrameworkView view
protected T entity
public SingleEntityToDmrBridgeImpl(ApplicationMetaData propertyMetaData, Class<? extends T> type, FrameworkView view, DispatchAsync dispatcher)
public void loadEntities(String nameEditedOrAdded)
EntityToDmrBridgeloadEntities in interface EntityToDmrBridge<T>public void loadEntities(String nameEditedOrAdded, ModelNode baseAddress)
loadEntities in interface EntityToDmrBridge<T>public String getNameOfLastEdited()
EntityToDmrBridgegetNameOfLastEdited in interface EntityToDmrBridge<T>null if no entity has been edited.public List<T> getEntityList()
EntityToDmrBridgegetEntityList in interface EntityToDmrBridge<T>public T findEntity(String name)
EntityToDmrBridgefindEntity in interface EntityToDmrBridge<T>null if not found.public void onAdd(T entity)
EntityToDmrBridgeonAdd in interface EntityToDmrBridge<T>public void onEdit()
EntityToDmrBridgeonEdit in interface EntityToDmrBridge<T>public void onCancel()
EntityToDmrBridgeonCancel in interface EntityToDmrBridge<T>public void onSaveDetails(T entity, Map<String,Object> changedValues, ModelNode... extraSteps)
EntityToDmrBridgeonSaveDetails in interface EntityToDmrBridge<T>entity - the edited entity.changedValues - the changed valuesextraSteps - Extra "step" operations to be added when saving.public void onRemove(T entity)
EntityToDmrBridgeonRemove in interface EntityToDmrBridge<T>entity - the entity to be removedpublic String getName(T entity)
EntityToDmrBridgegetName in interface EntityToDmrBridge<T>entity - The entity.public T newEntity()
EntityToDmrBridgenewEntity in interface EntityToDmrBridge<T>Copyright © 2014 JBoss, a division of Red Hat. All rights reserved.