Class CollectionViewImpl
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.FocusWidget
-
- org.drools.workbench.screens.scenariosimulation.client.collectioneditor.CollectionViewImpl
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllDragAndDropHandlers,com.google.gwt.event.dom.client.HasAllFocusHandlers,com.google.gwt.event.dom.client.HasAllGestureHandlers,com.google.gwt.event.dom.client.HasAllKeyHandlers,com.google.gwt.event.dom.client.HasAllMouseHandlers,com.google.gwt.event.dom.client.HasAllTouchHandlers,com.google.gwt.event.dom.client.HasBlurHandlers,com.google.gwt.event.dom.client.HasClickHandlers,com.google.gwt.event.dom.client.HasDoubleClickHandlers,com.google.gwt.event.dom.client.HasDragEndHandlers,com.google.gwt.event.dom.client.HasDragEnterHandlers,com.google.gwt.event.dom.client.HasDragHandlers,com.google.gwt.event.dom.client.HasDragLeaveHandlers,com.google.gwt.event.dom.client.HasDragOverHandlers,com.google.gwt.event.dom.client.HasDragStartHandlers,com.google.gwt.event.dom.client.HasDropHandlers,com.google.gwt.event.dom.client.HasFocusHandlers,com.google.gwt.event.dom.client.HasGestureChangeHandlers,com.google.gwt.event.dom.client.HasGestureEndHandlers,com.google.gwt.event.dom.client.HasGestureStartHandlers,com.google.gwt.event.dom.client.HasKeyDownHandlers,com.google.gwt.event.dom.client.HasKeyPressHandlers,com.google.gwt.event.dom.client.HasKeyUpHandlers,com.google.gwt.event.dom.client.HasMouseDownHandlers,com.google.gwt.event.dom.client.HasMouseMoveHandlers,com.google.gwt.event.dom.client.HasMouseOutHandlers,com.google.gwt.event.dom.client.HasMouseOverHandlers,com.google.gwt.event.dom.client.HasMouseUpHandlers,com.google.gwt.event.dom.client.HasMouseWheelHandlers,com.google.gwt.event.dom.client.HasTouchCancelHandlers,com.google.gwt.event.dom.client.HasTouchEndHandlers,com.google.gwt.event.dom.client.HasTouchMoveHandlers,com.google.gwt.event.dom.client.HasTouchStartHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.Focusable,com.google.gwt.user.client.ui.HasEnabled,com.google.gwt.user.client.ui.HasFocus,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.SourcesClickEvents,com.google.gwt.user.client.ui.SourcesFocusEvents,com.google.gwt.user.client.ui.SourcesKeyboardEvents,com.google.gwt.user.client.ui.SourcesMouseEvents,CollectionView,HasCloseCompositeHandler,HasSaveEditorHandler
@Templated public class CollectionViewImpl extends com.google.gwt.user.client.ui.FocusWidget implements HasCloseCompositeHandler, HasSaveEditorHandler, CollectionView
This class is used asCollectioneditorThe overall architecture is:
this widget contains a series of elements
if this widget represent a list, each element will show a single item of it, represented by a
ListEditorElementViewImplif this widget represent a map, each element will show a single entry (key/value) of it, represented by a
MapEditorElementViewImplPropertyEditorViewImplrepresents a single property (label with name and textbox for value)each item/key/value could be a simple java object or a complex one
for complex java object, for each property a
PropertyEditorViewImplwill be createdthe presenter will be responsible to choose which kind of elements are to be populated
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface org.drools.workbench.screens.scenariosimulation.client.collectioneditor.CollectionView
CollectionView.Presenter
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.gwt.dom.client.ButtonElementaddItemButtonprotected com.google.gwt.dom.client.SpanElementaddItemButtonLabelprotected com.google.gwt.dom.client.ButtonElementcancelButtonprotected com.google.gwt.dom.client.ButtonElementcloseCollectionEditorButtonprotected com.google.gwt.dom.client.SpanElementcollectionCreationCreateLabelprotected com.google.gwt.dom.client.SpanElementcollectionCreationCreateSpanprotected com.google.gwt.dom.client.SpanElementcollectionCreationDefineLabelprotected com.google.gwt.dom.client.SpanElementcollectionCreationDefineSpanprotected com.google.gwt.dom.client.LabelElementcollectionCreationModeLabelprotected com.google.gwt.dom.client.DivElementcollectionEditorprotected com.google.gwt.dom.client.DivElementcollectionEditorModalBodyprotected com.google.gwt.dom.client.DivElementcreateCollectionContainerprotected com.google.gwt.dom.client.InputElementcreateCollectionRadioprotected com.google.gwt.dom.client.LabelElementcreateLabelprotected com.google.gwt.dom.client.DivElementdefineCollectionContainerprotected com.google.gwt.dom.client.InputElementdefineCollectionRadioprotected com.google.gwt.dom.client.HeadingElementeditorTitleprotected com.google.gwt.dom.client.UListElementelementsContainerprotected com.google.gwt.dom.client.TextAreaElementexpressionElementprotected com.google.gwt.dom.client.SpanElementfaAngleRightprotected booleanlistWidgetFlag to indicate if thisCollectionEditorViewImplwill manage aListor aMap.protected CollectionPresenterpresenterprotected com.google.gwt.dom.client.SpanElementpropertyTitleprotected com.google.gwt.dom.client.ButtonElementremoveButtonprotected com.google.gwt.dom.client.SpanElementremoveButtonSpanTextprotected com.google.gwt.dom.client.ButtonElementsaveButtonprotected com.google.gwt.dom.client.SpanElementsaveButtonSpanTextprotected org.drools.scenariosimulation.api.model.ScenarioSimulationModel.TypescenarioTypeFlag to indicate if thisCollectionEditorViewImplis opened in DMN or RULE scenarioprotected StringvalueThe json representation of the values of this editor
-
Constructor Summary
Constructors Constructor Description CollectionViewImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistrationaddCloseCompositeEventHandler(CloseCompositeEventHandler handler)Adds aCloseCompositeEventhandler.com.google.gwt.event.shared.HandlerRegistrationaddSaveEditorEventHandler(SaveEditorEventHandler handler)Adds aSaveEditorEventhandler.voidclose()Close the currentCollectionViewprotected voidcommonInit(org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)protected voidenableCreateCollectionContainer(boolean toEnable)voidenableEditingMode(boolean isEditingMode)It enable the view to Editing Mode of the Guided collection editorprotected voidensureExpressionSyntax()com.google.gwt.dom.client.HeadingElementgetEditorTitle()com.google.gwt.dom.client.UListElementgetElementsContainer()StringgetExpression()com.google.gwt.dom.client.SpanElementgetPropertyTitle()StringgetValue()Actual implementations are meant to call thePresenterto retrieve the json representation of their contentsprotected voidinitAndRegisterHandlerForExpressionTextArea()It inits and registers the native "input" , which is not managed by GWTvoidinitListStructure(String key, Map<String,String> simplePropertiesMap, Map<String,Map<String,String>> expandablePropertiesMap, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)Set the name of the property and theMapto be used to create the skeleton of the currentCollectionViewImpleditor showing a List of elementsvoidinitMapStructure(String key, Map<String,String> keyPropertyMap, Map<String,String> valuePropertyMap, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)Set the name of the property and theMapto be used to create the skeleton of the currentCollectionViewImpleditor showing a Map of elementsbooleanisExpressionWidget()Returnstrueif the current instance is managing an user defined expression.booleanisListWidget()Returnstrueif the current instance will manage aList,falsefor aMap.protected booleanisShown()voidonAddItemButton(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonCancelButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonCloseCollectionEditorButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonCreateCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonDefineCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonFaAngleRightClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonRemoveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidonSaveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)voidsetExpression(String expressionValue)voidsetFixedHeight(double value, com.google.gwt.dom.client.Style.Unit unit)voidsetValue(String jsonString)Actual implementations are meant to call thePresenterto be populated by this json representationprotected voidshowAddItemButton(boolean show)protected voidshowCreateCollectionContainer(boolean show)protected voidshowDefineCollectionContainer(boolean show)voidtoggleRowExpansion()protected voidtoggleRowExpansion(boolean toExpand)voidupdateRowExpansionStatus(boolean isShown)Updates the expanded status of main collection container to reflect the status of all contained items, when they have the same expanded statusvoidupdateValue(String value)Updates the json representation of the values shown by this editor-
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
-
-
-
Field Detail
-
presenter
@Inject protected CollectionPresenter presenter
-
collectionEditor
@DataField("collectionEditor") protected com.google.gwt.dom.client.DivElement collectionEditor
-
collectionEditorModalBody
@DataField("collectionEditorModalBody") protected com.google.gwt.dom.client.DivElement collectionEditorModalBody
-
elementsContainer
@DataField("elementsContainer") protected com.google.gwt.dom.client.UListElement elementsContainer
-
closeCollectionEditorButton
@DataField("closeCollectionEditorButton") protected com.google.gwt.dom.client.ButtonElement closeCollectionEditorButton
-
createCollectionRadio
@DataField("createCollectionRadio") protected com.google.gwt.dom.client.InputElement createCollectionRadio
-
defineCollectionRadio
@DataField("defineCollectionRadio") protected com.google.gwt.dom.client.InputElement defineCollectionRadio
-
cancelButton
@DataField("cancelButton") protected com.google.gwt.dom.client.ButtonElement cancelButton
-
removeButton
@DataField("removeButton") protected com.google.gwt.dom.client.ButtonElement removeButton
-
removeButtonSpanText
@DataField("removeButtonSpanText") protected com.google.gwt.dom.client.SpanElement removeButtonSpanText
-
saveButton
@DataField("saveButton") protected com.google.gwt.dom.client.ButtonElement saveButton
-
saveButtonSpanText
@DataField("saveButtonSpanText") protected com.google.gwt.dom.client.SpanElement saveButtonSpanText
-
addItemButton
@DataField("addItemButton") protected com.google.gwt.dom.client.ButtonElement addItemButton
-
editorTitle
@DataField("editorTitle") protected com.google.gwt.dom.client.HeadingElement editorTitle
-
faAngleRight
@DataField("faAngleRight") protected com.google.gwt.dom.client.SpanElement faAngleRight
-
propertyTitle
@DataField("propertyTitle") protected com.google.gwt.dom.client.SpanElement propertyTitle
-
defineCollectionContainer
@DataField("defineCollectionContainer") protected com.google.gwt.dom.client.DivElement defineCollectionContainer
-
createCollectionContainer
@DataField("createCollectionContainer") protected com.google.gwt.dom.client.DivElement createCollectionContainer
-
addItemButtonLabel
@DataField("addItemButtonLabel") protected com.google.gwt.dom.client.SpanElement addItemButtonLabel
-
createLabel
@DataField("createLabel") protected com.google.gwt.dom.client.LabelElement createLabel
-
collectionCreationModeLabel
@DataField("collectionCreationModeLabel") protected com.google.gwt.dom.client.LabelElement collectionCreationModeLabel
-
collectionCreationCreateLabel
@DataField("collectionCreationCreateLabel") protected com.google.gwt.dom.client.SpanElement collectionCreationCreateLabel
-
collectionCreationCreateSpan
@DataField("collectionCreationCreateSpan") protected com.google.gwt.dom.client.SpanElement collectionCreationCreateSpan
-
collectionCreationDefineLabel
@DataField("collectionCreationDefineLabel") protected com.google.gwt.dom.client.SpanElement collectionCreationDefineLabel
-
collectionCreationDefineSpan
@DataField("collectionCreationDefineSpan") protected com.google.gwt.dom.client.SpanElement collectionCreationDefineSpan
-
expressionElement
@DataField("expressionElement") protected com.google.gwt.dom.client.TextAreaElement expressionElement
-
listWidget
protected boolean listWidget
Flag to indicate if thisCollectionEditorViewImplwill manage aListor aMap.
-
scenarioType
protected org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type scenarioType
Flag to indicate if thisCollectionEditorViewImplis opened in DMN or RULE scenario
-
value
protected String value
The json representation of the values of this editor
-
-
Method Detail
-
initListStructure
public void initListStructure(String key, Map<String,String> simplePropertiesMap, Map<String,Map<String,String>> expandablePropertiesMap, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
Set the name of the property and theMapto be used to create the skeleton of the currentCollectionViewImpleditor showing a List of elements- Specified by:
initListStructurein interfaceCollectionView- Parameters:
key- The key representing the property, i.e Classname#propertyname (e.g Author#books)simplePropertiesMap-expandablePropertiesMap-type-
-
initMapStructure
public void initMapStructure(String key, Map<String,String> keyPropertyMap, Map<String,String> valuePropertyMap, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
Set the name of the property and theMapto be used to create the skeleton of the currentCollectionViewImpleditor showing a Map of elements- Specified by:
initMapStructurein interfaceCollectionView- Parameters:
key- The key representing the property, i.e Classname#propertyname (e.g Author#books)keyPropertyMap-valuePropertyMap-type-
-
commonInit
protected void commonInit(org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
-
initAndRegisterHandlerForExpressionTextArea
protected void initAndRegisterHandlerForExpressionTextArea()
It inits and registers the native "input" , which is not managed by GWT
-
addCloseCompositeEventHandler
public com.google.gwt.event.shared.HandlerRegistration addCloseCompositeEventHandler(CloseCompositeEventHandler handler)
Description copied from interface:HasCloseCompositeHandlerAdds aCloseCompositeEventhandler.- Specified by:
addCloseCompositeEventHandlerin interfaceHasCloseCompositeHandler- Parameters:
handler- the handler- Returns:
HandlerRegistrationused to remove this handler
-
addSaveEditorEventHandler
public com.google.gwt.event.shared.HandlerRegistration addSaveEditorEventHandler(SaveEditorEventHandler handler)
Description copied from interface:HasSaveEditorHandlerAdds aSaveEditorEventhandler.- Specified by:
addSaveEditorEventHandlerin interfaceHasSaveEditorHandler- Parameters:
handler- the handler- Returns:
HandlerRegistrationused to remove this handler
-
getValue
public String getValue()
Description copied from interface:CollectionViewActual implementations are meant to call thePresenterto retrieve the json representation of their contents- Specified by:
getValuein interfaceCollectionView- Returns:
- the json representation of the current content
-
setValue
public void setValue(String jsonString)
Description copied from interface:CollectionViewActual implementations are meant to call thePresenterto be populated by this json representation- Specified by:
setValuein interfaceCollectionView
-
isExpressionWidget
public boolean isExpressionWidget()
Description copied from interface:CollectionViewReturnstrueif the current instance is managing an user defined expression.- Specified by:
isExpressionWidgetin interfaceCollectionView
-
isListWidget
public boolean isListWidget()
Description copied from interface:CollectionViewReturnstrueif the current instance will manage aList,falsefor aMap.- Specified by:
isListWidgetin interfaceCollectionView- Returns:
-
getElementsContainer
public com.google.gwt.dom.client.UListElement getElementsContainer()
- Specified by:
getElementsContainerin interfaceCollectionView
-
getEditorTitle
public com.google.gwt.dom.client.HeadingElement getEditorTitle()
- Specified by:
getEditorTitlein interfaceCollectionView
-
getPropertyTitle
public com.google.gwt.dom.client.SpanElement getPropertyTitle()
- Specified by:
getPropertyTitlein interfaceCollectionView
-
getExpression
public String getExpression()
- Specified by:
getExpressionin interfaceCollectionView
-
setExpression
public void setExpression(String expressionValue)
- Specified by:
setExpressionin interfaceCollectionView
-
onCreateCollectionClick
@EventHandler("createCollectionRadio") public void onCreateCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
onDefineCollectionClick
@EventHandler("defineCollectionRadio") public void onDefineCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
enableCreateCollectionContainer
protected void enableCreateCollectionContainer(boolean toEnable)
-
onCloseCollectionEditorButtonClick
@EventHandler("closeCollectionEditorButton") public void onCloseCollectionEditorButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
onCancelButtonClick
@EventHandler("cancelButton") public void onCancelButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
onRemoveButtonClick
@EventHandler("removeButton") public void onRemoveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
onSaveButtonClick
@EventHandler("saveButton") public void onSaveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
onAddItemButton
@EventHandler("addItemButton") public void onAddItemButton(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
onFaAngleRightClick
@EventHandler("faAngleRight") public void onFaAngleRightClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
-
toggleRowExpansion
public void toggleRowExpansion()
- Specified by:
toggleRowExpansionin interfaceCollectionView
-
updateRowExpansionStatus
public void updateRowExpansionStatus(boolean isShown)
Description copied from interface:CollectionViewUpdates the expanded status of main collection container to reflect the status of all contained items, when they have the same expanded status- Specified by:
updateRowExpansionStatusin interfaceCollectionView- Parameters:
isShown- the current expansion status of the collection
-
updateValue
public void updateValue(String value)
Description copied from interface:CollectionViewUpdates the json representation of the values shown by this editor- Specified by:
updateValuein interfaceCollectionView
-
close
public void close()
Description copied from interface:CollectionViewClose the currentCollectionView- Specified by:
closein interfaceCollectionView
-
setFixedHeight
public void setFixedHeight(double value, com.google.gwt.dom.client.Style.Unit unit)- Specified by:
setFixedHeightin interfaceCollectionView
-
enableEditingMode
public void enableEditingMode(boolean isEditingMode)
Description copied from interface:CollectionViewIt enable the view to Editing Mode of the Guided collection editor- Specified by:
enableEditingModein interfaceCollectionView
-
isShown
protected boolean isShown()
-
toggleRowExpansion
protected void toggleRowExpansion(boolean toExpand)
-
ensureExpressionSyntax
protected void ensureExpressionSyntax()
-
showCreateCollectionContainer
protected void showCreateCollectionContainer(boolean show)
-
showDefineCollectionContainer
protected void showDefineCollectionContainer(boolean show)
-
showAddItemButton
protected void showAddItemButton(boolean show)
-
-