use of org.kie.workbench.common.dmn.api.definition.model.Relation in project kie-wb-common by kiegroup.
the class ExpressionPropertyConverterTest method testDMNFromWB_RelationConversion.
@Test
public void testDMNFromWB_RelationConversion() {
final Relation wb = new Relation();
final List<Double> wbComponentWidths = wb.getComponentWidths();
wbComponentWidths.set(0, 200.0);
wb.getId().setValue(EXPRESSION_UUID);
assertDMNFromWBConversion(wb, TRelation.class, 200.0);
}
use of org.kie.workbench.common.dmn.api.definition.model.Relation in project kie-wb-common by kiegroup.
the class RelationGrid method doAfterSelectionChange.
@Override
public void doAfterSelectionChange(final int uiRowIndex, final int uiColumnIndex) {
if (hasAnyHeaderCellSelected() || hasMultipleCellsSelected()) {
super.doAfterSelectionChange(uiRowIndex, uiColumnIndex);
return;
}
if (getExpression().get().isPresent()) {
final Relation relation = getExpression().get().get();
final RelationUIModelMapperHelper.RelationSection section = RelationUIModelMapperHelper.getSection(relation, uiColumnIndex);
if (section == RelationUIModelMapperHelper.RelationSection.INFORMATION_ITEM) {
final int iiIndex = RelationUIModelMapperHelper.getInformationItemIndex(relation, uiColumnIndex);
final HasExpression hasExpression = relation.getRow().get(uiRowIndex).getExpression().get(iiIndex);
final Expression expression = hasExpression.getExpression();
if (expression instanceof DomainObject) {
final DomainObject domainObject = (DomainObject) expression;
fireDomainObjectSelectionEvent(domainObject);
return;
}
}
}
super.doAfterSelectionChange(uiRowIndex, uiColumnIndex);
}
use of org.kie.workbench.common.dmn.api.definition.model.Relation in project kie-wb-common by kiegroup.
the class AddRelationColumnCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.informationItem = new InformationItem();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
makeCommand(1);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiModelColumn).getIndex();
}
use of org.kie.workbench.common.dmn.api.definition.model.Relation in project kie-wb-common by kiegroup.
the class AddRelationRowCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.row = new List();
this.uiModelRow = new BaseGridRow();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
makeCommand(0);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiModelColumn).getIndex();
}
use of org.kie.workbench.common.dmn.api.definition.model.Relation in project kie-wb-common by kiegroup.
the class MoveColumnsCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.uiModel = new DMNGridData();
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiModelColumn1).getIndex();
doReturn(2).when(uiModelColumn2).getIndex();
addRelationColumn(II1);
addRelationColumn(II2);
addRelationRow(II1);
addRelationRow(II2);
addUiModelColumn(uiRowNumberColumn);
addUiModelColumn(uiModelColumn1);
addUiModelColumn(uiModelColumn2);
addUiModelRow(0);
addUiModelRow(1);
}
Aggregations