Search in sources :

Example 1 with GridColumnRenderer

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer in project kie-wb-common by kiegroup.

the class BaseExpressionGridGeneralTest method mockColumn.

@SuppressWarnings("unchecked")
private DMNGridColumn mockColumn(final double width, final BaseGrid gridWidget) {
    final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class);
    final GridColumnRenderer columnRenderer = mock(GridColumnRenderer.class);
    return new DMNGridColumn(headerMetaData, columnRenderer, width, gridWidget) {

        {
            setWidth(width);
        }
    };
}
Also used : GridColumnRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn) BaseGridColumn(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn)

Example 2 with GridColumnRenderer

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer in project kie-wb-common by kiegroup.

the class BaseExpressionGridGeneralTest method mockColumn.

@SuppressWarnings("unchecked")
private DMNGridColumn mockColumn(final double width, final GridWidget gridWidget) {
    final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class);
    final GridColumnRenderer columnRenderer = mock(GridColumnRenderer.class);
    return new DMNGridColumn(headerMetaData, columnRenderer, gridWidget) {

        {
            setWidth(width);
        }
    };
}
Also used : GridColumnRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn)

Example 3 with GridColumnRenderer

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer in project kie-wb-common by kiegroup.

the class ExpressionEditorColumnTest method mockEditor.

@SuppressWarnings("unchecked")
private BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper> mockEditor(final double padding, final double... widthOfCells) {
    final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class);
    final GridColumnRenderer gridColumnRenderer = mock(GridColumnRenderer.class);
    final BaseExpressionGrid gridWidget = mock(BaseExpressionGrid.class);
    when(gridWidget.getExpression()).thenReturn(Optional::empty);
    final GridCellTuple parent = new GridCellTuple(0, 0, null);
    final Optional<HasName> hasName = Optional.of(mock(HasName.class));
    return new BaseExpressionGrid(parent, Optional.empty(), HasExpression.NOP, hasName, gridPanel, gridLayer, new DMNGridData(), renderer, definitionUtils, sessionManager, sessionCommandManager, canvasCommandFactory, editorSelectedEvent, refreshFormPropertiesEvent, domainObjectSelectionEvent, cellEditorControls, listSelector, translationService, false, 0, readOnlyProvider) {

        @Override
        protected BaseUIModelMapper makeUiModelMapper() {
            return null;
        }

        @Override
        public void initialiseUiColumns() {
            for (double width : widthOfCells) {
                model.appendColumn(new DMNGridColumn<BaseGrid<Expression>, Object>(headerMetaData, gridColumnRenderer, width, gridWidget) {

                    {
                        setMinimumWidth(width);
                        setWidth(width);
                    }
                });
            }
        }

        @Override
        public void initialiseUiRows() {
        // Nothing for this test
        }

        @Override
        public void initialiseUiCells() {
        // Nothing for this test
        }

        @Override
        public double getPadding() {
            return padding;
        }
    };
}
Also used : GridColumnRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer) Optional(java.util.Optional) HasName(org.kie.workbench.common.dmn.api.definition.HasName) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) BaseGrid(org.kie.workbench.common.dmn.client.widgets.grid.BaseGrid) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) BaseExpressionGrid(org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn)

Aggregations

DMNGridColumn (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn)3 GridColumn (org.uberfire.ext.wires.core.grids.client.model.GridColumn)3 GridColumnRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.columns.GridColumnRenderer)3 Optional (java.util.Optional)1 HasName (org.kie.workbench.common.dmn.api.definition.HasName)1 BaseExpressionGrid (org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid)1 BaseGrid (org.kie.workbench.common.dmn.client.widgets.grid.BaseGrid)1 DMNGridData (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)1 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)1 BaseGridColumn (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridColumn)1