Simplify StructuredModelManager facade
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
index 371f9e5..30b51fe 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationUtil.java
@@ -107,6 +107,6 @@
}
protected IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
+ return StructuredModelManager.getModelManager();
}
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
index 8486ae4..f2b0985 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/search/JSPSearchDocument.java
@@ -21,7 +21,6 @@
import org.eclipse.jst.jsp.core.internal.java.JSPTranslationAdapterFactory;
import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension;
import org.eclipse.wst.common.encoding.exceptions.UnsupportedCharsetExceptionWithDetail;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.xml.core.document.XMLDocument;
@@ -72,34 +71,7 @@
public String getJavaText() {
return new String(getCharContents());
}
-
- private IModelManager getModelManager() {
-// IModelManager modelManager = null;
-// Bundle mmBundle = Platform.getBundle("org.eclipse.wst.sse.core"); //$NON-NLS-1$
-// int state = mmBundle.getState();
-// // I put in check to active bundle to avoid so many
-// // exceptions during unit tests ... apparently the search
-// // indexing continues, even when being shutdown. We should
-// // fix that "root" problem, but I'm not sure where right now.
-// // Note: the "active" state assume's we're never called early
-// // before already active once.
-// if (state == Bundle.ACTIVE) {
-// //System.out.println("state: " + state);
-// modelManager = StructuredModelManager.getInstance().getModelManager();
-// } else {
-// // occassionally, during unit tests, I've seen this return null, I
-// // suspect because
-// // the workbench is shutting down. So, if we get 'null' back,
-// // we'll though relatively CoreException, just to get it logged.
-// // and cease processing.
-// Logger.log(Logger.INFO, "ModelManager not available, probably due to shutting down"); //$NON-NLS-1$
-// modelManager = new NullModelManager();
-// }
-// return modelManager;
- // none of the above should be necessary since it is already done if you just call the below
- return StructuredModelManager.getInstance().getModelManager();
- }
-
+
/**
* @param file
* @throws CoreException
@@ -115,7 +87,7 @@
XMLModel xmlModel = null;
try {
// get existing model for read, then get document from it
- xmlModel = (XMLModel) getModelManager().getModelForRead(file);
+ xmlModel = (XMLModel) StructuredModelManager.getModelManager().getModelForRead(file);
// handle unsupported
if (xmlModel != null) {
setupAdapterFactory(xmlModel);
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java
index 04a65c5..865ee9c 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/parser/JSPCodeRegion.java
@@ -40,7 +40,7 @@
*/
protected RegionParser getBlockNodeChecker() {
if (fBlockNodeChecker == null) {
- IModelManager mmanager = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mmanager = StructuredModelManager.getModelManager();
fBlockNodeChecker = mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_JSP).getParser();
}
return fBlockNodeChecker;
diff --git a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/URLModelProviderCSS.java b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/URLModelProviderCSS.java
index ef34334..a11952d 100644
--- a/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/URLModelProviderCSS.java
+++ b/bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/util/URLModelProviderCSS.java
@@ -59,7 +59,7 @@
super();
// obtain model manager
- modelManager = StructuredModelManager.getInstance().getModelManager();
+ modelManager = StructuredModelManager.getModelManager();
}
/**
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java
index 58afb63..f196fff 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/preferences/ui/CSSColorPage.java
@@ -195,7 +195,7 @@
* setupPicker method comment.
*/
protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mmanager = StructuredModelManager.getModelManager();
picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_CSS).getParser());
Dictionary descriptions = new Hashtable();
diff --git a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java
index 2ec1f18..366a72e 100644
--- a/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java
+++ b/bundles/org.eclipse.wst.css.ui/src/org/eclipse/wst/css/ui/views/properties/CSSTextPropertyDescriptor.java
@@ -98,7 +98,7 @@
//TODO Urgent needs to be fixed
// I think we need 'equals' (or 'equivalent'
// on model) for cases like this
- if (StructuredModelManager.getInstance().getModelManager().calculateId(file).equals(model.getId())) {
+ if (StructuredModelManager.getModelManager().calculateId(file).equals(model.getId())) {
return editPart;
}
}
diff --git a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java
index a4c3a60..e8dadcb 100644
--- a/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java
+++ b/bundles/org.eclipse.wst.dtd.ui/src/org/eclipse/wst/dtd/ui/preferences/DTDColorPage.java
@@ -150,8 +150,8 @@
}
protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getInstance().getModelManager();
- picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_DTD).getParser());
+ IModelManager mmanager = StructuredModelManager.getModelManager();
+ picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_DTD).getParser());
Dictionary descriptions = new Hashtable();
initDescriptions(descriptions);
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLConverter.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLConverter.java
index 47ca8b5..76fe5c7 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLConverter.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/document/HTMLConverter.java
@@ -137,12 +137,6 @@
/**
*/
- private static IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
- /**
- */
private static void insertBreak(XMLModel model, Node node) {
if (model == null || node == null)
return;
@@ -174,7 +168,7 @@
return null;
// create temporary model
String id = input.toString() + ".html"; //$NON-NLS-1$
- IModelManager manager = getModelManager();
+ IModelManager manager = StructuredModelManager.getModelManager();
IStructuredModel model = manager.getModelForEdit(id, input, null);
if (!(model instanceof XMLModel)) {
if (model == null)
@@ -189,7 +183,7 @@
private XMLModel readModel(IFile file) throws IOException, CoreException {
if (file == null)
return null;
- IModelManager manager = getModelManager();
+ IModelManager manager = StructuredModelManager.getModelManager();
IStructuredModel model = manager.getModelForEdit(file);
if (!(model instanceof XMLModel)) {
if (model != null)
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/URLModelProvider.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/URLModelProvider.java
index 3eec54c..38906d1 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/URLModelProvider.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/htmlcss/URLModelProvider.java
@@ -66,7 +66,7 @@
super();
// obtain model manager
- modelManager = StructuredModelManager.getInstance().getModelManager();
+ modelManager = StructuredModelManager.getModelManager();
}
/**
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
index 7cf796b..521ff36 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/StructuredTextViewerConfigurationHTML.java
@@ -50,7 +50,6 @@
import org.eclipse.wst.javascript.common.ui.taginfo.JavaScriptBestMatchHoverProcessor;
import org.eclipse.wst.javascript.common.ui.taginfo.JavaScriptInformationProvider;
import org.eclipse.wst.javascript.common.ui.taginfo.JavaScriptTagInfoHoverProcessor;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
@@ -235,10 +234,6 @@
return fInformationPresenter;
}
- private IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
/**
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconcilerg(org.eclipse.jface.text.source.ISourceViewer)
*/
@@ -270,7 +265,7 @@
viewer = ((StructuredTextViewer) sourceViewer);
}
- IStructuredModel sModel = getModelManager().getExistingModelForRead(viewer.getDocument());
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
try {
if (sModel != null) {
// check language (ContentTypeID)....
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
index d6d201b..5faee48 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/HTMLContentAssistProcessor.java
@@ -265,8 +265,7 @@
* @return ICompletionProposal
*/
private ICompletionProposal getHTMLTagPropsosal(StructuredTextViewer viewer, int documentPosition) {
-
- IModelManager mm = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mm = StructuredModelManager.getModelManager();
IStructuredModel model = null;
try {
if (mm != null)
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java
index cc6bd4e..ac1f281 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/openon/DefaultOpenOnHTML.java
@@ -11,6 +11,7 @@
package org.eclipse.wst.html.ui.openon;
import org.eclipse.wst.sse.core.IStructuredModel;
+import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.util.PathHelper;
import org.eclipse.wst.sse.core.util.URIResolver;
import org.eclipse.wst.sse.ui.internal.Logger;
@@ -35,7 +36,7 @@
String resolvedURI = systemId;
if (systemId != null) {
- IStructuredModel sModel = getModelManager().getExistingModelForRead(getDocument());
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
try {
if (sModel != null) {
URIResolver resolver = sModel.getResolver();
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java
index 490522c..3b29d68 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/preferences/ui/HTMLColorPage.java
@@ -88,7 +88,7 @@
}
protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mmanager = StructuredModelManager.getModelManager();
picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_HTML).getParser());
// create descriptions for hilighting types
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FileModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FileModelProvider.java
index dcc0274..1555b47 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FileModelProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FileModelProvider.java
@@ -215,10 +215,7 @@
*/
protected static IModelManager getModelManager() {
if (fModelManager == null) {
- // get the model manager from the plugin
- // note: we can use the static "ID" variable, since we pre-req
- // that plugin
- fModelManager = StructuredModelManager.getInstance().getModelManager();
+ fModelManager = StructuredModelManager.getModelManager();
}
return fModelManager;
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/NullModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/NullModelProvider.java
index 557f33d..3c07f9d 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/NullModelProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/NullModelProvider.java
@@ -21,9 +21,7 @@
import org.eclipse.jface.text.source.AnnotationModel;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
-import org.eclipse.wst.sse.core.StructuredModelManager;
/**
@@ -45,16 +43,6 @@
return _instance;
}
- /**
- * Utility method also used in subclasses
- */
- protected static IModelManager getModelManager() {
- // get the model manager from the plugin
- // note: we can use the static "ID" variable, since we pre-req that
- // plugin
- return StructuredModelManager.getInstance().getModelManager();
- }
-
private HashMap fModelMap = new HashMap(1);
public NullModelProvider() {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StorageModelProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StorageModelProvider.java
index a94eaa1..532ca8e 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StorageModelProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StorageModelProvider.java
@@ -189,12 +189,9 @@
/**
* Utility method also used in subclasses
*/
- protected static IModelManager getModelManager() {
+ private static IModelManager getModelManager() {
if (fModelManager == null) {
- // get the model manager from the plugin
- // note: we can use the static "ID" variable, since we pre-req
- // that plugin
- fModelManager = StructuredModelManager.getInstance().getModelManager();
+ fModelManager = StructuredModelManager.getModelManager();
}
return fModelManager;
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
index a5af9db..e473ff8 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextEditor.java
@@ -1257,9 +1257,9 @@
} else {
IDocument doc = getDocument();
Assert.isTrue(doc instanceof IStructuredDocument, "Editing document must be an IStructuredDocument");
- model = StructuredModelManager.getInstance().getModelManager().getExistingModelForEdit(doc);
+ model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
if (model == null) {
- model = StructuredModelManager.getInstance().getModelManager().getModelForEdit((IStructuredDocument) doc);
+ model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
EditorModelUtil.addFactoriesTo(model);
}
}
@@ -1602,10 +1602,10 @@
fStructuredModel = ((IModelProvider) getDocumentProvider()).getModel(getEditorInput());
} else { // nsd_TODO: FileBuffer cleanup
IDocument doc = getDocument();
- Assert.isTrue(doc instanceof IStructuredDocument);
- IStructuredModel model = StructuredModelManager.getInstance().getModelManager().getExistingModelForEdit(doc);
+ Assert.isTrue(doc instanceof IStructuredDocument, "StructuredTextEditor must be used with an IStructuredDocument");
+ IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc);
if (model == null) {
- model = StructuredModelManager.getInstance().getModelManager().getModelForEdit((IStructuredDocument) doc);
+ model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc);
EditorModelUtil.addFactoriesTo(model);
}
fStructuredModel = model;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java
index 8e4984c..374eaae 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextReconciler.java
@@ -304,7 +304,7 @@
protected IModelManager getModelManager() {
if (this.fModelManager == null)
- this.fModelManager = StructuredModelManager.getInstance().getModelManager();
+ this.fModelManager = StructuredModelManager.getModelManager();
return this.fModelManager;
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ContentSettingsPropertyPage.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ContentSettingsPropertyPage.java
index 87c01a6..61fdaaa 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ContentSettingsPropertyPage.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentproperties/ui/ContentSettingsPropertyPage.java
@@ -74,7 +74,7 @@
final long afterModifiedFromIFile = file.getModificationStamp();
if (beforeModifiedFromJavaIO != afterModifiedFromJavaIO) {
- IModelManager manager = StructuredModelManager.getInstance().getModelManager();
+ IModelManager manager = StructuredModelManager.getModelManager();
IStructuredModel model = manager.getExistingModelForRead(file);
if (model != null) {
if (!model.isDirty()) {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/format/StructuredFormattingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/format/StructuredFormattingStrategy.java
index 4290fda..2ad356b 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/format/StructuredFormattingStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/format/StructuredFormattingStrategy.java
@@ -22,18 +22,12 @@
import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy;
import org.eclipse.jface.text.formatter.FormattingContextProperties;
import org.eclipse.jface.text.formatter.IFormattingContext;
-import org.eclipse.wst.sse.core.IModelManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.exceptions.SourceEditingRuntimeException;
import org.eclipse.wst.sse.core.format.IStructuredFormatProcessor;
public class StructuredFormattingStrategy extends ContextBasedFormattingStrategy {
- protected static IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
/** Documents to be formatted by this strategy */
private final LinkedList fDocuments = new LinkedList();
private IStructuredFormatProcessor fFormatProcessor;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
index 75e5f8c..2e2a799 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/ContentAssistUtils.java
@@ -45,7 +45,7 @@
return null;
IndexedRegion node = null;
- IModelManager mm = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mm = StructuredModelManager.getModelManager();
IStructuredModel model = null;
if (mm != null)
model = mm.getExistingModelForRead(viewer.getDocument());
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
index ac7ef76..00b0d6d 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/BreakpointRulerAction.java
@@ -45,8 +45,8 @@
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.ui.extensions.breakpoint.IBreakpointProvider;
-import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
import org.eclipse.wst.sse.ui.internal.Logger;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
import org.eclipse.wst.sse.ui.internal.extension.BreakpointProviderBuilder;
@@ -120,7 +120,7 @@
}
if (textEditor != null) {
IDocument textDocument = textEditor.getDocumentProvider().getDocument(input);
- model = StructuredModelManager.getInstance().getModelManager().getExistingModelForRead(textDocument);
+ model = StructuredModelManager.getModelManager().getExistingModelForRead(textDocument);
if (model != null) {
resource = BreakpointProviderBuilder.getInstance().getResource(input, model.getContentTypeIdentifier(), getFileExtension(input));
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
index 74da743..f8765c4 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/debug/ToggleBreakpointAction.java
@@ -112,7 +112,7 @@
}
protected String getContentType(IDocument document) {
- IModelManager mgr = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mgr = StructuredModelManager.getModelManager();
String contentType = null;
IStructuredModel model = null;
try {
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
index 0c7c44f..6ac39ab 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/DropActionProxy.java
@@ -25,7 +25,6 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager;
@@ -77,7 +76,7 @@
if (editor != null) {
document = editor.getDocument();
if (document != null)
- fRecorder = getModelManager().getExistingModelForEdit(document);
+ fRecorder = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
// Prepare for Undo
if (fRecorder != null) {
IStructuredTextUndoManager um = fRecorder.getUndoManager();
@@ -106,13 +105,6 @@
}
/**
- *
- */
- private IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
- /**
* @see java.lang.reflect.InvocationHandler#invoke(Object, Method,
* Object[])
*/
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
index 509d749..64b0d28 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/extension/ExtendedEditorActionProxy.java
@@ -25,7 +25,6 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.undo.IStructuredTextUndoManager;
@@ -71,7 +70,7 @@
if (editor != null) {
document = editor.getDocument();
if (document != null)
- fRecorder = getModelManager().getExistingModelForEdit(document);
+ fRecorder = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
// Prepare for Undo
if (fRecorder != null) {
IStructuredTextUndoManager um = fRecorder.getUndoManager();
@@ -98,13 +97,6 @@
}
/**
- *
- */
- private IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
- /**
* @see java.lang.reflect.InvocationHandler#invoke(Object, Method,
* Object[])
*/
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
index 833ef6b..c646f8b 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/AbstractStructuredTextReconcilingStrategy.java
@@ -188,7 +188,7 @@
* @return the corresponding node for sdRegion
*/
protected IndexedRegion getCorrespondingNode(IStructuredDocumentRegion sdRegion) {
- IStructuredModel sModel = StructuredModelManager.getInstance().getModelManager().getExistingModelForRead(fDocument);
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
IndexedRegion xmlNode = sModel.getIndexedRegion(sdRegion.getStart());
sModel.releaseFromRead();
return xmlNode;
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
index ed6ba51..3453fe9 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/StructuredReconcileStep.java
@@ -134,7 +134,7 @@
*/
protected IModelManager getModelManager() {
if (fModelManager == null)
- fModelManager = StructuredModelManager.getInstance().getModelManager();
+ fModelManager = StructuredModelManager.getModelManager();
return fModelManager;
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/AbstractOpenOn.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/AbstractOpenOn.java
index b6f4633..b2d4ed0 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/AbstractOpenOn.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/AbstractOpenOn.java
@@ -30,7 +30,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.ui.extensions.openon.IOpenOn;
@@ -91,7 +90,7 @@
IStructuredModel model = null;
IFile file = null;
try {
- model = getModelManager().getExistingModelForRead(getDocument());
+ model = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
if (model != null) {
// use the base location to obtain the in-workspace IFile
IFile modelFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(model.getBaseLocation()));
@@ -128,10 +127,6 @@
return file;
}
- protected IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
/*
* (non-Javadoc)
*
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/OpenOnProvider.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/OpenOnProvider.java
index b11af57..bee0636 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/OpenOnProvider.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/openon/OpenOnProvider.java
@@ -54,7 +54,7 @@
protected String getContentType(IDocument document) {
String type = null;
- IModelManager mgr = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mgr = StructuredModelManager.getModelManager();
IStructuredModel model = null;
try {
model = mgr.getExistingModelForRead(document);
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/EditStructuredTextEditorPreferencesAction.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/EditStructuredTextEditorPreferencesAction.java
index 1d2ac66..d555013 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/EditStructuredTextEditorPreferencesAction.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/preferences/ui/EditStructuredTextEditorPreferencesAction.java
@@ -28,7 +28,6 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.util.DocumentInputStream;
@@ -141,7 +140,7 @@
private String getContentType() {
String contentType = null;
- IStructuredModel model = getModelManager().getExistingModelForRead(getEditor().getDocument());
+ IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(getEditor().getDocument());
if (model != null) {
contentType = model.getContentTypeIdentifier();
model.releaseFromRead();
@@ -164,10 +163,6 @@
return fEditor;
}
- private IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
public boolean isVisible() {
return true;
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/StructuredPropertySheetConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/StructuredPropertySheetConfiguration.java
index f66444c..eae1b5a 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/StructuredPropertySheetConfiguration.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/views/properties/StructuredPropertySheetConfiguration.java
@@ -21,7 +21,6 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.views.properties.IPropertySourceProvider;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
@@ -31,13 +30,6 @@
* StructuredModels
*/
public class StructuredPropertySheetConfiguration extends PropertySheetConfiguration {
- /**
- * Utility method also used in subclasses
- */
- protected static IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
protected IStructuredModel fModel;
/**
@@ -101,7 +93,7 @@
if (textEditor != null) {
IDocument document = textEditor.getDocumentProvider().getDocument(editor.getEditorInput());
if (document != null)
- model = getModelManager().getExistingModelForRead(document);
+ model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
else
model = null;
}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
index d86870d..fa3d2a4 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/StructuredTextViewerConfigurationXML.java
@@ -32,7 +32,6 @@
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.dtd.ui.style.LineStyleProviderForDTDSubSet;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.text.rules.StructuredTextPartitioner;
@@ -177,10 +176,6 @@
return fInformationPresenter;
}
- private IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
public IReconciler getReconciler(ISourceViewer sourceViewer) {
if (fReconciler != null) {
@@ -210,7 +205,7 @@
if (sourceViewer instanceof StructuredTextViewer) {
viewer = ((StructuredTextViewer) sourceViewer);
}
- IStructuredModel sModel = getModelManager().getExistingModelForRead(viewer.getDocument());
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(viewer.getDocument());
try {
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java
index 1f6d59b..66888cd 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/actions/CommentActionXML.java
@@ -37,10 +37,6 @@
protected static final String CLOSE_COMMENT = "-->"; //$NON-NLS-1$
protected static final String OPEN_COMMENT = "<!--"; //$NON-NLS-1$
- static IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
protected IDocument fDocument;
protected IStructuredModel fModel;
protected ITextSelection fSelection;
@@ -107,7 +103,7 @@
if (fDocument == null)
return;
- IModelManager modelManager = getModelManager();
+ IModelManager modelManager = StructuredModelManager.getModelManager();
fModel = modelManager.getExistingModelForEdit(fDocument);
if (fModel == null)
return;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractContentAssistProcessor.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractContentAssistProcessor.java
index a2045c8..2eed99b 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractContentAssistProcessor.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/AbstractContentAssistProcessor.java
@@ -1216,7 +1216,7 @@
// Handle empty Documents
if (completionRegion == null) {
if (((treeNode == null) || ((Node) treeNode).getNodeType() == Node.DOCUMENT_NODE) && completionRegion == null && (xmlnode == null || xmlnode.getChildNodes() == null || xmlnode.getChildNodes().getLength() == 0)) {
- IStructuredModel sModel = StructuredModelManager.getInstance().getModelManager().getExistingModelForRead(textViewer.getDocument());
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(textViewer.getDocument());
try {
if (sModel != null) {
XMLDocument docNode = ((XMLModel) sModel).getDocument();
@@ -2170,7 +2170,7 @@
*/
private boolean needsEndTag(IStructuredDocumentRegion startTag) {
boolean result = false;
- IStructuredModel sModel = StructuredModelManager.getInstance().getModelManager().getExistingModelForRead(fTextViewer.getDocument());
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(fTextViewer.getDocument());
try {
if (sModel != null) {
XMLNode xmlNode = (XMLNode) sModel.getIndexedRegion(startTag.getStart());
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ContextInfoModelUtil.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ContextInfoModelUtil.java
index 1d85817..ef37450 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ContextInfoModelUtil.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/contentassist/ContextInfoModelUtil.java
@@ -13,7 +13,6 @@
package org.eclipse.wst.xml.ui.contentassist;
import org.eclipse.wst.common.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.text.IStructuredDocument;
import org.eclipse.wst.xml.core.document.XMLModel;
@@ -36,14 +35,10 @@
return fDocument;
}
- public IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
public ModelQuery getModelQuery() {
ModelQuery mq = null;
- XMLModel xmlModel = (XMLModel) getModelManager().getExistingModelForRead(getDocument());
+ XMLModel xmlModel = (XMLModel) StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
mq = ModelQueryUtil.getModelQuery(xmlModel.getDocument());
xmlModel.releaseFromRead();
@@ -51,7 +46,7 @@
}
public XMLNode getXMLNode(int offset) {
- XMLModel xmlModel = (XMLModel) getModelManager().getExistingModelForRead(getDocument());
+ XMLModel xmlModel = (XMLModel) StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
XMLNode xmlNode = (XMLNode) xmlModel.getIndexedRegion(offset);
xmlModel.releaseFromRead();
return xmlNode;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/doubleclick/XMLDoubleClickStrategy.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/doubleclick/XMLDoubleClickStrategy.java
index 93dbf16..5aee21f 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/doubleclick/XMLDoubleClickStrategy.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/doubleclick/XMLDoubleClickStrategy.java
@@ -15,7 +15,6 @@
import org.eclipse.jface.text.DefaultTextDoubleClickStrategy;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
@@ -42,7 +41,7 @@
if (textViewer instanceof StructuredTextViewer) {
fStructuredTextViewer = (StructuredTextViewer) textViewer;
try {
- fStructuredModel = getModelManager().getExistingModelForRead(fStructuredTextViewer.getDocument());
+ fStructuredModel = StructuredModelManager.getModelManager().getExistingModelForRead(fStructuredTextViewer.getDocument());
if (fStructuredModel != null) {
int caretPosition = textViewer.getSelectedRange().x;
@@ -69,10 +68,6 @@
}
}
- protected IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
protected Point getWord(String string, int cursor) {
if (string == null)
return null;
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extensions/XMLSourceEditingTextTools.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extensions/XMLSourceEditingTextTools.java
index 9bee91b..b85f876 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extensions/XMLSourceEditingTextTools.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/extensions/XMLSourceEditingTextTools.java
@@ -79,7 +79,7 @@
if (res == null || !(res instanceof IFile))
return null;
- IModelManager mm = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mm = StructuredModelManager.getModelManager();
IStructuredModel model = null;
try {
model = mm.getExistingModelForRead((IFile) res);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
index 60ac815..d932829 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/autoedit/StructuredAutoEditStrategyXML.java
@@ -16,7 +16,6 @@
import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.texteditor.ITextEditorExtension3;
-import org.eclipse.wst.sse.core.IModelManager;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
@@ -37,7 +36,7 @@
IStructuredModel model = null;
try {
- model = getModelManager().getExistingModelForRead(document);
+ model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
if (model != null) {
if (structuredDocumentCommand.text != null) {
smartInsertForComment(structuredDocumentCommand, document, model);
@@ -50,10 +49,6 @@
}
}
- private IModelManager getModelManager() {
- return StructuredModelManager.getInstance().getModelManager();
- }
-
private boolean isCommentNode(XMLNode node) {
return (node != null && node instanceof XMLElement && ((XMLElement) node).isCommentTag());
}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/openon/DefaultOpenOnXML.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/openon/DefaultOpenOnXML.java
index fe373a2..0ec46ea 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/openon/DefaultOpenOnXML.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/openon/DefaultOpenOnXML.java
@@ -28,6 +28,7 @@
import org.eclipse.wst.common.uriresolver.URIResolverPlugin;
import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.IndexedRegion;
+import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.util.StringUtils;
import org.eclipse.wst.sse.ui.openon.AbstractOpenOn;
import org.eclipse.wst.xml.core.document.XMLAttr;
@@ -103,7 +104,7 @@
// get the base location from the current model
IStructuredModel sModel = null;
try {
- sModel = getModelManager().getExistingModelForRead(getDocument());
+ sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
if (sModel != null) {
IPath location = new Path(sModel.getBaseLocation());
if (location.toFile().exists()) {
@@ -156,7 +157,7 @@
protected Node getCurrentNode(int offset) {
// get the current node at the offset (returns element, doctype, text)
IndexedRegion inode = null;
- IStructuredModel sModel = getModelManager().getExistingModelForRead(getDocument());
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(getDocument());
inode = sModel.getIndexedRegion(offset);
if (inode == null)
inode = sModel.getIndexedRegion(offset - 1);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLColorPage.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLColorPage.java
index f1527a5..3f19c77 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLColorPage.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/preferences/XMLColorPage.java
@@ -198,7 +198,7 @@
}
protected void setupPicker(StyledTextColorPicker picker) {
- IModelManager mmanager = StructuredModelManager.getInstance().getModelManager();
+ IModelManager mmanager = StructuredModelManager.getModelManager();
picker.setParser(mmanager.createStructuredDocumentFor(IContentTypeIdentifier.ContentTypeID_SSEXML).getParser());
Dictionary descriptions = new Hashtable();