Class PropertyPresenter
- java.lang.Object
-
- org.drools.workbench.screens.scenariosimulation.client.collectioneditor.PropertyPresenter
-
- All Implemented Interfaces:
PropertyView.Presenter
public class PropertyPresenter extends Object implements PropertyView.Presenter
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,com.google.gwt.dom.client.SpanElement>propertySpanElementMapMapto pair a given property with theSpanElementshowing its valueprotected Map<String,List<PropertyView>>propertyViewMapMapto pair a given itemId with itsPropertyEditorViewsprotected ViewsProviderviewsProvider
-
Constructor Summary
Constructors Constructor Description PropertyPresenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteProperties(String itemId)Remove all the properties belonging to the given baseNodeId from bothDOMand internalMapprotected voiddeletePropertyView(PropertyView toDelete)voideditProperties(String itemId)Show theInputElements to edit the properties shown at the given baseNodeId and hide theirSpanElementscom.google.gwt.dom.client.LIElementgetEditingPropertyFields(String itemId, String propertyName, String propertyValue)com.google.gwt.dom.client.LIElementgetPropertyFields(String itemId, String propertyName, String propertyValue)StringgetPropertyValue(String propertyName)Get the text shown in the property valueMap<String,String>getSimpleProperties(String itemId)Retrieve the simple properties shown at the given itemIdvoidonToggleRowExpansion(String itemId, boolean isShown)protected voidstartEditPropertyView(PropertyView toEdit)Enable editing a propertyprotected Map<String,String>stopEdit(String itemId, boolean toUpdate)voidstopEditProperties(String itemId)Show theSpanElements of the properties shown at the given baseNodeId without change their values, and and hide theirInputElementsprotected voidstopEditPropertyView(Map<String,String> toPopulate, PropertyView toStopEdit, boolean toUpdate)Disable editing a property and put its value in givenMapMap<String,String>updateProperties(String itemId)Show theSpanElements of the properties shown at the given baseNodeId with the value of theirInputElements, and hide the latters
-
-
-
Field Detail
-
viewsProvider
@Inject protected ViewsProvider viewsProvider
-
propertySpanElementMap
protected Map<String,com.google.gwt.dom.client.SpanElement> propertySpanElementMap
Mapto pair a given property with theSpanElementshowing its value
-
propertyViewMap
protected Map<String,List<PropertyView>> propertyViewMap
Mapto pair a given itemId with itsPropertyEditorViews
-
-
Method Detail
-
getPropertyValue
public String getPropertyValue(String propertyName) throws Exception
Description copied from interface:PropertyView.PresenterGet the text shown in the property value- Specified by:
getPropertyValuein interfacePropertyView.Presenter- Parameters:
propertyName- the property fro which we are retrieving the value- Returns:
- Throws:
Exception- if the given property value is not found
-
editProperties
public void editProperties(String itemId)
Description copied from interface:PropertyView.PresenterShow theInputElements to edit the properties shown at the given baseNodeId and hide theirSpanElements- Specified by:
editPropertiesin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement
-
stopEditProperties
public void stopEditProperties(String itemId)
Description copied from interface:PropertyView.PresenterShow theSpanElements of the properties shown at the given baseNodeId without change their values, and and hide theirInputElements- Specified by:
stopEditPropertiesin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement
-
updateProperties
public Map<String,String> updateProperties(String itemId)
Description copied from interface:PropertyView.PresenterShow theSpanElements of the properties shown at the given baseNodeId with the value of theirInputElements, and hide the latters- Specified by:
updatePropertiesin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement- Returns:
- the map with updated values
-
getSimpleProperties
public Map<String,String> getSimpleProperties(String itemId)
Description copied from interface:PropertyView.PresenterRetrieve the simple properties shown at the given itemId- Specified by:
getSimplePropertiesin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement- Returns:
- the map with updated values
-
getPropertyFields
public com.google.gwt.dom.client.LIElement getPropertyFields(String itemId, String propertyName, String propertyValue)
- Specified by:
getPropertyFieldsin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement- Returns:
- the
LIElementcontaining the property' fields
-
getEditingPropertyFields
public com.google.gwt.dom.client.LIElement getEditingPropertyFields(String itemId, String propertyName, String propertyValue)
- Specified by:
getEditingPropertyFieldsin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement- Returns:
- the
LIElementcontaining the property' fields in editing mode
-
onToggleRowExpansion
public void onToggleRowExpansion(String itemId, boolean isShown)
- Specified by:
onToggleRowExpansionin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElementisShown-trueit the item is currently shown
-
deleteProperties
public void deleteProperties(String itemId)
Description copied from interface:PropertyView.PresenterRemove all the properties belonging to the given baseNodeId from bothDOMand internalMap- Specified by:
deletePropertiesin interfacePropertyView.Presenter- Parameters:
itemId- the id of the item containing theLIElement
-
startEditPropertyView
protected void startEditPropertyView(PropertyView toEdit)
Enable editing a property- Parameters:
toEdit-
-
stopEditPropertyView
protected void stopEditPropertyView(Map<String,String> toPopulate, PropertyView toStopEdit, boolean toUpdate)
Disable editing a property and put its value in givenMap- Parameters:
toPopulate-toStopEdit-toUpdate-
-
deletePropertyView
protected void deletePropertyView(PropertyView toDelete)
-
-