throw new IllegalStateException(
"Stop cannot be called without a shared project");
// Creating StopActivity for asking user to stop
User localUser = sarosSession.getLocalUser();
final StopActivity stopActivity = new StopActivity(localUser,
localUser, user, Type.LOCKREQUEST, State.INITIATED,
new SimpleDateFormat("HHmmssSS").format(new Date())
+ random.nextLong());
StartHandle handle = generateStartHandle(stopActivity);
addStartHandle(handle);
// Short cut if affected user is local
if (user.isLocal()) {
Utils.runSafeSWTSync(log, new Runnable() {
public void run() {
lockProject(true);
}
});
return handle;
}
StopActivity expectedAck = stopActivity.generateAcknowledgment(user);
expectedAcknowledgments.add(expectedAck);
Utils.runSafeSWTSync(log, new Runnable() {
public void run() {
fireActivity(stopActivity);