JBoss Tools SVN: r11228 - trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-27 21:30:14 -0400 (Mon, 27 Oct 2008)
New Revision: 11228
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
Log:
JBIDE-2796 / JBIDE-3015 - seam template .project files included archives builder / nature when they shouldnt
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2008-10-28 01:28:27 UTC (rev 11227)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2008-10-28 01:30:14 UTC (rev 11228)
@@ -10,11 +10,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
<buildCommand>
<name>org.jboss.tools.seam.core.seambuilder</name>
<arguments>
@@ -22,7 +17,6 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.jboss.tools.seam.core.seamnature</nature>
</natures>
17 years, 5 months
JBoss Tools SVN: r11227 - branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-27 21:28:27 -0400 (Mon, 27 Oct 2008)
New Revision: 11227
Modified:
branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
Log:
JBIDE-2796,JBIDE-3015 - seam test project templates including archives builder / nature when they should not.
Modified: branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2008-10-27 22:35:17 UTC (rev 11226)
+++ branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2008-10-28 01:28:27 UTC (rev 11227)
@@ -10,11 +10,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
<buildCommand>
<name>org.jboss.tools.seam.core.seambuilder</name>
<arguments>
@@ -22,7 +17,6 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.jboss.tools.seam.core.seamnature</nature>
</natures>
17 years, 5 months
JBoss Tools SVN: r11226 - in trunk: common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-27 18:35:17 -0400 (Mon, 27 Oct 2008)
New Revision: 11226
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RelativeLinkHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/XModelBasedHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPForBeanIdHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPTaglibHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPXmlNsHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLContextParamLinkHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLDoctypeHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLJumpToHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTagAttributeValueHyperlinkPartitioner.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFContextParamLinkHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/PropertyHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/RenderKitHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ValidatorHyperlink.java
Log:
remove copy-pasted inline classes
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -26,6 +26,7 @@
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
@@ -202,16 +203,7 @@
if (("." + styleName).equalsIgnoreCase(name)) {
final int offset = startOffset + scanner.getTokenOffset();
final int length = scanner.getTokenLength();
- region = new IRegion () {
- public int getLength() {
- return length;
- }
-
- public int getOffset() {
- return offset;
- }
- };
- return region;
+ return new Region (offset,length);
}
} else if (CSSTextScanner.CSS_CLASS_BODY.equals(tToken.getType())) {
// String body = tToken.getText();
@@ -243,15 +235,7 @@
if (("." + styleName).equalsIgnoreCase(name)) {
final int offset = scanner.getTokenOffset();
final int length = scanner.getTokenLength();
- return new IRegion () {
- public int getLength() {
- return length;
- }
-
- public int getOffset() {
- return offset;
- }
- };
+ return new Region (offset,length);
}
} else if (CSSTextScanner.CSS_CLASS_BODY.equals(tToken.getType())) {
// String body = tToken.getText();
@@ -265,7 +249,9 @@
ExtensionsPlugin.getPluginLog().logError("Error while looking for style region ", x);
} finally {
try {
- stream.close();
+ if(stream!=null) {
+ stream.close();
+ }
} catch (IOException x) {
//ignore
}
@@ -352,31 +338,7 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
-
- };
- return region;
+ return new Region (propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -37,6 +37,7 @@
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IStorageEditorInput;
@@ -247,31 +248,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
-
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JSPStylesheetRelLinkHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -12,6 +12,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -96,28 +97,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
-// String propText = text.substring(bStart, bEnd);
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/JumpToHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -190,25 +190,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException e) {
openFileFailed();
} finally {
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RelativeLinkHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RelativeLinkHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/RelativeLinkHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.common.text.ext.ExtensionsPlugin;
@@ -123,32 +124,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/XModelBasedHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/XModelBasedHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/XModelBasedHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IPromptingProvider;
import org.jboss.tools.common.model.project.PromptingProviderFactory;
@@ -108,31 +109,7 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
-
- };
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPForBeanIdHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPForBeanIdHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPForBeanIdHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -14,6 +14,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
@@ -69,28 +70,7 @@
final int offset = Utils.getValueStart(element);
final int length = ((IDOMElement)element).getStartStructuredDocumentRegion().getLength();
- return new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return length;
- }
-
- public int getOffset() {
- return offset;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
+ return new Region (offset, length);
} finally {
smw.dispose();
}
@@ -191,31 +171,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region (propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -13,6 +13,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -224,28 +225,7 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPTaglibHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPTaglibHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPTaglibHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -137,26 +138,7 @@
final int taglibLength = taglib.getEndOffset() - taglib.getStartOffset();
final int taglibOffset = taglib.getStartOffset();
- IRegion region = new IRegion () {
- public int getLength() {
- return taglibLength;
- }
-
- public int getOffset() {
- return taglibOffset;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- };
- return region;
+ return new Region(taglibOffset,taglibLength);
} finally {
smw.dispose();
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPXmlNsHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPXmlNsHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/jsp/JSPXmlNsHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
@@ -150,27 +151,8 @@
final int taglibLength = xmlnsAttr.getValueRegionText().length();
final int taglibOffset = xmlnsAttr.getValueRegionStartOffset();
-
- IRegion region = new IRegion () {
- public int getLength() {
- return taglibLength;
- }
- public int getOffset() {
- return taglibOffset;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- };
- return region;
+ return new Region(taglibOffset,taglibLength);
} finally {
smw.dispose();
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLContextParamLinkHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLContextParamLinkHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLContextParamLinkHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -13,6 +13,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
@@ -98,27 +99,8 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLDoctypeHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLDoctypeHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLDoctypeHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -12,6 +12,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.text.ext.ExtensionsPlugin;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
@@ -79,26 +80,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} finally {
smw.dispose();
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLJumpToHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLJumpToHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLJumpToHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -17,6 +17,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -106,27 +107,8 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -13,6 +13,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -103,31 +104,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
// Ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTagAttributeValueHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTagAttributeValueHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLTagAttributeValueHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -13,6 +13,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -94,26 +95,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
//ignore
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLXmlNsHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -29,6 +29,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.pde.internal.ui.editor.JarEntryEditorInput;
import org.eclipse.pde.internal.ui.editor.JarEntryFile;
import org.eclipse.ui.IEditorInput;
@@ -354,26 +355,8 @@
taglibLength = newLength;
taglibOffset = newOffset;
}
- IRegion region = new IRegion () {
- public int getLength() {
- return taglibLength;
- }
- public int getOffset() {
- return taglibOffset;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- };
- return region;
+ return new Region(taglibOffset,taglibLength);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -22,6 +22,7 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.common.model.XModel;
@@ -317,31 +318,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
@@ -115,32 +116,8 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
@@ -57,28 +58,7 @@
if (element != null) {
final int offset = element.getStartOffset();
final int length = element.getStartStructuredDocumentRegion().getLength();
- return new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return length;
- }
-
- public int getOffset() {
- return offset;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
+ return new Region(offset,length);
}
return null;
} finally {
@@ -190,31 +170,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFContextParamLinkHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFContextParamLinkHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFContextParamLinkHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -12,6 +12,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -78,28 +79,8 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
- public int getOffset() {
- return propStart;
- }
-
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPValidatorHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -13,6 +13,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -104,27 +105,8 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log(x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
@@ -197,32 +198,8 @@
final int propLength = bEnd - bStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
-
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -16,6 +16,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -135,30 +136,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
@@ -153,32 +154,8 @@
final int nameEnd = nameStart + tagName.length();
if (nameStart > offset || nameEnd <= offset) return null;
-
- IRegion region = new IRegion () {
-
- public int getLength() {
- return nameEnd - nameStart;
- }
-
- public int getOffset() {
- return nameStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
- return region;
+ return new Region(nameStart,nameEnd - nameStart);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagNameHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -107,31 +108,7 @@
if (nameStart > offset || nameEnd <= offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return nameEnd - nameStart;
- }
-
- public int getOffset() {
- return nameStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(nameStart,nameEnd - nameStart);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.XModelBasedHyperlink;
@@ -100,26 +101,7 @@
final int taglibLength = xmlnsAttr.getValueRegionText().length();
final int taglibOffset = xmlnsAttr.getValueRegionStartOffset();
- IRegion region = new IRegion () {
- public int getLength() {
- return taglibLength;
- }
-
- public int getOffset() {
- return taglibOffset;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- };
- return region;
+ return new Region(taglibOffset,taglibLength);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPXmlNsHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -106,26 +107,8 @@
final int propLength = Utils.getValueEnd(n) - propStart;
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -14,6 +14,7 @@
import java.util.Properties;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.text.ext.hyperlink.XModelBasedHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
@@ -88,26 +89,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlinkPartitioner.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfTaglibDirectiveHyperlinkPartitioner.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -115,25 +116,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
- };
- return region;
+ return new Region(propStart,propLength);
} finally {
smw.dispose();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/PropertyHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/PropertyHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/PropertyHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
@@ -167,31 +168,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
-
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/RenderKitHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/RenderKitHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/RenderKitHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -15,6 +15,7 @@
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
@@ -115,31 +116,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
- IRegion region = new IRegion () {
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
-
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ValidatorHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ValidatorHyperlink.java 2008-10-27 20:18:14 UTC (rev 11225)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ValidatorHyperlink.java 2008-10-27 22:35:17 UTC (rev 11226)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
@@ -123,31 +124,7 @@
if (propStart > offset || propStart + propLength < offset) return null;
-
- IRegion region = new IRegion () {
- public boolean equals(Object arg) {
- if (!(arg instanceof IRegion)) return false;
- IRegion region = (IRegion)arg;
-
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- return true;
- }
-
- public int getLength() {
- return propLength;
- }
-
- public int getOffset() {
- return propStart;
- }
-
- public String toString() {
- return "IRegion [" + getOffset() +", " + getLength()+ "]";
- }
- };
-
- return region;
+ return new Region(propStart,propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return null;
17 years, 5 months
JBoss Tools SVN: r11225 - branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-27 16:18:14 -0400 (Mon, 27 Oct 2008)
New Revision: 11225
Modified:
branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2954 Fixed
Modified: branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-27 20:15:29 UTC (rev 11224)
+++ branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-27 20:18:14 UTC (rev 11225)
@@ -114,7 +114,7 @@
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
final IContainer source = srcRootFolder.getUnderlyingFolder();
- File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1) + "/action/");
+ File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1).toString());
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "seam.properties"), actionsSrc, true); //$NON-NLS-1$
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
} else {
17 years, 5 months
JBoss Tools SVN: r11224 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-27 16:15:29 -0400 (Mon, 27 Oct 2008)
New Revision: 11224
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2954 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-27 19:40:44 UTC (rev 11223)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-27 20:15:29 UTC (rev 11224)
@@ -114,7 +114,7 @@
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
final IContainer source = srcRootFolder.getUnderlyingFolder();
- File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1) + "/action/");
+ File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1).toString());
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "seam.properties"), actionsSrc, true); //$NON-NLS-1$
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
} else {
17 years, 5 months
JBoss Tools SVN: r11223 - in branches/jbosstools-3.0.0.Beta1: seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-27 15:40:44 -0400 (Mon, 27 Oct 2008)
New Revision: 11223
Modified:
branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java
branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml
branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2914 Fixed
Modified: branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java 2008-10-27 19:25:42 UTC (rev 11222)
+++ branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java 2008-10-27 19:40:44 UTC (rev 11223)
@@ -171,7 +171,8 @@
*/
public List<Var> findAllVars(Node node) {
ArrayList<Var> vars = null;
- Node parentNode = node.getParentNode();
+// Node parentNode = node.getParentNode();
+ Node parentNode = node;
while(parentNode!=null) {
Var var = findVar(parentNode);
if(var!=null) {
@@ -248,7 +249,7 @@
ELExpression token = var.getElToken();
if(token!=null && !token.getText().endsWith(".")) {
String varName = var.getName();
- if(el.startsWith(varName)) { //TODO it was el.equals(varName) and did not work. Why?
+ if(el.equals(varName) || el.startsWith(varName.trim()+".")) {
if(var.getElToken()!=null && initializeNestedVars) {
Var parentVar = findVarForEl(var.getElToken().getText(), parentVars, true);
if(parentVar!=null) {
Modified: branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2008-10-27 19:25:42 UTC (rev 11222)
+++ branches/jbosstools-3.0.0.Beta1/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2008-10-27 19:40:44 UTC (rev 11223)
@@ -322,15 +322,19 @@
return isDataModel;
}
- protected void setDataModel(boolean isDataModel) {
+ public void setDataModel(boolean isDataModel) {
this.isDataModel = isDataModel;
}
public TypeInfoCollector getTypeCollector() {
+ return getTypeCollector(false);
+ }
+
+ public TypeInfoCollector getTypeCollector(boolean varIsUsed) {
// The rev. 7651 results in a deadlock, typeInfo is not stored anymore
// The rev. 7623 results in a deadlock, so, it's rolled back
// >>> Fix for JBIDE-2090
- return new TypeInfoCollector(this);
+ return new TypeInfoCollector(this, varIsUsed);
// <<< Fix for JBIDE-2090
}
@@ -682,9 +686,13 @@
}
public TypeInfoCollector(MemberInfo member) {
+ this(member, false);
+ }
+
+ public TypeInfoCollector(MemberInfo member, boolean varIsUsed) {
this.fMember = member;
this.fType = member.getMemberType();
- collectInfo();
+ collectInfo(varIsUsed);
}
public IType getType() {
@@ -692,6 +700,10 @@
}
public void collectInfo() {
+ collectInfo(false);
+ }
+
+ public void collectInfo(boolean var) {
if (fMethods == null) {
fMethods = new ArrayList<MethodInfo>();
} else {
@@ -722,7 +734,12 @@
if (binMethods[i].isConstructor()) {
continue;
}
- fMethods.add(new MethodInfo(binMethods[i], fTypeInfo, parent, false));
+ MethodInfo info = new MethodInfo(binMethods[i], fTypeInfo, parent, false);
+ if(info.getType().isArray() && var) {
+ info.setDataModel(true);
+ }
+ fMethods.add(info);
+
}
binType = getSuperclass(binType);
if(binType!=null) {
Modified: branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-10-27 19:25:42 UTC (rev 11222)
+++ branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-10-27 19:40:44 UTC (rev 11223)
@@ -132,30 +132,39 @@
Var var = varSearcher.findVarForEl(oldEl, vars, true);
String suffix = "";
String newEl = oldEl;
+ TypeInfoCollector.MemberInfo member = null;
+ boolean isArray = false;
if(var!=null) {
- TypeInfoCollector.MemberInfo member = resolveSeamEL(file, var.getElToken());
- if(member!=null && !member.getType().isArray()) {
- IType type = member.getMemberType();
- if(type!=null) {
- try {
- if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) {
- suffix = collectionAdditionForMapDataModel;
- } else {
- suffix = collectionAdditionForCollectionDataModel;
+ member = resolveSeamEL(file, var.getElToken());
+ if(member!=null) {
+ if(!member.getType().isArray()) {
+ IType type = member.getMemberType();
+ if(type!=null) {
+ try {
+ if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) {
+ suffix = collectionAdditionForMapDataModel;
+ } else {
+ suffix = collectionAdditionForCollectionDataModel;
+ }
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
}
- } catch (JavaModelException e) {
- SeamCorePlugin.getPluginLog().logError(e);
}
+ } else {
+ isArray = true;
}
}
if(var.getElToken() != null) {
newEl = var.getElToken().getText() + suffix + oldEl.substring(var.getName().length());
}
}
- boolean prefixWasChanged = newEl != oldEl;
+ boolean prefixWasChanged = !oldEl.equals(newEl);
+ if(prefixWasChanged && isArray) {
+ member.setDataModel(true);
+ }
ELExpression newOperand = (prefixWasChanged) ? parseOperand(newEl) : operand;
- SeamELOperandResolveStatus status = resolveELOperand(file, newOperand, returnEqualedVariablesOnly);
+ SeamELOperandResolveStatus status = resolveELOperand(file, newOperand, returnEqualedVariablesOnly, prefixWasChanged);
if(prefixWasChanged) {
ELInvocationExpression newLastResolvedToken = status.getLastResolvedToken();
@@ -211,7 +220,7 @@
*/
public TypeInfoCollector.MemberInfo resolveSeamEL(IFile file, ELExpression operand) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression)) return null;
- ELOperandResolveStatus status = resolveELOperand(file, operand, true);
+ ELOperandResolveStatus status = resolveELOperand(file, operand, true, false);
return status.getMemberOfResolvedOperand();
}
@@ -272,7 +281,7 @@
}
public SeamELOperandResolveStatus resolveELOperand(IFile file, ELExpression operand,
- boolean returnEqualedVariablesOnly) throws BadLocationException, StringIndexOutOfBoundsException {
+ boolean returnEqualedVariablesOnly, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression)) {
return new SeamELOperandResolveStatus(null);
}
@@ -357,9 +366,9 @@
if(left != null) while(left != expr) {
left = (ELInvocationExpression)left.getParent();
if (left != expr) { // inside expression
- members = resolveSegment(left, members, status, returnEqualedVariablesOnly);
+ members = resolveSegment(left, members, status, returnEqualedVariablesOnly, varIsUsed);
} else { // Last segment
- resolveLastSegment((ELInvocationExpression)operand, members, status, returnEqualedVariablesOnly);
+ resolveLastSegment((ELInvocationExpression)operand, members, status, returnEqualedVariablesOnly, varIsUsed);
break;
}
}
@@ -373,7 +382,7 @@
private List<TypeInfoCollector.MemberInfo> resolveSegment(ELInvocationExpression expr,
List<TypeInfoCollector.MemberInfo> members,
ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly) {
+ boolean returnEqualedVariablesOnly, boolean varIsUsed) {
LexicalToken lt = (expr instanceof ELPropertyInvocation)
? ((ELPropertyInvocation)expr).getName()
: (expr instanceof ELMethodInvocation)
@@ -385,7 +394,7 @@
List<TypeInfoCollector.MemberInfo> newMembers = new ArrayList<TypeInfoCollector.MemberInfo>();
for (TypeInfoCollector.MemberInfo mbr : members) {
if (mbr.getMemberType() == null) continue;
- TypeInfoCollector infos = mbr.getTypeCollector();
+ TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
status.setMapOrCollectionOrBundleAmoungTheTokens();
}
@@ -434,7 +443,7 @@
private void resolveLastSegment(ELInvocationExpression expr,
List<TypeInfoCollector.MemberInfo> members,
ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly) {
+ boolean returnEqualedVariablesOnly, boolean varIsUsed) {
Set<String> proposals = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION && ((ELPropertyInvocation)expr).getName() == null) {
// return all the methods + properties
@@ -459,7 +468,7 @@
if (mbr.getMemberType() == null) {
continue;
}
- TypeInfoCollector infos = mbr.getTypeCollector();
+ TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
status.setMapOrCollectionOrBundleAmoungTheTokens();
}
Modified: branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-10-27 19:25:42 UTC (rev 11222)
+++ branches/jbosstools-3.0.0.Beta1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-10-27 19:40:44 UTC (rev 11223)
@@ -214,26 +214,26 @@
private void validateChildNodes(IFile file, Node parent) {
String preferenceValue = SeamPreferences.getProjectPreference(project, SeamPreferences.CHECK_VARS);
- Var var = null;
- if (SeamPreferences.ENABLE.equals(preferenceValue)) {
- var = elVarSearcher.findVar(parent);
- }
- if(var!=null) {
- varListForCurentValidatedNode.add(var);
- }
NodeList children = parent.getChildNodes();
for(int i=0; i<children.getLength() && !reporter.isCancelled(); i++) {
Node curentValidatedNode = children.item(i);
+ Var var = null;
if(Node.ELEMENT_NODE == curentValidatedNode.getNodeType()) {
+ if (SeamPreferences.ENABLE.equals(preferenceValue)) {
+ var = elVarSearcher.findVar(curentValidatedNode);
+ }
+ if(var!=null) {
+ varListForCurentValidatedNode.add(var);
+ }
validateNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE);
} else if(Node.TEXT_NODE == curentValidatedNode.getNodeType()) {
validateNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_CONTENT);
}
validateChildNodes(file, curentValidatedNode);
+ if(var!=null) {
+ varListForCurentValidatedNode.remove(var);
+ }
}
- if(var!=null) {
- varListForCurentValidatedNode.remove(var);
- }
}
private void validateNodeContent(IFile file, IStructuredDocumentRegion node, String regionType) {
@@ -299,51 +299,48 @@
try {
int offset = operand.length();
if (!operand.endsWith(".")) { //$NON-NLS-1$
- {
- SeamELOperandResolveStatus status =
- engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
+ SeamELOperandResolveStatus status =
+ engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
- if(status.getUsedVariables().size()==0 && status.isError()) {
- // Save resources with unknown variables names
- validationContext.addUnnamedElResource(file.getFullPath());
- } else {
- // Save links between resource and used variables names
- for(ISeamContextVariable variable: status.getUsedVariables()) {
- validationContext.addLinkedElResource(variable.getName(), file.getFullPath());
- }
+ if(status.getUsedVariables().size()==0 && status.isError()) {
+ // Save resources with unknown variables names
+ validationContext.addUnnamedElResource(file.getFullPath());
+ } else {
+ // Save links between resource and used variables names
+ for(ISeamContextVariable variable: status.getUsedVariables()) {
+ validationContext.addLinkedElResource(variable.getName(), file.getFullPath());
}
+ }
- // Check pair for getter/setter
- if(status.getUnpairedGettersOrSetters().size()>0) {
- TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
- String methodName = unpairedMethod.getName();
- String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
- String missingMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
- String existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_GETTER;
- if(methodName.startsWith("s")) { //$NON-NLS-1$
- missingMethodName = existedMethodName;
- existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
- }
- addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, operand.length(), documnetOffset, file);
+ // Check pair for getter/setter
+ if(status.getUnpairedGettersOrSetters().size()>0) {
+ TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
+ String methodName = unpairedMethod.getName();
+ String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
+ String missingMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
+ String existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_GETTER;
+ if(methodName.startsWith("s")) { //$NON-NLS-1$
+ missingMethodName = existedMethodName;
+ existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
}
+ addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, operand.length(), documnetOffset, file);
+ }
- if (status.isOK()) {
- // It's valid EL.
- return;
- }
-
- ELInvocationExpression ts = status.getUnresolvedTokens();
-
- varName = ts.getMemberName();
- if(varName == null) {
- //This is syntax error case. Reported by parser.
- return;
- }
- offsetOfVarName = documnetOffset + ts.getInvocationStartPosition();
- lengthOfVarName = varName == null ? 0 : varName.length();
- unresolvedTokenIsVariable = true;
-
+ if (status.isOK()) {
+ // It's valid EL.
+ return;
}
+
+ ELInvocationExpression ts = status.getUnresolvedTokens();
+
+ varName = ts.getMemberName();
+ if(varName == null) {
+ //This is syntax error case. Reported by parser.
+ return;
+ }
+ offsetOfVarName = documnetOffset + ts.getInvocationStartPosition();
+ lengthOfVarName = varName == null ? 0 : varName.length();
+ unresolvedTokenIsVariable = true;
}
} catch (BadLocationException e) {
SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_EL_VALIDATOR_ERROR_VALIDATING_SEAM_EL, e);
Modified: branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml 2008-10-27 19:25:42 UTC (rev 11222)
+++ branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml 2008-10-27 19:40:44 UTC (rev 11223)
@@ -26,6 +26,18 @@
<h:dataTable value="#{testComponentForVars.list}" var="item">
<h:outputText value="#{item.name}"/>
</h:dataTable>
+
+ <h:dataTable value="#{tipos}" var="itemNew" label="#{itemNew}">
+ <h:outputText value="#{itemNew.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{tiposs}" var="secondItem">
+ <h:outputText value="#{secondItem.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testComponentForVars.array}" var="thrItem">
+ <h:outputText value="#{thrItem.name}"/>
+ </h:dataTable>
</h:dataTable>
</ui:define>
Modified: branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java 2008-10-27 19:25:42 UTC (rev 11222)
+++ branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java 2008-10-27 19:40:44 UTC (rev 11223)
@@ -30,6 +30,20 @@
return null;
}
+ @Factory("tipos")
+ public Value[] initTipos() {
+ return null;
+ }
+
+ public Value[] getArray() {
+ return null;
+ }
+
+ @Factory("tiposs")
+ public List<Value> initTiposNew() {
+ return null;
+ }
+
public static class Value {
public String getName() {
return null;
17 years, 5 months
JBoss Tools SVN: r11222 - in trunk: seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-27 15:25:42 -0400 (Mon, 27 Oct 2008)
New Revision: 11222
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2914 Fixed
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java 2008-10-27 19:22:37 UTC (rev 11221)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ElVarSearcher.java 2008-10-27 19:25:42 UTC (rev 11222)
@@ -171,7 +171,8 @@
*/
public List<Var> findAllVars(Node node) {
ArrayList<Var> vars = null;
- Node parentNode = node.getParentNode();
+// Node parentNode = node.getParentNode();
+ Node parentNode = node;
while(parentNode!=null) {
Var var = findVar(parentNode);
if(var!=null) {
@@ -248,7 +249,7 @@
ELExpression token = var.getElToken();
if(token!=null && !token.getText().endsWith(".")) {
String varName = var.getName();
- if(el.startsWith(varName)) { //TODO it was el.equals(varName) and did not work. Why?
+ if(el.equals(varName) || el.startsWith(varName.trim()+".")) {
if(var.getElToken()!=null && initializeNestedVars) {
Var parentVar = findVarForEl(var.getElToken().getText(), parentVars, true);
if(parentVar!=null) {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2008-10-27 19:22:37 UTC (rev 11221)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2008-10-27 19:25:42 UTC (rev 11222)
@@ -322,15 +322,19 @@
return isDataModel;
}
- protected void setDataModel(boolean isDataModel) {
+ public void setDataModel(boolean isDataModel) {
this.isDataModel = isDataModel;
}
public TypeInfoCollector getTypeCollector() {
+ return getTypeCollector(false);
+ }
+
+ public TypeInfoCollector getTypeCollector(boolean varIsUsed) {
// The rev. 7651 results in a deadlock, typeInfo is not stored anymore
// The rev. 7623 results in a deadlock, so, it's rolled back
// >>> Fix for JBIDE-2090
- return new TypeInfoCollector(this);
+ return new TypeInfoCollector(this, varIsUsed);
// <<< Fix for JBIDE-2090
}
@@ -682,9 +686,13 @@
}
public TypeInfoCollector(MemberInfo member) {
+ this(member, false);
+ }
+
+ public TypeInfoCollector(MemberInfo member, boolean varIsUsed) {
this.fMember = member;
this.fType = member.getMemberType();
- collectInfo();
+ collectInfo(varIsUsed);
}
public IType getType() {
@@ -692,6 +700,10 @@
}
public void collectInfo() {
+ collectInfo(false);
+ }
+
+ public void collectInfo(boolean var) {
if (fMethods == null) {
fMethods = new ArrayList<MethodInfo>();
} else {
@@ -722,7 +734,12 @@
if (binMethods[i].isConstructor()) {
continue;
}
- fMethods.add(new MethodInfo(binMethods[i], fTypeInfo, parent, false));
+ MethodInfo info = new MethodInfo(binMethods[i], fTypeInfo, parent, false);
+ if(info.getType().isArray() && var) {
+ info.setDataModel(true);
+ }
+ fMethods.add(info);
+
}
binType = getSuperclass(binType);
if(binType!=null) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-10-27 19:22:37 UTC (rev 11221)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-10-27 19:25:42 UTC (rev 11222)
@@ -132,30 +132,39 @@
Var var = varSearcher.findVarForEl(oldEl, vars, true);
String suffix = "";
String newEl = oldEl;
+ TypeInfoCollector.MemberInfo member = null;
+ boolean isArray = false;
if(var!=null) {
- TypeInfoCollector.MemberInfo member = resolveSeamEL(file, var.getElToken());
- if(member!=null && !member.getType().isArray()) {
- IType type = member.getMemberType();
- if(type!=null) {
- try {
- if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) {
- suffix = collectionAdditionForMapDataModel;
- } else {
- suffix = collectionAdditionForCollectionDataModel;
+ member = resolveSeamEL(file, var.getElToken());
+ if(member!=null) {
+ if(!member.getType().isArray()) {
+ IType type = member.getMemberType();
+ if(type!=null) {
+ try {
+ if(TypeInfoCollector.isInstanceofType(type, "java.util.Map")) {
+ suffix = collectionAdditionForMapDataModel;
+ } else {
+ suffix = collectionAdditionForCollectionDataModel;
+ }
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
}
- } catch (JavaModelException e) {
- SeamCorePlugin.getPluginLog().logError(e);
}
+ } else {
+ isArray = true;
}
}
if(var.getElToken() != null) {
newEl = var.getElToken().getText() + suffix + oldEl.substring(var.getName().length());
}
}
- boolean prefixWasChanged = newEl != oldEl;
+ boolean prefixWasChanged = !oldEl.equals(newEl);
+ if(prefixWasChanged && isArray) {
+ member.setDataModel(true);
+ }
ELExpression newOperand = (prefixWasChanged) ? parseOperand(newEl) : operand;
- SeamELOperandResolveStatus status = resolveELOperand(file, newOperand, returnEqualedVariablesOnly);
+ SeamELOperandResolveStatus status = resolveELOperand(file, newOperand, returnEqualedVariablesOnly, prefixWasChanged);
if(prefixWasChanged) {
ELInvocationExpression newLastResolvedToken = status.getLastResolvedToken();
@@ -211,7 +220,7 @@
*/
public TypeInfoCollector.MemberInfo resolveSeamEL(IFile file, ELExpression operand) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression)) return null;
- ELOperandResolveStatus status = resolveELOperand(file, operand, true);
+ ELOperandResolveStatus status = resolveELOperand(file, operand, true, false);
return status.getMemberOfResolvedOperand();
}
@@ -272,7 +281,7 @@
}
public SeamELOperandResolveStatus resolveELOperand(IFile file, ELExpression operand,
- boolean returnEqualedVariablesOnly) throws BadLocationException, StringIndexOutOfBoundsException {
+ boolean returnEqualedVariablesOnly, boolean varIsUsed) throws BadLocationException, StringIndexOutOfBoundsException {
if(!(operand instanceof ELInvocationExpression)) {
return new SeamELOperandResolveStatus(null);
}
@@ -357,9 +366,9 @@
if(left != null) while(left != expr) {
left = (ELInvocationExpression)left.getParent();
if (left != expr) { // inside expression
- members = resolveSegment(left, members, status, returnEqualedVariablesOnly);
+ members = resolveSegment(left, members, status, returnEqualedVariablesOnly, varIsUsed);
} else { // Last segment
- resolveLastSegment((ELInvocationExpression)operand, members, status, returnEqualedVariablesOnly);
+ resolveLastSegment((ELInvocationExpression)operand, members, status, returnEqualedVariablesOnly, varIsUsed);
break;
}
}
@@ -373,7 +382,7 @@
private List<TypeInfoCollector.MemberInfo> resolveSegment(ELInvocationExpression expr,
List<TypeInfoCollector.MemberInfo> members,
ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly) {
+ boolean returnEqualedVariablesOnly, boolean varIsUsed) {
LexicalToken lt = (expr instanceof ELPropertyInvocation)
? ((ELPropertyInvocation)expr).getName()
: (expr instanceof ELMethodInvocation)
@@ -385,7 +394,7 @@
List<TypeInfoCollector.MemberInfo> newMembers = new ArrayList<TypeInfoCollector.MemberInfo>();
for (TypeInfoCollector.MemberInfo mbr : members) {
if (mbr.getMemberType() == null) continue;
- TypeInfoCollector infos = mbr.getTypeCollector();
+ TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
status.setMapOrCollectionOrBundleAmoungTheTokens();
}
@@ -434,7 +443,7 @@
private void resolveLastSegment(ELInvocationExpression expr,
List<TypeInfoCollector.MemberInfo> members,
ELOperandResolveStatus status,
- boolean returnEqualedVariablesOnly) {
+ boolean returnEqualedVariablesOnly, boolean varIsUsed) {
Set<String> proposals = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
if (expr.getType() == ELObjectType.EL_PROPERTY_INVOCATION && ((ELPropertyInvocation)expr).getName() == null) {
// return all the methods + properties
@@ -459,7 +468,7 @@
if (mbr.getMemberType() == null) {
continue;
}
- TypeInfoCollector infos = mbr.getTypeCollector();
+ TypeInfoCollector infos = mbr.getTypeCollector(varIsUsed);
if (TypeInfoCollector.isNotParameterizedCollection(mbr) || TypeInfoCollector.isResourceBundle(mbr.getMemberType())) {
status.setMapOrCollectionOrBundleAmoungTheTokens();
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml 2008-10-27 19:22:37 UTC (rev 11221)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/varAttributes.xhtml 2008-10-27 19:25:42 UTC (rev 11222)
@@ -26,6 +26,18 @@
<h:dataTable value="#{testComponentForVars.list}" var="item">
<h:outputText value="#{item.name}"/>
</h:dataTable>
+
+ <h:dataTable value="#{tipos}" var="itemNew" label="#{itemNew}">
+ <h:outputText value="#{itemNew.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{tiposs}" var="secondItem">
+ <h:outputText value="#{secondItem.name}"/>
+ </h:dataTable>
+
+ <h:dataTable value="#{testComponentForVars.array}" var="thrItem">
+ <h:outputText value="#{thrItem.name}"/>
+ </h:dataTable>
</h:dataTable>
</ui:define>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java 2008-10-27 19:22:37 UTC (rev 11221)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/entity/TestComponentForVarAttributes.java 2008-10-27 19:25:42 UTC (rev 11222)
@@ -30,6 +30,20 @@
return null;
}
+ @Factory("tipos")
+ public Value[] initTipos() {
+ return null;
+ }
+
+ public Value[] getArray() {
+ return null;
+ }
+
+ @Factory("tiposs")
+ public List<Value> initTiposNew() {
+ return null;
+ }
+
public static class Value {
public String getName() {
return null;
17 years, 5 months
JBoss Tools SVN: r11221 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-27 15:22:37 -0400 (Mon, 27 Oct 2008)
New Revision: 11221
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2914 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-10-27 19:21:12 UTC (rev 11220)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-10-27 19:22:37 UTC (rev 11221)
@@ -299,51 +299,48 @@
try {
int offset = operand.length();
if (!operand.endsWith(".")) { //$NON-NLS-1$
- {
- SeamELOperandResolveStatus status =
- engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
+ SeamELOperandResolveStatus status =
+ engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
- if(status.getUsedVariables().size()==0 && status.isError()) {
- // Save resources with unknown variables names
- validationContext.addUnnamedElResource(file.getFullPath());
- } else {
- // Save links between resource and used variables names
- for(ISeamContextVariable variable: status.getUsedVariables()) {
- validationContext.addLinkedElResource(variable.getName(), file.getFullPath());
- }
+ if(status.getUsedVariables().size()==0 && status.isError()) {
+ // Save resources with unknown variables names
+ validationContext.addUnnamedElResource(file.getFullPath());
+ } else {
+ // Save links between resource and used variables names
+ for(ISeamContextVariable variable: status.getUsedVariables()) {
+ validationContext.addLinkedElResource(variable.getName(), file.getFullPath());
}
+ }
- // Check pair for getter/setter
- if(status.getUnpairedGettersOrSetters().size()>0) {
- TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
- String methodName = unpairedMethod.getName();
- String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
- String missingMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
- String existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_GETTER;
- if(methodName.startsWith("s")) { //$NON-NLS-1$
- missingMethodName = existedMethodName;
- existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
- }
- addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, operand.length(), documnetOffset, file);
+ // Check pair for getter/setter
+ if(status.getUnpairedGettersOrSetters().size()>0) {
+ TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
+ String methodName = unpairedMethod.getName();
+ String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
+ String missingMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
+ String existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_GETTER;
+ if(methodName.startsWith("s")) { //$NON-NLS-1$
+ missingMethodName = existedMethodName;
+ existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
}
+ addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, operand.length(), documnetOffset, file);
+ }
- if (status.isOK()) {
- // It's valid EL.
- return;
- }
-
- ELInvocationExpression ts = status.getUnresolvedTokens();
-
- varName = ts.getMemberName();
- if(varName == null) {
- //This is syntax error case. Reported by parser.
- return;
- }
- offsetOfVarName = documnetOffset + ts.getInvocationStartPosition();
- lengthOfVarName = varName == null ? 0 : varName.length();
- unresolvedTokenIsVariable = true;
-
+ if (status.isOK()) {
+ // It's valid EL.
+ return;
}
+
+ ELInvocationExpression ts = status.getUnresolvedTokens();
+
+ varName = ts.getMemberName();
+ if(varName == null) {
+ //This is syntax error case. Reported by parser.
+ return;
+ }
+ offsetOfVarName = documnetOffset + ts.getInvocationStartPosition();
+ lengthOfVarName = varName == null ? 0 : varName.length();
+ unresolvedTokenIsVariable = true;
}
} catch (BadLocationException e) {
SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_EL_VALIDATOR_ERROR_VALIDATING_SEAM_EL, e);
17 years, 5 months
JBoss Tools SVN: r11220 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-27 15:21:12 -0400 (Mon, 27 Oct 2008)
New Revision: 11220
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2914 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-10-27 17:31:28 UTC (rev 11219)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-10-27 19:21:12 UTC (rev 11220)
@@ -214,26 +214,26 @@
private void validateChildNodes(IFile file, Node parent) {
String preferenceValue = SeamPreferences.getProjectPreference(project, SeamPreferences.CHECK_VARS);
- Var var = null;
- if (SeamPreferences.ENABLE.equals(preferenceValue)) {
- var = elVarSearcher.findVar(parent);
- }
- if(var!=null) {
- varListForCurentValidatedNode.add(var);
- }
NodeList children = parent.getChildNodes();
for(int i=0; i<children.getLength() && !reporter.isCancelled(); i++) {
Node curentValidatedNode = children.item(i);
+ Var var = null;
if(Node.ELEMENT_NODE == curentValidatedNode.getNodeType()) {
+ if (SeamPreferences.ENABLE.equals(preferenceValue)) {
+ var = elVarSearcher.findVar(curentValidatedNode);
+ }
+ if(var!=null) {
+ varListForCurentValidatedNode.add(var);
+ }
validateNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE);
} else if(Node.TEXT_NODE == curentValidatedNode.getNodeType()) {
validateNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_CONTENT);
}
validateChildNodes(file, curentValidatedNode);
+ if(var!=null) {
+ varListForCurentValidatedNode.remove(var);
+ }
}
- if(var!=null) {
- varListForCurentValidatedNode.remove(var);
- }
}
private void validateNodeContent(IFile file, IStructuredDocumentRegion node, String regionType) {
17 years, 5 months
JBoss Tools SVN: r11219 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-27 13:31:28 -0400 (Mon, 27 Oct 2008)
New Revision: 11219
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
Fix junit errors
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-10-27 17:25:38 UTC (rev 11218)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-10-27 17:31:28 UTC (rev 11219)
@@ -1,317 +1,323 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.jsf.test.jbide;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
-import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
-import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
-
-/**
- * @author Max Areshkau
- *
- * JUnit test for http://jira.jboss.com/jira/browse/JBIDE-788
- */
-public class JBIDE788Test extends VpeTest {
-
- private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
-
- public JBIDE788Test(String name) {
- super(name);
- }
-
- /**
- * Tests inner nodes include URI
- *
- * @throws Throwable
- */
- public void testCAforIncludeTaglibInInenerNodes() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
- // Tests CA
-
- checkOfCAByStartString(CA_NAME, "JBIDE/788/TestChangeUriInInnerNodes.xhtml","s:validateFormat",11,2); //$NON-NLS-1$//$NON-NLS-2$
- checkOfCAByStartString(CA_NAME, "JBIDE/788/TestChangeUriInInnerNodes.xhtml","rich:validateA", 14,14); //$NON-NLS-1$ //$NON-NLS-2$
- checkOfCAByStartString(CA_NAME, "JBIDE/788/TestChangeUriInInnerNodes.xhtml","c:otherwi",18,6); //$NON-NLS-1$//$NON-NLS-2$
-
- // check exception
- if (getException() != null) {
-
- throw getException();
- }
- }
-
- /**
- * Tests Path proposals of CA
- */
- public void testCAPathProposals() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
- // Tests CA
-
- ICompletionProposal[] results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml","",11,31,false); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull(results);
- assertTrue("The lenft should be more than 0",results.length>0); //$NON-NLS-1$
- for (ICompletionProposal completionProposal : results) {
- String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
- if(!displayString.startsWith("${msg.")) { //$NON-NLS-1$
- fail("String doesn't matches"); //$NON-NLS-1$
- }
-
- }
-
- results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAPathProposals.xhtml","",11,43,false); //$NON-NLS-1$//$NON-NLS-2$
- assertNotNull(results);
-
- for(ICompletionProposal completionProposal : results) {
- String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
- if(!displayString.contains("temp") && !displayString.startsWith("#{")) { //$NON-NLS-1$ //$NON-NLS-2$
- fail("String doesn't matches"); //$NON-NLS-1$
- }
- }
- // check exception
- if (getException() != null) {
-
- throw getException();
- }
- }
-
- /**
- * Tests CA for proposals for JSFC
- *
- * @throws Throwable
- */
- public void testCAforForJSFCProposals() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
- // Tests CA
- ICompletionProposal[] results =checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml","",21,58); //$NON-NLS-1$//$NON-NLS-2$
- assertNotNull(results);
- assertTrue(results.length>2);
- for(ICompletionProposal completionProposal : results) {
- String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
- if(!displayString.startsWith("h:command") && !displayString.startsWith("#{")) { //$NON-NLS-1$ //$NON-NLS-2$
- fail("String doesn't matches"); //$NON-NLS-1$
- }
- }
-
- // check exception
- if (getException() != null) {
-
- throw getException();
- }
-
- }
-
- /**
- * Tests CA on html files
- *
- * @throws Throwable
- */
- public void testCAforHtmlFiles() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
- // Tests CA
- ICompletionProposal[] results =checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforHtml.html", "", 5, 13,false); //$NON-NLS-1$//$NON-NLS-2$
-
- assertNotNull(results);
- assertTrue("The lenft should be more than 0",results.length>0); //$NON-NLS-1$
- boolean isMatches=true;
- for (ICompletionProposal completionProposal : results) {
- String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
-
- if(!displayString.startsWith("ta")) { //$NON-NLS-1$
- isMatches=false;
- }
-
- }
- assertTrue("Proposals doesn't match to entered string",isMatches); //$NON-NLS-1$
-
- // check exception
- if (getException() != null) {
-
- throw getException();
- }
- }
-
- /**
- * Tests CA on jsp files
- *
- * @throws Throwable
- */
- public void testCAforJSPFiles() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
- // Tests CA
-
- // cursor will set after "outputText" tag
- ICompletionProposal[] results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforJSP.jsp", "h:outp",26,14,false); //$NON-NLS-1$ //$NON-NLS-2$
-
- for (ICompletionProposal completionProposal : results) {
-
- String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
-
- if(completionProposal instanceof AutoContentAssistantProposal) {
-
- assertTrue(displayString.startsWith("h:outp")) ; //$NON-NLS-1$
- }
- }
- // check exception
- if (getException() != null) {
-
- throw getException();
- }
- }
-
- /**
- * Tests CA on jsp files
- *
- * @throws Throwable
- */
- public void testCAforXHTMLFiles() throws Throwable {
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
-
- // cursor will set after "<" simbol
- checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforXHTML.xhtml", "c", //$NON-NLS-1$ //$NON-NLS-2$
- 15,12);
-
- // cursor will set after "outputText" tag
- checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforXHTML.xhtml", "s", //$NON-NLS-1$//$NON-NLS-2$
- 19,43);
-
- // check exception
- if (getException() != null) {
-
- throw getException();
- }
- }
-
- /**
- *
- * @param caName
- * @param testPagePath
- * @param partOfString
- * @param lineIndex
- * @param linePosition
- * @return
- * @throws CoreException
- */
- private ICompletionProposal[] checkOfCAByStartString(String caName, String testPagePath,
- String partOfString, int lineIndex, int linePosition) throws CoreException {
- return this.checkOfCAByStartString(caName, testPagePath, partOfString, lineIndex, linePosition,true);
-
- }
- /**
- *
- * @param caName
- * @param testPagePath
- * @param partOfString
- * @param lineIndex
- * @param linePosition
- * @param isCheck
- * @return
- * @throws CoreException
- */
-
- private ICompletionProposal[] checkOfCAByStartString(String caName, String testPagePath,
- String partOfString, int lineIndex, int linePosition,boolean isCheck) throws CoreException {
- // get test page path
- IFile file = (IFile) TestUtil.getComponentPath(testPagePath,
- JsfAllTests.IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
- file);
-
- IEditorInput input = new FileEditorInput(file);
-
- assertNotNull("Editor input is null", input); //$NON-NLS-1$
-
- // open and get editor
- ICompletionProposal[] results;
- try {
- JSPMultiPageEditor part = openEditor(input);
-
- int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex, linePosition);
-
- // insert string
- part.getSourceEditor().getTextViewer().getTextWidget()
- .replaceTextRange(position, 0, partOfString);
-
- int newPosition = position + partOfString.length();
-
- // sets cursor position
- part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(
- newPosition);
-
- TestUtil.waitForJobs();
- TestUtil.delay(1000);
- SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor) part
- .getSourceEditor()).getSourceViewerConfigurationForTest();
- // errase errors which can be on start of editor(for example xuklunner
- // not found)
- setException(null);
- StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration) sourceViewerConfiguration;
- IContentAssistant iContentAssistant = stvc
- .getContentAssistant((ISourceViewer) part.getSourceEditor()
- .getAdapter(ISourceViewer.class));
- assertNotNull(iContentAssistant);
- IContentAssistProcessor iContentAssistProcessor = iContentAssistant
- .getContentAssistProcessor(caName);
- assertNotNull(iContentAssistProcessor);
- results = iContentAssistProcessor
- .computeCompletionProposals(part.getSourceEditor()
- .getTextViewer(), newPosition);
-
- // remove inserted string
- part.getSourceEditor().getTextViewer().getTextWidget()
- .replaceTextRange(position, partOfString.length(), ""); //$NON-NLS-1$
- assertNotNull(results);
- assertTrue("Number of ca proposals shouldn't be a null",results.length>0); //$NON-NLS-1$
- if (isCheck) {
- for (int i = 0; i < results.length; i++) {
-
- String displayString = ((ICompletionProposal) results[i]).getDisplayString();
- assertNotNull(displayString);
- assertEquals(true, displayString.startsWith(partOfString));
- }
- }
- } finally {
- closeEditors();
- TestUtil.delay(1000L);
- }
-
- return results;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * @author Max Areshkau
+ *
+ * JUnit test for http://jira.jboss.com/jira/browse/JBIDE-788
+ */
+public class JBIDE788Test extends VpeTest {
+
+ private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
+
+ public JBIDE788Test(String name) {
+ super(name);
+ }
+
+ /**
+ * Tests inner nodes include URI
+ *
+ * @throws Throwable
+ */
+ public void testCAforIncludeTaglibInInenerNodes() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+
+ checkOfCAByStartString(CA_NAME, "JBIDE/788/TestChangeUriInInnerNodes.xhtml","s:validateFormat",11,2); //$NON-NLS-1$//$NON-NLS-2$
+ checkOfCAByStartString(CA_NAME, "JBIDE/788/TestChangeUriInInnerNodes.xhtml","rich:validateA", 14,14); //$NON-NLS-1$ //$NON-NLS-2$
+ checkOfCAByStartString(CA_NAME, "JBIDE/788/TestChangeUriInInnerNodes.xhtml","c:otherwi",18,6); //$NON-NLS-1$//$NON-NLS-2$
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ * Tests Path proposals of CA
+ */
+ public void testCAPathProposals() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+
+ ICompletionProposal[] results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml","",11,31,false); //$NON-NLS-1$ //$NON-NLS-2$
+ assertNotNull(results);
+ assertTrue("The length should be more than 0",results.length>0); //$NON-NLS-1$
+ boolean str_exists=false;
+ for (ICompletionProposal completionProposal : results) {
+ String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
+ if(displayString.startsWith("${msg.")) { //$NON-NLS-1$
+ str_exists=true;
+ }
+
+ }
+ assertEquals("$msg should be in proposals",true, str_exists);
+ str_exists=false;
+ results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAPathProposals.xhtml","",11,41,false); //$NON-NLS-1$//$NON-NLS-2$
+ assertNotNull(results);
+ for(ICompletionProposal completionProposal : results) {
+ String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
+ if(displayString.contains("templates")) { //$NON-NLS-1$ //$NON-NLS-2$
+ str_exists=true;
+ }
+ }
+ assertEquals("path proposala should be in proposals",true, str_exists);
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ * Tests CA for proposals for JSFC
+ *
+ * @throws Throwable
+ */
+ public void testCAforForJSFCProposals() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+ ICompletionProposal[] results =checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAMessageBundlesAndEL.xhtml","",21,58); //$NON-NLS-1$//$NON-NLS-2$
+ assertNotNull(results);
+ assertTrue(results.length>2);
+ for(ICompletionProposal completionProposal : results) {
+ if(completionProposal instanceof AutoContentAssistantProposal ) {
+ String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
+ if(!displayString.startsWith("h:command") && !displayString.startsWith("#{")) { //$NON-NLS-1$ //$NON-NLS-2$
+ fail("String doesn't matches"); //$NON-NLS-1$
+ }
+ }
+ }
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+
+ }
+
+ /**
+ * Tests CA on html files
+ *
+ * @throws Throwable
+ */
+ public void testCAforHtmlFiles() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+ ICompletionProposal[] results =checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforHtml.html", "", 5, 13,false); //$NON-NLS-1$//$NON-NLS-2$
+
+ assertNotNull(results);
+ assertTrue("The lenft should be more than 0",results.length>0); //$NON-NLS-1$
+ boolean isMatches=true;
+ for (ICompletionProposal completionProposal : results) {
+ if(completionProposal instanceof AutoContentAssistantProposal ) {
+ String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
+
+ if(!displayString.startsWith("ta")) { //$NON-NLS-1$
+ isMatches=false;
+ }
+ }
+ }
+ assertTrue("Proposals doesn't match to entered string",isMatches); //$NON-NLS-1$
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ * Tests CA on jsp files
+ *
+ * @throws Throwable
+ */
+ public void testCAforJSPFiles() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+
+ // cursor will set after "outputText" tag
+ ICompletionProposal[] results = checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforJSP.jsp", "h:outp",26,14,false); //$NON-NLS-1$ //$NON-NLS-2$
+
+ for (ICompletionProposal completionProposal : results) {
+
+ String displayString = ((ICompletionProposal) completionProposal).getDisplayString();
+
+ if(completionProposal instanceof AutoContentAssistantProposal) {
+
+ assertTrue(displayString.startsWith("h:outp")) ; //$NON-NLS-1$
+ }
+ }
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ * Tests CA on jsp files
+ *
+ * @throws Throwable
+ */
+ public void testCAforXHTMLFiles() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // cursor will set after "<" simbol
+ checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforXHTML.xhtml", "c", //$NON-NLS-1$ //$NON-NLS-2$
+ 15,12);
+
+ // cursor will set after "outputText" tag
+ checkOfCAByStartString(CA_NAME, "JBIDE/788/testCAforXHTML.xhtml", "s", //$NON-NLS-1$//$NON-NLS-2$
+ 19,43);
+
+ // check exception
+ if (getException() != null) {
+
+ throw getException();
+ }
+ }
+
+ /**
+ *
+ * @param caName
+ * @param testPagePath
+ * @param partOfString
+ * @param lineIndex
+ * @param linePosition
+ * @return
+ * @throws CoreException
+ */
+ private ICompletionProposal[] checkOfCAByStartString(String caName, String testPagePath,
+ String partOfString, int lineIndex, int linePosition) throws CoreException {
+ return this.checkOfCAByStartString(caName, testPagePath, partOfString, lineIndex, linePosition,true);
+
+ }
+ /**
+ *
+ * @param caName
+ * @param testPagePath
+ * @param partOfString
+ * @param lineIndex
+ * @param linePosition
+ * @param isCheck
+ * @return
+ * @throws CoreException
+ */
+
+ private ICompletionProposal[] checkOfCAByStartString(String caName, String testPagePath,
+ String partOfString, int lineIndex, int linePosition,boolean isCheck) throws CoreException {
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(testPagePath,
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+ // open and get editor
+ ICompletionProposal[] results;
+ try {
+ JSPMultiPageEditor part = openEditor(input);
+
+ int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex, linePosition);
+
+ // insert string
+ part.getSourceEditor().getTextViewer().getTextWidget()
+ .replaceTextRange(position, 0, partOfString);
+
+ int newPosition = position + partOfString.length();
+
+ // sets cursor position
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(
+ newPosition);
+
+ TestUtil.waitForJobs();
+ TestUtil.delay(1000);
+ SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor) part
+ .getSourceEditor()).getSourceViewerConfigurationForTest();
+ // errase errors which can be on start of editor(for example xuklunner
+ // not found)
+ setException(null);
+ StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration) sourceViewerConfiguration;
+ IContentAssistant iContentAssistant = stvc
+ .getContentAssistant((ISourceViewer) part.getSourceEditor()
+ .getAdapter(ISourceViewer.class));
+ assertNotNull(iContentAssistant);
+ IContentAssistProcessor iContentAssistProcessor = iContentAssistant
+ .getContentAssistProcessor(caName);
+ assertNotNull(iContentAssistProcessor);
+ results = iContentAssistProcessor
+ .computeCompletionProposals(part.getSourceEditor()
+ .getTextViewer(), newPosition);
+
+ // remove inserted string
+ part.getSourceEditor().getTextViewer().getTextWidget()
+ .replaceTextRange(position, partOfString.length(), ""); //$NON-NLS-1$
+ assertNotNull(results);
+ assertTrue("Number of ca proposals shouldn't be a null",results.length>0); //$NON-NLS-1$
+ if (isCheck) {
+ for (int i = 0; i < results.length; i++) {
+ if(results[i] instanceof AutoContentAssistantProposal ) {
+ String displayString = ((ICompletionProposal) results[i]).getDisplayString();
+ assertNotNull(displayString);
+ assertEquals(true, displayString.startsWith(partOfString));
+ }
+ }
+ }
+ } finally {
+ closeEditors();
+ TestUtil.delay(1000L);
+ }
+
+ return results;
+ }
+}
17 years, 5 months