use of org.eclipse.emf.common.command.Command in project Palladio-Editors-Sirius by PalladioSimulator.
the class SiriusCustomUtil method selectViewpoints.
public static void selectViewpoints(Session session, HashSet<Viewpoint> viewpoints, boolean createRepresentation, IProgressMonitor monitor) {
final ViewpointSelectionCallback selectionCallback = new ViewpointSelectionCallback();
final TransactionalEditingDomain domain = session.getTransactionalEditingDomain();
Collection<Viewpoint> selectedViewpoints = session.getSelectedViewpoints(false);
for (Viewpoint v : viewpoints) {
if (selectedViewpoints.contains(v))
viewpoints.remove(v);
}
@SuppressWarnings("restriction") final Command command = new ChangeViewpointSelectionCommand(session, selectionCallback, viewpoints, new HashSet<Viewpoint>(), createRepresentation, SubMonitor.convert(monitor));
domain.getCommandStack().execute(command);
}
Aggregations