Search in sources :

Example 16 with TextBoxSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testHeaderHasNameTextBoxFactoryWhenNested.

@Test
public void testHeaderHasNameTextBoxFactoryWhenNested() {
    setupGrid(makeHasNameForDecision(), 1);
    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);
    assertCommands(factory.getHasValueCommand().apply(tupleWithValue), SetHeaderValueCommand.class);
}
Also used : GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Test(org.junit.Test)

Example 17 with TextBoxSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testBodyTextBoxFactoryWhenNested.

@Test
public void testBodyTextBoxFactoryWhenNested() {
    setupGrid(makeHasNameForDecision(), 1);
    final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 3, gridWidget);
    final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 3, gridWidget, new BaseGridCellValue<>("value"));
    final TextBoxSingletonDOMElementFactory factory = grid.getBodyTextBoxFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Test(org.junit.Test)

Example 18 with TextBoxSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class InvocationGridTest method testBodyFactoryWhenNotNested.

@Test
public void testBodyFactoryWhenNotNested() {
    setupGrid(0);
    final TextBoxSingletonDOMElementFactory factory = grid.getBodyTextBoxFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory) Test(org.junit.Test)

Example 19 with TextBoxSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class InvocationGridTest method testHeaderFactoryWhenNotNested.

@Test
public void testHeaderFactoryWhenNotNested() {
    setupGrid(0);
    final TextBoxSingletonDOMElementFactory factory = grid.getHeaderHasNameTextBoxFactory();
    assertCommands(factory.getHasNoValueCommand().apply(tupleWithoutValue), DeleteHeaderValueCommand.class, UpdateElementPropertyCommand.class);
    assertCommands(factory.getHasValueCommand().apply(tupleWithValue), SetHeaderValueCommand.class, UpdateElementPropertyCommand.class);
}
Also used : TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory) Test(org.junit.Test)

Example 20 with TextBoxSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class InvocationGridTest method testHeaderFactoryWhenNested.

@Test
public void testHeaderFactoryWhenNested() {
    setupGrid(1);
    final TextBoxSingletonDOMElementFactory factory = grid.getHeaderHasNameTextBoxFactory();
    assertCommands(factory.getHasNoValueCommand().apply(tupleWithoutValue), DeleteHeaderValueCommand.class);
    assertCommands(factory.getHasValueCommand().apply(tupleWithValue), SetHeaderValueCommand.class);
}
Also used : TextBoxSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory) Test(org.junit.Test)

Aggregations

TextBoxSingletonDOMElementFactory (org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory)23 Test (org.junit.Test)22 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)8 GridCellValueTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple)8 ExpressionEditorColumn (org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionEditorColumn)1 NameColumnHeaderMetaData (org.kie.workbench.common.dmn.client.editors.expressions.types.context.NameColumnHeaderMetaData)1 BaseHeaderMetaData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData)1 RowNumberColumn (org.uberfire.ext.wires.core.grids.client.widget.grid.columns.RowNumberColumn)1