if (activeContext == null)
{
return;
}
final CrosstabColumnGroup newGroup = new CrosstabColumnGroup();
try
{
Object selectedElement = null;
if (getSelectionModel().getSelectionCount() > 0)
{
selectedElement = getSelectionModel().getSelectedElement(0);
}
if (selectedElement instanceof CrosstabColumnGroup)
{
final CrosstabColumnGroup selectedGroup = (CrosstabColumnGroup) selectedElement;
final GroupBody oldGroupBody = selectedGroup.getBody();
final CrosstabColumnGroupBody newGroupBody = new CrosstabColumnGroupBody(newGroup);
selectedGroup.setBody(newGroupBody);
newGroup.setBody(oldGroupBody);
activeContext.getUndo().addChange(ActionMessages.getString("InsertCrosstabColumnGroupAction.UndoName"),
new InsertGroupBodyOnGroupUndoEntry(selectedGroup.getObjectID(), oldGroupBody, newGroupBody));
}
}
catch (Exception ex)
{
UncaughtExceptionsModel.getInstance().addException(ex);