summaryrefslogtreecommitdiff
path: root/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java')
-rw-r--r--platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java
new file mode 100644
index 000000000000..09758a5e2191
--- /dev/null
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/CompileContext.java
@@ -0,0 +1,71 @@
+package com.intellij.structuralsearch.impl.matcher.compiler;
+
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.structuralsearch.MatchOptions;
+import com.intellij.structuralsearch.impl.matcher.CompiledPattern;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: maxim
+ * Date: 17.11.2004
+ * Time: 19:26:37
+ * To change this template use File | Settings | File Templates.
+ */
+public class CompileContext {
+ private OptimizingSearchHelper searchHelper;
+
+ private CompiledPattern pattern;
+ private MatchOptions options;
+ private Project project;
+
+ public void clear() {
+ if (searchHelper!=null) searchHelper.clear();
+
+ project = null;
+ pattern = null;
+ options = null;
+ }
+
+ public void init(final CompiledPattern _result, final MatchOptions _options, final Project _project, final boolean _findMatchingFiles) {
+ options = _options;
+ project = _project;
+ pattern = _result;
+
+ searchHelper = ApplicationManager.getApplication().isUnitTestMode() ?
+ new TestModeOptimizingSearchHelper(this) :
+ new FindInFilesOptimizingSearchHelper(this, _findMatchingFiles, _project);
+ }
+
+ public OptimizingSearchHelper getSearchHelper() {
+ return searchHelper;
+ }
+
+ void setSearchHelper(OptimizingSearchHelper searchHelper) {
+ this.searchHelper = searchHelper;
+ }
+
+ public CompiledPattern getPattern() {
+ return pattern;
+ }
+
+ void setPattern(CompiledPattern pattern) {
+ this.pattern = pattern;
+ }
+
+ MatchOptions getOptions() {
+ return options;
+ }
+
+ void setOptions(MatchOptions options) {
+ this.options = options;
+ }
+
+ Project getProject() {
+ return project;
+ }
+
+ void setProject(Project project) {
+ this.project = project;
+ }
+}