private void setEditValue(PrefPanel pp, String name, PersistentBean bean, int mode) {
   Field fld = pp.getField(name);
   if (bean == null) fld.setValue(null);
   else {
     Object value = bean.getObject(name);
     fld.setValue(value);
   }
   setMode(fld, mode);
 }
  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 != null) && 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);
  }
  private void setEditValueWithInheritence(String name, PersistentBean bean) {
    Field fld = metadataPP.getField(name);
    if (bean == null) {
      fld.setValue(null);
      return;
    }

    Object value = bean.getObject("localMetadata." + name); // local, non inheritable
    if (value != null) {
      fld.setValue(value);
      setMode(fld, 0);
    } else {
      value = bean.getObject("localMetadataInheritable." + name); // local, inheritable
      if (value != null) {
        fld.setValue(value);
        setMode(fld, 1);

      } else {
        value = bean.getObject(name); // inherited
        fld.setValue(value);
        setMode(fld, (value == null) ? 1 : 2);
      }
    }
  }
 private void setTCmode(int mode) {
   setMode(metadataPP.getField(RangeDateSelector.TIME_START), mode);
   setMode(metadataPP.getField(RangeDateSelector.TIME_END), mode);
   setMode(metadataPP.getField(RangeDateSelector.TIME_DURATION), mode);
   setMode(metadataPP.getField(RangeDateSelector.TIME_RESOLUTION), mode);
 }
  private void setGCmode(int mode) {
    setMode(metadataPP.getField(LAT_START), mode);
    setMode(metadataPP.getField(LAT_EXTENT), mode);
    setMode(metadataPP.getField(LAT_RESOLUTION), mode);
    setMode(metadataPP.getField(LAT_UNITS), mode);
    setMode(metadataPP.getField(LON_START), mode);
    setMode(metadataPP.getField(LON_EXTENT), mode);
    setMode(metadataPP.getField(LON_RESOLUTION), mode);
    setMode(metadataPP.getField(LON_UNITS), mode);
    setMode(metadataPP.getField(HEIGHT_START), mode);
    setMode(metadataPP.getField(HEIGHT_EXTENT), mode);
    setMode(metadataPP.getField(HEIGHT_RESOLUTION), mode);
    setMode(metadataPP.getField(HEIGHT_UNITS), mode);
    setMode(metadataPP.getField(ZPOSITIVE_UP), mode);

    extractGCButton.setEnabled(mode != 2);
  }