public class EntityToDmrBridgeImpl<T extends NamedEntity> extends Object implements EntityToDmrBridge<T>
| Modifier and Type | Field and Description |
|---|---|
protected AddressBinding |
address |
protected BeanMetaData |
beanMetaData |
protected DispatchAsync |
dispatcher |
protected EntityAdapter<T> |
entityAdapter |
protected Comparator |
entityComparator |
protected List<T> |
entityList |
protected FormMetaData |
formMetaData |
protected String |
nameOfLastEdited |
protected ApplicationMetaData |
propertyMetadata |
protected Class<?> |
type |
protected FrameworkView |
view |
| Constructor and Description |
|---|
EntityToDmrBridgeImpl(ApplicationMetaData propertyMetadata,
Class<? extends T> type,
FrameworkView view,
DispatchAsync dispatcher)
Create a new EntityToDmrBridgeImpl.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
execute(ModelNode operation,
String nameEditedOrAdded,
String successMessage) |
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.
|
protected ModelNode |
getResourceAddress(String name) |
void |
loadEntities(String nameEditedOrAdded)
Query the server for the full entity list.
|
void |
loadEntities(String nameEditedOrAdded,
ModelNode baseAddress) |
T |
newEntity()
Make a new Entity WITH ITS DEFAULT VALUES SET.
|
void |
onAdd(T entity)
Add the entity from the add form.
|
void |
onCancel()
Cancel an edit
|
void |
onEdit()
Prepare for editing.
|
protected void |
onLoadEntitiesSuccess(ModelNode response) |
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 void |
refreshView(ModelNode response)
Overriding this method allows a subclass to modify entities before the view is refreshed.
|
protected List<T> |
sortEntities(List<T> entities) |
protected ApplicationMetaData propertyMetadata
protected BeanMetaData beanMetaData
protected AddressBinding address
protected final Class<?> type
protected EntityAdapter<T extends NamedEntity> entityAdapter
protected DispatchAsync dispatcher
protected FrameworkView view
protected FormMetaData formMetaData
protected List<T extends NamedEntity> entityList
protected String nameOfLastEdited
protected Comparator entityComparator
public EntityToDmrBridgeImpl(ApplicationMetaData propertyMetadata, Class<? extends T> type, FrameworkView view, DispatchAsync dispatcher)
propertyMetadata - The main ApplicationMetaData object.type - The class that this bridge knows how to handle.view - The view that will receive FrameworkView callbacks.dispatcher - The dispatcher for sending commands to the server.public T newEntity()
newEntity in interface EntityToDmrBridge<T extends NamedEntity>public T findEntity(String name)
EntityToDmrBridgefindEntity in interface EntityToDmrBridge<T extends NamedEntity>null if not found.public List<T> getEntityList()
EntityToDmrBridgegetEntityList in interface EntityToDmrBridge<T extends NamedEntity>public String getName(T entity)
EntityToDmrBridgegetName in interface EntityToDmrBridge<T extends NamedEntity>entity - The entity.public String getNameOfLastEdited()
EntityToDmrBridgegetNameOfLastEdited in interface EntityToDmrBridge<T extends NamedEntity>null if no entity has been edited.public void onAdd(T entity)
EntityToDmrBridgeonAdd in interface EntityToDmrBridge<T extends NamedEntity>public void onEdit()
EntityToDmrBridgeonEdit in interface EntityToDmrBridge<T extends NamedEntity>public void onCancel()
EntityToDmrBridgeonCancel in interface EntityToDmrBridge<T extends NamedEntity>public void onRemove(T entity)
EntityToDmrBridgeonRemove in interface EntityToDmrBridge<T extends NamedEntity>entity - the entity to be removedpublic void onSaveDetails(T entity, Map<String,Object> changedValues, ModelNode... extraSteps)
EntityToDmrBridgeonSaveDetails in interface EntityToDmrBridge<T extends NamedEntity>entity - the edited entity.changedValues - the changed valuesextraSteps - Extra "step" operations to be added when saving.public void loadEntities(String nameEditedOrAdded)
EntityToDmrBridgeloadEntities in interface EntityToDmrBridge<T extends NamedEntity>public void loadEntities(String nameEditedOrAdded, ModelNode baseAddress)
loadEntities in interface EntityToDmrBridge<T extends NamedEntity>protected void onLoadEntitiesSuccess(ModelNode response)
protected void refreshView(ModelNode response)
Copyright © 2014 JBoss, a division of Red Hat. All rights reserved.