@Override
public boolean update(IUpdateContext context) {
IPeService peService = Graphiti.getPeService();
ContainerShape container = (ContainerShape) context.getPictogramElement();
DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);
boolean drawCollectionMarker = data.isIsCollection();
Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
while (iterator.hasNext()) {
Shape shape = iterator.next();
String prop = peService.getPropertyValue(shape, Properties.HIDEABLE_PROPERTY);
if (prop != null && new Boolean(prop)) {
Polyline line = (Polyline) shape.getGraphicsAlgorithm();
line.setLineVisible(drawCollectionMarker);
}
}
peService.setPropertyValue(container, Properties.COLLECTION_PROPERTY,
Boolean.toString(data.isIsCollection()));
return true;
}