Author: dsakovich
Date: 2008-08-14 12:22:42 -0400 (Thu, 14 Aug 2008)
New Revision: 9730
Added:
trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/
trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/templates/vpe-templates-myfaces.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/templates/vpe-templates-struts.xml
trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1601
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="https://ajax4jsf.dev.java.net/ajax"
prefix="a4j" />
<vpe:template-taglib
uri="http://richfaces.org/a4j" prefix="a4j"
/>
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/templates/vpe-templates-facelets.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="http://java.sun.com/jsf/facelets"
prefix="ui"/>
<vpe:tag name="ui:composition" case-sensitive="yes" >
@@ -34,14 +34,6 @@
<vpe:template
class="org.jboss.tools.jsf.vpe.facelets.template.VpeInsertTemplate"/>
</vpe:tag>
- <vpe:tag name="ui:insert_" case-sensitive="yes" >
- <vpe:template children="yes" modify="yes">
- <div style="border: 1px solid gray">
- <div class="__any__tag__caption"><vpe:value
expr="{@name}"/>:</div>
- </div>
- </vpe:template>
- </vpe:tag>
-
<vpe:tag name="ui.component" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
<div style="border:1px dotted #FF6600;padding: 5px;"
title="{tagstring()}"/>
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-08-14
16:21:06 UTC (rev 9729)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="http://java.sun.com/jsf/html"
prefix="h" />
<vpe:template-taglib
uri="http://java.sun.com/jsf/core"
prefix="f" />
@@ -786,11 +786,4 @@
</vpe:textFormatting>
</vpe:template>
</vpe:tag>
-
- <!--
- Проблема с селектированием элемента: в мозилле селектируется заголовок а не рамка
- -->
- <vpe:template children="yes" modify="no">
- <vpe:any value="{name()}" title="{tagstring()}" />
- </vpe:template>
</vpe:templates>
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/templates/vpe-templates-myfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/templates/vpe-templates-myfaces.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/templates/vpe-templates-myfaces.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="http://myfaces.apache.org/extensions" prefix="x" />
<vpe:tag name="x:checkbox" case-sensitive="yes">
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="http://richfaces.org/rich"
prefix="rich" />
<vpe:template-taglib
uri="http://richfaces.ajax4jsf.org/rich"
prefix="rich" />
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="http://jboss.com/products/seam/taglib"
prefix="s" />
Modified:
trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/templates/vpe-templates-struts.xml
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/templates/vpe-templates-struts.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/struts/plugins/org.jboss.tools.struts.vpe.struts/templates/vpe-templates-struts.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:template-taglib
uri="http://struts.apache.org/tags-html"
prefix="html" />
<vpe:template-taglib
@@ -288,8 +288,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:tag>
@@ -306,39 +305,6 @@
</vpe:template>
</vpe:tag>
- <vpe:tag name="html:reset_" case-sensitive="yes">
- <vpe:if test="@value=''">
- <vpe:template children="yes" modify="yes">
- <input type="button" value="Reset"
class="{@styleClass}"
- style="{@style}" title="{tagstring()}"/>
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- <vpe:drop container="no" />
- </vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
- </vpe:template>
- </vpe:if>
- <vpe:template children="yes" modify="yes">
- <input type="button" value="{@value}"
class="{@styleClass}"
- style="{@style}" title="{tagstring()}"/>
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- <vpe:drop container="no" />
- </vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
- </vpe:template>
- </vpe:tag>
-
<vpe:tag name="html:reset" case-sensitive="yes">
<vpe:if test="@value=''">
<vpe:if test="hascontent()">
@@ -353,8 +319,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:if>
<vpe:template children="no" modify="yes">
@@ -368,8 +333,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:if>
<vpe:template children="no" modify="yes">
@@ -383,8 +347,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:tag>
@@ -401,8 +364,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="yes" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:tag>
@@ -420,8 +382,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:if>
<vpe:template children="no" modify="yes">
@@ -435,8 +396,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:if>
<vpe:template children="no" modify="yes">
@@ -450,8 +410,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:tag>
@@ -469,8 +428,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:if>
<vpe:template children="no" modify="yes">
@@ -484,8 +442,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:tag>
@@ -504,8 +461,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no" />
</vpe:dnd>
- <textFormatting use-default-formats="yes">
- </textFormatting>
+ <textFormatting use-default-formats="yes"/>
</vpe:template>
</vpe:tag>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:tag name="a" case-sensitive="no">
<vpe:template children="yes" modify="yes">
<vpe:a class="{@class}" style="{@style}"/>
@@ -2143,8 +2143,4 @@
class="org.jboss.tools.vpe.html.template.HtmlTextTemplate">
</vpe:template>
</vpe:tag>
-
- <vpe:template children="yes" modify="yes">
- <vpe:any value="{name()}" title="{tagstring()}" />
- </vpe:template>
</vpe:templates>
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml 2008-08-14
16:21:06 UTC (rev 9729)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.jsp/templates/vpe-templates-jsp.xml 2008-08-14
16:22:42 UTC (rev 9730)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates>
+<vpe:templates
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
<vpe:tag name="jsp:declaration" case-sensitive="yes">
<vpe:template children="no" modify="no">
Added: trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd
(rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/scheme/scheme.xsd 2008-08-14 16:22:42 UTC
(rev 9730)
@@ -0,0 +1,516 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://www.w3.org/2001/XMLSchema-instance"
xmlns:vpe="http://www.w3.org/2001/XMLSchema-instance">
+ <xs:element name="templates">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:template-taglib"/>
+ <xs:element maxOccurs="unbounded" ref="vpe:tag"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="template-taglib">
+ <xs:complexType>
+ <xs:attribute name="prefix" use="required"
type="xs:NCName"/>
+ <xs:attribute name="uri" use="required"
type="xs:anyURI"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="tag">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element ref="vpe:copy"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:if"/>
+ </xs:choice>
+ <xs:element minOccurs="0" ref="vpe:template"/>
+ </xs:sequence>
+ <xs:attribute name="case-sensetive" type="xs:NCName"/>
+ <xs:attribute name="case-sensitive" type="xs:NCName"/>
+ <xs:attribute name="haveVisualPreview"
type="xs:NCName"/>
+ <xs:attribute name="name" use="required"
type="xs:anyURI"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="copy">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="vpe:attribute"/>
+ </xs:sequence>
+ <xs:attribute name="attrs"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="attribute">
+ <xs:complexType>
+ <xs:attribute name="name" use="required"
type="xs:NCName"/>
+ <xs:attribute name="value" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="if">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:if"/>
+ <xs:element minOccurs="0" ref="vpe:template"/>
+ <xs:element minOccurs="0" ref="vpe:textFormatting"/>
+ </xs:sequence>
+ <xs:attribute name="test" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="template">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="span"
form="unqualified">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="vpe:input"/>
+ <xs:element ref="vpe:value"/>
+ </xs:choice>
+ <xs:attribute name="class"/>
+ <xs:attribute name="dir"/>
+ <xs:attribute name="style" type="xs:anyURI"/>
+ <xs:attribute name="title"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:choice minOccurs="0">
+ <xs:element ref="vpe:jsproot"/>
+ <xs:element ref="vpe:taglib"/>
+ </xs:choice>
+ <xs:choice minOccurs="0">
+ <xs:element name="button" form="unqualified">
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:value"/>
+ </xs:sequence>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="title" use="required"/>
+ <xs:attribute name="value"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="label" form="unqualified">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="vpe:value"/>
+ </xs:sequence>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="for" use="required"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="title" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:element minOccurs="0" ref="vpe:grid"/>
+ <xs:choice minOccurs="0">
+ <xs:group ref="vpe:td"/>
+ <xs:element ref="vpe:copy"/>
+ <xs:element ref="vpe:panelgrid"/>
+ </xs:choice>
+ <xs:choice minOccurs="0">
+ <xs:group ref="vpe:option"/>
+ <xs:element ref="vpe:style"/>
+ </xs:choice>
+ <xs:choice minOccurs="0">
+ <xs:group ref="vpe:textarea"/>
+ <xs:element name="nobr" form="unqualified">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element ref="vpe:value"/>
+ <xs:group maxOccurs="unbounded"
ref="vpe:input"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:choice minOccurs="0">
+ <xs:element ref="vpe:any"/>
+ <xs:element ref="vpe:load-bundle"/>
+ </xs:choice>
+ <xs:element minOccurs="0" name="img"
form="unqualified">
+ <xs:complexType>
+ <xs:attribute name="alt"/>
+ <xs:attribute name="border"/>
+ <xs:attribute name="class"/>
+ <xs:attribute name="height"/>
+ <xs:attribute name="src" use="required"/>
+ <xs:attribute name="style"/>
+ <xs:attribute name="title"/>
+ <xs:attribute name="width"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:choice minOccurs="0">
+ <xs:element ref="vpe:column"/>
+ <xs:element ref="vpe:link"/>
+ </xs:choice>
+ <xs:group minOccurs="0" ref="vpe:select"/>
+ <xs:element minOccurs="0" ref="vpe:panellayout"/>
+ <xs:element minOccurs="0" ref="vpe:a"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="vpe:div"/>
+ <xs:group ref="vpe:input"/>
+ <xs:element ref="vpe:datatable"/>
+ <xs:element ref="vpe:dnd"/>
+ <xs:element ref="vpe:resize"/>
+ </xs:choice>
+ <xs:choice minOccurs="0">
+ <xs:group ref="vpe:table"/>
+ <xs:element name="textFormatting"
form="unqualified">
+ <xs:complexType>
+ <xs:attribute name="use-default-formats"
use="required" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:choice minOccurs="0">
+ <xs:element ref="vpe:breaker"/>
+ <xs:element ref="vpe:list"/>
+ <xs:sequence>
+ <xs:element ref="vpe:drag"/>
+ <xs:element ref="vpe:drop"/>
+ </xs:sequence>
+ </xs:choice>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="vpe:textFormatting"/>
+ <xs:element ref="vpe:pseudoContent"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="children" type="xs:NCName"/>
+ <xs:attribute name="class"/>
+ <xs:attribute name="file"/>
+ <xs:attribute name="hasImaginaryBorder"
type="xs:NCName"/>
+ <xs:attribute name="modify" type="xs:NCName"/>
+ <xs:attribute name="namespaceIdentifier"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="jsproot">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="taglib">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="grid">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="vpe:value"/>
+ <xs:group minOccurs="0" ref="vpe:input"/>
+ </xs:sequence>
+ <xs:attribute name="border"/>
+ <xs:attribute name="class"/>
+ <xs:attribute name="disabled" type="xs:boolean"/>
+ <xs:attribute name="layout"/>
+ <xs:attribute name="style"/>
+ <xs:attribute name="title" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="panelgrid">
+ <xs:complexType>
+ <xs:attribute name="bgcolor" use="required"/>
+ <xs:attribute name="border" use="required"/>
+ <xs:attribute name="captionClass" use="required"/>
+ <xs:attribute name="captionStyle" use="required"/>
+ <xs:attribute name="cellpadding" use="required"/>
+ <xs:attribute name="cellspacing" use="required"/>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="columnClasses" use="required"/>
+ <xs:attribute name="dir" use="required"/>
+ <xs:attribute name="footerClass" use="required"/>
+ <xs:attribute name="frame" use="required"/>
+ <xs:attribute name="headerClass" use="required"/>
+ <xs:attribute name="rowClasses" use="required"/>
+ <xs:attribute name="rules" use="required"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="table-size" use="required"/>
+ <xs:attribute name="title" use="required"/>
+ <xs:attribute name="width" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="style">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="any">
+ <xs:complexType>
+ <xs:attribute name="display" use="required"
type="xs:NCName"/>
+ <xs:attribute name="title" use="required"/>
+ <xs:attribute name="value" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="load-bundle">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="column">
+ <xs:complexType>
+ <xs:attribute name="title" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="link">
+ <xs:complexType>
+ <xs:attribute name="href" use="required"/>
+ <xs:attribute name="rel" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="panellayout">
+ <xs:complexType/>
+ </xs:element>
+ <xs:element name="a">
+ <xs:complexType>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="dir"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="title" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="datatable">
+ <xs:complexType>
+ <xs:attribute name="bgcolor" use="required"/>
+ <xs:attribute name="border" use="required"/>
+ <xs:attribute name="cellpadding" use="required"/>
+ <xs:attribute name="cellspacing" use="required"/>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="columnClasses" use="required"/>
+ <xs:attribute name="dir"/>
+ <xs:attribute name="footerClass" use="required"/>
+ <xs:attribute name="frame" use="required"/>
+ <xs:attribute name="headerClass" use="required"/>
+ <xs:attribute name="height"/>
+ <xs:attribute name="rowClasses" use="required"/>
+ <xs:attribute name="rules" use="required"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="title" use="required"/>
+ <xs:attribute name="width"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="dnd">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="vpe:drag"/>
+ <xs:element minOccurs="0" ref="vpe:drop"/>
+ <xs:element minOccurs="0" ref="vpe:container-child"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="resize">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="vpe:width"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:height"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="width">
+ <xs:complexType>
+ <xs:attribute name="disable-absolute-position"
type="xs:NCName"/>
+ <xs:attribute name="width-attr" use="required"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="height">
+ <xs:complexType>
+ <xs:attribute name="disable-absolute-position"
type="xs:NCName"/>
+ <xs:attribute name="height-attr" use="required"
type="xs:NCName"/>
+ <xs:attribute name="tag-xpath" type="xs:NCName"/>
+ <xs:attribute name="test"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="breaker">
+ <xs:complexType>
+ <xs:attribute name="type" use="required"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="list">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="vpe:value"/>
+ </xs:sequence>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="ordered" use="required"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="title" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pseudoContent">
+ <xs:complexType>
+ <xs:attribute name="attrName" type="xs:NCName"/>
+ <xs:attribute name="defaultText" type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="textFormatting">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:format"/>
+ </xs:sequence>
+ <xs:attribute name="use-default-formats"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="format">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="vpe:formatAttribute"/>
+ </xs:sequence>
+ <xs:attribute name="addChildren" type="xs:NCName"/>
+ <xs:attribute name="addParent" type="xs:NCName"/>
+ <xs:attribute name="handler"/>
+ <xs:attribute name="setDefault" type="xs:boolean"/>
+ <xs:attribute name="type" use="required"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="formatAttribute">
+ <xs:complexType>
+ <xs:attribute name="type" use="required"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:group name="input">
+ <xs:sequence>
+ <xs:element name="input" form="unqualified">
+ <xs:complexType>
+ <xs:attribute name="border"/>
+ <xs:attribute name="checked"/>
+ <xs:attribute name="class"/>
+ <xs:attribute name="dir"/>
+ <xs:attribute name="disabled" type="xs:NCName"/>
+ <xs:attribute name="size"/>
+ <xs:attribute name="src"/>
+ <xs:attribute name="style"/>
+ <xs:attribute name="title"/>
+ <xs:attribute name="type"/>
+ <xs:attribute name="value"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+ <xs:element name="value">
+ <xs:complexType>
+ <xs:attribute name="expr" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:group name="td">
+ <xs:sequence>
+ <xs:element name="td" form="unqualified">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="vpe:value"/>
+ <xs:element name="a" form="unqualified">
+ <xs:complexType mixed="true">
+ <xs:attribute name="href" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="class"/>
+ <xs:attribute name="colspan" type="xs:integer"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="option">
+ <xs:sequence>
+ <xs:element name="option" form="unqualified">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="vpe:value"/>
+ </xs:sequence>
+ <xs:attribute name="title"/>
+ <xs:attribute name="value" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="textarea">
+ <xs:sequence>
+ <xs:element name="textarea" form="unqualified">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="vpe:value"/>
+ </xs:sequence>
+ <xs:attribute name="class" use="required"/>
+ <xs:attribute name="cols"/>
+ <xs:attribute name="disabled" type="xs:boolean"/>
+ <xs:attribute name="rows" use="required"/>
+ <xs:attribute name="style" use="required"/>
+ <xs:attribute name="title" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="select">
+ <xs:sequence>
+ <xs:element name="select" form="unqualified">
+ <xs:complexType>
+ <xs:choice minOccurs="0">
+ <xs:group ref="vpe:option"/>
+ <xs:element ref="vpe:value"/>
+ </xs:choice>
+ <xs:attribute name="class"/>
+ <xs:attribute name="dir"/>
+ <xs:attribute name="disabled" type="xs:boolean"/>
+ <xs:attribute name="multiple" type="xs:NCName"/>
+ <xs:attribute name="size"/>
+ <xs:attribute name="style"/>
+ <xs:attribute name="title"/>
+ <xs:attribute name="value"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+ <xs:element name="drag">
+ <xs:complexType>
+ <xs:attribute name="start-enable" use="required"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="drop">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
ref="vpe:container-child"/>
+ </xs:sequence>
+ <xs:attribute name="container" use="required"
type="xs:NCName"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="container-child">
+ <xs:complexType>
+ <xs:attribute name="tag-name" use="required"
type="xs:anyURI"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:group name="div">
+ <xs:sequence>
+ <xs:element name="div" form="unqualified">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="vpe:div"/>
+ <xs:group ref="vpe:input"/>
+ <xs:group ref="vpe:select"/>
+ <xs:group ref="vpe:table"/>
+ <xs:group ref="vpe:textarea"/>
+ <xs:element ref="vpe:value"/>
+ <xs:element name="b" form="unqualified">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="vpe:value"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="action"/>
+ <xs:attribute name="bgcolor"/>
+ <xs:attribute name="border"/>
+ <xs:attribute name="class"/>
+ <xs:attribute name="cols"/>
+ <xs:attribute name="onclick"/>
+ <xs:attribute name="rendered"/>
+ <xs:attribute name="rows"/>
+ <xs:attribute name="size"/>
+ <xs:attribute name="style"/>
+ <xs:attribute name="title"/>
+ <xs:attribute name="width"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+ <xs:group name="table">
+ <xs:sequence>
+ <xs:element name="table" form="unqualified">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded"
name="tr" form="unqualified">
+ <xs:complexType>
+ <xs:group maxOccurs="unbounded" ref="vpe:td"/>
+ <xs:attribute name="class"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="cellspacing" type="xs:integer"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:group>
+</xs:schema>
Added:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplateSchemeValidateTest.java 2008-08-14
16:22:42 UTC (rev 9730)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.vpe.VpePlugin;
+import org.osgi.framework.Bundle;
+import org.w3c.dom.Document;
+
+/**
+ * JUnit Test for scheme validate template
+ *
+ * @author Dzmitry Sakovich
+ */
+public class TemplateSchemeValidateTest extends TestCase {
+ /**
+ * Extension point ID
+ */
+ private static final String COM_REDHAT_VPE_TEMPLATES =
"org.jboss.tools.vpe.templates";
+
+ private static final String SCHEME_PATH = "/scheme/scheme.xsd";
+
+ /**
+ * Test for load all templates
+ */
+ public void testParseTemplates() {
+ //
+
+ Bundle bundle = VpeTestPlugin.getDefault().getBundle();
+ URL url = null;
+ try {
+ url = bundle == null ? null : FileLocator.resolve(bundle
+ .getEntry(SCHEME_PATH));
+ File schemeFile = new File(url.getPath());
+ if (!schemeFile.exists() || !schemeFile.isFile()) {
+ fail("scheme is not exist");
+ }
+
+ IExtensionRegistry extensionRepository = Platform
+ .getExtensionRegistry();
+
+ IExtensionPoint extensionPoint = extensionRepository
+ .getExtensionPoint(COM_REDHAT_VPE_TEMPLATES);
+ IExtension[] extensions = extensionPoint.getExtensions();
+
+ // iterate for all extensions
+ for (int i = 0; i < extensions.length; i++) {
+ IExtension extension = extensions[i];
+ IConfigurationElement[] elements = extension
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ String pathAttrValue = elements[j].getAttribute("path");
+
+ IPath templateFile = getFullpathForConfigurationElement(
+ pathAttrValue, elements[j]);
+
+ File file = templateFile.toFile();
+ if (file.exists() && file.isFile()) {
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory
+ .newInstance();
+ docFactory.setNamespaceAware(true);
+ DocumentBuilder parser = docFactory
+ .newDocumentBuilder();
+
+ Document document = parser.parse(file);
+ SchemaFactory factory = SchemaFactory
+ .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+
+ Source schemaFile = new StreamSource(schemeFile);
+ Schema schema = factory.newSchema(schemaFile);
+ Validator validator = schema.newValidator();
+ validator.validate(new DOMSource(document));
+ }
+
+ }
+ }
+
+ } catch (Exception exception) {
+ fail(exception.getMessage());
+ }
+ }
+
+ /**
+ * Get a full path for IConfigurationElement
+ *
+ * @param fileName
+ * a String contain relevant fileName
+ * @param confElement
+ * a IConfigurationElement
+ * @return full path for IConfigurationElement
+ * @throws IOException
+ * if an error occurs during the conversion
+ */
+ private static IPath getFullpathForConfigurationElement(String name,
+ IConfigurationElement confElement) throws IOException {
+ // 1. get a shared instance
+ VpePlugin plugin = VpePlugin.getDefault();
+
+ Bundle bundle = null;
+
+ if (confElement == null) {
+ bundle = plugin.getBundle();
+ } else {
+ bundle = Platform.getBundle(confElement.getNamespaceIdentifier());
+ }
+
+ URL url = bundle.getEntry("/");
+
+ IPath path = new Path(FileLocator.toFileURL(url).getFile());
+ path = path.append(name);
+ return path;
+ }
+
+}
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-08-14
16:21:06 UTC (rev 9729)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllTests.java 2008-08-14
16:22:42 UTC (rev 9730)
@@ -37,6 +37,7 @@
TestSuite suite = new TestSuite("Tests for vpe");
// $JUnit-BEGIN$
suite.addTestSuite(TemplateLoadingTest.class);
+ suite.addTestSuite(TemplateSchemeValidateTest.class);
suite.addTestSuite(TemplatesExpressionParsingTest.class);
suite.addTestSuite(VpeEditorPreferencesPageTest.class);
suite.addTestSuite(VpeTemplateManagerTest.class);