public class ScenarioGridModel
extends org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData
| Modifier and Type | Field and Description |
|---|---|
protected AtomicInteger |
columnCounter |
protected Set<String> |
dataObjectsInstancesName |
protected com.google.gwt.event.shared.EventBus |
eventBus |
static int |
HEADER_ROW_COUNT |
protected org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> |
selectedColumn |
protected Set<String> |
simpleJavaTypeInstancesName |
protected 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(Simulation simulation)
Method to bind the data serialized inside backend
ScenarioSimulationModel |
protected void |
checkSimulation() |
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,
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 |
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
|
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. |
org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> |
getSelectedColumn() |
Optional<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,
Scenario scenario)
This method insert a row to the grid and populate it with values taken from given
Scenario |
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 |
isInstanceName(String value) |
protected boolean |
isNewInstanceName(String value) |
protected boolean |
isNewPropertyName(String value) |
boolean |
isSameSelectedColumnProperty(int columnIndex,
String propertyName)
Returns
true if property mapped to the column at given index is the same as the provided one |
boolean |
isSameSelectedColumnProperty(String propertyName)
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 mapped to the column at given index is the same as the provided one |
boolean |
isSameSelectedColumnType(String className)
Returns
true if type 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 |
protected boolean |
isUnique(String value,
int rowIndex,
int columnIndex) |
int |
nextColumnCount() |
void |
refreshErrors() |
protected void |
refreshErrorsRow(int rowIndex) |
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 |
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 |
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,
String value,
String lastLevelClassName,
boolean keepData)
This method update the type mapped inside a give column and updates the underlying model
|
protected void |
updateFactMapping(SimulationDescriptor simulationDescriptor,
FactMapping factMappingReference,
int index,
String value)
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 value) |
protected void |
updateIndexColumn() |
boolean |
validateHeaderUpdate(String value,
int rowIndex,
int columnIndex) |
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, updateColumnpublic static final int HEADER_ROW_COUNT
protected Simulation simulation
protected com.google.gwt.event.shared.EventBus eventBus
protected AtomicInteger columnCounter
protected org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> selectedColumn
public ScenarioGridModel()
public ScenarioGridModel(boolean isMerged)
public void bindContent(Simulation simulation)
ScenarioSimulationModelsimulation - public void setEventBus(com.google.gwt.event.shared.EventBus eventBus)
public int nextColumnCount()
public void appendRow(org.uberfire.ext.wires.core.grids.client.model.GridRow row)
appendRow in interface org.uberfire.ext.wires.core.grids.client.model.GridDataappendRow in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatarow - public void insertRowGridOnly(int rowIndex,
org.uberfire.ext.wires.core.grids.client.model.GridRow row,
Scenario scenario)
Scenariorow - 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.GridDatainsertRow in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatarow - 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.GridDatadeleteRow in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatarowIndex - public void duplicateRow(int rowIndex,
org.uberfire.ext.wires.core.grids.client.model.GridRow row)
rowIndex - 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.GridDatainsertColumn in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDataindex - 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,
String value,
String lastLevelClassName,
boolean keepData)
columnIndex - column - value - lastLevelClassName - keepData - 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.GridDatasetCell in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatarowIndex - 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.GridDatasetCellValue in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatapublic 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.GridDatadeleteCell in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatapublic 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 int getFirstIndexLeftOfGroup(String groupName)
groupName - public int getFirstIndexRightOfGroup(String groupName)
groupName - public long getGroupSize(String groupName)
groupName - public void updateHeader(int columnIndex,
int headerRowIndex,
String value)
public void clear()
public void clearSelections()
clearSelections in interface org.uberfire.ext.wires.core.grids.client.model.GridDataclearSelections in class org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridDatapublic void selectColumn(int columnIndex)
columnIndex - public void selectRow(int rowIndex)
rowIndex - public org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> getSelectedColumn()
public Optional<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 isSameSelectedColumnProperty(String propertyName)
true if property mapped to the selected column is the same as the provided onepropertyName - public boolean isSameSelectedColumnProperty(int columnIndex,
String propertyName)
true if property mapped to the column at given index is the same as the provided onecolumnIndex - propertyName - public boolean isSameSelectedColumnType(String className)
true if type mapped to the selected column is the same as the provided oneclassName - public boolean isSameSelectedColumnType(int columnIndex,
String className)
true if type mapped to the column at given index is the same as the provided onecolumnIndex - className - public boolean validateHeaderUpdate(String value, int rowIndex, int columnIndex)
public void resetErrors()
public void resetErrors(int rowIndex)
public void refreshErrors()
public void setDataObjectsInstancesName(Set<String> dataObjectsInstancesName)
dataObjectsInstancesName - public void setSimpleJavaTypeInstancesName(Set<String> simpleJavaTypeInstancesName)
simpleJavaTypeInstancesName - protected void updateFactMapping(SimulationDescriptor simulationDescriptor, FactMapping factMappingReference, int index, String value)
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 ExpressionIdentifierindex - column - protected void commonAddColumn(int index,
org.uberfire.ext.wires.core.grids.client.model.GridColumn<?> column,
ExpressionIdentifier ei)
index - column - ei - protected void commonAddRow(int rowIndex)
protected void updateIndexColumn()
protected void checkSimulation()
protected boolean isUnique(String value, int rowIndex, int columnIndex)
protected boolean isNewInstanceName(String value)
protected boolean isNewPropertyName(String value)
protected boolean isInstanceName(String value)
protected void refreshErrorsRow(int rowIndex)
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.