@Override protected List<PropertySupport.ReadOnly<?>> createPropertyItems( List<PropertySupport.ReadOnly<?>> props) { CostCentre e = getEntity(); if (e != null) { props.add(new StringReadonlyProperty("Node Type", "CostCentreNode")); props.add( shortdescriptionproperty = new StringReadonlyProperty("Shortdescription", e.formatShortdescription())); props.add( descriptionproperty = new StringReadonlyProperty("Description", e.formatDescription())); props.add( profitCentreproperty = new StringReadonlyProperty("ProfitCentre", e.formatProfitCentre())); props.add(idproperty = new StringReadonlyProperty("Id", e.formatId())); props.add(createdbyproperty = new StringReadonlyProperty("Created by", e.formatCreatedby())); props.add(createdonproperty = new StringReadonlyProperty("Created on", e.formatCreatedon())); props.add(updatedbyproperty = new StringReadonlyProperty("Updated by", e.formatUpdatedby())); props.add(updatedonproperty = new StringReadonlyProperty("Updated on", e.formatUpdatedon())); } return props; }
@Override protected void nodeProcessFieldChange(CostCentreField field) { CostCentre e = getEntity(); if (field == null) { if (e != null && idproperty != null) { shortdescriptionproperty.update(e.formatShortdescription()); descriptionproperty.update(e.formatDescription()); profitCentreproperty.update(e.formatProfitCentre()); idproperty.update(e.formatId()); createdbyproperty.update(e.formatCreatedby()); createdonproperty.update(e.formatCreatedon()); updatedbyproperty.update(e.formatUpdatedby()); updatedonproperty.update(e.formatUpdatedon()); propertyChange(); } } else { switch (field) { case SHORTDESCRIPTION: if (e != null && shortdescriptionproperty != null) { shortdescriptionproperty.update(e.formatShortdescription()); propertyChange("Shortdescription"); } break; case DESCRIPTION: if (e != null && descriptionproperty != null) { descriptionproperty.update(e.formatDescription()); propertyChange("Description"); } break; case PROFITCENTRE: if (e != null && profitCentreproperty != null) { profitCentreproperty.update(e.formatProfitCentre()); propertyChange("ProfitCentre"); } break; } } }