Class AbstractSelectedColumnCommand

    • Field Detail

      • factMappingValueType

        protected org.drools.scenariosimulation.api.model.FactMappingValueType factMappingValueType
    • Constructor Detail

      • AbstractSelectedColumnCommand

        protected AbstractSelectedColumnCommand​(GridWidget gridWidget,
                                                org.drools.scenariosimulation.api.model.FactMappingValueType factMappingValueType)
    • Method Detail

      • insertNewColumn

        protected ScenarioGridColumn insertNewColumn​(ScenarioSimulationContext context,
                                                     ScenarioGridColumn selectedColumn,
                                                     int columnPosition,
                                                     boolean cloneInstance)
        It inserts a new ScenarioGridColumn in ScenarioGridModel
        Parameters:
        context - It contains the Context inside which the commands will be executed
        selectedColumn - The selected ScenarioGridColumn where the command was launched
        columnPosition - Used to define in which position the new column should be added
        cloneInstance - If true, it create a new column inside the same instance of the selected column
        Returns:
        The created ScenarioGridColumn
      • setInstanceHeader

        protected void setInstanceHeader​(ScenarioSimulationContext context,
                                         ScenarioGridColumn selectedColumn,
                                         String alias,
                                         String fullClassName)
        Sets the instance header for a ScenarioSimulationContext.
        Parameters:
        context - It contains the Context inside which the commands will be executed
        selectedColumn - The selected ScenarioGridColumn where the command was launched
      • getSelectedColumn

        protected Optional<ScenarioGridColumn> getSelectedColumn​(ScenarioSimulationContext context)
        Returns an Optional for a ScenarioSimulationContext.
        Parameters:
        context - It contains the Context inside which the commands will be executed
        Returns:
      • getFullPackage

        protected String getFullPackage​(ScenarioSimulationContext context)
        Returns the full package String of a ScenarioSimulationContext.
        Parameters:
        context -
        Returns:
      • setEditableHeadersAndGetFactIdentifier

        protected org.drools.scenariosimulation.api.model.FactIdentifier setEditableHeadersAndGetFactIdentifier​(ScenarioSimulationContext context,
                                                                                                                ScenarioGridColumn selectedColumn,
                                                                                                                String aliasName,
                                                                                                                String canonicalClassName)
        Sets the editable headers on a given ScenarioGridColumn and returns a FactIdentifier.
        Parameters:
        context -
        selectedColumn -
        aliasName -
        canonicalClassName -
        Returns:
      • setInstanceHeaderMetaData

        protected void setInstanceHeaderMetaData​(ScenarioGridColumn selectedColumn,
                                                 String aliasName,
                                                 org.drools.scenariosimulation.api.model.FactIdentifier factIdentifier)
        Sets the metadata for an instance header on a given ScenarioGridColumn.
        Parameters:
        selectedColumn - The selected ScenarioGridColumn where the command was launched
        aliasName - The title to assign to the selected column
        factIdentifier - The FactIdentifier to assign to the selected column
      • setPropertyHeader

        protected void setPropertyHeader​(ScenarioSimulationContext context,
                                         ScenarioGridColumn selectedColumn,
                                         String canonicalClassName,
                                         List<String> propertyNameElements,
                                         String propertyClass)
        It assigns a property to the selected ScenarioGridColumn
        Parameters:
        context - It contains the Context inside which the commands will be executed
        selectedColumn - The selected ScenarioGridColumn where the command was launched
        propertyNameElements - The List with the path instance_name.property.name (eg. Author.isAlive)
        propertyClass - it contains the full classname of the property (eg. com.Author)
      • setPropertyHeader

        protected void setPropertyHeader​(ScenarioSimulationContext context,
                                         ScenarioGridColumn selectedColumn,
                                         String canonicalClassName,
                                         List<String> propertyNameElements,
                                         String propertyClass,
                                         String propertyTitle)
        It assigns a property to the selected ScenarioGridColumn
        Parameters:
        context - It contains the Context inside which the commands will be executed
        selectedColumn - The selected ScenarioGridColumn where the command was launched
        propertyNameElements - The List with the path instance_name.property.name (eg. Author.isAlive)
        propertyClass - it contains the full classname of the property (eg. com.Author)
        propertyTitle - The title to assign to this property.
      • setPropertyHeader

        protected void setPropertyHeader​(ScenarioSimulationContext context,
                                         ScenarioGridColumn selectedColumn,
                                         org.drools.scenariosimulation.api.model.FactIdentifier factIdentifier,
                                         List<String> propertyNameElements,
                                         String propertyClass,
                                         String propertyTitle)
        It assigns a property to the selected ScenarioGridColumn
        Parameters:
        context - It contains the Context inside which the commands will be executed
        selectedColumn - The selected ScenarioGridColumn where the command was launched
        factIdentifier - The FactIdentifier associated to the selected column
        propertyNameElements - The List with the path instance_name.property.name (eg. Author.isAlive)
        propertyClass - it contains the full classname of the property (eg. com.Author)
        propertyTitle - The title to assign to this property.
      • setPropertyMetaData

        protected void setPropertyMetaData​(ScenarioHeaderMetaData propertyHeaderMetaData,
                                           String title,
                                           boolean readOnly,
                                           ScenarioGridColumn selectedColumn,
                                           String placeHolder)
        It sets the title and readOnly setting of a property header and sets the place holder on a given ScenarioGridColumn.
        Parameters:
        propertyHeaderMetaData -
        title -
        readOnly -
        selectedColumn -
        placeHolder -
      • manageCollectionProperty

        protected void manageCollectionProperty​(ScenarioSimulationContext context,
                                                ScenarioGridColumn selectedColumn,
                                                String factName,
                                                int columnIndex,
                                                List<String> fullPropertyPathElements)
        Parameters:
        context -
        selectedColumn -
        factName - The name of the class to be used to retrieve the corresponding FactModelTree, i.e. without the package
        columnIndex -
        fullPropertyPathElements - This is the List of all the elements pointing to the final property (ex. Book.author.books)
      • navigateComplexObject

        protected org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree navigateComplexObject​(org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree factModelTree,
                                                                                                                           List<String> pathElements,
                                                                                                                           SortedMap<String,​org.drools.workbench.screens.scenariosimulation.model.typedescriptor.FactModelTree> dataObjectFieldsMap)
        Parameters:
        factModelTree -
        pathElements - This is the List of all the elements pointing to the final property (ex. Book.author.books)
        dataObjectFieldsMap -
        Returns:
      • getPropertyHeaderTitle

        protected String getPropertyHeaderTitle​(ScenarioSimulationContext context,
                                                List<String> propertyNameElements,
                                                org.drools.scenariosimulation.api.model.FactIdentifier factIdentifier)