Author: akazakov
Date: 2010-10-08 10:14:50 -0400 (Fri, 08 Oct 2010)
New Revision: 25646
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
Log:
https://jira.jboss.org/browse/JBIDE-7264
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2010-10-08
12:26:17 UTC (rev 25645)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2010-10-08
14:14:50 UTC (rev 25646)
@@ -12,6 +12,7 @@
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.el.core.resolver.ELContext;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java 2010-10-08
12:26:17 UTC (rev 25645)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IXmlContext.java 2010-10-08
14:14:50 UTC (rev 25646)
@@ -11,6 +11,8 @@
package org.jboss.tools.jst.web.kb;
+import java.util.Set;
+
import org.jboss.tools.common.el.core.resolver.ELContext;
/**
@@ -20,4 +22,9 @@
*/
public interface IXmlContext extends ELContext {
+ /**
+ * Returns all the URIs which are used in the page.
+ * @return
+ */
+ Set<String> getURIs();
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2010-10-08
12:26:17 UTC (rev 25645)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/XmlContextImpl.java 2010-10-08
14:14:50 UTC (rev 25646)
@@ -2,6 +2,7 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -24,7 +25,8 @@
// Fix for JBIDE-5097: It must be a map of <IRegion to Map of <NS-Prefix to
NS>>
protected Map<IRegion, Map<String, INameSpace>> nameSpaces = new
HashMap<IRegion, Map<String, INameSpace>>();
-
+ protected Set<String> uris = new HashSet<String>();
+
/**
* Sets up the context resource and retrieves the document for the specified resource
*/
@@ -115,8 +117,16 @@
nameSpaces.put(region, nameSpaceMap);
}
nameSpaces.get(region).put(nameSpace.getPrefix(), nameSpace); // Fix for JBIDE-5097
+ String uri = nameSpace.getURI();
+ if(uri!=null && uri.length()>0) {
+ uris.add(uri);
+ }
}
-
+
+ public Set<String> getURIs() {
+ return uris;
+ }
+
private IDocument getConnectedDocument(IEditorInput input) {
IDocumentProvider provider=
DocumentProviderRegistry.getDefault().getDocumentProvider(input);
try {