JBoss Tools SVN: r6583 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-26 13:03:41 -0500 (Tue, 26 Feb 2008)
New Revision: 6583
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1812
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-26 18:03:18 UTC (rev 6582)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-26 18:03:41 UTC (rev 6583)
@@ -5,6 +5,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
+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.SourceViewerConfiguration;
import org.eclipse.ui.IEditorPart;
@@ -83,7 +85,38 @@
(document instanceof IStructuredDocument));
}
+
+ protected void contentAssistantCommonTest(String fileName, int offset, String[] proposals, boolean exactly){
+ openEditor(fileName);
+
+ ICompletionProposal[] result= null;
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, offset, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offset);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ }
+
+ assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
+
+ for (int i = 0; i < proposals.length; i++) {
+ assertTrue("Proposal "+proposals[i]+" not found!", compareProposal(proposals[i], result));
+ }
+
+ if(exactly)
+ assertTrue("Some other proposals was found!", result.length == proposals.length);
+ }
+
+ protected boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
+ for (int i = 0; i < proposals.length; i++) {
+ if(proposals[i].getDisplayString().equals(proposalName)) return true;
+ }
+ return false;
+ }
+
protected void closeEditor() {
if (jspEditor != null) {
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
16 years, 2 months
JBoss Tools SVN: r6582 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-26 13:03:18 -0500 (Tue, 26 Feb 2008)
New Revision: 6582
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputLabelTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1718
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractJsfTemplate.java 2008-02-26 16:59:09 UTC (rev 6581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractJsfTemplate.java 2008-02-26 18:03:18 UTC (rev 6582)
@@ -47,11 +47,29 @@
Set<String> jsfAttributes = attributes.keySet();
for (String key : jsfAttributes) {
- if (sourceElement.hasAttribute(key))
- visualElement.setAttribute(attributes.get(key), sourceElement
- .getAttribute(key));
+
+ copyAttribute(visualElement, sourceElement, key, attributes
+ .get(key));
}
}
+ /**
+ * copy attribute
+ *
+ * @param visualElement
+ * @param sourceElement
+ * @param sourceAttributeName
+ * @param targetAtttributeName
+ */
+ protected void copyAttribute(nsIDOMElement visualElement,
+ Element sourceElement, String sourceAttributeName,
+ String targetAtttributeName) {
+
+ if (sourceElement.hasAttribute(sourceAttributeName))
+ visualElement.setAttribute(targetAtttributeName, sourceElement
+ .getAttribute(sourceAttributeName));
+
+ }
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputLabelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputLabelTemplate.java 2008-02-26 16:59:09 UTC (rev 6581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputLabelTemplate.java 2008-02-26 18:03:18 UTC (rev 6582)
@@ -13,9 +13,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.jsf.vpe.jsf.template.util.NodeProxyUtil;
-import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -32,26 +30,16 @@
/**
* @author Sergey Dzmitrovich
*
- * template for <h:outputText .../> jsf tag
+ * template for <h:outputLabel .../> jsf tag
*
*/
-public class JsfOutputLabelTemplate extends AbstractJsfTemplate {
+public class JsfOutputLabelTemplate extends AbstractOutputJsfTemplate {
/**
- * name of "value" attribute
+ * name of "for" attribute
*/
- private static final String VALUE_ATTR_NAME = "value";
+ protected static final String FOR_ATTR_NAME = "for";
- /**
- * name of "binding" attribute
- */
- private static final String BINDING_ATTR_NAME = "binding";
-
- /**
- * name of "escape" attribute
- */
- private static final String ESCAPE_ATTR_NAME = "escape";
-
/*
* (non-Javadoc)
*
@@ -65,24 +53,35 @@
List<VpeNodeMapping> attributesMapping = new ArrayList<VpeNodeMapping>();
- // create span element
- nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ // create label element
+ nsIDOMElement label = visualDocument.createElement(HTML.TAG_LABEL);
- VpeCreationData creationData = new VpeCreationData(span);
+ // copy attributes
+ copyOutputJsfAttributes(label, element);
+ copyAttribute(label, element, FOR_ATTR_NAME, HTML.ATTR_FOR);
- copyGeneralJsfAttributes(span, element);
+ // creation data
+ VpeCreationData creationData = new VpeCreationData(label);
+ // get attribute to represent
Attr attr = getOutputAttributeNode(element);
if (attr != null) {
- if ("true".equalsIgnoreCase(element.getAttribute(ESCAPE_ATTR_NAME))) {
+ // if escape then contents of value (or other attribute) is only
+ // text
+ if (!element.hasAttribute(ESCAPE_ATTR_NAME)
+ || ("true".equalsIgnoreCase(element
+ .getAttribute(ESCAPE_ATTR_NAME)))) {
String value = attr.getNodeValue();
+ // get bundle value
String bundleValue = getBundleValue(pageContext, attr);
nsIDOMText text;
+ // if bundleValue differ from value then will be represent
+ // bundleValue, but text will be not edit
if (!value.equals(bundleValue)) {
text = visualDocument.createTextNode(bundleValue);
@@ -90,15 +89,21 @@
} else {
text = visualDocument.createTextNode(value);
+ // add attribute for ability of editing
attributesMapping.add(new VpeNodeMapping(attr, text));
}
- span.appendChild(text);
- } else {
+ label.appendChild(text);
+ }
+ // then text can be html code
+ else {
- VpeChildrenInfo spanInfo = new VpeChildrenInfo(span);
+ // create info
+ VpeChildrenInfo spanInfo = new VpeChildrenInfo(label);
+ // reparse attribute's value
NodeList list = NodeProxyUtil.reparseAttributeValue(attr);
+ // add children to info
for (int i = 0; i < list.getLength(); i++) {
Node child = list.item(i);
@@ -106,6 +111,7 @@
spanInfo.addSourceChild(child);
}
+ // add info to creation data
creationData.addChildrenInfo(spanInfo);
}
@@ -126,24 +132,4 @@
return true;
}
- private Attr getOutputAttributeNode(Element element) {
-
- if (element.hasAttribute(VALUE_ATTR_NAME))
- return element.getAttributeNode(VALUE_ATTR_NAME);
- else if (element.hasAttribute(BINDING_ATTR_NAME))
- return element.getAttributeNode(BINDING_ATTR_NAME);
-
- return null;
-
- }
-
- private String getBundleValue(VpePageContext pageContext, Attr attr) {
-
- BundleMap bundle = pageContext.getBundle();
-
- return bundle.getBundleValue(attr.getNodeValue(), ((IDOMAttr) attr)
- .getValueRegionStartOffset());
-
- }
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java 2008-02-26 16:59:09 UTC (rev 6581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfOutputTextTemplate.java 2008-02-26 18:03:18 UTC (rev 6582)
@@ -13,9 +13,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.jsf.vpe.jsf.template.util.NodeProxyUtil;
-import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -35,23 +33,8 @@
* template for <h:outputText .../> jsf tag
*
*/
-public class JsfOutputTextTemplate extends AbstractJsfTemplate {
+public class JsfOutputTextTemplate extends AbstractOutputJsfTemplate {
- /**
- * name of "value" attribute
- */
- private static final String VALUE_ATTR_NAME = "value";
-
- /**
- * name of "binding" attribute
- */
- private static final String BINDING_ATTR_NAME = "binding";
-
- /**
- * name of "escape" attribute
- */
- private static final String ESCAPE_ATTR_NAME = "escape";
-
/*
* (non-Javadoc)
*
@@ -68,21 +51,30 @@
// create span element
nsIDOMElement span = visualDocument.createElement(HTML.TAG_SPAN);
+ // creation data
VpeCreationData creationData = new VpeCreationData(span);
- copyGeneralJsfAttributes(span, element);
+ // copy attributes
+ copyOutputJsfAttributes(span, element);
+ // get attribute to represent
Attr attr = getOutputAttributeNode(element);
if (attr != null) {
+ // if escape then contents of value (or other attribute) is only
+ // text
+ if (!element.hasAttribute(ESCAPE_ATTR_NAME)
+ || "true".equalsIgnoreCase(element
+ .getAttribute(ESCAPE_ATTR_NAME))) {
- if (!element.hasAttribute(ESCAPE_ATTR_NAME) || "true".equalsIgnoreCase(element.getAttribute(ESCAPE_ATTR_NAME))) {
-
String value = attr.getNodeValue();
+ // get bundle value
String bundleValue = getBundleValue(pageContext, attr);
nsIDOMText text;
+ // if bundleValue differ from value then will be represent
+ // bundleValue, but text will be not edit
if (!value.equals(bundleValue)) {
text = visualDocument.createTextNode(bundleValue);
@@ -90,19 +82,26 @@
} else {
text = visualDocument.createTextNode(value);
+ // add attribute for ability of editing
attributesMapping.add(new VpeNodeMapping(attr, text));
}
span.appendChild(text);
- } else {
+ }
+ // then text can be html code
+ else {
+ // create info
VpeChildrenInfo spanInfo = new VpeChildrenInfo(span);
+ // reparse attribute's value
NodeList list = NodeProxyUtil.reparseAttributeValue(attr);
+ // add children to info
for (int i = 0; i < list.getLength(); i++) {
Node child = list.item(i);
+ // add info to creation data
spanInfo.addSourceChild(child);
}
@@ -126,24 +125,4 @@
return true;
}
- private Attr getOutputAttributeNode(Element element) {
-
- if (element.hasAttribute(VALUE_ATTR_NAME))
- return element.getAttributeNode(VALUE_ATTR_NAME);
- else if (element.hasAttribute(BINDING_ATTR_NAME))
- return element.getAttributeNode(BINDING_ATTR_NAME);
-
- return null;
-
- }
-
- private String getBundleValue(VpePageContext pageContext, Attr attr) {
-
- BundleMap bundle = pageContext.getBundle();
-
- return bundle.getBundleValue(attr.getNodeValue(), ((IDOMAttr) attr)
- .getValueRegionStartOffset());
-
- }
-
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java 2008-02-26 16:59:09 UTC (rev 6581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java 2008-02-26 18:03:18 UTC (rev 6582)
@@ -29,12 +29,11 @@
public class NodeProxyUtil {
- static public NodeList reparseAttributeValue(Attr attr) {
-
+ static public NodeList reparseAttributeValue(String attrString, int offset) {
IStructuredDocument newStructuredDocument = StructuredDocumentFactory
.getNewStructuredDocumentInstance(new JSPSourceParser());
- newStructuredDocument.set(attr.getValue());
+ newStructuredDocument.set(attrString);
IDOMModel modelForJSP = new DOMModelForJSP();
modelForJSP.setStructuredDocument(newStructuredDocument);
@@ -43,13 +42,19 @@
NodeList list = document.getChildNodes();
- NodeList adaptersList = getNodeAdapterList(list, ((IDOMAttr) attr)
- .getValueRegionStartOffset());
+ NodeList adaptersList = getNodeAdapterList(list, offset);
return adaptersList;
}
+ static public NodeList reparseAttributeValue(Attr attr) {
+
+ return reparseAttributeValue(attr.getValue(), ((IDOMAttr) attr)
+ .getValueRegionStartOffset());
+
+ }
+
static public NodeProxy getNodeAdapter(Node node, int basicOffset) {
if (node == null)
return null;
@@ -69,7 +74,9 @@
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
- newNodeList.appendNode(getNodeAdapter(node, basicOffset));
+ // if node is only html tag
+ if (node.getPrefix() == null)
+ newNodeList.appendNode(getNodeAdapter(node, basicOffset));
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-26 16:59:09 UTC (rev 6581)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-26 18:03:18 UTC (rev 6582)
@@ -164,173 +164,80 @@
</vpe:drop>
</vpe:dnd>
</vpe:template>
- </vpe:tag>
-
- <vpe:tag name="h:outputText" case-sensitive="yes">
- <vpe:template children="yes" modify="no"
+ </vpe:tag>
+
+ <vpe:tag name="h:outputText" case-sensitive="yes">
+ <vpe:template children="yes" modify="no"
class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputTextTemplate">
- </vpe:template>
- <!-- <vpe:if test="attrpresent('value')">
- <vpe:template children="no" modify="yes">
- <span class="{@styleClass}" style="{@style}" title="{tagstring()}">
- <vpe:value expr="{jsfvalue(@value)}"/>
- </span>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- <vpe:drop container="yes">
- <vpe:container-child tag-name="converter" />
- <vpe:container-child tag-name="convertNumber" />
- <vpe:container-child tag-name="convertDateTime" />
- <vpe:container-child tag-name="validator" />
- <vpe:container-child tag-name="validateDoubleRange" />
- <vpe:container-child tag-name="validateLongRange" />
- <vpe:container-child tag-name="validateLength" />
- </vpe:drop>
- </vpe:dnd>
- <vpe:textFormating>
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:if>
- <vpe:if test="attrpresent('binding')">
- <vpe:template children="no" modify="yes">
- <span class="{@styleClass}" style="{@style}" title="{tagstring()}">
- <vpe:value expr="{jsfvalue(@binding)}"/>
- </span>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- <vpe:drop container="yes">
- <vpe:container-child tag-name="converter" />
- <vpe:container-child tag-name="convertNumber" />
- <vpe:container-child tag-name="convertDateTime" />
- <vpe:container-child tag-name="validator" />
- <vpe:container-child tag-name="validateDoubleRange" />
- <vpe:container-child tag-name="validateLongRange" />
- <vpe:container-child tag-name="validateLength" />
- </vpe:drop>
- </vpe:dnd>
- <vpe:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:if>
- <vpe:template children="yes" modify="yes">
- <span class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- <vpe:drop container="yes">
- <vpe:container-child tag-name="converter" />
- <vpe:container-child tag-name="convertNumber" />
- <vpe:container-child tag-name="convertDateTime" />
- <vpe:container-child tag-name="validator" />
- <vpe:container-child tag-name="validateDoubleRange" />
- <vpe:container-child tag-name="validateLongRange" />
- <vpe:container-child tag-name="validateLength" />
- </vpe:drop>
- </vpe:dnd>
- <vpe:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat" handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BoldFormatHandler" />
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- -->
- </vpe:tag>
-<!-- Проблема с подстановкой значений вложенных параметров (26 of 4) -->
- <vpe:tag name="h:outputFormat" case-sensitive="yes">
- <vpe:template children="no" modify="yes">
- <span title="{tagstring()}" style="{@style}" class="{@styleClass}" >
- <vpe:value expr="{jsfvalue(@value)}"/>
- </span>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- </vpe:dnd>
- <vpe:textFormating>
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:tag>
-
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="converter" />
+ <vpe:container-child tag-name="convertNumber" />
+ <vpe:container-child tag-name="convertDateTime" />
+ <vpe:container-child tag-name="validator" />
+ <vpe:container-child tag-name="validateDoubleRange" />
+ <vpe:container-child tag-name="validateLongRange" />
+ <vpe:container-child tag-name="validateLength" />
+ </vpe:drop>
+ </vpe:dnd>
+ <vpe:textFormating>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:tag>
+
+ <vpe:tag name="h:outputFormat" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputFormatTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ </vpe:dnd>
+ <vpe:textFormating>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:tag>
<vpe:tag name="h:graphicImage" case-sensitive="yes">
<vpe:if test="attrpresent('value')">
<vpe:template children="no" modify="yes">
@@ -559,43 +466,41 @@
</vpe:tag>
- <vpe:tag name="h:outputLabel" case-sensitive="yes">
- <vpe:template children="yes" modify="yes">
- <label style="{@style}" class="{@styleClass}" title="{tagstring()}" for="{@for}">
- <vpe:value expr="{jsfvalue(@value)}"/>
- </label>
- <vpe:dnd>
- <vpe:drag start-enable="yes"/>
- <vpe:drop container="yes">
- <vpe:container-child tag-name="outputText"/>
- </vpe:drop>
- </vpe:dnd>
- <vpe:textFormating>
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:tag>
-
+ <vpe:tag name="h:outputLabel" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputLabelTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="outputText" />
+ </vpe:drop>
+ </vpe:dnd>
+ <vpe:textFormating>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="h:selectBooleanCheckbox" case-sensitive="yes">
<vpe:if test="@disabled='on'"> <!-- Gavr --><!-- added x: 15.02.05 -->
<vpe:template children="no" modify="no">
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-26 16:59:09 UTC (rev 6581)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-02-26 18:03:18 UTC (rev 6582)
@@ -74,5 +74,7 @@
public static final String ATTR_WIDTH = "WIDTH"; //$NON-NLS-1$
public static final String ATTR_HEIGHT = "HEIGHT"; //$NON-NLS-1$
public static final String ATTR_BORDER = "BORDER"; //$NON-NLS-1$
+ public static final String ATTR_FOR = "FOR";
+ public static final String ATTR_DIR = "DIR";
}
\ No newline at end of file
16 years, 2 months
JBoss Tools SVN: r6581 - trunk/seam/docs/resources/styles/en.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-02-26 11:59:09 -0500 (Tue, 26 Feb 2008)
New Revision: 6581
Modified:
trunk/seam/docs/resources/styles/en/html.css
Log:
http://jira.jboss.com/jira/browse/JBDS-200
Modified: trunk/seam/docs/resources/styles/en/html.css
===================================================================
--- trunk/seam/docs/resources/styles/en/html.css 2008-02-26 16:40:00 UTC (rev 6580)
+++ trunk/seam/docs/resources/styles/en/html.css 2008-02-26 16:59:09 UTC (rev 6581)
@@ -103,7 +103,7 @@
div.book div.mediaobject{
-text-align:center;
+text-align:left;
}
div.mediaobject, div.mediaobject img *{
16 years, 2 months
JBoss Tools SVN: r6580 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-26 11:40:00 -0500 (Tue, 26 Feb 2008)
New Revision: 6580
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1812
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-26 16:17:00 UTC (rev 6579)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-26 16:40:00 UTC (rev 6580)
@@ -24,7 +24,6 @@
protected JSPMultiPageEditor jspEditor = null;
protected JSPTextEditor jspTextEditor = null;
protected StructuredTextViewer viewer = null;
- protected IStructuredDocumentRegion[] regions = null;
protected IContentAssistant contentAssistant = null;
protected IDocument document = null;
@@ -83,8 +82,6 @@
assertTrue("The IDocument is not instance of IStructuredDocument",
(document instanceof IStructuredDocument));
- IStructuredDocument sDocument = (IStructuredDocument) document;
- regions = sDocument.getStructuredDocumentRegions();
}
protected void closeEditor() {
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-02-26 16:17:00 UTC (rev 6579)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-02-26 16:40:00 UTC (rev 6580)
@@ -7,6 +7,7 @@
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
@@ -67,6 +68,7 @@
openEditor(pageName);
+ IStructuredDocumentRegion[] regions = ((IStructuredDocument)document).getStructuredDocumentRegions();
boolean fLoadBundleTagIsFound = false;
for (int i = 0; i < regions.length; i++) {
@@ -118,13 +120,6 @@
}
-// try {
-// EditorTestHelper.joinBackgroundActivities();
-// } catch (Exception e) {
-// e.printStackTrace();
-// assertTrue("Waiting for the jobs to complete has failed.", false);
-// }
-
closeEditor();
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-02-26 16:17:00 UTC (rev 6579)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-02-26 16:40:00 UTC (rev 6580)
@@ -79,7 +79,6 @@
}
errorMessage= p.getErrorMessage();
}
-
List<String> customCompletionProposals = new ArrayList<String>();
for (int i = 0; i < result.length; i++) {
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2008-02-26 16:17:00 UTC (rev 6579)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2008-02-26 16:40:00 UTC (rev 6580)
@@ -70,12 +70,11 @@
}
errorMessage= p.getErrorMessage();
}
-
assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
for (int i = 0; i < result.length; i++) {
- assertTrue("Content Assistant peturned proposals which type (" + result[i].getClass().getName() + ") differs from RedHatCustomCompletionProposal", (result[i] instanceof AutoContentAssistantProposal));
+ assertTrue("Content Assistant returned proposals which type (" + result[i].getClass().getName() + ") differs from RedHatCustomCompletionProposal", (result[i] instanceof AutoContentAssistantProposal));
AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)result[i];
String proposalString = proposal.getReplacementString();
int proposalReplacementOffset = proposal.getReplacementOffset();
16 years, 2 months
JBoss Tools SVN: r6579 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template: expression and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-02-26 11:17:00 -0500 (Tue, 26 Feb 2008)
New Revision: 6579
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionInfo.java
Log:
Code adjustment.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlCreator.java 2008-02-26 15:31:08 UTC (rev 6578)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlCreator.java 2008-02-26 16:17:00 UTC (rev 6579)
@@ -40,19 +40,19 @@
if (templAttrs != null) {
int len = templAttrs.getLength();
if (len > 0) {
- List creatorAttrs = new ArrayList(len);
+ List<VpeCreator> creatorAttrs = new ArrayList<VpeCreator>(len);
for (int i = 0; i < len; i++) {
Attr templAttr = (Attr)templAttrs.item(i);
creatorAttrs.add(new VpeAttributeCreator(templAttr.getName(), templAttr.getValue(), dependencyMap, caseSensitive));
}
- attrs = (VpeCreator[]) creatorAttrs.toArray(new VpeCreator[len]);
+ attrs = creatorAttrs.toArray(new VpeCreator[len]);
}
}
NodeList htmlChildren = htmlElement.getChildNodes();
if (htmlChildren != null) {
int len = htmlChildren.getLength();
if (len > 0) {
- List creatorNodes = new ArrayList(len);
+ List<VpeCreator> creatorNodes = new ArrayList<VpeCreator>(len);
for (int i = 0; i < len; i++) {
Node innerNode = htmlChildren.item(i);
switch (innerNode.getNodeType()) {
@@ -73,7 +73,7 @@
}
}
}
- nodes = (VpeCreator[]) creatorNodes.toArray(new VpeCreator[creatorNodes.size()]);
+ nodes = creatorNodes.toArray(new VpeCreator[creatorNodes.size()]);
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java 2008-02-26 15:31:08 UTC (rev 6578)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java 2008-02-26 16:17:00 UTC (rev 6579)
@@ -41,7 +41,7 @@
private String originalText;
private String text;
private boolean caseSensitive;
- private Set dependencySet;
+ private Set<String> dependencySet;
public VpeExpressionInfo buildPlainExpression(String text, boolean caseSensitive) throws VpeExpressionBuilderException {
if (text == null) {
@@ -53,7 +53,7 @@
return new VpeExpressionInfo();
}
this.caseSensitive = caseSensitive;
- dependencySet = new HashSet();
+ dependencySet = new HashSet<String>();
return new VpeExpressionInfo(build(), dependencySet.size() > 0 ? dependencySet : null);
}
@@ -62,8 +62,8 @@
return new VpeExpressionInfo();
}
VpeExpressionBuilder builder = new VpeExpressionBuilder();
- Set dependencySet = new HashSet();
- List expressions = new ArrayList();
+ Set<String> dependencySet = new HashSet<String>();
+ List<VpeExpression> expressions = new ArrayList<VpeExpression>();
int len = text.length();
int startIndex = 0;
while (startIndex < len) {
@@ -101,9 +101,9 @@
}
VpeExpression expression;
if (expressions.size() == 1) {
- expression = (VpeExpression)expressions.get(0);
+ expression = expressions.get(0);
} else {
- expression = new VpeCompletedExpression((VpeExpression[])expressions.toArray(new VpeExpression[expressions.size()]));
+ expression = new VpeCompletedExpression(expressions.toArray(new VpeExpression[expressions.size()]));
}
return new VpeExpressionInfo(expression, dependencySet);
}
@@ -190,10 +190,10 @@
private VpeOperand buildFunction(String name, int namePos) throws VpeExpressionBuilderException {
VpeFunction function = VpeFunctionFactory.getFunction(name);
if (function == null) {
- error("Function \'" + name + "\' is not found", namePos);
+ error("Function \'" + name + "\' is not found", namePos); //$NON-NLS-1$ //$NON-NLS-2$
}
int bracketPos = currentPosition();
- List params = new ArrayList();
+ List<VpeOperand> params = new ArrayList<VpeOperand>();
text = text.substring(1);
text = text.trim();
while (!end() && nextChar() != FUNC_BRACKET_RIGHT) {
@@ -212,7 +212,7 @@
}
text = text.substring(1);
if (params.size() > 0) {
- function.setParameters((VpeOperand[])params.toArray(new VpeOperand[params.size()]));
+ function.setParameters(params.toArray(new VpeOperand[params.size()]));
}
String[] signatures = function.getSignatures();
if (signatures != null) {
@@ -258,7 +258,7 @@
String token;
if (pos == -1) {
token = text;
- text = "";
+ text = ""; //$NON-NLS-1$
} else {
token = text.substring(0, pos);
text = text.substring(pos);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionInfo.java 2008-02-26 15:31:08 UTC (rev 6578)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionInfo.java 2008-02-26 16:17:00 UTC (rev 6579)
@@ -14,13 +14,13 @@
public class VpeExpressionInfo {
private VpeExpression expression;
- private Set dependencySet;
+ private Set<String> dependencySet;
VpeExpressionInfo() {
this(null, null);
}
- VpeExpressionInfo(VpeExpression expression, Set dependencySet) {
+ VpeExpressionInfo(VpeExpression expression, Set<String> dependencySet) {
this.expression = expression;
this.dependencySet = dependencySet;
}
@@ -29,7 +29,7 @@
return expression;
}
- public Set getDependencySet() {
+ public Set<String> getDependencySet() {
return dependencySet;
}
}
16 years, 2 months
JBoss Tools SVN: r6578 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-02-26 10:31:08 -0500 (Tue, 26 Feb 2008)
New Revision: 6578
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1812
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -0,0 +1,99 @@
+package org.jboss.tools.jst.jsp.test.ca;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
+
+public class ContentAssistantTestCase extends TestCase {
+ protected IProject project = null;
+ protected JSPMultiPageEditor jspEditor = null;
+ protected JSPTextEditor jspTextEditor = null;
+ protected StructuredTextViewer viewer = null;
+ protected IStructuredDocumentRegion[] regions = null;
+ protected IContentAssistant contentAssistant = null;
+ protected IDocument document = null;
+
+ protected void openEditor(String fileName) {
+
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+
+ IFile jspFile = project.getFile(fileName);
+
+ assertTrue("The file \"" + fileName + "\" is not found",
+ (jspFile != null));
+ assertTrue("The file \"" + fileName + "\" is not found", (jspFile
+ .exists()));
+
+ FileEditorInput editorInput = new FileEditorInput(jspFile);
+ IEditorPart editorPart = null;
+ try {
+ editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().openEditor(editorInput,
+ "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
+ } catch (PartInitException ex) {
+ ex.printStackTrace();
+ assertTrue("The JSP Visual Editor couldn't be initialized.", false);
+ }
+
+ if (editorPart instanceof JSPMultiPageEditor)
+ jspEditor = (JSPMultiPageEditor) editorPart;
+
+ // Delay for 3 seconds so that
+ // the Favorites view can be seen.
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+ TestUtil.delay(3000);
+
+ jspTextEditor = jspEditor.getJspEditor();
+ viewer = jspTextEditor.getTextViewer();
+ document = viewer.getDocument();
+ SourceViewerConfiguration config = TestUtil
+ .getSourceViewerConfiguration(jspTextEditor);
+ contentAssistant = (config == null ? null : config
+ .getContentAssistant(viewer));
+
+ assertTrue(
+ "Cannot get the Content Assistant instance for the editor for page \""
+ + fileName + "\"", (contentAssistant != null));
+
+ assertTrue("The IDocument is not instance of IStructuredDocument",
+ (document instanceof IStructuredDocument));
+
+ IStructuredDocument sDocument = (IStructuredDocument) document;
+ regions = sDocument.getStructuredDocumentRegions();
+ }
+
+ protected void closeEditor() {
+ if (jspEditor != null) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().closeEditor(jspEditor, false);
+ jspEditor = null;
+ }
+
+ }
+
+}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-02-26 15:05:30 UTC (rev 6577)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -1,39 +1,24 @@
package org.jboss.tools.jst.jsp.test.ca;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.IDocument;
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.SourceViewerConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegionList;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
-import org.jboss.tools.jst.jsp.contentassist.ExtendedJSPContentAssistProcessor;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JsfJspJbide1704Test extends TestCase {
+public class JsfJspJbide1704Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
+
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1704Test";
private static final String PAGE_NAME = "/WebContent/pages/greeting";
@@ -79,51 +64,10 @@
}
private void doTestJsfJspJbide1704(String pageName) {
- IFile jspFile = project.getFile(pageName);
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
+ openEditor(pageName);
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
-
- assertTrue("The IDocument is not instance of IStructuredDocument", (document instanceof IStructuredDocument));
-
- IStructuredDocument sDocument = (IStructuredDocument)document;
- IStructuredDocumentRegion[] regions = sDocument.getStructuredDocumentRegions();
- String documentContent = document.get();
-
boolean fLoadBundleTagIsFound = false;
for (int i = 0; i < regions.length; i++) {
IStructuredDocumentRegion sdRegion = regions[i];
@@ -163,10 +107,6 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
-
for (int k = 0; result != null && k < result.length; k++) {
// There should not be a proposal of type Red.Proposal in the result
assertFalse("Content Assistant peturned proposals of type (" + result[k].getClass().getName() + ").", (result[k] instanceof AutoContentAssistantProposal));
@@ -178,15 +118,14 @@
}
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
+// try {
+// EditorTestHelper.joinBackgroundActivities();
+// } catch (Exception e) {
+// e.printStackTrace();
+// assertTrue("Waiting for the jobs to complete has failed.", false);
+// }
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-02-26 15:05:30 UTC (rev 6577)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -2,35 +2,21 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.IDocument;
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.SourceViewerConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.test.util.TestProjectProvider;
-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.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JsfJspJbide1717Test extends TestCase {
+public class JsfJspJbide1717Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1704Test";
private static final String PAGE_NAME = "/WebContent/pages/greeting.jsp";
@@ -63,52 +49,8 @@
}
public void testJstJspJbide1641() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+ openEditor(PAGE_NAME);
- IFile jspFile = project.getFile(PAGE_NAME);
-
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
-
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
-
// Find start of <h:outputText> tag
String documentContent = document.get();
int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
@@ -138,9 +80,6 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
List<String> customCompletionProposals = new ArrayList<String>();
for (int i = 0; i < result.length; i++) {
@@ -182,9 +121,6 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
for (int i = 0; i < result.length; i++) {
// There should be the same proposals as in the saved result
@@ -196,8 +132,7 @@
}
assertTrue("Content Assistant didn't returned some proposals.",customCompletionProposals.isEmpty());
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2008-02-26 15:05:30 UTC (rev 6577)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1585Test.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -1,42 +1,18 @@
package org.jboss.tools.jst.jsp.test.ca;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
+import junit.framework.Test;
+import junit.framework.TestSuite;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.TextUtilities;
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.contentassist.IContentAssistantExtension;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.jboss.tools.common.test.util.TestProjectProvider;
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.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JstJspJbide1585Test extends TestCase {
+public class JstJspJbide1585Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1585Test";
private static final String PAGE_NAME = "/WebContent/pages/inputname.xhtml";
@@ -68,53 +44,8 @@
}
public void testJstJspJbide1585() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
-
- IFile jspFile = project.getFile(PAGE_NAME);
-
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
+ openEditor(PAGE_NAME);
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
-
-
// Find start of <ui:define> tag
String documentContent = document.get();
int start = (documentContent == null ? -1 : documentContent.indexOf("<ui:define"));
@@ -140,9 +71,6 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
@@ -152,17 +80,13 @@
String proposalString = proposal.getReplacementString();
int proposalReplacementOffset = proposal.getReplacementOffset();
int proposalReplacementLength = proposal.getReplacementLength();
-// try {
-// System.out.println("Result#" + i + " ==> Offs: " + offsetToTest + " RedHatCustomCompletionProposal[" + proposalString + "], Offs: " + proposalReplacementOffset + ", Len: " + proposalReplacementLength + ", Doc: [" + document.get(proposalReplacementOffset, proposalReplacementLength));
-// } catch (BadLocationException e) {
-// }
+
assertTrue("The proposal replacement Offset is not correct.", proposalReplacementOffset == start + TAG_OPEN_STRING.length());
assertTrue("The proposal replacement Length is not correct.", proposalReplacementLength == PREFIX_STRING.length());
assertTrue("The proposal isn\'t filtered properly in the Content Assistant.", proposalString.startsWith(PREFIX_STRING));
}
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-02-26 15:05:30 UTC (rev 6577)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -1,33 +1,19 @@
package org.jboss.tools.jst.jsp.test.ca;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
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.SourceViewerConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.jboss.tools.common.test.util.TestProjectProvider;
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.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JstJspJbide1641Test extends TestCase {
+public class JstJspJbide1641Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1641Test";
private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
@@ -63,52 +49,9 @@
}
public void testJstJspJbide1641() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- }
- assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
-
- IFile jspFile = project.getFile(PAGE_NAME);
-
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
+ openEditor(PAGE_NAME);
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
-
// Find start of <ui:composition> tag
String documentContent = document.get();
int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
@@ -136,9 +79,6 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
@@ -148,10 +88,7 @@
continue;
AutoContentAssistantProposal proposal = (AutoContentAssistantProposal)result[i];
String proposalString = proposal.getReplacementString();
-// try {
-// System.out.println("Result#" + i + " ==> Offs: " + offsetToTest + " RedHatCustomCompletionProposal[" + proposalString + "], Offs: " + proposalReplacementOffset + ", Len: " + proposalReplacementLength + ", Doc: [" + document.get(proposalReplacementOffset, proposalReplacementLength));
-// } catch (BadLocationException e) {
-// }
+
if (PROPOSAL_TO_APPLY_STRING.equals(proposalString)) {
bPropoosalToApplyFound = true;
proposal.apply(document);
@@ -170,8 +107,7 @@
String documentUpdatedContent = document.get();
assertTrue("The proposal replacement is failed.", documentContentToCompare.equals(documentUpdatedContent));
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-02-26 15:05:30 UTC (rev 6577)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -3,33 +3,20 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.IDocument;
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.SourceViewerConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.test.util.TestProjectProvider;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JstJspJbide1759Test extends TestCase {
+public class JstJspJbide1759Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "JsfJbide1704Test";
private static final String PAGE_NAME = "/WebContent/pages/greeting";
@@ -76,46 +63,9 @@
}
private void testJstJspJbide1641(String pageName) {
-
- IFile jspFile = project.getFile(pageName);
-
- assertTrue("The file \"" + pageName + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + pageName + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
+ openEditor(pageName);
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + pageName + "\"", (contentAssistant != null));
-
// Find start of <h:outputText> tag
String documentContent = document.get();
int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
@@ -130,10 +80,6 @@
int offsetToTest = start + INSERTION_BEGIN_STRING.length();
-// String visualizeCursorPosition = documentContentModified.substring(0, offsetToTest) +
-// "|" + documentContentModified.substring(offsetToTest);
-
-// System.out.println(visualizeCursorPosition);
jspTextEditor.setText(documentContentModified);
@@ -150,9 +96,6 @@
errorMessage= p.getErrorMessage();
}
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
List<String> customCompletionProposals = new ArrayList<String>();
for (int i = 0; i < result.length; i++) {
@@ -179,11 +122,6 @@
offsetToTest = start + INSERTION_BEGIN_STRING.length();
-// visualizeCursorPosition = documentContentModified.substring(0, offsetToTest) +
-// "|" + documentContentModified.substring(offsetToTest);
-
-// System.out.println(visualizeCursorPosition);
-
jspTextEditor.setText(documentContentModified);
p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
@@ -195,10 +133,6 @@
}
errorMessage= p.getErrorMessage();
}
-
-// if (errorMessage != null && errorMessage.trim().length() > 0) {
-// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
-// }
for (int i = 0; i < result.length; i++) {
// There should be the same proposals as in the saved result
@@ -210,7 +144,6 @@
}
assertTrue("Content Assistant didn't returned some proposals.",customCompletionProposals.isEmpty());
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2008-02-26 15:05:30 UTC (rev 6577)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2008-02-26 15:31:08 UTC (rev 6578)
@@ -1,32 +1,18 @@
package org.jboss.tools.jst.jsp.test.ca;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.IDocument;
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.SourceViewerConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.jboss.tools.common.test.util.TestProjectProvider;
-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.jst.jsp.test.TestUtil;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class StrutsJspJbide1648Test extends TestCase {
+public class StrutsJspJbide1648Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
- IProject project = null;
boolean makeCopy = false;
private static final String PROJECT_NAME = "StrutsJbide1648Test";
private static final String[] PAGE_NAMES = {
@@ -72,45 +58,8 @@
}
private void doTestOnPage(String pageName) {
- IFile jspFile = project.getFile(pageName);
-
- assertTrue("The file \"" + pageName + "\" is not found", (jspFile != null));
- assertTrue("The file \"" + pageName + "\" is not found", (jspFile.exists()));
-
- FileEditorInput editorInput = new FileEditorInput(jspFile);
- Throwable exception = null;
- IEditorPart editorPart = null;
- try {
- editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
- } catch (PartInitException ex) {
- exception = ex;
- ex.printStackTrace();
- assertTrue("The JSP Visual Editor couldn't be initialized.", false);
- }
-
- JSPMultiPageEditor jspEditor = null;
+ openEditor(pageName);
- if (editorPart instanceof JSPMultiPageEditor)
- jspEditor = (JSPMultiPageEditor)editorPart;
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- assertTrue("Waiting for the jobs to complete has failed.", false);
- }
- TestUtil.delay(3000);
-
- JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
- StructuredTextViewer viewer = jspTextEditor.getTextViewer();
- IDocument document = viewer.getDocument();
- SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
- IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
-
- assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + pageName + "\"", (contentAssistant != null));
-
ICompletionProposal[] result= null;
String errorMessage = null;
@@ -121,9 +70,6 @@
errorMessage= p.getErrorMessage();
}
- // if (errorMessage != null && errorMessage.trim().length() > 0) {
- // System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
- // }
} catch (Throwable x) {
x.printStackTrace();
if (x instanceof NullPointerException) {
@@ -133,8 +79,7 @@
}
}
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .closeEditor(editorPart, false);
+ closeEditor();
}
}
16 years, 2 months
JBoss Tools SVN: r6577 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-26 10:05:30 -0500 (Tue, 26 Feb 2008)
New Revision: 6577
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
Log:
JBIDE-1384
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2008-02-26 15:05:22 UTC (rev 6576)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2008-02-26 15:05:30 UTC (rev 6577)
@@ -417,6 +417,7 @@
<value name="2.2"/>
<value name="2.3"/>
<value name="2.4"/>
+ <value name="2.5"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -871,6 +872,7 @@
<Constraint loader="List">
<value name="2.3"/>
<value name="2.4"/>
+ <value name="2.5"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
16 years, 2 months
JBoss Tools SVN: r6576 - trunk/common/plugins/org.jboss.tools.common.model/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-26 10:05:22 -0500 (Tue, 26 Feb 2008)
New Revision: 6576
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta
Log:
JBIDE-1384
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta 2008-02-26 14:30:27 UTC (rev 6575)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta 2008-02-26 15:05:22 UTC (rev 6576)
@@ -258,6 +258,7 @@
<Constraint loader="List">
<value name="2.3"/>
<value name="2.4"/>
+ <value name="2.5"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -293,6 +294,7 @@
<Constraint loader="List">
<value name="2.3"/>
<value name="2.4"/>
+ <value name="2.5"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -604,6 +606,7 @@
<Constraint loader="List">
<value name="2.3"/>
<value name="2.4"/>
+ <value name="2.5"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
@@ -664,6 +667,7 @@
<Constraint loader="List">
<value name="2.3"/>
<value name="2.4"/>
+ <value name="2.5"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
16 years, 2 months
JBoss Tools SVN: r6575 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-02-26 09:30:27 -0500 (Tue, 26 Feb 2008)
New Revision: 6575
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
Log:
JBIDE-771
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2008-02-26 10:56:33 UTC (rev 6574)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2008-02-26 14:30:27 UTC (rev 6575)
@@ -1079,6 +1079,7 @@
</XModelAttribute>
<XModelAttribute name="application name" xmlname="NAME">
<Constraint loader="FolderName"/>
+ <Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="location" visibility="false" xmlname="location">
<Constraint loader="FileFilter">
16 years, 2 months
JBoss Tools SVN: r6574 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-02-26 05:56:33 -0500 (Tue, 26 Feb 2008)
New Revision: 6574
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF
Log:
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF 2008-02-26 08:21:34 UTC (rev 6573)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/META-INF/MANIFEST.MF 2008-02-26 10:56:33 UTC (rev 6574)
@@ -11,7 +11,9 @@
org.jboss.tools.vpe,
org.mozilla.xpcom,
org.jboss.tools.jst.jsp,
- org.eclipse.wst.sse.core
+ org.eclipse.wst.sse.core,
+ org.eclipse.jst.jsp.core,
+ org.eclipse.wst.html.core
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.jsf.vpe.jsf.template
Bundle-Localization: plugin
16 years, 2 months