faster reaction on cancel button while searching for modified files

This commit is contained in:
Eugene Zhuravlev
2011-02-02 13:41:53 +01:00
parent 6a74319e06
commit d105a2f5f9
2 changed files with 7 additions and 1 deletions
@@ -84,6 +84,9 @@ public class HotSwapManager extends AbstractProjectComponent {
CompilerPathsEx.visitFiles(allDirs, new CompilerPathsEx.FileVisitor() {
protected void acceptDirectory(final VirtualFile file, final String fileRoot, final String filePath) {
if (progress.isCancelled()) {
return;
}
progress.setText(DebuggerBundle.message("progress.hotswap.scanning.path", filePath));
if(file.getFileSystem() instanceof JarFileSystem && FileTypes.ARCHIVE.equals(fileTypeManager.getFileTypeByFile(file))) {
if(file.getTimeStamp() > timeStamp) {
@@ -96,6 +99,9 @@ public class HotSwapManager extends AbstractProjectComponent {
}
protected void acceptFile(VirtualFile file, String fileRoot, String filePath) {
if (progress.isCancelled()) {
return;
}
if (file.getTimeStamp() > timeStamp && StdFileTypes.CLASS.equals(fileTypeManager.getFileTypeByFile(file))) {
//noinspection HardCodedStringLiteral
if (SystemInfo.isFileSystemCaseSensitive? filePath.endsWith(CLASS_EXTENSION) : StringUtil.endsWithIgnoreCase(filePath, CLASS_EXTENSION)) {
@@ -25,7 +25,7 @@ import com.intellij.openapi.project.Project;
public abstract class HotSwapProgress {
private final Project myProject;
private Runnable myCancelWorker;
private boolean myIsCancelled;
private volatile boolean myIsCancelled;
public HotSwapProgress(Project project) {
myProject = project;