public class CollectionPresenter extends Object implements CollectionView.Presenter
| Modifier and Type | Field and Description |
|---|---|
protected CollectionView |
collectionView |
protected Map<String,Map<String,String>> |
instancePropertiesMap
Map used to pair the Map with instance' properties classes with a specific key representing the property, i.e Classname#propertyname (e.g Author#books) |
protected ItemEditingBoxPresenter |
listEditingBoxPresenter |
protected ItemElementPresenter |
listElementPresenter |
protected KeyValueEditingBoxPresenter |
mapEditingBoxPresenter |
protected KeyValueElementPresenter |
mapElementPresenter |
protected com.google.gwt.dom.client.LIElement |
objectSeparatorLI |
protected boolean |
toRemove |
protected ViewsProvider |
viewsProvider |
| Constructor and Description |
|---|
CollectionPresenter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListItem(Map<String,String> propertiesValues)
Creates a new single item element with values taken from given
Map |
void |
addMapItem(Map<String,String> keyPropertiesValues,
Map<String,String> valuePropertiesValues)
Creates a new key/value item element with values taken from given
Map |
protected void |
commonInit(String key,
CollectionView collectionView) |
protected com.google.gwt.json.client.JSONObject |
getJSONObject(String jsonString) |
protected com.google.gwt.json.client.JSONValue |
getJSONValue(String jsonString) |
protected String |
getListValue() |
protected String |
getMapValue() |
void |
initListStructure(String key,
Map<String,String> instancePropertyMap,
CollectionView collectionView)
Actual implementations should invoke this method first to retrieve information about the collection
generic type and the structure of such type
|
void |
initMapStructure(String key,
Map<String,String> keyPropertyMap,
Map<String,String> valuePropertyMap,
CollectionView collectionView)
Actual implementations should invoke this method first to retrieve information about the collection
generic type and the structure of such type
|
void |
onToggleRowExpansion(boolean isShown)
Toggle the expansion of the collection.
|
protected void |
populateList(com.google.gwt.json.client.JSONValue jsonValue) |
protected void |
populateMap(com.google.gwt.json.client.JSONValue jsonValue) |
void |
remove()
Completely remove the given
Collection, i.e. set it to null |
void |
save()
Actual implementations are meant to retrieve the json representation of the content of the
current
CollectionEditorView and save it. |
void |
setValue(String jsonString)
Actual implementations are meant to transform that json representation to a
com.google.gwt.json.client.JSONValue and use that to populate the
current CollectionEditorView |
void |
showEditingBox()
Show the editing box in the current
CollectionEditorView |
void |
toggleEditingStatus(boolean toDisable)
Toggles the status of the addItem button
|
@Inject protected ItemElementPresenter listElementPresenter
@Inject protected KeyValueElementPresenter mapElementPresenter
@Inject protected ViewsProvider viewsProvider
@Inject protected ItemEditingBoxPresenter listEditingBoxPresenter
@Inject protected KeyValueEditingBoxPresenter mapEditingBoxPresenter
protected Map<String,Map<String,String>> instancePropertiesMap
Map used to pair the Map with instance' properties classes with a specific key representing the property, i.e Classname#propertyname (e.g Author#books)protected CollectionView collectionView
protected com.google.gwt.dom.client.LIElement objectSeparatorLI
protected boolean toRemove
public void initListStructure(String key, Map<String,String> instancePropertyMap, CollectionView collectionView)
CollectionView.PresenterinitListStructure in interface CollectionView.Presenterkey - The key representing the property, i.e classname#propertyname (e.g Author#books)public void initMapStructure(String key, Map<String,String> keyPropertyMap, Map<String,String> valuePropertyMap, CollectionView collectionView)
CollectionView.PresenterinitMapStructure in interface CollectionView.Presenterkey - The key representing the property, i.e classname#propertyname (e.g Author#books)public void setValue(String jsonString)
CollectionView.Presentercom.google.gwt.json.client.JSONValue and use that to populate the
current CollectionEditorViewsetValue in interface CollectionView.Presenterpublic void showEditingBox()
CollectionView.PresenterCollectionEditorViewshowEditingBox in interface CollectionView.Presenterpublic void onToggleRowExpansion(boolean isShown)
CollectionView.PresenteronToggleRowExpansion in interface CollectionView.PresenterisShown - the current expansion status of the collectionpublic void addListItem(Map<String,String> propertiesValues)
CollectionView.PresenterMapaddListItem in interface CollectionView.Presenterpublic void addMapItem(Map<String,String> keyPropertiesValues, Map<String,String> valuePropertiesValues)
CollectionView.PresenterMapaddMapItem in interface CollectionView.Presenterpublic void save()
CollectionView.PresenterCollectionEditorView and save it.save in interface CollectionView.Presenterpublic void remove()
CollectionView.PresenterCollection, i.e. set it to nullremove in interface CollectionView.Presenterpublic void toggleEditingStatus(boolean toDisable)
CollectionView.PresentertoggleEditingStatus in interface CollectionView.Presenterprotected void commonInit(String key, CollectionView collectionView)
protected void populateList(com.google.gwt.json.client.JSONValue jsonValue)
protected void populateMap(com.google.gwt.json.client.JSONValue jsonValue)
protected com.google.gwt.json.client.JSONObject getJSONObject(String jsonString)
protected com.google.gwt.json.client.JSONValue getJSONValue(String jsonString)
protected String getListValue()
protected String getMapValue()
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.