示例#1
0
 /**
  * Sets the appropriate property value, if possible. Otherwise, this silently fails.
  *
  * @param value the new value for the appropriate property
  * @param rowIndex the row corresponding to a property
  * @param columnIndex only the value column (column one) works
  */
 public void setValueAt(Object value, int rowIndex, int columnIndex) {
   if (columnIndex == 1) {
     InstancePropertyDescriptor row = getRow(rowIndex);
     if (row.isSettable(props.getObject())) {
       row.applySetter(props.getObject(), value);
     }
   }
 }
示例#2
0
 /**
  * Determines if the value at a cell is editable
  *
  * @param rowIndex the property
  * @param columnIndex whether the property name (column zero) or property value (column one)
  * @return true, if the corresponding property is settable and the column index is 1
  */
 public boolean isCellEditable(int rowIndex, int columnIndex) {
   InstancePropertyDescriptor row = getRow(rowIndex);
   if (columnIndex == 0) {
     return false;
   } else if (columnIndex == 1) {
     return row.isSettable(props.getObject());
   } else {
     throw new IndexOutOfBoundsException("Not a valid cell: " + rowIndex + "x" + columnIndex);
   }
 }