Author: scabanovich
Date: 2012-01-26 16:02:10 -0500 (Thu, 26 Jan 2012)
New Revision: 38223
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java
Log:
JBIDE-6132
https://issues.jboss.org/browse/JBIDE-6132
Do not create instance of preference XModel when it is not necessary . Use
XModelMetaDataImpl.getInstance() when meta data is required.
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java 2012-01-26
20:54:10 UTC (rev 38222)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/XMLContentDescriber.java 2012-01-26
21:02:10 UTC (rev 38223)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.ITextContentDescriber;
import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.util.FileUtil;
@@ -44,7 +45,7 @@
}
private int describe(String text, IContentDescription description) {
- String entity =
PreferenceModelUtilities.getPreferenceModel().getEntityRecognizer().getEntityName(new
EntityRecognizerContext("xml", text)); //$NON-NLS-1$
+ String entity =
XModelMetaDataImpl.getInstance().getEntityRecognizer().getEntityName(new
EntityRecognizerContext("xml", text)); //$NON-NLS-1$
if(entity == null || entity.length() == 0 || entity.equals("FileXML")
//$NON-NLS-1$
|| entity.equals("FileHibConfig3") ||
entity.equals("FileHibernate3") //$NON-NLS-1$ //$NON-NLS-2$
|| entity.equals("FileANT") //$NON-NLS-1$