final CoordinateReferenceSystem layerCRS = layer.getCRS();
ReferencedEnvelope bounds = layer.getBounds(ProgressManager.instance().get(), layerCRS);
final List<SummaryData> data=new ArrayList<SummaryData>();
String name = layer.getName();
nameData=new SummaryData(Messages.LayerSummary_name, name==null?"":name); //$NON-NLS-1$
nameData.setModifier(new NameModifier());
data.add(nameData);
newName=oldName=nameData.getInfo();
data.add(new SummaryData(Messages.LayerSummary_id,layer.getID()));
data.add(new SummaryData(Messages.LayerSummary_bounds, bounds==null?Messages.LayerSummary_unknownBounds:parseBounds(bounds)));
data.add(new SummaryData(Messages.LayerSummary_selection,layer.getFilter()));
data.add(new SummaryData(Messages.LayerSummary_status, layer.getStatusMessage()));
if ( layer.getSchema()!=null ){
SimpleFeatureType schema = layer.getSchema();
SummaryData schemaData=new SummaryData(Messages.LayerSummary_featureType, schema.getName().getLocalPart());
SummaryData[] children=new SummaryData[schema.getAttributeCount()];
for( int i = 0; i < children.length; i++ ) {
AttributeDescriptor attributeType = schema.getDescriptor(i);
children[i]=new SummaryData(attributeType.getLocalName(), attributeType.getType().getBinding().getSimpleName());
children[i].setParent(schemaData);
List<SummaryData> attTypeChildren=new ArrayList<SummaryData>();
attTypeChildren.add(new SummaryData(Messages.LayerSummary_nillable, attributeType.isNillable()));
attTypeChildren.get(0).setParent(children[i]);
List<Filter> restrictions = attributeType.getType().getRestrictions();
for (Filter filter : restrictions) {
SummaryData summaryData = new SummaryData(Messages.LayerSummary_restriction, filter);
attTypeChildren.add(summaryData);
summaryData.setParent(children[i]);
}
SummaryData summaryData = new SummaryData(Messages.LayerSummary_maxOccurs, attributeType.getMaxOccurs());
attTypeChildren.add(summaryData);
summaryData.setParent(children[i]);
summaryData = new SummaryData(Messages.LayerSummary_minOccurs, attributeType.getMinOccurs());
attTypeChildren.add(summaryData);
summaryData.setParent(children[i]);
children[i].setChildren(attTypeChildren.toArray(new SummaryData[0]));
}
schemaData.setChildren(children);
data.add(schemaData);