use of org.uberfire.ext.wires.core.grids.client.widget.dom.single.impl.BaseSingletonDOMElementFactory in project drools-wb by kiegroup.
the class AbstractScesimGridModelTest method getDOMElementFactory_Expression.
@Test
public void getDOMElementFactory_Expression() {
BaseSingletonDOMElementFactory factory = abstractScesimGridModelSpy.getDOMElementFactory("com.Test", ScenarioSimulationModel.Type.DMN, FactMappingValueType.EXPRESSION);
assertSame(scenarioCellTextAreaSingletonDOMElementFactorySpy, factory);
factory = abstractScesimGridModelSpy.getDOMElementFactory("com.Test", ScenarioSimulationModel.Type.RULE, FactMappingValueType.EXPRESSION);
assertSame(scenarioExpressionCellTextAreaSingletonDOMElementFactorySpy, factory);
}
use of org.uberfire.ext.wires.core.grids.client.widget.dom.single.impl.BaseSingletonDOMElementFactory in project drools-wb by kiegroup.
the class AbstractScesimGridModelTest method getDOMElementFactory_NotExpressionNotCollection.
@Test
public void getDOMElementFactory_NotExpressionNotCollection() {
BaseSingletonDOMElementFactory factory = abstractScesimGridModelSpy.getDOMElementFactory("com.Test", ScenarioSimulationModel.Type.DMN, FactMappingValueType.NOT_EXPRESSION);
assertSame(scenarioCellTextAreaSingletonDOMElementFactorySpy, factory);
factory = abstractScesimGridModelSpy.getDOMElementFactory("com.Test", ScenarioSimulationModel.Type.RULE, FactMappingValueType.NOT_EXPRESSION);
assertSame(scenarioCellTextAreaSingletonDOMElementFactorySpy, factory);
}
use of org.uberfire.ext.wires.core.grids.client.widget.dom.single.impl.BaseSingletonDOMElementFactory in project drools-wb by kiegroup.
the class ScenarioGrid method setHeaderColumn.
protected void setHeaderColumn(int columnIndex, FactMapping factMapping, boolean editableHeaders) {
final FactIdentifier factIdentifier = factMapping.getFactIdentifier();
String columnId = factMapping.getExpressionIdentifier().getName();
String instanceTitle = factMapping.getFactAlias();
String propertyTitle = factMapping.getExpressionAlias();
String columnGroup = factMapping.getExpressionIdentifier().getType().name();
boolean isInstanceAssigned = isInstanceAssigned(factIdentifier);
boolean isPropertyAssigned = isPropertyAssigned(isInstanceAssigned, factMapping);
String placeHolder = getPlaceHolder(isInstanceAssigned, isPropertyAssigned, factMapping.getFactMappingValueType(), factMapping.getClassName());
ScenarioGridColumn scenarioGridColumn = getScenarioGridColumnLocal(instanceTitle, propertyTitle, columnId, columnGroup, factMapping.getExpressionIdentifier().getType(), placeHolder);
scenarioGridColumn.setInstanceAssigned(isInstanceAssigned);
scenarioGridColumn.setPropertyAssigned(isPropertyAssigned);
scenarioGridColumn.setFactIdentifier(factIdentifier);
scenarioGridColumn.setEditableHeaders(editableHeaders);
if (FactMappingType.OTHER.equals(factMapping.getExpressionIdentifier().getType())) {
scenarioGridColumn.setColumnWidthMode(ColumnWidthMode.FIXED);
scenarioGridColumn.setMinimumWidth(scenarioGridColumn.getWidth());
}
if (isPropertyAssigned) {
BaseSingletonDOMElementFactory factory = ((AbstractScesimGridModel) model).getDOMElementFactory(factMapping.getClassName(), type, factMapping.getFactMappingValueType());
scenarioGridColumn.setFactory(factory);
}
((AbstractScesimGridModel) model).insertColumnGridOnly(columnIndex, scenarioGridColumn);
}
use of org.uberfire.ext.wires.core.grids.client.widget.dom.single.impl.BaseSingletonDOMElementFactory in project drools-wb by kiegroup.
the class AbstractScesimGridModelTest method getDOMElementFactory_Collection.
@Test
public void getDOMElementFactory_Collection() {
BaseSingletonDOMElementFactory factory = abstractScesimGridModelSpy.getDOMElementFactory("java.util.List", ScenarioSimulationModel.Type.RULE, FactMappingValueType.NOT_EXPRESSION);
assertSame(collectionEditorSingletonDOMElementFactoryTest, factory);
factory = abstractScesimGridModelSpy.getDOMElementFactory("java.util.Map", ScenarioSimulationModel.Type.RULE, FactMappingValueType.NOT_EXPRESSION);
assertSame(collectionEditorSingletonDOMElementFactoryTest, factory);
factory = abstractScesimGridModelSpy.getDOMElementFactory("java.util.List", ScenarioSimulationModel.Type.DMN, FactMappingValueType.NOT_EXPRESSION);
assertSame(collectionEditorSingletonDOMElementFactoryTest, factory);
factory = abstractScesimGridModelSpy.getDOMElementFactory("java.util.List", ScenarioSimulationModel.Type.DMN, FactMappingValueType.EXPRESSION);
assertSame(scenarioCellTextAreaSingletonDOMElementFactorySpy, factory);
factory = abstractScesimGridModelSpy.getDOMElementFactory("java.util.List", ScenarioSimulationModel.Type.RULE, FactMappingValueType.EXPRESSION);
assertSame(scenarioExpressionCellTextAreaSingletonDOMElementFactorySpy, factory);
}
Aggregations