use of org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testHeaderTextBoxFactoryWhenNotNested.
@Test
public void testHeaderTextBoxFactoryWhenNotNested() {
setupGrid(makeHasNameForDecision(), 0);
final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 2, gridWidget);
final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 2, gridWidget, new BaseGridCellValue<>("value"));
final TextBoxSingletonDOMElementFactory factory = grid.getHeaderTextBoxFactory();
assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteHeaderValueCommand.class);
assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetHeaderValueCommand.class);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testHeaderHasNameTextBoxFactoryWhenNotNested.
@Test
public void testHeaderHasNameTextBoxFactoryWhenNotNested() {
setupGrid(makeHasNameForDecision(), 0);
final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 2, gridWidget);
final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 2, gridWidget, new BaseGridCellValue<>("value"));
final TextBoxSingletonDOMElementFactory factory = grid.getHeaderHasNameTextBoxFactory();
assertCommands(factory.getHasNoValueCommand().apply(tupleWithoutValue), DeleteHeaderValueCommand.class, UpdateElementPropertyCommand.class);
assertCommands(factory.getHasValueCommand().apply(tupleWithValue), SetHeaderValueCommand.class, UpdateElementPropertyCommand.class);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testHeaderTextAreaFactoryWhenNotNested.
@Test
public void testHeaderTextAreaFactoryWhenNotNested() {
setupGrid(makeHasNameForDecision(), 0);
final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 1, gridWidget);
final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 1, gridWidget, new BaseGridCellValue<>("value"));
final TextBoxSingletonDOMElementFactory factory = grid.getHeaderTextBoxFactory();
assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteHeaderValueCommand.class);
assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetHeaderValueCommand.class);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testBodyTextBoxFactoryWhenNotNested.
@Test
public void testBodyTextBoxFactoryWhenNotNested() {
setupGrid(makeHasNameForDecision(), 0);
final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 3, gridWidget);
final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 3, gridWidget, new BaseGridCellValue<>("value"));
final TextAreaSingletonDOMElementFactory factory = grid.getBodyTextAreaFactory();
assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple in project kie-wb-common by kiegroup.
the class SetKindCommandTest method setupCommand.
private void setupCommand() {
final GridCellValueTuple gcv = new GridCellValueTuple<>(0, 0, gridWidget, new ExpressionCellValue(Optional.of(newEditor)));
this.command = new SetKindCommand(gcv, function, newKind, Optional.of(newExpression), executeCanvasOperation, undoCanvasOperation, () -> Optional.of(newEditor));
}
Aggregations