mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ReadonlyStatusHandler.setClearReadOnlyInTests moved from public API to Impl only
This commit is contained in:
+2
-1
@@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vcs.readOnlyHandler.ReadonlyStatusHandlerImpl;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.vfs.ReadonlyStatusHandler;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -196,7 +197,7 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
});
|
||||
ReadonlyStatusHandler handler = ReadonlyStatusHandler.getInstance(file.getProject());
|
||||
ReadonlyStatusHandlerImpl handler = (ReadonlyStatusHandlerImpl)ReadonlyStatusHandler.getInstance(file.getProject());
|
||||
handler.setClearReadOnlyInTests(true);
|
||||
try {
|
||||
ShowIntentionActionsHandler.chooseActionAndInvoke(file, getEditor(), action, action.getText());
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -68,14 +67,4 @@ public abstract class ReadonlyStatusHandler {
|
||||
public static ReadonlyStatusHandler getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, ReadonlyStatusHandler.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normally when file is read-only and ensureFilesWritable is called, a dialog box appears which allows user to decide
|
||||
* whether to clear read-only flag or not. This method allows to control what will happen in unit-test mode.
|
||||
*
|
||||
* @param clearReadOnlyInTests if true, ensureFilesWritable will try to clear read-only status from passed files.
|
||||
* Otherwise, read-only status is not modified (as if user refused to modify it).
|
||||
*/
|
||||
@TestOnly
|
||||
public abstract void setClearReadOnlyInTests(boolean clearReadOnlyInTests);
|
||||
}
|
||||
|
||||
+7
-1
@@ -158,7 +158,13 @@ public class ReadonlyStatusHandlerImpl extends ReadonlyStatusHandler implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Normally when file is read-only and ensureFilesWritable is called, a dialog box appears which allows user to decide
|
||||
* whether to clear read-only flag or not. This method allows to control what will happen in unit-test mode.
|
||||
*
|
||||
* @param clearReadOnlyInTests if true, ensureFilesWritable will try to clear read-only status from passed files.
|
||||
* Otherwise, read-only status is not modified (as if user refused to modify it).
|
||||
*/
|
||||
@TestOnly
|
||||
public void setClearReadOnlyInTests(boolean clearReadOnlyInTests) {
|
||||
assert ApplicationManager.getApplication().isUnitTestMode();
|
||||
|
||||
Reference in New Issue
Block a user