use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow in project kie-wb-common by kiegroup.
the class ReassignmentWidgetViewImpl method initGroups.
private void initGroups() {
PopoverTextCell toGroups = new PopoverTextCell();
Column<ReassignmentRow, String> toGroupsColumn = new Column<ReassignmentRow, String>(toGroups) {
@Override
public String getValue(ReassignmentRow object) {
if (object.getGroups() != null) {
return object.getGroups().stream().collect(Collectors.joining(","));
} else {
return "";
}
}
};
toGroupsColumn.setSortable(false);
table.addColumn(toGroupsColumn, presenter.getToGroupsLabel());
table.setColumnWidth(toGroupsColumn, 150, Style.Unit.PX);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow in project kie-wb-common by kiegroup.
the class ReassignmentWidgetViewImpl method initType.
private void initType() {
TextCell typeCell = new TextCell();
Column<ReassignmentRow, String> typeColumn = new Column<ReassignmentRow, String>(typeCell) {
@Override
public String getValue(ReassignmentRow object) {
if (object.getType() != null) {
return object.getType().getType();
}
return "";
}
};
typeColumn.setSortable(false);
table.addColumn(typeColumn, presenter.getTypeLabel());
table.setColumnWidth(typeColumn, 140, Style.Unit.PX);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow in project kie-wb-common by kiegroup.
the class ReassignmentEditorWidgetTest method testCreateAndSaveEmpty.
@Test
public void testCreateAndSaveEmpty() {
ReassignmentRow test = new ReassignmentRow();
doNothing().when(view).hide();
when(customerBinder.getModel()).thenReturn(test);
when(notCompleted.getValue()).thenReturn(ReassignmentType.NotCompletedReassign.getAlias());
when(typeSelect.getSelectedItem()).thenReturn(notCompleted);
when(multipleLiveSearchSelectionHandlerGroups.getSelectedValues()).thenReturn(Collections.EMPTY_LIST);
when(multipleLiveSearchSelectionHandlerUsers.getSelectedValues()).thenReturn(Collections.EMPTY_LIST);
view.createOrEdit(reassignmentWidgetViewImpl, test);
view.ok();
ReassignmentRow result = getFieldValue(ReassignmentEditorWidgetViewImpl.class, view, "current");
Assert.assertEquals(result, test);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow in project kie-wb-common by kiegroup.
the class ReassignmentWidgetViewImplTest method generateRows.
private List<ReassignmentRow> generateRows() {
List<ReassignmentRow> rows = new ArrayList<>();
ReassignmentRow row1 = new ReassignmentRow();
row1.setId(1);
ReassignmentRow row2 = new ReassignmentRow();
row2.setId(2);
ReassignmentRow row3 = new ReassignmentRow();
row3.setId(3);
ReassignmentRow row4 = new ReassignmentRow();
row4.setId(4);
rows.add(row1);
rows.add(row2);
rows.add(row3);
rows.add(row4);
return rows;
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.ReassignmentRow in project kie-wb-common by kiegroup.
the class ReassignmentWidgetViewImplTest method testDeleteRow.
@Test
public void testDeleteRow() {
ReassignmentRow row4 = new ReassignmentRow();
row4.setId(4);
reassignmentWidgetViewImpl.init(presenter, generateRows());
ListDataProvider<ReassignmentRow> dataProvider = getFieldValue(ReassignmentWidgetViewImpl.class, reassignmentWidgetViewImpl, "dataProvider");
Assert.assertEquals(4, dataProvider.getList().size());
reassignmentWidgetViewImpl.delete(row4);
Assert.assertEquals(3, dataProvider.getList().size());
}
Aggregations