use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class DecisionTableEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
final Optional<DecisionTable> expression = definition.getModelClass();
final Optional<BaseExpressionGrid> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, expression, hasName, 0);
assertThat(oEditor).isPresent();
final GridWidget editor = oEditor.get();
assertThat(editor).isInstanceOf(DecisionTableGrid.class);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class FunctionEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
final Optional<FunctionDefinition> expression = definition.getModelClass();
final Optional<BaseExpressionGrid> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, expression, hasName, 0);
assertTrue(oEditor.isPresent());
final GridWidget editor = oEditor.get();
assertTrue(editor instanceof FunctionGrid);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class InvocationEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
final Optional<Invocation> expression = definition.getModelClass();
final Optional<BaseExpressionGrid> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, expression, hasName, 0);
assertTrue(oEditor.isPresent());
final GridWidget editor = oEditor.get();
assertTrue(editor instanceof InvocationGrid);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class InvocationGridTest method testOnItemSelectedExpressionColumnDefinedExpressionType.
@Test
public void testOnItemSelectedExpressionColumnDefinedExpressionType() {
setupGrid(0);
// Set an editor for expression at (0, 2)
final BaseExpressionGrid editor = mock(BaseExpressionGrid.class);
grid.getModel().setCellValue(0, 2, new ExpressionCellValue(Optional.of(editor)));
final List<HasListSelectorControl.ListSelectorItem> items = grid.getItems(0, 2);
assertThat(items.size()).isEqualTo(5);
assertDefaultListItems(items.subList(0, 3));
assertThat(items.get(DIVIDER)).isInstanceOf(HasListSelectorControl.ListSelectorDividerItem.class);
assertListSelectorItem(items.get(CLEAR_EXPRESSION_TYPE), DMNEditorConstants.ExpressionEditor_Clear);
((HasListSelectorControl.ListSelectorTextItem) items.get(CLEAR_EXPRESSION_TYPE)).getCommand().execute();
verify(cellEditorControls).hide();
verify(sessionCommandManager).execute(eq(canvasHandler), any(ClearExpressionTypeCommand.class));
}
use of org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid in project kie-wb-common by kiegroup.
the class LiteralExpressionEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
final Optional<LiteralExpression> expression = definition.getModelClass();
final Optional<BaseExpressionGrid> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, expression, hasName, 0);
assertThat(oEditor).isPresent();
final GridWidget editor = oEditor.get();
assertThat(editor).isInstanceOf(LiteralExpressionGrid.class);
}
Aggregations