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 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); } } }