ProcessDefinitionRemoveSwimlaneCommand result = new ProcessDefinitionRemoveSwimlaneCommand();
result.setSwimlane((Swimlane) element);
result.setProcessDefinition((ProcessDefinition) selectedPart.getParent().getModel());
return result;
} else if (element instanceof Action) {
ActionDeleteCommand command = new ActionDeleteCommand();
command.setAction((Action) element);
return command;
} else {
throw new IllegalArgumentException("Unknown element " + element);
}
}