public class CollectionPresenter extends Object implements CollectionView.Presenter
| Modifier and Type | Field and Description |
|---|---|
protected CollectionView |
collectionView |
protected ConfirmPopupPresenter |
confirmPopupPresenter |
protected Map<String,Map<String,Map<String,String>>> |
expandablePropertiesMap
Map used to pair the Map with instance' expandable 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 ScenarioConfirmationPopupPresenter |
scenarioConfirmationPopupPresenter |
protected Map<String,Map<String,String>> |
simplePropertiesMap
Map used to pair the Map with instance' simple properties classes with a specific key representing the property, i.e Classname#propertyname (e.g Author#books) |
protected ViewsProvider |
viewsProvider |
| Constructor and Description |
|---|
CollectionPresenter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListItem(Map<String,String> simplePropertiesValues,
Map<String,Map<String,String>> expandablePropertiesValues)
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 Map<String,Map<String,String>> |
getExpandablePropertiesValues(com.google.gwt.json.client.JSONObject jsonObject) |
protected String |
getExpressionValue() |
protected com.google.gwt.json.client.JSONObject |
getJSONObject(Map<String,String> properties)
Translates a
Map to a JSONObject |
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() |
protected Map<String,String> |
getSimplePropertiesMap(com.google.gwt.json.client.JSONObject jsonObject) |
protected String |
getValueFromCreateCollection()
It gets the guided "Create Collection" editor
|
void |
initListStructure(String key,
Map<String,String> simplePropertiesMap,
Map<String,Map<String,String>> expandablePropertiesMap,
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
|
protected void |
okRemoveCommandMethod() |
void |
onToggleRowExpansion(boolean isShown)
Toggle the expansion of the items included in the collection.
|
protected void |
populateCreateCollection(com.google.gwt.json.client.JSONValue value)
It populates the guided "Create Collection" editor
|
protected void |
populateExpression(com.google.gwt.json.client.JSONValue jsonValue) |
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 editingStatus)
Toggles the status of the addItem button
|
void |
updateRowExpansionStatus(boolean isShown)
Updates the expanded status of main collection container to reflect
the status of all contained items, when they have the same expanded status
|
@Inject protected ItemElementPresenter listElementPresenter
@Inject protected KeyValueElementPresenter mapElementPresenter
@Inject protected ViewsProvider viewsProvider
@Inject protected ItemEditingBoxPresenter listEditingBoxPresenter
@Inject protected KeyValueEditingBoxPresenter mapEditingBoxPresenter
@Inject protected ScenarioConfirmationPopupPresenter scenarioConfirmationPopupPresenter
@Inject protected ConfirmPopupPresenter confirmPopupPresenter
protected Map<String,Map<String,String>> simplePropertiesMap
Map used to pair the Map with instance' simple properties classes with a specific key representing the property, i.e Classname#propertyname (e.g Author#books)protected Map<String,Map<String,Map<String,String>>> expandablePropertiesMap
Map used to pair the Map with instance' expandable properties classes with a specific key representing the property, i.e Classname#propertyname (e.g Author#books)protected CollectionView collectionView
public void initListStructure(String key, Map<String,String> simplePropertiesMap, Map<String,Map<String,String>> expandablePropertiesMap, 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.Presenterprotected void populateCreateCollection(com.google.gwt.json.client.JSONValue value)
value - public 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 updateRowExpansionStatus(boolean isShown)
CollectionView.PresenterupdateRowExpansionStatus in interface CollectionView.PresenterisShown - the current expansion status of the collectionpublic void addListItem(Map<String,String> simplePropertiesValues, Map<String,Map<String,String>> expandablePropertiesValues)
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.Presenterprotected String getValueFromCreateCollection()
public void remove()
CollectionView.PresenterCollection, i.e. set it to nullremove in interface CollectionView.Presenterpublic void toggleEditingStatus(boolean editingStatus)
CollectionView.PresentertoggleEditingStatus in interface CollectionView.Presenterprotected void okRemoveCommandMethod()
protected 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 void populateExpression(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 getExpressionValue()
protected String getListValue()
protected com.google.gwt.json.client.JSONObject getJSONObject(Map<String,String> properties)
Map to a JSONObjectproperties - protected Map<String,String> getSimplePropertiesMap(com.google.gwt.json.client.JSONObject jsonObject)
jsonObject - Map with propertyName/propertyValueprotected Map<String,Map<String,String>> getExpandablePropertiesValues(com.google.gwt.json.client.JSONObject jsonObject)
jsonObject - Map where the key is the name of the complex property, and the value is a a Map with
the nested propertyName/propertyValueprotected String getMapValue()
Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.