Author: scabanovich
Date: 2011-05-02 15:04:14 -0400 (Mon, 02 May 2011)
New Revision: 31002
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java
Log:
JBIDE-8832
https://issues.jboss.org/browse/JBIDE-8832
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java 2011-05-02
19:03:27 UTC (rev 31001)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamMemberDefinition.java 2011-05-02
19:04:14 UTC (rev 31002)
@@ -14,9 +14,9 @@
import java.util.Map;
import org.jboss.tools.cdi.core.IJavaAnnotation;
+import org.jboss.tools.cdi.seam.config.core.scanner.Location;
import org.jboss.tools.cdi.seam.config.core.scanner.SAXElement;
import org.jboss.tools.cdi.seam.config.core.scanner.SAXNode;
-import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -59,11 +59,11 @@
return annotations.get(typeName);
}
- public ITextSourceReference getReplacesLocation() {
+ public Location getReplacesLocation() {
return replaces == null ? null : replaces.getLocation();
}
- public ITextSourceReference getModifiesLocation() {
+ public Location getModifiesLocation() {
return modifies == null ? null : modifies.getLocation();
}
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java 2011-05-02
19:03:27 UTC (rev 31001)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/Location.java 2011-05-02
19:04:14 UTC (rev 31002)
@@ -10,14 +10,15 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.core.scanner;
-import org.jboss.tools.common.text.ITextSourceReference;
+import org.eclipse.core.resources.IFile;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class Location implements ITextSourceReference {
+public class Location {
+ IFile file;
int start;
int length;
@@ -34,4 +35,8 @@
return length;
}
+ public IFile getResource() {
+ return file;
+ }
+
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java 2011-05-02
19:03:27 UTC (rev 31001)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXAttribute.java 2011-05-02
19:04:14 UTC (rev 31002)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.core.scanner;
-import org.jboss.tools.common.text.ITextSourceReference;
-
/**
*
* @author Viacheslav Kabanovich
@@ -19,7 +17,7 @@
*/
public class SAXAttribute extends SAXText {
private String name;
- private ITextSourceReference nameLocation;
+ private Location nameLocation;
private SAXElement parent;
@@ -31,19 +29,19 @@
return name;
}
- public void setNameLocation(ITextSourceReference location) {
+ public void setNameLocation(Location location) {
nameLocation = location;
}
- public ITextSourceReference getNameLocation() {
+ public Location getNameLocation() {
return nameLocation;
}
- public void setValueLocation(ITextSourceReference location) {
+ public void setValueLocation(Location location) {
setLocation(location);
}
- public ITextSourceReference getValueLocation() {
+ public Location getValueLocation() {
return getLocation();
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java 2011-05-02
19:03:27 UTC (rev 31001)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXElement.java 2011-05-02
19:04:14 UTC (rev 31002)
@@ -16,8 +16,6 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.tools.common.text.ITextSourceReference;
-
/**
*
* @author Viacheslav Kabanovich
@@ -27,7 +25,7 @@
protected String uri;
protected String localName;
protected String name;
- protected ITextSourceReference nameLocation;
+ protected Location nameLocation;
protected Map<String, SAXAttribute> attributes = new HashMap<String,
SAXAttribute>();
protected SAXText text;
@@ -44,11 +42,11 @@
return name;
}
- public void setNameLocation(ITextSourceReference location) {
+ public void setNameLocation(Location location) {
nameLocation = location;
}
- public ITextSourceReference getNameLocation() {
+ public Location getNameLocation() {
return nameLocation;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java 2011-05-02
19:03:27 UTC (rev 31001)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXNode.java 2011-05-02
19:04:14 UTC (rev 31002)
@@ -10,21 +10,19 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.core.scanner;
-import org.jboss.tools.common.text.ITextSourceReference;
-
/**
*
* @author Viacheslav Kabanovich
*
*/
public class SAXNode {
- protected ITextSourceReference location = null;
+ protected Location location = null;
- public void setLocation(ITextSourceReference location) {
+ public void setLocation(Location location) {
this.location = location;
}
- public ITextSourceReference getLocation() {
+ public Location getLocation() {
return location;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java 2011-05-02
19:03:27 UTC (rev 31001)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SAXParser.java 2011-05-02
19:04:14 UTC (rev 31002)
@@ -8,7 +8,6 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.common.xml.SAXValidator;
import org.jboss.tools.common.xml.XMLEntityResolverImpl;
import org.xml.sax.Attributes;
@@ -82,7 +81,7 @@
SAXElement current = null;
StringBuffer currentText = new StringBuffer();
- ITextSourceReference currentTextLocation = null;
+ Location currentTextLocation = null;
ConfigHanlder(IDocument document) {
this.document = document;
@@ -165,7 +164,7 @@
int end = getCurrentLocation();
if(end > 0) {
int start = document.get().lastIndexOf("<", end);
- ITextSourceReference endLocation = new Location(start, end - start);
+ Location endLocation = new Location(start, end - start);
//TODO
}
if(currentText.length() > 0) {