public class ScenarioGridModel
extends org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
Modifier and Type | Field and Description |
---|---|
protected CollectionEditorSingletonDOMElementFactory |
collectionEditorSingletonDOMElementFactory |
protected AtomicInteger |
columnCounter |
protected Set<String> |
dataObjectsInstancesName |
protected com.google.gwt.event.shared.EventBus |
eventBus |
static int |
HEADER_ROW_COUNT |
protected ScenarioCellTextAreaSingletonDOMElementFactory |
scenarioCellTextAreaSingletonDOMElementFactory |
protected ScenarioHeaderTextBoxSingletonDOMElementFactory |
scenarioHeaderTextBoxSingletonDOMElementFactory |
protected org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> |
selectedColumn |
protected Set<String> |
simpleJavaTypeInstancesName |
protected org.drools.scenariosimulation.api.model.Simulation |
simulation |
Constructor and Description |
---|
ScenarioGridModel() |
ScenarioGridModel(boolean isMerged) |
Modifier and Type | Method and Description |
---|---|
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
|
void |
bindContent(org.drools.scenariosimulation.api.model.Simulation simulation)
Method to bind the data serialized inside backend
ScenarioSimulationModel |
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
|
void |
checkSameInstanceHeader(int columnIndex,
String headerName)
Check if given headerName is the same as the Fact mapped to the
column at given index
|
void |
checkSamePropertyHeader(int columnIndex,
List<String> propertyNameElements)
Check if given headerName is the same as the element steps mapped to the given column
|
protected void |
checkSimulation() |
protected void |
checkUniquePropertyHeaderTitle(String propertyHeaderCellValue,
int columnIndex)
Verify if the given value is not already used as property header name inside the same instance
|
protected void |
checkValidAndUniqueInstanceHeaderTitle(String instanceHeaderCellValue,
int columnIndex)
Verify the given value is not already used as instance header name between different groups
|
protected void |
checkValidAndUniquePropertyHeaderTitle(String propertyHeaderCellValue,
int columnIndex)
Verify if the given value is not already used as property header name inside the same instance
|
void |
clear() |
void |
clearSelections() |
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.
|
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.
|
protected void |
commonAddRow(int rowIndex) |
org.uberfire.ext.wires.core.grids.client.model.GridData.Range |
deleteCell(int rowIndex,
int columnIndex) |
void |
deleteColumn(int columnIndex)
This method delete the column at the given index from both the grid and the underlying model
|
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
|
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
|
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
|
CollectionEditorSingletonDOMElementFactory |
getCollectionEditorSingletonDOMElementFactory() |
int |
getFirstIndexLeftOfGroup(String groupName)
Return the first index to the left of the given group, i.e.
|
int |
getFirstIndexRightOfGroup(String groupName)
Return the first index to the right of the given group, i.e.
|
long |
getGroupSize(String groupName)
Returns how many columns are already in place for the given group
|
org.uberfire.ext.wires.core.grids.client.model.GridData.Range |
getInstanceLimits(int columnIndex)
This methods returns the
Range of a single block of columns of the same instance/data object. |
List<ScenarioGridColumn> |
getInstanceScenarioGridColumns(ScenarioGridColumn selectedColumn)
This methods returns the
List<ScenarioGridColumn> of a single block of columns of the same instance/data object. |
int |
getInstancesCount(String className)
Returns the count of instantiated facts given a classname.
|
ScenarioCellTextAreaSingletonDOMElementFactory |
getScenarioCellTextAreaSingletonDOMElementFactory() |
ScenarioHeaderTextBoxSingletonDOMElementFactory |
getScenarioHeaderTextBoxSingletonDOMElementFactory() |
org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> |
getSelectedColumn() |
Optional<org.drools.scenariosimulation.api.model.Simulation> |
getSimulation() |
Map.Entry<String,String> |
getValidPlaceholders() |
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
|
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
|
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
|
void |
insertRowGridOnly(int rowIndex,
org.uberfire.ext.wires.core.grids.client.model.GridRow row,
org.drools.scenariosimulation.api.model.Scenario scenario)
This method insert a row to the grid and populate it with values taken from given
Scenario |
boolean |
isAlreadyAssignedProperty(List<String> propertyNameElements)
Returns
true if property mapped to the selected column is already assigned to
another column of the same instance |
boolean |
isColumnEmpty(int columnIndex)
Returns
true if all the grid cells of the column at given index are empty, i.e. the GridCell.getValue() == null OR
GridCell.getValue().getValue() == null |
protected boolean |
isNewInstanceName(String value) |
protected boolean |
isNewPropertyName(String value) |
boolean |
isSameSelectedColumnProperty(int columnIndex,
List<String> propertyNameElements)
Returns
true if property mapped to the column at given index is the same as the provided one |
boolean |
isSameSelectedColumnProperty(List<String> propertyNameElements)
Returns
true if property mapped to the selected column is the same as the provided one |
boolean |
isSameSelectedColumnType(int columnIndex,
String className)
Returns
true if type of the property mapped to the column at given index is the same as the provided one |
boolean |
isSameSelectedColumnType(String className)
Returns
true if no column is selected OR if type of the property mapped to the selected column is the same as the provided one |
boolean |
isSelectedColumnEmpty()
Returns
true if all the grid cells of the selected column are empty, i.e. the GridCell.getValue() == null OR
GridCell.getValue().getValue() == null |
int |
nextColumnCount() |
void |
refreshErrors() |
protected void |
refreshErrorsRow(int rowIndex) |
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.
|
void |
resetErrors() |
void |
resetErrors(int rowIndex) |
void |
selectColumn(int columnIndex)
Select all the cells of the given column
|
void |
selectRow(int rowIndex)
Select all the cells of the given row
|
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
|
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
|
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) |
void |
setCollectionEditorSingletonDOMElementFactory(CollectionEditorSingletonDOMElementFactory collectionEditorSingletonDOMElementFactory) |
void |
setDataObjectsInstancesName(Set<String> dataObjectsInstancesName)
Set the names of already existing Data Objects/Instances, used inside updateHeaderValidation
|
void |
setEventBus(com.google.gwt.event.shared.EventBus eventBus) |
void |
setScenarioCellTextAreaSingletonDOMElementFactory(ScenarioCellTextAreaSingletonDOMElementFactory scenarioCellTextAreaSingletonDOMElementFactory) |
void |
setScenarioHeaderTextBoxSingletonDOMElementFactory(ScenarioHeaderTextBoxSingletonDOMElementFactory scenarioHeaderTextBoxSingletonDOMElementFactory) |
void |
setSimpleJavaTypeInstancesName(Set<String> simpleJavaTypeInstancesName)
Set the names of already existing Simple Java Types/Instances, used inside updateHeaderValidation
|
void |
updateColumnInstance(int columnIndex,
org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
This method update the instance mapped inside a given column
|
void |
updateColumnProperty(int columnIndex,
org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column,
List<String> propertyNameElements,
String lastLevelClassName,
boolean keepData)
This method update the type mapped inside a give column and updates the underlying model
|
protected void |
updateFactMapping(org.drools.scenariosimulation.api.model.SimulationDescriptor simulationDescriptor,
org.drools.scenariosimulation.api.model.FactMapping factMappingReference,
int index,
String value,
ScenarioHeaderMetaData.MetadataType metadataType)
If the
FactIdentifier of the given FactMapping equals the one at index, update the FactMapping.FactAlias at index
position with the provided value |
void |
updateHeader(int columnIndex,
int headerRowIndex,
String headerCellValue) |
protected void |
updateIndexColumn() |
void |
validateInstanceHeaderUpdate(String instanceHeaderCellValue,
int columnIndex,
boolean isADataType)
Check validity of given instanceHeaderCellValue
|
void |
validatePropertyHeaderUpdate(String propertyHeaderCellValue,
int columnIndex,
boolean isPropertyType)
Check validity of given propertyHeaderCellValue
|
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
public static final int HEADER_ROW_COUNT
protected org.drools.scenariosimulation.api.model.Simulation simulation
protected com.google.gwt.event.shared.EventBus eventBus
protected AtomicInteger columnCounter
protected org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> selectedColumn
protected CollectionEditorSingletonDOMElementFactory collectionEditorSingletonDOMElementFactory
protected ScenarioCellTextAreaSingletonDOMElementFactory scenarioCellTextAreaSingletonDOMElementFactory
protected ScenarioHeaderTextBoxSingletonDOMElementFactory scenarioHeaderTextBoxSingletonDOMElementFactory
public ScenarioGridModel()
public ScenarioGridModel(boolean isMerged)
public void bindContent(org.drools.scenariosimulation.api.model.Simulation simulation)
ScenarioSimulationModel
simulation
- public void setEventBus(com.google.gwt.event.shared.EventBus eventBus)
public int nextColumnCount()
public CollectionEditorSingletonDOMElementFactory getCollectionEditorSingletonDOMElementFactory()
public void setCollectionEditorSingletonDOMElementFactory(CollectionEditorSingletonDOMElementFactory collectionEditorSingletonDOMElementFactory)
public ScenarioCellTextAreaSingletonDOMElementFactory getScenarioCellTextAreaSingletonDOMElementFactory()
public void setScenarioCellTextAreaSingletonDOMElementFactory(ScenarioCellTextAreaSingletonDOMElementFactory scenarioCellTextAreaSingletonDOMElementFactory)
public ScenarioHeaderTextBoxSingletonDOMElementFactory getScenarioHeaderTextBoxSingletonDOMElementFactory()
public void setScenarioHeaderTextBoxSingletonDOMElementFactory(ScenarioHeaderTextBoxSingletonDOMElementFactory scenarioHeaderTextBoxSingletonDOMElementFactory)
public void appendRow(org.uberfire.ext.wires.core.grids.client.model.GridRow row)
appendRow
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
appendRow
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
row
- public void insertRowGridOnly(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row, org.drools.scenariosimulation.api.model.Scenario scenario)
Scenario
row
- public void insertRow(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)
insertRow
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
insertRow
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
row
- public org.uberfire.ext.wires.core.grids.client.model.GridData.Range deleteRow(int rowIndex)
deleteRow
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
deleteRow
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
rowIndex
- public void duplicateRow(int rowIndex, org.uberfire.ext.wires.core.grids.client.model.GridRow row)
rowIndex
- public void duplicateColumnValues(int originalColumnIndex, int newColumnIndex)
originalColumnIndex
- newColumnIndex
- public void insertColumnGridOnly(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
index
- column
- public void insertColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
insertColumn
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
insertColumn
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
index
- column
- public void deleteColumn(int columnIndex)
columnIndex
- public void updateColumnInstance(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
columnIndex
- column
- public void updateColumnProperty(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column, List<String> propertyNameElements, String lastLevelClassName, boolean keepData)
columnIndex
- column
- propertyNameElements
- lastLevelClassName
- keepData
- protected void replaceColumn(int columnIndex, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
columnIndex
- column
- 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)
rowIndex
- columnIndex
- cellSupplier
- 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)
setCell
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
setCell
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
rowIndex
- columnIndex
- cellSupplier
- 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)
setCellValue
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
setCellValue
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range deleteCell(int rowIndex, int columnIndex)
deleteCell
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
deleteCell
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
public org.uberfire.ext.wires.core.grids.client.model.GridData.Range getInstanceLimits(int columnIndex)
Range
of a single block of columns of the same instance/data object.
A single
block 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.columnIndex
- public List<ScenarioGridColumn> getInstanceScenarioGridColumns(ScenarioGridColumn selectedColumn)
List<ScenarioGridColumn>
of a single block of columns of the same instance/data object.
A single
block 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.selectedColumn
- public int getFirstIndexLeftOfGroup(String groupName)
groupName
- public int getFirstIndexRightOfGroup(String groupName)
groupName
- public long getGroupSize(String groupName)
groupName
- public int getInstancesCount(String className)
className
- public void updateHeader(int columnIndex, int headerRowIndex, String headerCellValue)
public void clear()
public void clearSelections()
clearSelections
in interface org.uberfire.ext.wires.core.grids.client.model.GridData
clearSelections
in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
public void selectColumn(int columnIndex)
columnIndex
- public void selectRow(int rowIndex)
rowIndex
- public org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> getSelectedColumn()
public Optional<org.drools.scenariosimulation.api.model.Simulation> getSimulation()
public boolean isSelectedColumnEmpty()
true
if all the grid cells of the selected column are empty, i.e. the GridCell.getValue() == null OR
GridCell.getValue().getValue() == nullpublic boolean isColumnEmpty(int columnIndex)
true
if all the grid cells of the column at given index are empty, i.e. the GridCell.getValue() == null OR
GridCell.getValue().getValue() == nullcolumnIndex
- public boolean isAlreadyAssignedProperty(List<String> propertyNameElements)
true
if property mapped to the selected column is already assigned to
another column of the same instancepropertyNameElements
- public void checkAlreadyAssignedProperty(int columnIndex, List<String> propertyNameElements) throws Exception
columnIndex
- propertyNameElements
- Exception
- if the given propertyNameElements
are already mapped to a column of the same instancepublic boolean isSameSelectedColumnProperty(List<String> propertyNameElements)
true
if property mapped to the selected column is the same as the provided onepropertyNameElements
- public boolean isSameSelectedColumnProperty(int columnIndex, List<String> propertyNameElements)
true
if property mapped to the column at given index is the same as the provided onecolumnIndex
- propertyNameElements
- public boolean isSameSelectedColumnType(String className)
true
if no column is selected OR if type of the property mapped to the selected column is the same as the provided oneclassName
- public boolean isSameSelectedColumnType(int columnIndex, String className)
true
if type of the property mapped to the column at given index is the same as the provided onecolumnIndex
- className
- public void checkSameInstanceHeader(int columnIndex, String headerName) throws Exception
columnIndex
- headerName
- Exception
- if the given headerName is not the name of the class mapped to the given columnpublic void checkSamePropertyHeader(int columnIndex, List<String> propertyNameElements) throws Exception
columnIndex
- propertyNameElements
- Exception
- if the given propertyNameElements (corrected for the class name) represents the element steps of the given columnpublic void resetErrors()
public void resetErrors(int rowIndex)
public void refreshErrors()
public void setDataObjectsInstancesName(Set<String> dataObjectsInstancesName)
dataObjectsInstancesName
- public void setSimpleJavaTypeInstancesName(Set<String> simpleJavaTypeInstancesName)
simpleJavaTypeInstancesName
- public void validateInstanceHeaderUpdate(String instanceHeaderCellValue, int columnIndex, boolean isADataType) throws Exception
instanceHeaderCellValue
- columnIndex
- isADataType
- Exception
- with message specific to failed checkpublic void validatePropertyHeaderUpdate(String propertyHeaderCellValue, int columnIndex, boolean isPropertyType) throws Exception
propertyHeaderCellValue
- columnIndex
- isPropertyType
- Exception
- with message specific to failed checkprotected void updateFactMapping(org.drools.scenariosimulation.api.model.SimulationDescriptor simulationDescriptor, org.drools.scenariosimulation.api.model.FactMapping factMappingReference, int index, String value, ScenarioHeaderMetaData.MetadataType metadataType)
FactIdentifier
of the given FactMapping
equals the one at index, update the FactMapping.FactAlias
at index
position with the provided valuesimulationDescriptor
- factMappingReference
- index
- value
- protected void commonAddColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column)
FactIdentifier
(for String class) and ExpressionIdentifier
index
- column
- protected void commonAddColumn(int index, org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column, org.drools.scenariosimulation.api.model.ExpressionIdentifier ei)
index
- column
- ei
- protected void commonAddRow(int rowIndex)
protected void updateIndexColumn()
protected void checkSimulation()
protected void checkValidAndUniqueInstanceHeaderTitle(String instanceHeaderCellValue, int columnIndex) throws Exception
instanceHeaderCellValue
- columnIndex
- Exception
- if the given instanceHeaderCellValue contains a dot OR it has already been used
inside the group (GIVEN/EXPECT) of the given columnprotected void checkValidAndUniquePropertyHeaderTitle(String propertyHeaderCellValue, int columnIndex) throws Exception
propertyHeaderCellValue
- columnIndex
- Exception
- if the given propertyHeaderCellValue contains a dot OR it has already been used
inside the instance of the given columnprotected void checkUniquePropertyHeaderTitle(String propertyHeaderCellValue, int columnIndex) throws Exception
propertyHeaderCellValue
- columnIndex
- Exception
- if the given propertyHeaderCellValue has already been used
inside the instance of the given columnprotected boolean isNewInstanceName(String value)
protected boolean isNewPropertyName(String value)
protected void refreshErrorsRow(int rowIndex)
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.