Find In Path: return back to 'old' setup FindModel from DataContext

This commit is contained in:
Vassiliy.Kudryashov
2017-11-13 17:24:01 +03:00
parent 63bc67b869
commit 93ae28b3c5
2 changed files with 5 additions and 7 deletions
@@ -1077,14 +1077,15 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
String dirName = directory.getPresentableUrl();
FindModel model = new FindModel();
checkContext(model, myProject, null, null, true, null, null, false);
model.setDirectoryName("initialDirectoryName");
model.setModuleName("initialModuleName");
model.setProjectScope(false);
model.setCustomScopeName("initialScopeName");
checkContext(model, myProject, directory, module, false, null, moduleName, false);
checkContext(model, myProject, directory, null, false, dirName, moduleName, false);//prev module state
checkContext(model, myProject, null, null, true, dirName, moduleName, false);//prev module and dir state
checkContext(model, myProject, directory, module, false, dirName, moduleName, false);
checkContext(model, myProject, directory, null, false, dirName, moduleName, false);//prev directory state
checkContext(model, myProject, null, null, false, dirName, moduleName, false);//prev module and dir state
model.setCustomScope(scope);
model.setCustomScope(true);
checkContext(model, myProject, null, null, false, dirName, moduleName, true);//prev module and dir state
@@ -113,9 +113,6 @@ public class FindInProjectUtil {
// apply explicit settings from context
if (module != null) {
model.setModuleName(module.getName());
directoryName = null;// Explicit 'module' scope is more specific than 'module directory' scope
model.setCustomScope(false);
model.setDirectoryName(null);
}
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
@@ -127,7 +124,7 @@ public class FindInProjectUtil {
}
// set project scope if we have no other settings
model.setProjectScope(directoryName == null && module == null && !model.isCustomScope());
model.setProjectScope(model.getDirectoryName() == null && model.getModuleName() == null && !model.isCustomScope());
}
/** @deprecated to remove in IDEA 2018 */