private ViewerRow getRowAbove() { int index = item.getParent().indexOf(item) - 1; if (index >= 0) { return new GridViewerRow(item.getParent().getItem(index)); } return null; }
private ViewerRow getRowBelow() { int index = item.getParent().indexOf(item) + 1; if (index < item.getParent().getItemCount()) { GridItem tmp = item.getParent().getItem(index); // Maybe this is a dummy item!! if (tmp != null && !tmp.isDisposed() && tmp.isVisible() && tmp.getData() != null) { return new GridViewerRow(tmp); } } return null; }
/** {@inheritDoc} */ @Override public int getCreationIndex(int visualIndex) { if (item != null && !item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex)) { return item.getParent().getColumnOrder()[visualIndex]; } return super.getCreationIndex(visualIndex); }
/** {@inheritDoc} */ @Override public int getVisualIndex(int creationIndex) { int[] order = item.getParent().getColumnOrder(); for (int i = 0; i < order.length; i++) { if (order[i] == creationIndex) { return i; } } return super.getVisualIndex(creationIndex); }
/** {@inheritDoc} */ @Override public Rectangle getBounds(int columnIndex) { if (columnIndex == Integer.MAX_VALUE) { // TODO Provide implementation for GridItem return null; } else { if (!item.getParent().getColumn(columnIndex).isVisible()) { return new Rectangle(0, 0, 0, 0); } else { return item.getBounds(columnIndex); } } }
/** {@inheritDoc} */ @Override public int getColumnCount() { return item.getParent().getColumnCount(); }
/** * Check if the column of the cell is part of is visible * * @param columnIndex the column index * @return <code>true</code> if the column is visible */ @Override protected boolean isColumnVisible(int columnIndex) { return item.getParent().getColumn(columnIndex).isVisible(); }
/** {@inheritDoc} */ @Override public Control getControl() { return item.getParent(); }