コード例 #1
0
  /**
   * The <code>PropertySheetEntry</code> implmentation of this method declared on<code>
   * IPropertySheetEntry</code> will obtain an editable value for the given objects and update the
   * child entries.
   *
   * <p>Updating the child entries will typically call this method on the child entries and thus the
   * entire entry tree is updated
   *
   * @param objects the new values for this entry
   */
  public void setValues(Object[] objects) {
    values = objects;
    sources = new HashMap(values.length * 2 + 1);

    if (values.length == 0) {
      editValue = null;
    } else {
      // set the first value object as the entry's value
      Object newValue = values[0];

      // see if we should convert the value to an editable value
      IPropertySource source = getPropertySource(newValue);
      if (source != null) {
        newValue = source.getEditableValue();
        if (newValue instanceof AuroraComponent) {
          if (lastAc != null) lastAc.removePropertyChangeListener(pcListener);
          lastAc = (AuroraComponent) newValue;
          lastAc.addPropertyChangeListener(pcListener);
        }
      }
      editValue = newValue;
    }

    // update our child entries
    refreshChildEntries();

    // inform listeners that our value changed
    fireValueChanged();
  }
コード例 #2
0
 /**
  * Returns the edit value for the object at the given index.
  *
  * @param index the value object index
  * @return the edit value for the object at the given index
  */
 protected Object getEditValue(int index) {
   Object value = values[index];
   IPropertySource source = getPropertySource(value);
   if (source != null) {
     value = source.getEditableValue();
   }
   return value;
 } /* (non-Javadoc)
コード例 #3
0
 /**
  * The <code>PropertySheetEntry</code> implmentation of this method declared on<code>
  * IPropertySheetEntry</code> will obtain an editable value for the given objects and update the
  * child entries.
  *
  * <p>Updating the child entries will typically call this method on the child entries and thus the
  * entire entry tree is updated
  *
  * @param objects the new values for this entry
  */
 public void setValues(Object[] objects) {
   values = objects;
   sources = new HashMap(values.length * 2 + 1);
   if (values.length == 0) editValue = null;
   else {
     // set the first value object as the entry's value
     Object newValue = values[0];
     // see if we should convert the value to an editable value
     IPropertySource source = getPropertySource(newValue);
     if (source != null) newValue = source.getEditableValue();
     editValue = newValue;
   } // update our child entries
   refreshChildEntries();
   // inform listeners that our value changed
   fireValueChanged();
 }