use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project kie-wb-common by kiegroup.
the class InvocationGridTest method testExpressionColumnMetaData.
@Test
public void testExpressionColumnMetaData() {
setupGrid(0);
final GridColumn<?> column = grid.getModel().getColumns().get(InvocationUIModelMapper.BINDING_EXPRESSION_COLUMN_INDEX);
final List<GridColumn.HeaderMetaData> header = column.getHeaderMetaData();
assertEquals(2, header.size());
assertTrue(header.get(0) instanceof BaseHeaderMetaData);
assertTrue(header.get(1) instanceof InvocationColumnExpressionHeaderMetaData);
final BaseHeaderMetaData md1 = (BaseHeaderMetaData) header.get(0);
final InvocationColumnExpressionHeaderMetaData md2 = (InvocationColumnExpressionHeaderMetaData) header.get(1);
assertEquals("", md1.getTitle());
assertEquals("invocation-expression", md2.getTitle());
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project kie-wb-common by kiegroup.
the class CommandUtilsTest method testUpdateParentInformation_WithMultipleColumns.
@Test
@SuppressWarnings("unchecked")
public void testUpdateParentInformation_WithMultipleColumns() {
setupUiModel(Pair.newPair(new ExpressionEditorColumn(gridLayer, new BaseHeaderMetaData("column"), ExpressionEditorColumn.DEFAULT_WIDTH, gridWidget), (rowIndex) -> {
final BaseExpressionGrid grid = mock(BaseExpressionGrid.class);
final GridCellTuple gct = new GridCellTuple(rowIndex, 0, mock(GridWidget.class));
when(grid.getParentInformation()).thenReturn(gct);
return new ExpressionCellValue(Optional.of(grid));
}), Pair.newPair(new RowNumberColumn(), (rowIndex) -> new BaseGridCellValue<>(rowIndex + 1)));
assertParentInformationValues(0);
gridData.moveColumnTo(0, gridData.getColumns().get(1));
CommandUtils.updateParentInformation(gridData);
assertParentInformationValues(1);
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ActionWorkItemExecuteColumnConverter method makeHeaderMetaData.
@Override
public List<GridColumn.HeaderMetaData> makeHeaderMetaData(final BaseColumn column) {
final PortableWorkDefinition pwd = ((ActionWorkItemCol52) column).getWorkItemDefinition();
final String workItemName = pwd == null ? column.getHeader() : pwd.getName();
return new ArrayList<GridColumn.HeaderMetaData>() {
{
add(new BaseHeaderMetaData(workItemName, ActionCol52.class.getName()));
add(new BaseHeaderMetaData(column.getHeader(), workItemName + "-exec"));
}
};
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ActionInsertFactColumnConverter method makeHeaderMetaData.
@Override
public List<GridColumn.HeaderMetaData> makeHeaderMetaData(final BaseColumn column) {
return new ArrayList<GridColumn.HeaderMetaData>() {
{
if (column instanceof ActionInsertFactCol52) {
ActionInsertFactCol52 actionInsertFactColumn = (ActionInsertFactCol52) column;
StringBuilder headerFirstRow = new StringBuilder();
if (actionInsertFactColumn.getBoundName() != null && !actionInsertFactColumn.getBoundName().isEmpty()) {
headerFirstRow.append(actionInsertFactColumn.getBoundName()).append(" : ");
}
headerFirstRow.append(actionInsertFactColumn.getFactType());
add(new BaseHeaderMetaData(headerFirstRow.toString(), ActionCol52.class.getName()));
add(new BaseHeaderMetaData(column.getHeader(), headerFirstRow.toString()));
} else {
add(new BaseHeaderMetaData(column.getHeader(), ActionCol52.class.getName()));
}
}
};
}
use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseHeaderMetaData in project drools-wb by kiegroup.
the class ActionSetFieldColumnConverter method makeHeaderMetaData.
@Override
public List<GridColumn.HeaderMetaData> makeHeaderMetaData(final BaseColumn column) {
return new ArrayList<GridColumn.HeaderMetaData>() {
{
if (column instanceof ActionSetFieldCol52) {
ActionSetFieldCol52 actionSetFieldColumn = (ActionSetFieldCol52) column;
if (actionSetFieldColumn.getBoundName() != null && !actionSetFieldColumn.getBoundName().isEmpty()) {
add(new BaseHeaderMetaData(actionSetFieldColumn.getBoundName(), ActionCol52.class.getName()));
add(new BaseHeaderMetaData(column.getHeader(), actionSetFieldColumn.getBoundName()));
}
} else {
add(new BaseHeaderMetaData(column.getHeader(), ActionCol52.class.getName()));
}
}
};
}
Aggregations