Example #1
0
 /** @param parent the parent to set */
 public void setParent(SuperGrid<T> parent) {
   if (this.parent != null) {
     this.parent.remove(this);
   }
   if (parent != null) {
     parent.add(this);
   }
 }
Example #2
0
 public void insertColumnBefore(int col) {
   if (col < 0 || col > width) {
     throw new IllegalArgumentException("Column #" + col + " does not exist");
   }
   if (col == width) {
     for (Row<T> row : this) {
       row.lastCell._insertCellAfter();
     }
   } else {
     for (Row<T> row : this) {
       row.get(col)._insertCellBefore();
     }
   }
   width++;
   if (parent != null) {
     parent._insertColumnBefore(col, width);
   }
 }