introduce VetoableProjectManagerListener to avoid inappropriate using of message bus

This commit is contained in:
Vladimir Krivosheev
2017-05-09 18:31:16 +02:00
parent 9354592142
commit 4ae9edbe94
9 changed files with 102 additions and 21 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -566,11 +566,10 @@ public class CompilerTask extends Task.Backgroundable {
private boolean myUserAcceptedCancel = false;
@Override
public boolean canCloseProject(final Project project) {
if (project != null && project.equals(myProject)) {
public void projectClosingBeforeSave(@NotNull Project project) {
if (myProject == project) {
cancel();
}
return true;
}
public void setContent(Content content, ContentManager contentManager) {
@@ -1693,9 +1693,8 @@ public class BuildManager implements Disposable {
}
@Override
public boolean canCloseProject(Project project) {
public void projectClosingBeforeSave(@NotNull Project project) {
cancelAutoMakeTasks(project);
return true;
}
@Override