Class 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 as 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

    • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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 showAddItemButton​(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
      • 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
      • Methods inherited from interface com.google.gwt.event.shared.HasHandlers

        fireEvent
    • Field Detail

      • 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 this CollectionEditorViewImpl will manage a List or a Map.
      • scenarioType

        protected org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type scenarioType
        Flag to indicate if this CollectionEditorViewImpl is opened in DMN or RULE scenario
      • value

        protected String value
        The json representation of the values of this editor
    • Constructor Detail

      • CollectionViewImpl

        public CollectionViewImpl()
    • 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 the Map to be used to create the skeleton of the current CollectionViewImpl editor showing a List of elements
        Specified by:
        initListStructure in interface CollectionView
        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 the Map to be used to create the skeleton of the current CollectionViewImpl editor showing a Map of elements
        Specified by:
        initMapStructure in interface CollectionView
        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
      • getValue

        public String getValue()
        Description copied from interface: CollectionView
        Actual implementations are meant to call the Presenter to retrieve the json representation of their contents
        Specified by:
        getValue in interface CollectionView
        Returns:
        the json representation of the current content
      • setValue

        public void setValue​(String jsonString)
        Description copied from interface: CollectionView
        Actual implementations are meant to call the Presenter to be populated by this json representation
        Specified by:
        setValue in interface CollectionView
      • isExpressionWidget

        public boolean isExpressionWidget()
        Description copied from interface: CollectionView
        Returns true if the current instance is managing an user defined expression.
        Specified by:
        isExpressionWidget in interface CollectionView
      • isListWidget

        public boolean isListWidget()
        Description copied from interface: CollectionView
        Returns true if the current instance will manage a List, false for a Map.
        Specified by:
        isListWidget in interface CollectionView
        Returns:
      • getEditorTitle

        public com.google.gwt.dom.client.HeadingElement getEditorTitle()
        Specified by:
        getEditorTitle in interface CollectionView
      • 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)
      • updateRowExpansionStatus

        public void updateRowExpansionStatus​(boolean isShown)
        Description copied from interface: CollectionView
        Updates the expanded status of main collection container to reflect the status of all contained items, when they have the same expanded status
        Specified by:
        updateRowExpansionStatus in interface CollectionView
        Parameters:
        isShown - the current expansion status of the collection
      • updateValue

        public void updateValue​(String value)
        Description copied from interface: CollectionView
        Updates the json representation of the values shown by this editor
        Specified by:
        updateValue in interface CollectionView
      • setFixedHeight

        public void setFixedHeight​(double value,
                                   com.google.gwt.dom.client.Style.Unit unit)
        Specified by:
        setFixedHeight in interface CollectionView
      • enableEditingMode

        public void enableEditingMode​(boolean isEditingMode)
        Description copied from interface: CollectionView
        It enable the view to Editing Mode of the Guided collection editor
        Specified by:
        enableEditingMode in interface CollectionView
      • 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)