@Test @SuppressWarnings("unchecked") public void testEditWithDefinedCellEditor() { final UndefinedExpressionCell cell = mock(UndefinedExpressionCell.class); column.edit(cell, context, callback); verify(undefinedExpressionSelector).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(undefinedExpressionSelector), eq(0), eq(0)); }
@Override @SuppressWarnings("unchecked") public void edit(final GridCell<String> cell, final GridBodyCellEditContext context, final Consumer<GridCellValue<String>> callback) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); undefinedExpressionSelector.bind(gridWidget, uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX, absoluteCellY}; final Optional<com.ait.lienzo.client.core.types.Point2D> rx = context.getRelativeLocation(); if (!rx.isPresent()) { dxy[0] += gridWidget.getWidth() / 2.0; dxy[1] += gridWidget.getHeight() / 2.0; } else { dxy[0] = rx.get().getX(); dxy[1] = rx.get().getY(); } cellEditorControls.show(undefinedExpressionSelector, (int) (dxy[0]), (int) (dxy[1])); }
UndefinedExpressionColumn extends DMNGridColumn<UndefinedExpressionGrid, String> { @Override @SuppressWarnings("unchecked") public void edit(final GridCell<String> cell, final GridBodyCellEditContext context, final Consumer<GridCellValue<String>> callback) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); undefinedExpressionSelector.bind(gridWidget, uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX, absoluteCellY}; final Optional<com.ait.lienzo.client.core.types.Point2D> rx = context.getRelativeLocation(); if (!rx.isPresent()) { dxy[0] += gridWidget.getWidth() / 2.0; dxy[1] += gridWidget.getHeight() / 2.0; } else { dxy[0] = rx.get().getX(); dxy[1] = rx.get().getY(); } cellEditorControls.show(undefinedExpressionSelector, (int) (dxy[0]), (int) (dxy[1])); } }
UndefinedExpressionColumn extends DMNGridColumn<UndefinedExpressionGrid, String> { @Override @SuppressWarnings("unchecked") public void edit(final GridCell<String> cell, final GridBodyCellEditContext context, final Consumer<GridCellValue<String>> callback) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); undefinedExpressionSelector.bind(gridWidget, uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX, absoluteCellY}; final Optional<com.ait.lienzo.client.core.types.Point2D> rx = context.getRelativeLocation(); if (!rx.isPresent()) { dxy[0] += gridWidget.getWidth() / 2.0; dxy[1] += gridWidget.getHeight() / 2.0; } else { dxy[0] = rx.get().getX(); dxy[1] = rx.get().getY(); } cellEditorControls.show(undefinedExpressionSelector, (int) (dxy[0]), (int) (dxy[1])); } UndefinedExpressionColumn(final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector);  UndefinedExpressionColumn(final List<HeaderMetaData> headerMetaData,
                                     final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector); }
UndefinedExpressionColumn extends DMNGridColumn<UndefinedExpressionGrid, String> { @Override @SuppressWarnings("unchecked") public void edit(final GridCell<String> cell, final GridBodyCellEditContext context, final Consumer<GridCellValue<String>> callback) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); undefinedExpressionSelector.bind(gridWidget, uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX, absoluteCellY}; final Optional<com.ait.lienzo.client.core.types.Point2D> rx = context.getRelativeLocation(); if (!rx.isPresent()) { dxy[0] += gridWidget.getWidth() / 2.0; dxy[1] += gridWidget.getHeight() / 2.0; } else { dxy[0] = rx.get().getX(); dxy[1] = rx.get().getY(); } cellEditorControls.show(undefinedExpressionSelector, (int) (dxy[0]), (int) (dxy[1])); } UndefinedExpressionColumn(final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector);  UndefinedExpressionColumn(final List<HeaderMetaData> headerMetaData,
                                     final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector); @Override @SuppressWarnings("unchecked") void edit(final GridCell<String> cell,
                     final GridBodyCellEditContext context,
                     final Consumer<GridCellValue<String>> callback); @Override void setWidth(final double width); @Override void destroyResources(); }
UndefinedExpressionColumn extends DMNGridColumn<UndefinedExpressionGrid, String> { @Override @SuppressWarnings("unchecked") public void edit(final GridCell<String> cell, final GridBodyCellEditContext context, final Consumer<GridCellValue<String>> callback) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); undefinedExpressionSelector.bind(gridWidget, uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX, absoluteCellY}; final Optional<com.ait.lienzo.client.core.types.Point2D> rx = context.getRelativeLocation(); if (!rx.isPresent()) { dxy[0] += gridWidget.getWidth() / 2.0; dxy[1] += gridWidget.getHeight() / 2.0; } else { dxy[0] = rx.get().getX(); dxy[1] = rx.get().getY(); } cellEditorControls.show(undefinedExpressionSelector, (int) (dxy[0]), (int) (dxy[1])); } UndefinedExpressionColumn(final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector);  UndefinedExpressionColumn(final List<HeaderMetaData> headerMetaData,
                                     final double width,
                                     final UndefinedExpressionGrid gridWidget,
                                     final CellEditorControlsView.Presenter cellEditorControls,
                                     final UndefinedExpressionSelectorPopoverView.Presenter undefinedExpressionSelector); @Override @SuppressWarnings("unchecked") void edit(final GridCell<String> cell,
                     final GridBodyCellEditContext context,
                     final Consumer<GridCellValue<String>> callback); @Override void setWidth(final double width); @Override void destroyResources(); static final double DEFAULT_WIDTH; }