Class AbstractScesimGridModel<T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E>,E extends org.drools.scenariosimulation.api.model.AbstractScesimData>
- java.lang.Object
-
- org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
-
- org.drools.workbench.screens.scenariosimulation.client.models.AbstractScesimGridModel<T,E>
-
- All Implemented Interfaces:
org.uberfire.ext.wires.core.grids.client.model.GridData
- Direct Known Subclasses:
BackgroundGridModel,ScenarioGridModel
public abstract class AbstractScesimGridModel<T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E>,E extends org.drools.scenariosimulation.api.model.AbstractScesimData> extends org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDataAbstractBaseGridDatato be extended by actual implementations (Simulation andBackground)
-
-
Field Summary
Fields Modifier and Type Field Description protected TabstractScesimModelprotected CollectionEditorSingletonDOMElementFactorycollectionEditorSingletonDOMElementFactoryprotected AtomicIntegercolumnCounterprotected com.google.gwt.event.shared.EventBuseventBusstatic intHEADER_ROW_COUNTprotected ScenarioCellTextAreaSingletonDOMElementFactoryscenarioCellTextAreaSingletonDOMElementFactoryprotected ScenarioExpressionCellTextAreaSingletonDOMElementFactoryscenarioExpressionCellTextAreaSingletonDOMElementFactoryprotected ScenarioHeaderTextBoxSingletonDOMElementFactoryscenarioHeaderTextBoxSingletonDOMElementFactoryprotected org.uberfire.ext.wires.core.grids.client.model.GridColumn<?>selectedColumnprotected Set<String>simpleJavaTypeInstancesName
-
Constructor Summary
Constructors Constructor Description AbstractScesimGridModel()AbstractScesimGridModel(boolean isMerged)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidappendRow(org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method append a new row to the grid and to the underlying modelvoidbindContent(T abstractScesimModel)Method to bind the data serialized inside backendAbstractScesimModelvoidcheckAlreadyAssignedProperty(int columnIndex, List<String> propertyNameElements)Check if property mapped to the column at given index is already assigned to another column of the same instancevoidcheckSameInstanceHeader(int columnIndex, String headerName)Check if given headerName is the same as the Fact mapped to the column at given indexvoidcheckSamePropertyHeader(int columnIndex, List<String> propertyNameElements)Check if given headerName is the same as the element steps mapped to the given columnprotected voidcheckSimulation()protected voidcheckUniquePropertyHeaderTitle(String propertyHeaderCellValue, int columnIndex)Verify if the given value is not already used as property header name inside the same instanceprotected voidcheckValidAndUniqueInstanceHeaderTitle(String instanceHeaderCellValue, int columnIndex)Verify the given value is not already used as instance header name between different groupsprotected voidcheckValidAndUniquePropertyHeaderTitle(String propertyHeaderCellValue, int columnIndex)Verify if the given value is not already used as property header name inside the same instancevoidclear()voidclearSelections()protected voidcommonAddColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method add or insert a new column to the grid and to the underlying model, depending on the index value.protected voidcommonAddColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column, org.drools.scenariosimulation.api.model.ExpressionIdentifier ei)This method add or insert a new column to the grid and to the underlying model, depending on the index value.protected abstract voidcommonAddRow(int rowIndex)protected voidcommonAddRow(int rowIndex, int columnIndexStart)org.uberfire.ext.wires.core.grids.client.model.GridData.RangedeleteCell(int rowIndex, int columnIndex)voiddeleteColumn(int columnIndex)This method delete the column at the given index from both the grid and the underlying modelvoiddeleteInstance(int columnIndex)This method delete the whole instance of the column at the given index from both the grid and the underlying modelorg.uberfire.ext.wires.core.grids.client.model.GridData.RangedeleteRow(int rowIndex)This method delete the row at the given index from both the grid and the underlying modelvoiddestroyAllTextAreaDOMElementFactoryResources()It detaches all DomElement resources for selected DOMElementFactorysvoidduplicateColumnValues(int originalColumnIndex, int newColumnIndex)This method duplicates the row values at the source column index from both the grid and the underlying model and inserts at the target column indexvoidduplicateRow(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method duplicate the row at the given index from both the grid and the underlying model and insert just below the original onebooleanforceRefreshWidth()It forces ainternalRefreshWidthrefreshOptional<T>getAbstractScesimModel()CollectionEditorSingletonDOMElementFactorygetCollectionEditorSingletonDOMElementFactory()org.uberfire.ext.wires.core.grids.client.widget.dom.single.impl.BaseSingletonDOMElementFactorygetDOMElementFactory(String className, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type modelType, org.drools.scenariosimulation.api.model.FactMappingValueType valueType)Returns the correct DOMElement factory to the given dataintgetFirstIndexLeftOfGroup(String groupName)Return the first index to the left of the given group, i.e.intgetFirstIndexRightOfGroup(String groupName)Return the first index to the right of the given group, i.e.abstract GridWidgetgetGridWidget()longgetGroupSize(String groupName)Returns how many columns are already in place for the given groupabstract org.uberfire.ext.wires.core.grids.client.model.GridData.RangegetInstanceLimits(int columnIndex)This methods returns theRangeof a single block of columns of the same instance/data object.protected org.uberfire.ext.wires.core.grids.client.model.GridData.RangegetInstanceLimits(int columnIndex, int columnIndexStart)This methods returns theRangeof a single block of columns of the same instance/data object.List<ScenarioGridColumn>getInstanceScenarioGridColumns(int columnIndex)This methods returns theList<ScenarioGridColumn>of a single block of columns of the same instance/data object.List<ScenarioGridColumn>getInstanceScenarioGridColumns(ScenarioGridColumn selectedColumn)This methods returns theList<ScenarioGridColumn>of a single block of columns of the same instance/data object.intgetInstancesCount(String className)Returns the count of instantiated facts given a classname.ScenarioCellTextAreaSingletonDOMElementFactorygetScenarioCellTextAreaSingletonDOMElementFactory()ScenarioExpressionCellTextAreaSingletonDOMElementFactorygetScenarioExpressionCellTextAreaSingletonDOMElementFactory()ScenarioHeaderTextBoxSingletonDOMElementFactorygetScenarioHeaderTextBoxSingletonDOMElementFactory()org.uberfire.ext.wires.core.grids.client.model.GridColumn<?>getSelectedColumn()Map.Entry<String,String>getValidPlaceholders()voidinsertColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method insert a new column to the grid and to the underlying modelvoidinsertColumnGridOnly(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method insert a new column to the grid without modify underlying modelvoidinsertRow(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method insert a new row to the grid and to the underlying modelvoidinsertRowGridOnly(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method insert a row to the gridabstract voidinsertRowGridOnly(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row, E abstractScesimData)This method insert a row to the grid and populate it with values taken from givenAbstractScesimDatabooleanisAlreadyAssignedProperty(List<String> propertyNameElements)Returnstrueif property mapped to the selected column is already assigned to another column of the same instancebooleanisColumnEmpty(int columnIndex)Returnstrueif all the grid cells of the column at given index are empty, i.e. the GridCell.getValue() == null OR GridCell.getValue().getValue() == nullprotected booleanisNewInstanceName(String value)protected booleanisNewPropertyName(String value)booleanisSameInstanceType(int columnIndex, String headerName)Returnstrueif type of the INSTANCE mapped to the column at given index is the same as the provided onebooleanisSameInstanceType(String className)Returnstrueif no column is selected OR if type of the INSTANCE mapped to the selected column is the same as the provided onebooleanisSameSelectedColumnProperty(int columnIndex, List<String> propertyNameElements, org.drools.scenariosimulation.api.model.FactMappingValueType factMappingValueType)Returnstrueif property mapped to the column at given index is the same as the provided onebooleanisSameSelectedColumnProperty(List<String> propertyNameElements, org.drools.scenariosimulation.api.model.FactMappingValueType factMappingValueType)Returnstrueif property mapped to the selected column is the same as the provided onebooleanisSameSelectedColumnType(int columnIndex, String className)Returnstrueif type of the property mapped to the column at given index is the same as the provided onebooleanisSameSelectedColumnType(String className)Returnstrueif no column is selected OR if type of the property mapped to the selected column is the same as the provided onebooleanisSelectedColumnEmpty()Returnstrueif all the grid cells of the selected column are empty, i.e. the GridCell.getValue() == null OR GridCell.getValue().getValue() == nullbooleanisSimpleType(String factClassName)voidloadFactMappingsWidth()It retrieves the stored columnWidths and assigns them to every grid column.intnextColumnCount()voidrefreshErrors()protected voidrefreshErrorsRow(int rowIndex)protected voidreplaceColumn(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method replace a column at columnIndex position with a new column.voidresetError(int rowIndex, int columnIndex)It resets theFactMappingValuestatus for a specific CELLvoidresetErrors()It resets theFactMappingValuestatus for all CELLSvoidresetErrors(int rowIndex)It resets theFactMappingValuestatus for a specific ROWvoidselectColumn(int columnIndex)It puts the column present in the given columnIndex as the current selected one.voidselectRow(int rowIndex)Select all the cells of the given roworg.uberfire.ext.wires.core.grids.client.model.GridData.RangesetCell(int rowIndex, int columnIndex, Supplier<org.uberfire.ext.wires.core.grids.client.model.GridCell<?>> cellSupplier)This method set a cell value to the grid and to the underlying modelorg.uberfire.ext.wires.core.grids.client.model.GridData.RangesetCellGridOnly(int rowIndex, int columnIndex, Supplier<org.uberfire.ext.wires.core.grids.client.model.GridCell<?>> cellSupplier)This method set a cell value to the grid without modify underlying modelorg.uberfire.ext.wires.core.grids.client.model.GridData.RangesetCellValue(int rowIndex, int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridCellValue<?> value)voidsetCollectionEditorSingletonDOMElementFactory(CollectionEditorSingletonDOMElementFactory collectionEditorSingletonDOMElementFactory)voidsetEventBus(com.google.gwt.event.shared.EventBus eventBus)voidsetScenarioCellTextAreaSingletonDOMElementFactory(ScenarioCellTextAreaSingletonDOMElementFactory scenarioCellTextAreaSingletonDOMElementFactory)voidsetScenarioExpressionCellTextAreaSingletonDOMElementFactory(ScenarioExpressionCellTextAreaSingletonDOMElementFactory scenarioExpressionCellTextAreaSingletonDOMElementFactory)voidsetScenarioHeaderTextBoxSingletonDOMElementFactory(ScenarioHeaderTextBoxSingletonDOMElementFactory scenarioHeaderTextBoxSingletonDOMElementFactory)voidsetSimpleJavaTypeInstancesName(Set<String> simpleJavaTypeInstancesName)Set the names of already existing Simple Java Types/Instances, used inside updateHeaderValidationvoidsynchronizeFactMappingsWidths()It synchronizes all columns relatedfactMappingcolumnnWidthsvoidsynchronizeFactMappingWidth(org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)It updates a column relatedfactMappingcolumnWidthvoidupdateColumnInstance(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method update the instance mapped inside a given columnvoidupdateColumnProperty(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column, List<String> propertyNameElements, String lastLevelClassName, boolean keepData, org.drools.scenariosimulation.api.model.FactMappingValueType valueType, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)This method update the type mapped inside a give column and updates the underlying modelprotected voidupdateFactMapping(org.drools.scenariosimulation.api.model.ScesimModelDescriptor simulationDescriptor, org.drools.scenariosimulation.api.model.FactMapping factMappingReference, int index, String value, ScenarioHeaderMetaData.MetadataType metadataType)If theFactIdentifierof the givenFactMappingequals the one at index, update theFactMapping.FactAliasat index position with the provided valuevoidupdateHeader(int columnIndex, int headerRowIndex, String headerCellValue)protected voidupdateIndexColumn()voidvalidateInstanceHeaderUpdate(String instanceHeaderCellValue, int columnIndex, boolean isADataType)Check validity of given instanceHeaderCellValuevoidvalidatePropertyHeaderUpdate(String propertyHeaderCellValue, int columnIndex, boolean isPropertyType)Check validity of given propertyHeaderCellValue-
Methods inherited from class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
appendColumn, collapseCell, deleteColumn, doSetCell, expandCell, getCell, getColumnCount, getColumns, getHeaderRowCount, getRow, getRowCount, getRows, getSelectedCells, getSelectedCellsOrigin, getSelectedHeaderCells, getVisibleHeight, getVisibleWidth, getWidth, internalRefreshWidth, isColumnDraggingEnabled, isMerged, isRowDraggingEnabled, moveColumnsTo, moveColumnTo, moveRowsTo, moveRowTo, refreshWidth, refreshWidth, selectCell, selectCells, selectHeaderCell, setColumnDraggingEnabled, setHeaderRowCount, setMerged, setRowDraggingEnabled, setVisibleSizeAndRefresh, updateColumn
-
-
-
-
Field Detail
-
HEADER_ROW_COUNT
public static final int HEADER_ROW_COUNT
- See Also:
- Constant Field Values
-
abstractScesimModel
protected T extends org.drools.scenariosimulation.api.model.AbstractScesimModel<E> abstractScesimModel
-
eventBus
protected com.google.gwt.event.shared.EventBus eventBus
-
columnCounter
protected AtomicInteger columnCounter
-
selectedColumn
protected org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> selectedColumn
-
collectionEditorSingletonDOMElementFactory
protected CollectionEditorSingletonDOMElementFactory collectionEditorSingletonDOMElementFactory
-
scenarioCellTextAreaSingletonDOMElementFactory
protected ScenarioCellTextAreaSingletonDOMElementFactory scenarioCellTextAreaSingletonDOMElementFactory
-
scenarioHeaderTextBoxSingletonDOMElementFactory
protected ScenarioHeaderTextBoxSingletonDOMElementFactory scenarioHeaderTextBoxSingletonDOMElementFactory
-
scenarioExpressionCellTextAreaSingletonDOMElementFactory
protected ScenarioExpressionCellTextAreaSingletonDOMElementFactory scenarioExpressionCellTextAreaSingletonDOMElementFactory
-
-
Method Detail
-
getGridWidget
public abstract GridWidget getGridWidget()
-
bindContent
public void bindContent(T abstractScesimModel)
Method to bind the data serialized inside backendAbstractScesimModel- Parameters:
abstractScesimModel-
-
setEventBus
public void setEventBus(com.google.gwt.event.shared.EventBus eventBus)
-
nextColumnCount
public int nextColumnCount()
-
getCollectionEditorSingletonDOMElementFactory
public CollectionEditorSingletonDOMElementFactory getCollectionEditorSingletonDOMElementFactory()
-
setCollectionEditorSingletonDOMElementFactory
public void setCollectionEditorSingletonDOMElementFactory(CollectionEditorSingletonDOMElementFactory collectionEditorSingletonDOMElementFactory)
-
getScenarioCellTextAreaSingletonDOMElementFactory
public ScenarioCellTextAreaSingletonDOMElementFactory getScenarioCellTextAreaSingletonDOMElementFactory()
-
setScenarioCellTextAreaSingletonDOMElementFactory
public void setScenarioCellTextAreaSingletonDOMElementFactory(ScenarioCellTextAreaSingletonDOMElementFactory scenarioCellTextAreaSingletonDOMElementFactory)
-
getScenarioHeaderTextBoxSingletonDOMElementFactory
public ScenarioHeaderTextBoxSingletonDOMElementFactory getScenarioHeaderTextBoxSingletonDOMElementFactory()
-
setScenarioHeaderTextBoxSingletonDOMElementFactory
public void setScenarioHeaderTextBoxSingletonDOMElementFactory(ScenarioHeaderTextBoxSingletonDOMElementFactory scenarioHeaderTextBoxSingletonDOMElementFactory)
-
getScenarioExpressionCellTextAreaSingletonDOMElementFactory
public ScenarioExpressionCellTextAreaSingletonDOMElementFactory getScenarioExpressionCellTextAreaSingletonDOMElementFactory()
-
setScenarioExpressionCellTextAreaSingletonDOMElementFactory
public void setScenarioExpressionCellTextAreaSingletonDOMElementFactory(ScenarioExpressionCellTextAreaSingletonDOMElementFactory scenarioExpressionCellTextAreaSingletonDOMElementFactory)
-
destroyAllTextAreaDOMElementFactoryResources
public void destroyAllTextAreaDOMElementFactoryResources()
It detaches all DomElement resources for selected DOMElementFactorys
-
appendRow
public void appendRow(org.uberfire.ext.wires.core.grids.client.model.GridRow row)
This method append a new row to the grid and to the underlying model- Specified by:
appendRowin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
appendRowin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData- Parameters:
row-
-
insertRowGridOnly
public abstract void insertRowGridOnly(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row, E abstractScesimData)This method insert a row to the grid and populate it with values taken from givenAbstractScesimData- Parameters:
row-
-
insertRowGridOnly
public void insertRowGridOnly(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method insert a row to the grid- Parameters:
row-
-
insertRow
public void insertRow(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method insert a new row to the grid and to the underlying model- Specified by:
insertRowin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
insertRowin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData- Parameters:
row-
-
deleteRow
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range deleteRow(int rowIndex)
This method delete the row at the given index from both the grid and the underlying model- Specified by:
deleteRowin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
deleteRowin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData- Parameters:
rowIndex-
-
duplicateRow
public void duplicateRow(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)This method duplicate the row at the given index from both the grid and the underlying model and insert just below the original one- Parameters:
rowIndex-
-
duplicateColumnValues
public void duplicateColumnValues(int originalColumnIndex, int newColumnIndex)This method duplicates the row values at the source column index from both the grid and the underlying model and inserts at the target column index- Parameters:
originalColumnIndex-newColumnIndex-
-
insertColumnGridOnly
public void insertColumnGridOnly(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method insert a new column to the grid without modify underlying model- Parameters:
index-column-
-
insertColumn
public void insertColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method insert a new column to the grid and to the underlying model- Specified by:
insertColumnin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
insertColumnin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData- Parameters:
index-column-
-
deleteColumn
public void deleteColumn(int columnIndex)
This method delete the column at the given index from both the grid and the underlying model- Parameters:
columnIndex-
-
deleteInstance
public void deleteInstance(int columnIndex)
This method delete the whole instance of the column at the given index from both the grid and the underlying model- Parameters:
columnIndex-
-
updateColumnInstance
public void updateColumnInstance(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method update the instance mapped inside a given column- Parameters:
columnIndex-column-
-
updateColumnProperty
public void updateColumnProperty(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column, List<String> propertyNameElements, String lastLevelClassName, boolean keepData, org.drools.scenariosimulation.api.model.FactMappingValueType valueType, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)This method update the type mapped inside a give column and updates the underlying model- Parameters:
columnIndex-column-propertyNameElements-lastLevelClassName-keepData-
-
replaceColumn
protected void replaceColumn(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method replace a column at columnIndex position with a new column. It also save and restore width of the columns- Parameters:
columnIndex-column-
-
setCellGridOnly
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range setCellGridOnly(int rowIndex, int columnIndex, Supplier<org.uberfire.ext.wires.core.grids.client.model.GridCell<?>> cellSupplier)This method set a cell value to the grid without modify underlying model- Parameters:
rowIndex-columnIndex-cellSupplier-
-
setCell
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range setCell(int rowIndex, int columnIndex, Supplier<org.uberfire.ext.wires.core.grids.client.model.GridCell<?>> cellSupplier)This method set a cell value to the grid and to the underlying model- Specified by:
setCellin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
setCellin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData- Parameters:
rowIndex-columnIndex-cellSupplier-
-
setCellValue
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range setCellValue(int rowIndex, int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridCellValue<?> value)- Specified by:
setCellValuein interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
setCellValuein classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
-
deleteCell
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range deleteCell(int rowIndex, int columnIndex)- Specified by:
deleteCellin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
deleteCellin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
-
getInstanceLimits
public abstract org.uberfire.ext.wires.core.grids.client.model.GridData.Range getInstanceLimits(int columnIndex)
This methods returns theRangeof a single block of columns of the same instance/data object. Asingleblock is made of all the columns immediately to the left and right of the selected one with the same "label". If there is another column with the same "label" but separated by a different column, it is not part of the group.- Parameters:
columnIndex-- Returns:
-
getInstanceScenarioGridColumns
public List<ScenarioGridColumn> getInstanceScenarioGridColumns(int columnIndex)
This methods returns theList<ScenarioGridColumn>of a single block of columns of the same instance/data object. Asingleblock contains the selected column and all the columns immediately to the left and right of it with the same "label". If there is another column with the same "label" but separated by a different column, it is not part of the group.- Parameters:
columnIndex-- Returns:
-
getInstanceScenarioGridColumns
public List<ScenarioGridColumn> getInstanceScenarioGridColumns(ScenarioGridColumn selectedColumn)
This methods returns theList<ScenarioGridColumn>of a single block of columns of the same instance/data object. Asingleblock contains the selected column and all the columns immediately to the left and right of it with the same "label". If there is another column with the same "label" but separated by a different column, it is not part of the group.- Parameters:
selectedColumn-- Returns:
-
getFirstIndexLeftOfGroup
public int getFirstIndexLeftOfGroup(String groupName)
Return the first index to the left of the given group, i.e. excluded the left-most index of that group- Parameters:
groupName-- Returns:
-
getFirstIndexRightOfGroup
public int getFirstIndexRightOfGroup(String groupName)
Return the first index to the right of the given group, i.e. excluded the right-most index of that group- Parameters:
groupName-- Returns:
-
getGroupSize
public long getGroupSize(String groupName)
Returns how many columns are already in place for the given group- Parameters:
groupName-- Returns:
-
getInstancesCount
public int getInstancesCount(String className)
Returns the count of instantiated facts given a classname.- Parameters:
className-- Returns:
-
updateHeader
public void updateHeader(int columnIndex, int headerRowIndex, String headerCellValue)
-
clear
public void clear()
-
clearSelections
public void clearSelections()
- Specified by:
clearSelectionsin interfaceorg.uberfire.ext.wires.core.grids.client.model.GridData- Overrides:
clearSelectionsin classorg.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
-
forceRefreshWidth
public boolean forceRefreshWidth()
It forces ainternalRefreshWidthrefresh
-
synchronizeFactMappingsWidths
public void synchronizeFactMappingsWidths()
It synchronizes all columns relatedfactMappingcolumnnWidths
-
synchronizeFactMappingWidth
public void synchronizeFactMappingWidth(org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
It updates a column relatedfactMappingcolumnWidth- Parameters:
column-
-
loadFactMappingsWidth
public void loadFactMappingsWidth()
It retrieves the stored columnWidths and assigns them to every grid column.
-
selectColumn
public void selectColumn(int columnIndex)
It puts the column present in the given columnIndex as the current selected one.- Parameters:
columnIndex-
-
selectRow
public void selectRow(int rowIndex)
Select all the cells of the given row- Parameters:
rowIndex-
-
getSelectedColumn
public org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> getSelectedColumn()
-
isSelectedColumnEmpty
public boolean isSelectedColumnEmpty()
Returnstrueif all the grid cells of the selected column are empty, i.e. the GridCell.getValue() == null OR GridCell.getValue().getValue() == null- Returns:
-
isColumnEmpty
public boolean isColumnEmpty(int columnIndex)
Returnstrueif all the grid cells of the column at given index are empty, i.e. the GridCell.getValue() == null OR GridCell.getValue().getValue() == null- Parameters:
columnIndex-- Returns:
-
isAlreadyAssignedProperty
public boolean isAlreadyAssignedProperty(List<String> propertyNameElements)
Returnstrueif property mapped to the selected column is already assigned to another column of the same instance- Parameters:
propertyNameElements-- Returns:
-
checkAlreadyAssignedProperty
public void checkAlreadyAssignedProperty(int columnIndex, List<String> propertyNameElements)Check if property mapped to the column at given index is already assigned to another column of the same instance- Parameters:
columnIndex-propertyNameElements-- Throws:
IllegalStateException- if the givenpropertyNameElementsare already mapped to a column of the same instance
-
isSameSelectedColumnProperty
public boolean isSameSelectedColumnProperty(List<String> propertyNameElements, org.drools.scenariosimulation.api.model.FactMappingValueType factMappingValueType)
Returnstrueif property mapped to the selected column is the same as the provided one- Parameters:
propertyNameElements-factMappingValueType-- Returns:
-
isSameSelectedColumnProperty
public boolean isSameSelectedColumnProperty(int columnIndex, List<String> propertyNameElements, org.drools.scenariosimulation.api.model.FactMappingValueType factMappingValueType)Returnstrueif property mapped to the column at given index is the same as the provided one- Parameters:
columnIndex-propertyNameElements-factMappingValueType-- Returns:
-
isSameSelectedColumnType
public boolean isSameSelectedColumnType(String className)
Returnstrueif no column is selected OR if type of the property mapped to the selected column is the same as the provided one- Parameters:
className-- Returns:
-
isSameSelectedColumnType
public boolean isSameSelectedColumnType(int columnIndex, String className)Returnstrueif type of the property mapped to the column at given index is the same as the provided one- Parameters:
columnIndex-className-- Returns:
-
isSameInstanceType
public boolean isSameInstanceType(String className)
Returnstrueif no column is selected OR if type of the INSTANCE mapped to the selected column is the same as the provided one- Parameters:
className-- Returns:
-
checkSameInstanceHeader
public void checkSameInstanceHeader(int columnIndex, String headerName)Check if given headerName is the same as the Fact mapped to the column at given index- Parameters:
columnIndex-headerName-- Throws:
IllegalStateException- if the given headerName is not the name of the class mapped to the given column
-
isSameInstanceType
public boolean isSameInstanceType(int columnIndex, String headerName)Returnstrueif type of the INSTANCE mapped to the column at given index is the same as the provided one- Parameters:
columnIndex-headerName-- Returns:
-
checkSamePropertyHeader
public void checkSamePropertyHeader(int columnIndex, List<String> propertyNameElements)Check if given headerName is the same as the element steps mapped to the given column- Parameters:
columnIndex-propertyNameElements-- Throws:
IllegalStateException- if the given propertyNameElements (corrected for the class name) represents the element steps of the given column
-
resetErrors
public void resetErrors()
It resets theFactMappingValuestatus for all CELLS
-
resetErrors
public void resetErrors(int rowIndex)
It resets theFactMappingValuestatus for a specific ROW- Parameters:
rowIndex-
-
resetError
public void resetError(int rowIndex, int columnIndex)It resets theFactMappingValuestatus for a specific CELL- Parameters:
rowIndex-columnIndex-
-
refreshErrors
public void refreshErrors()
-
setSimpleJavaTypeInstancesName
public void setSimpleJavaTypeInstancesName(Set<String> simpleJavaTypeInstancesName)
Set the names of already existing Simple Java Types/Instances, used inside updateHeaderValidation- Parameters:
simpleJavaTypeInstancesName-
-
validateInstanceHeaderUpdate
public void validateInstanceHeaderUpdate(String instanceHeaderCellValue, int columnIndex, boolean isADataType)
Check validity of given instanceHeaderCellValue- Parameters:
instanceHeaderCellValue-columnIndex-isADataType-- Throws:
Exception- with message specific to failed check
-
validatePropertyHeaderUpdate
public void validatePropertyHeaderUpdate(String propertyHeaderCellValue, int columnIndex, boolean isPropertyType)
Check validity of given propertyHeaderCellValue- Parameters:
propertyHeaderCellValue-columnIndex-isPropertyType-- Throws:
Exception- with message specific to failed check
-
isSimpleType
public boolean isSimpleType(String factClassName)
-
getInstanceLimits
protected org.uberfire.ext.wires.core.grids.client.model.GridData.Range getInstanceLimits(int columnIndex, int columnIndexStart)This methods returns theRangeof a single block of columns of the same instance/data object. Asingleblock is made of all the columns immediately to the left and right of the selected one with the same "label". If there is another column with the same "label" but separated by a different column, it is not part of the group.- Parameters:
columnIndex-columnIndexStart- the leftmost index to consider when evaluating the range- Returns:
-
updateFactMapping
protected void updateFactMapping(org.drools.scenariosimulation.api.model.ScesimModelDescriptor simulationDescriptor, org.drools.scenariosimulation.api.model.FactMapping factMappingReference, int index, String value, ScenarioHeaderMetaData.MetadataType metadataType)If theFactIdentifierof the givenFactMappingequals the one at index, update theFactMapping.FactAliasat index position with the provided value- Parameters:
simulationDescriptor-factMappingReference-index-value-
-
commonAddColumn
protected void commonAddColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)This method add or insert a new column to the grid and to the underlying model, depending on the index value. If index == -1 -> add, otherwise insert. It automatically creates defaultFactIdentifier(for String class) andExpressionIdentifier- Parameters:
index-column-
-
commonAddColumn
protected void commonAddColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column, org.drools.scenariosimulation.api.model.ExpressionIdentifier ei)This method add or insert a new column to the grid and to the underlying model, depending on the index value. If index == -1 -> add, otherwise insert.- Parameters:
index-column-ei-
-
commonAddRow
protected abstract void commonAddRow(int rowIndex)
-
commonAddRow
protected void commonAddRow(int rowIndex, int columnIndexStart)
-
updateIndexColumn
protected void updateIndexColumn()
-
checkSimulation
protected void checkSimulation()
-
checkValidAndUniqueInstanceHeaderTitle
protected void checkValidAndUniqueInstanceHeaderTitle(String instanceHeaderCellValue, int columnIndex)
Verify the given value is not already used as instance header name between different groups- Parameters:
instanceHeaderCellValue-columnIndex-- Throws:
IllegalArgumentException- if the given instanceHeaderCellValue contains a dot OR it has already been used inside the group (GIVEN/EXPECT) of the given column
-
checkValidAndUniquePropertyHeaderTitle
protected void checkValidAndUniquePropertyHeaderTitle(String propertyHeaderCellValue, int columnIndex)
Verify if the given value is not already used as property header name inside the same instance- Parameters:
propertyHeaderCellValue-columnIndex-- Throws:
IllegalArgumentException- if the given propertyHeaderCellValue contains a dot OR it has already been used inside the instance of the given column
-
checkUniquePropertyHeaderTitle
protected void checkUniquePropertyHeaderTitle(String propertyHeaderCellValue, int columnIndex)
Verify if the given value is not already used as property header name inside the same instance- Parameters:
propertyHeaderCellValue-columnIndex-- Throws:
IllegalArgumentException- if the given propertyHeaderCellValue has already been used inside the instance of the given column
-
isNewInstanceName
protected boolean isNewInstanceName(String value)
-
isNewPropertyName
protected boolean isNewPropertyName(String value)
-
refreshErrorsRow
protected void refreshErrorsRow(int rowIndex)
-
getDOMElementFactory
public org.uberfire.ext.wires.core.grids.client.widget.dom.single.impl.BaseSingletonDOMElementFactory getDOMElementFactory(String className, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type modelType, org.drools.scenariosimulation.api.model.FactMappingValueType valueType)
Returns the correct DOMElement factory to the given data- Parameters:
modelType-valueType-
-
-