示例#1
0
  private void setStoreValue(PrefPanel pp, String name, PersistentBean bean, boolean inheritable) {
    if (bean == null) return;

    Field fld = pp.getField(name);
    Object newValue = fld.getValue();

    if (newValue == null) return; // LOOK remove from store ??

    // if it matches whats already stored (inherited or not), dont need to store it
    Object oldValue = bean.getObject(name);
    if (newValue == oldValue) return;
    if (newValue.equals(oldValue)) return;

    // otherwise store it
    if (!inheritable) bean.putObject(name, newValue);
    else if (isInheritable(fld)) bean.putObject("localMetadataInheritable." + name, newValue);
    else bean.putObject("localMetadata." + name, newValue);
  }