GridData.appendColumn
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.uberfire.ext.wires.core.grids.client.model.GridData.appendColumn (Showing top 20 results out of 315)

  • Common ways to obtain GridData
private void myMethod () {
GridData g =
  • GridWidget gridWidget;gridWidget.getModel()
  • Smart code suggestions by Codota
}
origin: org.kie.workbench/kie-wb-common-dmn-client

@Override
public void initialiseUiColumns() {
  final NameColumn nameColumn = new NameColumn(this);
  final ExpressionEditorColumn expressionColumn = new ExpressionEditorColumn(gridLayer,
                                        Collections.emptyList(),
                                        this);
  model.appendColumn(new ContextGridRowNumberColumn(Collections.emptyList()));
  model.appendColumn(nameColumn);
  model.appendColumn(expressionColumn);
  getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> !isSelectionLayer || gridColumn.equals(expressionColumn));
}
origin: org.kie.workbench/kie-wb-common-dmn-client

@Override
public void initialiseUiColumns() {
  expression.ifPresent(e -> {
    model.appendColumn(new RowNumberColumn());
    e.getColumn().forEach(ii -> {
      final GridColumn relationColumn = makeRelationColumn(ii);
      model.appendColumn(relationColumn);
    });
  });
  getRenderer().setColumnRenderConstraint((isSelectionLayer, gridColumn) -> true);
}
origin: org.kie.workbench/kie-wb-common-dmn-client

@Override
protected void initialiseUiColumns() {
  final DMNGridColumn undefinedExpressionColumn = new UndefinedExpressionColumn(this,
                                         cellEditorControls,
                                         undefinedExpressionSelector,
                                         translationService);
  undefinedExpressionColumn.setMovable(false);
  undefinedExpressionColumn.setResizable(false);
  model.appendColumn(undefinedExpressionColumn);
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
public void testEditWhenNoCellSelected() {
  final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class);
  final GridColumn<?> gridColumn = mockGridColumn(100.0, Arrays.asList(headerMetaData));
  gridWidget.getModel().appendColumn(gridColumn);
  CellContextUtilities.editSelectedCell(gridWidget);
  verify(headerMetaData, never()).edit(any(GridBodyCellEditContext.class));
  verify(gridWidget, never()).startEditingCell(anyInt(), anyInt());
  verify(gridWidget, never()).startEditingCell(any(Point2D.class));
}
origin: kiegroup/appformer

@Test
public void testEditWhenNoCellSelected() {
  final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class);
  final GridColumn<?> gridColumn = mockGridColumn(100.0, Arrays.asList(headerMetaData));
  gridWidget.getModel().appendColumn(gridColumn);
  CellContextUtilities.editSelectedCell(gridWidget);
  verify(headerMetaData, never()).edit(any(GridBodyCellEditContext.class));
  verify(gridWidget, never()).startEditingCell(anyInt(), anyInt());
  verify(gridWidget, never()).startEditingCell(any(Point2D.class));
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
public void testDestroyResourcesOnKeyDown() {
  when(layer.getGridWidgets()).thenReturn(gridWidgets);
  when(gridWidget1.isSelected()).thenReturn(true);
  when(event.getNativeKeyCode()).thenReturn(KeyCodes.KEY_RIGHT);
  final StringDOMElementColumn columnWithAdditionalDomElements = mock(StringDOMElementColumn.class);
  gridWidget1Data.appendColumn(columnWithAdditionalDomElements);
  handler.onKeyDown(event);
  verify(columnWithAdditionalDomElements).destroyResources();
}
origin: kiegroup/appformer

@Test
public void testDestroyResourcesAndFlushOnKeyDown() {
  when(layer.getGridWidgets()).thenReturn(gridWidgets);
  when(gridWidget1.isSelected()).thenReturn(true);
  when(event.getNativeKeyCode()).thenReturn(KeyCodes.KEY_RIGHT);
  final StringDOMElementSingletonColumn columnWithAdditionalDomElements = mock(StringDOMElementSingletonColumn.class);
  gridWidget1Data.appendColumn(columnWithAdditionalDomElements);
  handler.onKeyDown(event);
  verify(columnWithAdditionalDomElements).flush();
  verify(columnWithAdditionalDomElements).destroyResources();
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
public void testDestroyResourcesAndFlushOnKeyDown() {
  when(layer.getGridWidgets()).thenReturn(gridWidgets);
  when(gridWidget1.isSelected()).thenReturn(true);
  when(event.getNativeKeyCode()).thenReturn(KeyCodes.KEY_RIGHT);
  final StringDOMElementSingletonColumn columnWithAdditionalDomElements = mock(StringDOMElementSingletonColumn.class);
  gridWidget1Data.appendColumn(columnWithAdditionalDomElements);
  handler.onKeyDown(event);
  verify(columnWithAdditionalDomElements).flush();
  verify(columnWithAdditionalDomElements).destroyResources();
}
origin: kiegroup/appformer

@Test
public void testDestroyResourcesOnKeyDown() {
  when(layer.getGridWidgets()).thenReturn(gridWidgets);
  when(gridWidget1.isSelected()).thenReturn(true);
  when(event.getNativeKeyCode()).thenReturn(KeyCodes.KEY_RIGHT);
  final StringDOMElementColumn columnWithAdditionalDomElements = mock(StringDOMElementColumn.class);
  gridWidget1Data.appendColumn(columnWithAdditionalDomElements);
  handler.onKeyDown(event);
  verify(columnWithAdditionalDomElements).destroyResources();
}
origin: kiegroup/appformer

@Test
public void testSelectCellAppendColumnWithRowSelected() {
  doTestSelectCellWithRowSelected((data) -> data.appendColumn(new MockMergableGridColumn<String>("col1",
                                                  100)));
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
public void testSelectCellAppendColumnWithRowSelected() {
  doTestSelectCellWithRowSelected((data) -> data.appendColumn(new MockMergableGridColumn<String>("col1",
                                                  100)));
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
@SuppressWarnings("unchecked")
public void testGetUiColumnIndexInHeaderAfterLastColumn() throws Exception {
  gridData.appendColumn(new BaseGridColumn<>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH));
  gridData.appendColumn(new BaseGridColumn<>(new BaseHeaderMetaData("second"), gridColumnRenderer, COLUMN_WIDTH));
  gridData.appendColumn(new BaseGridColumn<>(new BaseHeaderMetaData("third"), gridColumnRenderer, COLUMN_WIDTH));
  setupGridWidget();
  doReturn(gridSelectionManager).when(view).getLayer();
  final Integer columnIndex = CoordinateUtilities.getUiColumnIndex(view, (COLUMN_WIDTH * 3) + 1);
  Assertions.assertThat(columnIndex).isNull();
}
origin: kiegroup/appformer

@Test
@SuppressWarnings("unchecked")
public void testGetUiColumnIndexInHeaderAfterLastColumn() throws Exception {
  gridData.appendColumn(new BaseGridColumn<>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH));
  gridData.appendColumn(new BaseGridColumn<>(new BaseHeaderMetaData("second"), gridColumnRenderer, COLUMN_WIDTH));
  gridData.appendColumn(new BaseGridColumn<>(new BaseHeaderMetaData("third"), gridColumnRenderer, COLUMN_WIDTH));
  setupGridWidget();
  doReturn(gridSelectionManager).when(view).getLayer();
  final Integer columnIndex = CoordinateUtilities.getUiColumnIndex(view, (COLUMN_WIDTH * 3) + 1);
  Assertions.assertThat(columnIndex).isNull();
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
public void testEditWhenDataCellSelectedSecondRow() {
  final GridColumn.HeaderMetaData headerMetaData = mock(GridColumn.HeaderMetaData.class);
  final GridColumn<?> gridColumn = mockGridColumn(100.0, Arrays.asList(headerMetaData));
  doReturn(0).when(gridColumn).getIndex();
  gridWidget.getModel().appendColumn(gridColumn);
  gridWidget.getModel().appendRow(new BaseGridRow());
  gridWidget.getModel().appendRow(new BaseGridRow());
  gridWidget.getModel().selectCell(1, 0);
  CellContextUtilities.editSelectedCell(gridWidget);
  verify(headerMetaData, never()).edit(any(GridBodyCellEditContext.class));
  verify(gridWidget).startEditingCell(1, 0);
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
@SuppressWarnings("unchecked")
public void testGetUiHeaderRowIndexHeaderMinY() {
  point = new Point2D(COLUMN_WIDTH / 2, -5.0);
  setupGridWidget();
  final GridColumn uiColumn = new BaseGridColumn<>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH);
  gridData.appendColumn(uiColumn);
  doReturn(uiColumn).when(ci).getColumn();
  final Integer uiHeaderRowIndex = CoordinateUtilities.getUiHeaderRowIndex(view,
                                       point);
  assertNull(uiHeaderRowIndex);
}
origin: kiegroup/appformer

@Test
@SuppressWarnings("unchecked")
public void testGetUiHeaderRowIndexHeaderMinY() {
  point = new Point2D(COLUMN_WIDTH / 2, -5.0);
  setupGridWidget();
  final GridColumn uiColumn = new BaseGridColumn<>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH);
  gridData.appendColumn(uiColumn);
  doReturn(uiColumn).when(ci).getColumn();
  final Integer uiHeaderRowIndex = CoordinateUtilities.getUiHeaderRowIndex(view,
                                       point);
  assertNull(uiHeaderRowIndex);
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
@SuppressWarnings("unchecked")
public void testGetUiHeaderRowIndexHeaderMaxY() {
  point = new Point2D(COLUMN_WIDTH / 2, gridRenderer.getHeaderHeight() + 5.0);
  setupGridWidget();
  final GridColumn uiColumn = new BaseGridColumn<>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH);
  gridData.appendColumn(uiColumn);
  doReturn(uiColumn).when(ci).getColumn();
  final Integer uiHeaderRowIndex = CoordinateUtilities.getUiHeaderRowIndex(view,
                                       point);
  assertNull(uiHeaderRowIndex);
}
origin: kiegroup/appformer

@Test
@SuppressWarnings("unchecked")
public void testGetUiHeaderRowIndexHeaderMaxY() {
  point = new Point2D(COLUMN_WIDTH / 2, gridRenderer.getHeaderHeight() + 5.0);
  setupGridWidget();
  final GridColumn uiColumn = new BaseGridColumn<>(new BaseHeaderMetaData("first"), gridColumnRenderer, COLUMN_WIDTH);
  gridData.appendColumn(uiColumn);
  doReturn(uiColumn).when(ci).getColumn();
  final Integer uiHeaderRowIndex = CoordinateUtilities.getUiHeaderRowIndex(view,
                                       point);
  assertNull(uiHeaderRowIndex);
}
origin: org.uberfire/uberfire-wires-core-grids

@Test
public void checkSelectedCellsWithHiddenColumnMultipleColumns() {
  final GridColumn<String> column2 = makeGridColumn(200.0);
  this.model.appendColumn(column2);
  setupSelectionContext();
  checkRenderedSelectedCells(0,
                0,
                2,
                1,
                0,
                0,
                column.getWidth() + column2.getWidth());
}
origin: kiegroup/appformer

@Test
public void checkSelectedCellsWithHiddenColumnMultipleColumns() {
  final GridColumn<String> column2 = makeGridColumn(200.0);
  this.model.appendColumn(column2);
  setupSelectionContext();
  checkRenderedSelectedCells(0,
                0,
                2,
                1,
                0,
                0,
                column.getWidth() + column2.getWidth());
}
org.uberfire.ext.wires.core.grids.client.modelGridDataappendColumn

Javadoc

Appends a column to the end of the grid. End being considered the far most right.

Popular methods of GridData

  • getColumns
    Returns the columns associated with the grid.
  • deleteCell
    Deletes a cell at the specified physical coordinate.
  • getCell
    Returns a cell at the specified physical coordinate.
  • getColumnCount
    Returns the total number of columns in the grid, including hidden columns.
  • getHeaderRowCount
    Returns the number of rows in the grid's header.
  • getRow
    Returns the row at the specified index.
  • clearSelections
    Clears all cell selections.
  • getRowCount
    Returns the total number of rows in the grid, including collapsed rows.
  • getSelectedCells
    Returns all selected cells.
  • getSelectedHeaderCells
    Returns all selected header cells.
  • selectCell
    Selects a cell at the specified physical coordinate.
  • setCellValue
    Sets a cell value at the specified physical coordinate.
  • selectCell,
  • setCellValue,
  • appendRow,
  • getSelectedCellsOrigin,
  • selectCells,
  • selectHeaderCell,
  • collapseCell,
  • deleteColumn,
  • deleteRow

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)