Search in sources :

Example 1 with TextBoxSingletonDOMElementFactory

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

the class RelationGridTest method testHeaderFactoryWhenNotNested.

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

Example 2 with TextBoxSingletonDOMElementFactory

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

the class ContextGridTest 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)

Example 3 with TextBoxSingletonDOMElementFactory

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

the class ContextGridTest 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 4 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 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);
}
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 5 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 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);
}
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)

Aggregations

Test (org.junit.Test)17 TextBoxSingletonDOMElementFactory (org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextBoxSingletonDOMElementFactory)17 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)6 GridCellValueTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple)6