// The first selected element is in charge of applying the collective action to the selection
Shape s0 = getElementContainer().getSelection().getShape(0);
if (s0 instanceof SelectionContextualActionProvider){
CompoundEdit ce=new CompoundEdit();
((SelectionContextualActionProvider)getElementContainer().getSelection().getSelectedElements().get(0)).doCollectiveAction(getElementContainer().getSelection(), actionX, actionY, actionTarget, actionName, ce);
ce.end();
if (ce.isSignificant()) {
fireUndoableEditUpdate(new UndoableEditEvent(ShapesContainer.this, ce));
}
}