}
// Now we check for layer groups that are affected
Iterator<LayerGroupInfo> lgiter = cat.getLayerGroups().iterator();
while(lgiter.hasNext()) {
LayerGroupInfo lgi = lgiter.next();
boolean truncate = false;
// First we check for referenced to affected layers
liter = lgi.getLayers().iterator();
while(! truncate && liter.hasNext()) {
LayerInfo li = liter.next();
if(layerNameList.contains(li.getResource().getPrefixedName())){
truncate = true;
}
}
// Finally we need to check whether the style is used explicitly
if(! truncate) {
Iterator<StyleInfo> siiter = lgi.getStyles().iterator();
while(! truncate && siiter.hasNext()) {
StyleInfo si2 = siiter.next();
if(si2 != null && si2.getName().equals(si.getName())) {
truncate = true;
}
}
}
if(truncate) {
cleanser.deleteLayer(lgi.getName());
}
// Next layer group
}
} else {
WMSLayer wmsLayer = null; //getLayer(obj);
if(obj instanceof LayerInfo) {
LayerInfo li = (LayerInfo) obj;
wmsLayer = getLayer(li);
} else
if(obj instanceof LayerGroupInfo) {
LayerGroupInfo lgInfo = (LayerGroupInfo) obj;
wmsLayer = getLayer(lgInfo);
}
if (wmsLayer != null && this.list != null) {
updateList(wmsLayer);