@Templated public class CollectionViewImpl extends com.google.gwt.user.client.ui.FocusWidget implements HasCloseCompositeHandler, HasSaveEditorHandler, CollectionView
Collection
editor
The 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 ListEditorElementViewImpl
if this widget represent a map, each element will show a single entry (key/value) of it, represented by a MapEditorElementViewImpl
PropertyEditorViewImpl
represents 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 PropertyEditorViewImpl
will be created
the presenter will be responsible to choose which kind of elements are to be populated
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
CollectionView.Presenter
Modifier and Type | Field and Description |
---|---|
protected com.google.gwt.dom.client.ButtonElement |
addItemButton |
protected com.google.gwt.dom.client.DivElement |
addItemButtonContainer |
protected com.google.gwt.dom.client.SpanElement |
addItemButtonLabel |
protected com.google.gwt.dom.client.ButtonElement |
cancelButton |
protected com.google.gwt.dom.client.ButtonElement |
closeCollectionEditorButton |
protected com.google.gwt.dom.client.SpanElement |
collectionCreationCreateLabel |
protected com.google.gwt.dom.client.SpanElement |
collectionCreationCreateSpan |
protected com.google.gwt.dom.client.SpanElement |
collectionCreationDefineLabel |
protected com.google.gwt.dom.client.SpanElement |
collectionCreationDefineSpan |
protected com.google.gwt.dom.client.LabelElement |
collectionCreationModeLabel |
protected com.google.gwt.dom.client.DivElement |
collectionEditor |
protected com.google.gwt.dom.client.DivElement |
collectionEditorModalBody |
protected com.google.gwt.dom.client.DivElement |
createCollectionContainer |
protected com.google.gwt.dom.client.InputElement |
createCollectionRadio |
protected com.google.gwt.dom.client.LabelElement |
createLabel |
protected com.google.gwt.dom.client.DivElement |
defineCollectionContainer |
protected com.google.gwt.dom.client.InputElement |
defineCollectionRadio |
protected com.google.gwt.dom.client.HeadingElement |
editorTitle |
protected com.google.gwt.dom.client.UListElement |
elementsContainer |
protected com.google.gwt.dom.client.TextAreaElement |
expressionElement |
protected com.google.gwt.dom.client.SpanElement |
faAngleRight |
protected boolean |
listWidget
Flag to indicate if this
CollectionEditorViewImpl will manage a List or a Map . |
protected CollectionPresenter |
presenter |
protected com.google.gwt.dom.client.SpanElement |
propertyTitle |
protected com.google.gwt.dom.client.ButtonElement |
removeButton |
protected com.google.gwt.dom.client.ButtonElement |
saveButton |
protected org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type |
scenarioType
Flag to indicate if this
CollectionEditorViewImpl is opened in DMN or RULE scenario |
protected String |
value
The json representation of the values of this editor
|
Constructor and Description |
---|
CollectionViewImpl() |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addCloseCompositeEventHandler(CloseCompositeEventHandler handler)
Adds a
CloseCompositeEvent handler. |
com.google.gwt.event.shared.HandlerRegistration |
addSaveEditorEventHandler(SaveEditorEventHandler handler)
Adds a
SaveEditorEvent handler. |
void |
close()
Close the current
CollectionView |
protected void |
commonInit(org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type) |
protected void |
enableCreateCollectionContainer(boolean toEnable) |
void |
enableEditingMode(boolean isEditingMode)
It enable the view to Editing Mode of the Guided collection editor
|
protected void |
ensureExpressionSyntax() |
com.google.gwt.dom.client.HeadingElement |
getEditorTitle() |
com.google.gwt.dom.client.UListElement |
getElementsContainer() |
String |
getExpression() |
com.google.gwt.dom.client.SpanElement |
getPropertyTitle() |
String |
getValue()
Actual implementations are meant to call the
Presenter to retrieve the json representation of their contents |
protected void |
initAndRegisterHandlerForExpressionTextArea()
It inits and registers the native "input" , which is not managed by GWT
|
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 the
Map to be used to create the skeleton of the current CollectionViewImpl editor
showing a List of elements |
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 the
Map to be used to create the skeleton of the current CollectionViewImpl editor
showing a Map of elements |
boolean |
isExpressionWidget()
Returns
true if the current instance is managing an user defined expression. |
boolean |
isListWidget()
Returns
true if the current instance will manage a List ,
false for a Map . |
protected boolean |
isShown() |
void |
onAddItemButton(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onCancelButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onCloseCollectionEditorButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onCreateCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onDefineCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onFaAngleRightClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onRemoveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
onSaveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent) |
void |
setExpression(String expressionValue) |
void |
setFixedHeight(double value,
com.google.gwt.dom.client.Style.Unit unit) |
void |
setValue(String jsonString)
Actual implementations are meant to call the
Presenter to be populated by this json representation |
protected void |
showAddItemButtonContainer(boolean show) |
protected void |
showCreateCollectionContainer(boolean show) |
protected void |
showDefineCollectionContainer(boolean show) |
void |
toggleRowExpansion() |
protected void |
toggleRowExpansion(boolean toExpand) |
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
|
void |
updateValue(String value)
Updates the json representation of the values shown by this editor
|
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
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
@Inject protected CollectionPresenter presenter
@DataField(value="collectionEditor") protected com.google.gwt.dom.client.DivElement collectionEditor
@DataField(value="collectionEditorModalBody") protected com.google.gwt.dom.client.DivElement collectionEditorModalBody
@DataField(value="elementsContainer") protected com.google.gwt.dom.client.UListElement elementsContainer
@DataField(value="closeCollectionEditorButton") protected com.google.gwt.dom.client.ButtonElement closeCollectionEditorButton
@DataField(value="addItemButtonContainer") protected com.google.gwt.dom.client.DivElement addItemButtonContainer
@DataField(value="createCollectionRadio") protected com.google.gwt.dom.client.InputElement createCollectionRadio
@DataField(value="defineCollectionRadio") protected com.google.gwt.dom.client.InputElement defineCollectionRadio
@DataField(value="cancelButton") protected com.google.gwt.dom.client.ButtonElement cancelButton
@DataField(value="removeButton") protected com.google.gwt.dom.client.ButtonElement removeButton
@DataField(value="saveButton") protected com.google.gwt.dom.client.ButtonElement saveButton
@DataField(value="addItemButton") protected com.google.gwt.dom.client.ButtonElement addItemButton
@DataField(value="editorTitle") protected com.google.gwt.dom.client.HeadingElement editorTitle
@DataField(value="faAngleRight") protected com.google.gwt.dom.client.SpanElement faAngleRight
@DataField(value="propertyTitle") protected com.google.gwt.dom.client.SpanElement propertyTitle
@DataField(value="defineCollectionContainer") protected com.google.gwt.dom.client.DivElement defineCollectionContainer
@DataField(value="createCollectionContainer") protected com.google.gwt.dom.client.DivElement createCollectionContainer
@DataField(value="addItemButtonLabel") protected com.google.gwt.dom.client.SpanElement addItemButtonLabel
@DataField(value="createLabel") protected com.google.gwt.dom.client.LabelElement createLabel
@DataField(value="collectionCreationModeLabel") protected com.google.gwt.dom.client.LabelElement collectionCreationModeLabel
@DataField(value="collectionCreationCreateLabel") protected com.google.gwt.dom.client.SpanElement collectionCreationCreateLabel
@DataField(value="collectionCreationCreateSpan") protected com.google.gwt.dom.client.SpanElement collectionCreationCreateSpan
@DataField(value="collectionCreationDefineLabel") protected com.google.gwt.dom.client.SpanElement collectionCreationDefineLabel
@DataField(value="collectionCreationDefineSpan") protected com.google.gwt.dom.client.SpanElement collectionCreationDefineSpan
@DataField(value="expressionElement") protected com.google.gwt.dom.client.TextAreaElement expressionElement
protected boolean listWidget
CollectionEditorViewImpl
will manage a List
or a Map
.protected org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type scenarioType
CollectionEditorViewImpl
is opened in DMN or RULE scenarioprotected String value
public void initListStructure(String key, Map<String,String> simplePropertiesMap, Map<String,Map<String,String>> expandablePropertiesMap, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
Map
to be used to create the skeleton of the current CollectionViewImpl
editor
showing a List of elementsinitListStructure
in interface CollectionView
key
- The key representing the property, i.e Classname#propertyname (e.g Author#books)simplePropertiesMap
- expandablePropertiesMap
- type
- public void initMapStructure(String key, Map<String,String> keyPropertyMap, Map<String,String> valuePropertyMap, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
Map
to be used to create the skeleton of the current CollectionViewImpl
editor
showing a Map of elementsinitMapStructure
in interface CollectionView
key
- The key representing the property, i.e Classname#propertyname (e.g Author#books)keyPropertyMap
- valuePropertyMap
- type
- protected void commonInit(org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
protected void initAndRegisterHandlerForExpressionTextArea()
public com.google.gwt.event.shared.HandlerRegistration addCloseCompositeEventHandler(CloseCompositeEventHandler handler)
HasCloseCompositeHandler
CloseCompositeEvent
handler.addCloseCompositeEventHandler
in interface HasCloseCompositeHandler
handler
- the handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addSaveEditorEventHandler(SaveEditorEventHandler handler)
HasSaveEditorHandler
SaveEditorEvent
handler.addSaveEditorEventHandler
in interface HasSaveEditorHandler
handler
- the handlerHandlerRegistration
used to remove this handlerpublic String getValue()
CollectionView
Presenter
to retrieve the json representation of their contentsgetValue
in interface CollectionView
public void setValue(String jsonString)
CollectionView
Presenter
to be populated by this json representationsetValue
in interface CollectionView
public boolean isExpressionWidget()
CollectionView
true
if the current instance is managing an user defined expression.isExpressionWidget
in interface CollectionView
public boolean isListWidget()
CollectionView
true
if the current instance will manage a List
,
false
for a Map
.isListWidget
in interface CollectionView
public com.google.gwt.dom.client.UListElement getElementsContainer()
getElementsContainer
in interface CollectionView
public com.google.gwt.dom.client.HeadingElement getEditorTitle()
getEditorTitle
in interface CollectionView
public com.google.gwt.dom.client.SpanElement getPropertyTitle()
getPropertyTitle
in interface CollectionView
public String getExpression()
getExpression
in interface CollectionView
public void setExpression(String expressionValue)
setExpression
in interface CollectionView
@EventHandler(value="createCollectionRadio") public void onCreateCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
@EventHandler(value="defineCollectionRadio") public void onDefineCollectionClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
protected void enableCreateCollectionContainer(boolean toEnable)
@EventHandler(value="closeCollectionEditorButton") public void onCloseCollectionEditorButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
@EventHandler(value="cancelButton") public void onCancelButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
@EventHandler(value="removeButton") public void onRemoveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
@EventHandler(value="saveButton") public void onSaveButtonClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
@EventHandler(value="addItemButton") public void onAddItemButton(com.google.gwt.event.dom.client.ClickEvent clickEvent)
@EventHandler(value="faAngleRight") public void onFaAngleRightClick(com.google.gwt.event.dom.client.ClickEvent clickEvent)
public void toggleRowExpansion()
toggleRowExpansion
in interface CollectionView
public void updateRowExpansionStatus(boolean isShown)
CollectionView
updateRowExpansionStatus
in interface CollectionView
isShown
- the current expansion status of the collectionpublic void updateValue(String value)
CollectionView
updateValue
in interface CollectionView
public void close()
CollectionView
CollectionView
close
in interface CollectionView
public void setFixedHeight(double value, com.google.gwt.dom.client.Style.Unit unit)
setFixedHeight
in interface CollectionView
public void enableEditingMode(boolean isEditingMode)
CollectionView
enableEditingMode
in interface CollectionView
protected boolean isShown()
protected void toggleRowExpansion(boolean toExpand)
protected void ensureExpressionSyntax()
protected void showCreateCollectionContainer(boolean show)
protected void showDefineCollectionContainer(boolean show)
protected void showAddItemButtonContainer(boolean show)
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.