コード例 #1
0
 /**
  * Gets the appropriate property name or property value.
  *
  * @param rowIndex the row corresponding to a property
  * @param columnIndex either the name column (zero) or value column (one)
  * @return the name or value of the appropriate property
  */
 public Object getValueAt(int rowIndex, int columnIndex) {
   InstancePropertyDescriptor row = getRow(rowIndex);
   if (columnIndex == 0) {
     return row.getName();
   } else if (columnIndex == 1) {
     return row;
   } else {
     throw new IndexOutOfBoundsException("Not a valid cell: " + rowIndex + "x" + columnIndex);
   }
 }
コード例 #2
0
    /**
     * Sort the descriptors by their display name using the current lexicographical ordering
     *
     * @param a a property descriptor
     * @param b the other ObjectPropertyDescriptor
     * @return <code>getName().compareto(b.getName())</code>
     */
    public int compare(Object a, Object b) {
      InstancePropertyDescriptor A = (InstancePropertyDescriptor) a;
      InstancePropertyDescriptor B = (InstancePropertyDescriptor) b;

      return A.getName().compareTo(B.getName());
    }