TemplateDataCellFactory extends AbstractCellFactory<TemplateDataColumn> { DecoratedGridCellValueAdaptor<? extends Comparable<?>> makeNumericSelectionEnumCell(String factType, String fieldName, String operator, String dataType) { if (dataType.equals(DataType.TYPE_NUMERIC)) { final AbstractProxyPopupDropDownEditCell<BigDecimal, BigDecimal> pudd = new ProxyPopupNumericBigDecimalDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_BIGDECIMAL)) { final AbstractProxyPopupDropDownEditCell<BigDecimal, BigDecimal> pudd = new ProxyPopupNumericBigDecimalDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_BIGINTEGER)) { final AbstractProxyPopupDropDownEditCell<BigInteger, BigInteger> pudd = new ProxyPopupNumericBigIntegerDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_BYTE)) { final AbstractProxyPopupDropDownEditCell<Byte, Byte> pudd = new ProxyPopupNumericByteDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_DOUBLE)) { final AbstractProxyPopupDropDownEditCell<Double, Double> pudd = new ProxyPopupNumericDoubleDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_FLOAT)) { final AbstractProxyPopupDropDownEditCell<Float, Float> pudd = new ProxyPopupNumericFloatDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_INTEGER)) { final AbstractProxyPopupDropDownEditCell<Integer, Integer> pudd = new ProxyPopupNumericIntegerDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_LONG)) { final AbstractProxyPopupDropDownEditCell<Long, Long> pudd = new ProxyPopupNumericLongDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else if (dataType.equals(DataType.TYPE_NUMERIC_SHORT)) { final AbstractProxyPopupDropDownEditCell<Short, Short> pudd = new ProxyPopupNumericShortDropDownEditCell(factType, fieldName, operator, oracle, dropDownManager, isReadOnly); return decoratedGridCellValueAdaptor(pudd); } else { throw new IllegalStateException("Unknown numeric data type: " + dataType); } } TemplateDataCellFactory(AsyncPackageDataModelOracle oracle,
                                   TemplateDropDownManager dropDownManager,
                                   boolean isReadOnly,
                                   EventBus eventBus); DecoratedGridCellValueAdaptor<? extends Comparable<?>> getCell(TemplateDataColumn column);  }
@Test(expected = IllegalStateException.class) public void testIllegalNumericType() { final String factType = "org.kiegroup.Car"; final String factField = "carAttribute"; final String dataType = DataType.TYPE_DATE; final String operator = "in"; testedFactory.makeNumericSelectionEnumCell(factType, factField, dataType, operator); }