Search in sources :

Example 1 with DecisionTableOrientation

use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testSetDecisionTableOrientation.

@Test
public void testSetDecisionTableOrientation() {
    final DecisionTableOrientation orientation = DecisionTableOrientation.RULE_AS_ROW;
    setupGrid(makeHasNameForDecision(), 0);
    grid.setDecisionTableOrientation(orientation);
    verify(sessionCommandManager).execute(eq(canvasHandler), setOrientationCommandCaptor.capture());
    final SetOrientationCommand setOrientationCommand = setOrientationCommandCaptor.getValue();
    setOrientationCommand.execute(canvasHandler);
    verify(gridLayer).batch();
}
Also used : SetOrientationCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetOrientationCommand) DecisionTableOrientation(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation) Test(org.junit.Test)

Example 2 with DecisionTableOrientation

use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation in project kie-wb-common by kiegroup.

the class HitPolicyEditorImplTest method testSetOrientationNonNullControl.

@Test
public void testSetOrientationNonNullControl() {
    final DecisionTableOrientation orientation = DecisionTableOrientation.RULE_AS_ROW;
    when(control.getDecisionTableOrientation()).thenReturn(orientation);
    editor.bind(control, UI_ROW_INDEX, UI_COLUMN_INDEX);
    reset(view);
    editor.setDecisionTableOrientation(orientation);
    verify(control).setDecisionTableOrientation(eq(orientation));
}
Also used : DecisionTableOrientation(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation) Test(org.junit.Test)

Example 3 with DecisionTableOrientation

use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation in project kie-wb-common by kiegroup.

the class SetOrientationCommandTest method makeCommand.

private void makeCommand(final DecisionTableOrientation orientation) {
    this.dtable = new DecisionTable();
    this.dtable.setPreferredOrientation(orientation);
    this.command = new SetOrientationCommand(dtable, NEW_ORIENTATION, canvasOperation);
}
Also used : DecisionTable(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable)

Example 4 with DecisionTableOrientation

use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation in project kie-wb-common by kiegroup.

the class HitPolicyEditorViewImpl method setupDecisionTableOrientationEventHandler.

private void setupDecisionTableOrientationEventHandler() {
    setupChangeEventHandler(lstDecisionTableOrientation, () -> {
        final DecisionTableOrientation orientation = DecisionTableOrientation.fromValue(lstDecisionTableOrientation.getValue());
        presenter.setDecisionTableOrientation(orientation);
    });
}
Also used : DecisionTableOrientation(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation)

Example 5 with DecisionTableOrientation

use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation in project kie-wb-common by kiegroup.

the class HitPolicyEditorImplTest method testBindNonNullControlOrientation.

@Test
public void testBindNonNullControlOrientation() {
    final DecisionTableOrientation orientation = DecisionTableOrientation.RULE_AS_ROW;
    reset(view);
    when(control.getDecisionTableOrientation()).thenReturn(orientation);
    editor.bind(control, UI_ROW_INDEX, UI_COLUMN_INDEX);
    verify(view).enableHitPolicies(eq(false));
    verify(view).enableBuiltinAggregators(eq(false));
    verify(view).enableDecisionTableOrientation(eq(true));
    verify(view).initSelectedDecisionTableOrientation(eq(orientation));
}
Also used : DecisionTableOrientation(org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation) Test(org.junit.Test)

Aggregations

DecisionTableOrientation (org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTableOrientation)4 Test (org.junit.Test)3 DecisionTable (org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable)1 SetOrientationCommand (org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetOrientationCommand)1