@Test public void testEditWithNoRelationLocation() { final GridBodyCellEditContext context = new GridBodyCellEditContext(ABSOLUTE_CELL_X, ABSOLUTE_CELL_Y, CELL_WIDTH, CELL_HEIGHT, CLIP_MIN_Y, CLIP_MIN_X, ROW_INDEX, COLUMN_INDEX, IS_FLOATING, transform, renderer, Optional.empty()); header.edit(context); verify(editor).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(editor), eq((int) (ABSOLUTE_CELL_X + CELL_WIDTH / 2)), eq((int) (ABSOLUTE_CELL_Y + CELL_HEIGHT / 2))); }
@Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); }
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } }
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
                                       final E editor); }
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
                                       final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
                                       final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources();  }