DLTKLanguageManager.getSearchPatternProcessor(toolkit) method extracted
diff --git a/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java b/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java
index 60d407d..6d6a63b 100644
--- a/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java
+++ b/core/plugins/org.eclipse.dltk.ui/core refactoring/org/eclipse/dltk/internal/corext/util/TypeInfoFilter.java
@@ -11,7 +11,6 @@
import org.eclipse.dltk.core.DLTKLanguageManager;
import org.eclipse.dltk.core.IDLTKLanguageToolkit;
-import org.eclipse.dltk.core.ISearchFactory;
import org.eclipse.dltk.core.ISearchPatternProcessor;
import org.eclipse.dltk.core.search.IDLTKSearchConstants;
import org.eclipse.dltk.core.search.IDLTKSearchScope;
@@ -273,22 +272,11 @@
}
private static String getPackageDelimiter(IDLTKLanguageToolkit toolkit) {
- ISearchPatternProcessor processor = getSearchPatternProcessor(toolkit);
+ ISearchPatternProcessor processor = DLTKLanguageManager
+ .getSearchPatternProcessor(toolkit);
if (processor != null) {
return processor.getDelimiterReplacementString();
}
return PACKAGE_DELIM;
}
-
- private static ISearchPatternProcessor getSearchPatternProcessor(
- IDLTKLanguageToolkit toolkit) {
- if (toolkit != null) {
- ISearchFactory factory = DLTKLanguageManager
- .getSearchFactory(toolkit.getNatureId());
- if (factory != null) {
- return factory.createSearchPatternProcessor();
- }
- }
- return null;
- }
}
diff --git a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/ScriptElementLabels.java b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/ScriptElementLabels.java
index 3a25144..c71a244 100644
--- a/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/ScriptElementLabels.java
+++ b/core/plugins/org.eclipse.dltk.ui/src/org/eclipse/dltk/ui/ScriptElementLabels.java
@@ -25,7 +25,6 @@
import org.eclipse.dltk.core.IProjectFragment;
import org.eclipse.dltk.core.IScriptFolder;
import org.eclipse.dltk.core.IScriptProject;
-import org.eclipse.dltk.core.ISearchFactory;
import org.eclipse.dltk.core.ISearchPatternProcessor;
import org.eclipse.dltk.core.ISourceModule;
import org.eclipse.dltk.core.IType;
@@ -402,14 +401,10 @@
protected String getTypeDelimiter(IModelElement modelElement) {
IDLTKLanguageToolkit toolkit = DLTKLanguageManager
.getLanguageToolkit(modelElement);
- ISearchFactory factory = DLTKLanguageManager.getSearchFactory(toolkit
- .getNatureId());
- if (factory != null) {
- ISearchPatternProcessor processor = factory
- .createSearchPatternProcessor();
- if (processor != null) {
- return processor.getDelimiterReplacementString();
- }
+ ISearchPatternProcessor processor = DLTKLanguageManager
+ .getSearchPatternProcessor(toolkit);
+ if (processor != null) {
+ return processor.getDelimiterReplacementString();
}
return ".";
}