use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DependentEnumsUtilities in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenter method initialiseUtilities.
void initialiseUtilities() {
this.cellUtilities = new CellUtilities();
this.columnUtilities = new ColumnUtilities(model, oracle);
// Setup the DropDownManager that requires the Model and UI data to determine drop-down lists
// for dependent enumerations. This needs to be called before the columns are created.
this.dependentEnumsUtilities = new DependentEnumsUtilities(model, oracle);
// Setup Factories for new Columns and Cells
gridWidgetColumnFactory.setConverters(getConverters());
gridWidgetColumnFactory.initialise(model, oracle, columnUtilities, this);
// Setup synchronizers to update the Model when the UiModel changes.
synchronizer.setSynchronizers(getSynchronizers());
synchronizer.initialise(model, uiModel, cellUtilities, columnUtilities, dependentEnumsUtilities, gridWidgetCellFactory, gridWidgetColumnFactory, view, rm, eventBus, access);
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DependentEnumsUtilities in project drools-wb by kiegroup.
the class BaseSynchronizerTest method setup.
@Before
public void setup() {
// Setup model related classes
model = new GuidedDecisionTable52();
uiModel = new GuidedDecisionTableUiModel(modelSynchronizer);
incrementalDataModelServiceCaller = new CallerMock<>(incrementalDataModelService);
final BRLRuleModel rm = new BRLRuleModel(model);
final CellUtilities cellUtilities = new CellUtilities();
final ColumnUtilities columnUtilities = new ColumnUtilities(model, oracle);
final DependentEnumsUtilities enumsUtilities = new DependentEnumsUtilities(model, oracle);
final GridWidgetCellFactory gridWidgetCellFactory = new GridWidgetCellFactoryImpl();
// Setup mocks
final GuidedDecisionTableModellerView.Presenter modellerPresenter = mock(GuidedDecisionTableModellerView.Presenter.class);
final GuidedDecisionTableModellerView modellerView = mock(GuidedDecisionTableModellerView.class);
final GridLayer gridLayer = mock(GridLayer.class);
final AbsolutePanel domElementContainer = mock(AbsolutePanel.class);
final GuidedDecisionTableView.Presenter dtablePresenter = mock(GuidedDecisionTableView.Presenter.class);
final EventBus eventBus = mock(EventBus.class);
when(dtablePresenter.getModellerPresenter()).thenReturn(modellerPresenter);
when(modellerPresenter.getView()).thenReturn(modellerView);
when(modellerView.getGridLayerView()).thenReturn(gridLayer);
when(gridLayer.getDomElementContainer()).thenReturn(domElementContainer);
when(domElementContainer.iterator()).thenReturn(mock(Iterator.class));
// Setup column converters
final List<BaseColumnConverter> converters = getConverters();
gridWidgetColumnFactory.setConverters(converters);
gridWidgetColumnFactory.initialise(model, oracle, columnUtilities, dtablePresenter);
// Setup synchronizers
final List<Synchronizer<? extends MetaData, ? extends MetaData, ? extends MetaData, ? extends MetaData, ? extends MetaData>> synchronizers = getSynchronizers();
modelSynchronizer.setSynchronizers(synchronizers);
modelSynchronizer.initialise(model, uiModel, cellUtilities, columnUtilities, enumsUtilities, gridWidgetCellFactory, gridWidgetColumnFactory, view, rm, eventBus, editable);
// Dummy columns for Row number and Description
uiModel.appendColumn(gridWidgetColumnFactory.convertColumn(new RowNumberCol52(), readOnly, view));
uiModel.appendColumn(gridWidgetColumnFactory.convertColumn(new DescriptionCol52(), readOnly, view));
ApplicationPreferences.setUp(new HashMap<String, String>() {
{
put(ApplicationPreferences.DATE_FORMAT, "dd-MM-yyyy");
}
});
}
Aggregations