use of org.uberfire.ext.wires.core.grids.client.model.GridColumn in project kie-wb-common by kiegroup.
the class LiteralExpressionGrid method initialiseUiColumns.
@Override
protected void initialiseUiColumns() {
final List<GridColumn.HeaderMetaData> headerMetaData = new ArrayList<>();
if (nesting == 0) {
headerMetaData.add(new LiteralExpressionColumnHeaderMetaData(hasExpression, hasName, clearValueConsumer(true, new Name()), setValueConsumer(true), setTypeRefConsumer(), translationService, cellEditorControls, headerEditor));
}
final GridColumn literalExpressionColumn = new LiteralExpressionColumn(headerMetaData, getAutocompleteTextareaFactory(), getAndSetInitialWidth(0, LITERAL_EXPRESSION_DEFAULT_WIDTH), this);
model.appendColumn(literalExpressionColumn);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridColumn in project kie-wb-common by kiegroup.
the class RelationGrid method initialiseUiColumns.
@Override
public void initialiseUiColumns() {
int uiColumnIndex = 0;
final RowNumberColumn rowNumberColumn = new RowNumberColumn();
rowNumberColumn.setWidth(getAndSetInitialWidth(uiColumnIndex++, rowNumberColumn.getWidth()));
if (getExpression().get().isPresent()) {
model.appendColumn(rowNumberColumn);
final Relation e = getExpression().get().get();
for (int index = 0; index < e.getColumn().size(); index++) {
final GridColumn relationColumn = makeRelationColumn(uiColumnIndex++, e.getColumn().get(index));
model.appendColumn(relationColumn);
}
}
getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridColumn in project kie-wb-common by kiegroup.
the class LiteralExpressionPMMLGrid method initialiseUiColumns.
@Override
protected void initialiseUiColumns() {
final GridColumn literalExpressionColumn = new LiteralExpressionPMMLColumn(getBodyListBoxFactory(), getAndSetInitialWidth(0, DMNGridColumn.DEFAULT_WIDTH), this);
model.appendColumn(literalExpressionColumn);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridColumn in project kie-wb-common by kiegroup.
the class DMNGridWidgetDnDMouseUpHandler method onNodeMouseUp.
@Override
public void onNodeMouseUp(final NodeMouseUpEvent event) {
if (state.getOperation() == GridWidgetDnDHandlersState.GridWidgetHandlersOperation.COLUMN_RESIZE) {
final GridWidget gridWidget = state.getActiveGridWidget();
final List<GridColumn<?>> gridColumns = state.getActiveGridColumns();
if (isBaseGrid(gridWidget) && isSingleDMNColumn(gridColumns)) {
final BaseGrid uiGridWidget = (BaseGrid) gridWidget;
final DMNGridColumn uiColumn = (DMNGridColumn) gridColumns.get(0);
uiGridWidget.registerColumnResizeCompleted(uiColumn, state.getEventInitialColumnWidth());
}
}
super.onNodeMouseUp(event);
}
use of org.uberfire.ext.wires.core.grids.client.model.GridColumn in project kie-wb-common by kiegroup.
the class DeleteRuleAnnotationClauseCommandTest method testNewCanvasCommandExecute.
@Test
public void testNewCanvasCommandExecute() {
final DeleteRuleAnnotationClauseCommand command = mock(DeleteRuleAnnotationClauseCommand.class);
final AbstractCanvasHandler handler = mock(AbstractCanvasHandler.class);
final int uiColumnIndex = 7;
final List columns = mock(List.class);
final GridData uiModel = mock(GridData.class);
final org.uberfire.mvp.Command executeCanvasOperation = mock(org.uberfire.mvp.Command.class);
final GridColumn gridColumn = mock(GridColumn.class);
doCallRealMethod().when(command).newCanvasCommand(handler);
when(command.getUiModel()).thenReturn(uiModel);
when(uiModel.getColumns()).thenReturn(columns);
when(command.getUiColumnIndex()).thenReturn(uiColumnIndex);
when(command.getExecuteCanvasOperation()).thenReturn(executeCanvasOperation);
when(columns.get(uiColumnIndex)).thenReturn(gridColumn);
final Command<AbstractCanvasHandler, CanvasViolation> canvasCommand = command.newCanvasCommand(handler);
final CommandResult<CanvasViolation> result = canvasCommand.execute(handler);
verify(uiModel).deleteColumn(gridColumn);
verify(command).updateParentInformation();
verify(executeCanvasOperation).execute();
assertEquals(CanvasCommandResultBuilder.SUCCESS, result);
}
Aggregations