idProperty = md.getName();
}
if (md.isProminent() != null && md.isProminent()
&& !ArrayUtils.contains(getGridHiddenVisibilities(), md.getVisibility())) {
Field hf = createHeaderField(p, md);
headerFields.add(hf);
}
}
}
type = ListGrid.Type.TO_ONE;
} else if (fmd instanceof BasicCollectionMetadata) {
readOnly = !((BasicCollectionMetadata) fmd).isMutable();
for (Property p : cmd.getProperties()) {
if (p.getMetadata() instanceof BasicFieldMetadata) {
BasicFieldMetadata md = (BasicFieldMetadata) p.getMetadata();
if (md.isProminent() != null && md.isProminent()
&& !ArrayUtils.contains(getGridHiddenVisibilities(), md.getVisibility())) {
Field hf = createHeaderField(p, md);
headerFields.add(hf);
}
}
}
type = ListGrid.Type.BASIC;
if (((BasicCollectionMetadata) fmd).getAddMethodType().equals(AddMethodType.PERSIST)) {
editable = true;
}
} else if (fmd instanceof AdornedTargetCollectionMetadata) {
readOnly = !((AdornedTargetCollectionMetadata) fmd).isMutable();
AdornedTargetCollectionMetadata atcmd = (AdornedTargetCollectionMetadata) fmd;
for (String fieldName : atcmd.getGridVisibleFields()) {
Property p = cmd.getPMap().get(fieldName);
BasicFieldMetadata md = (BasicFieldMetadata) p.getMetadata();
Field hf = createHeaderField(p, md);
headerFields.add(hf);
}
type = ListGrid.Type.ADORNED;
if (atcmd.getMaintainedAdornedTargetFields().length > 0) {
editable = true;
}
AdornedTargetList adornedList = (AdornedTargetList) atcmd.getPersistencePerspective()
.getPersistencePerspectiveItems().get(PersistencePerspectiveItemType.ADORNEDTARGETLIST);
sortable = StringUtils.isNotBlank(adornedList.getSortField());
} else if (fmd instanceof MapMetadata) {
readOnly = !((MapMetadata) fmd).isMutable();
MapMetadata mmd = (MapMetadata) fmd;
Property p2 = cmd.getPMap().get("key");
BasicFieldMetadata keyMd = (BasicFieldMetadata) p2.getMetadata();
keyMd.setFriendlyName("Key");
Field hf = createHeaderField(p2, keyMd);
headerFields.add(hf);
if (mmd.isSimpleValue()) {
Property valueProperty = cmd.getPMap().get("value");
BasicFieldMetadata valueMd = (BasicFieldMetadata) valueProperty.getMetadata();