Exemple #1
0
  private ViewerRow getRowAbove() {
    int index = item.getParent().indexOf(item) - 1;

    if (index >= 0) {
      return new GridViewerRow(item.getParent().getItem(index));
    }

    return null;
  }
Exemple #2
0
  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;
  }
Exemple #3
0
 /** {@inheritDoc} */
 @Override
 public int getCreationIndex(int visualIndex) {
   if (item != null && !item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex)) {
     return item.getParent().getColumnOrder()[visualIndex];
   }
   return super.getCreationIndex(visualIndex);
 }
Exemple #4
0
  /** {@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);
  }
Exemple #5
0
 /** {@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);
     }
   }
 }
Exemple #6
0
 /** {@inheritDoc} */
 @Override
 public int getColumnCount() {
   return item.getParent().getColumnCount();
 }
Exemple #7
0
 /**
  * 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();
 }
Exemple #8
0
 /** {@inheritDoc} */
 @Override
 public Control getControl() {
   return item.getParent();
 }