Author: ezheleznyakov
Date: 2007-09-03 12:34:56 -0400 (Mon, 03 Sep 2007)
New Revision: 3429
Added:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-847
Create <rich:messages> template
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java
===================================================================
---
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java 2007-09-03
16:33:58 UTC (rev 3428)
+++
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessageTemplate.java 2007-09-03
16:34:56 UTC (rev 3429)
@@ -29,38 +29,57 @@
*/
public class RichFacesMessageTemplate extends VpeAbstractTemplate {
- private static String PASSED_LABEL_ATTRIBUTE_NAME = "passedLabel";
- private static String LABEL_CLASS_ATTRIBUTE_NAME = "labelClass";
- private static String MARKER_CLASS_ATTRIBUTE_NAME = "markerClass";
- private static String MARKER_STYLE_ATTRIBUTE_NAME = "markerStyle";
+ protected static String PASSED_LABEL_ATTRIBUTE_NAME = "passedLabel";
+ protected static String LABEL_CLASS_ATTRIBUTE_NAME = "labelClass";
+ protected static String MARKER_CLASS_ATTRIBUTE_NAME = "markerClass";
+ protected static String MARKER_STYLE_ATTRIBUTE_NAME = "markerStyle";
- private static String ERROR_MARKER_CLASS_ATTRIBUTE_NAME = "errorMarkerClass";
- private static String ERROR_LABEL_CLASS_ATTRIBUTE_NAME = "errorLabelClass";
- private static String ERROR_CLASS_ATTRIBUTE_NAME = "errorClass";
+ protected static String ERROR_MARKER_CLASS_ATTRIBUTE_NAME =
"errorMarkerClass";
+ protected static String ERROR_LABEL_CLASS_ATTRIBUTE_NAME = "errorLabelClass";
+ protected static String ERROR_CLASS_ATTRIBUTE_NAME = "errorClass";
- private static String FATAL_MARKER_CLASS_ATTRIBUTE_NAME = "fatalMarkerClass";
- private static String FATAL_LABEL_CLASS_ATTRIBUTE_NAME = "fatalLabelClass";
- private static String FATAL_CLASS_ATTRIBUTE_NAME = "fatalClass";
+ protected static String FATAL_MARKER_CLASS_ATTRIBUTE_NAME =
"fatalMarkerClass";
+ protected static String FATAL_LABEL_CLASS_ATTRIBUTE_NAME = "fatalLabelClass";
+ protected static String FATAL_CLASS_ATTRIBUTE_NAME = "fatalClass";
- private static String INFO_MARKER_CLASS_ATTRIBUTE_NAME = "infoMarkerClass";
- private static String INFO_LABEL_CLASS_ATTRIBUTE_NAME = "infoLabelClass";
- private static String INFO_CLASS_ATTRIBUTE_NAME = "infoClass";
+ protected static String INFO_MARKER_CLASS_ATTRIBUTE_NAME = "infoMarkerClass";
+ protected static String INFO_LABEL_CLASS_ATTRIBUTE_NAME = "infoLabelClass";
+ protected static String INFO_CLASS_ATTRIBUTE_NAME = "infoClass";
- private static String WARN_MARKER_CLASS_ATTRIBUTE_NAME = "warnMarkerClass";
- private static String WARN_LABEL_CLASS_ATTRIBUTE_NAME = "warnLabelClass";
- private static String WARN_CLASS_ATTRIBUTE_NAME = "warnClass";
+ protected static String WARN_MARKER_CLASS_ATTRIBUTE_NAME = "warnMarkerClass";
+ protected static String WARN_LABEL_CLASS_ATTRIBUTE_NAME = "warnLabelClass";
+ protected static String WARN_CLASS_ATTRIBUTE_NAME = "warnClass";
- private static String ERROR_MESSAGE = "Error message";
- private static String FATAL_MESSAGE = "Fatal message";
- private static String INFO_MESSAGE = "Info message";
- private static String WARNING_MESSAGE = "Warning message";
+ protected static String ERROR_MESSAGE = "Error message";
+ protected static String FATAL_MESSAGE = "Fatal message";
+ protected static String INFO_MESSAGE = "Info message";
+ protected static String WARNING_MESSAGE = "Warning message";
- private static String[] markers = { "passedMarker", "errorMarker",
+ protected String passedLabelValue;
+ protected String labelClassValue;
+ protected String markerClassValue;
+ protected String markerStyleValue;
+ protected String errorMarkerClassValue;
+ protected String errorLabelClassValue;
+ protected String errorClassValue;
+ protected String fatalMarkerClassValue;
+ protected String fatalLabelClassValue;
+ protected String fatalClassValue;
+ protected String infoMarkerClassValue;
+ protected String infoLabelClassValue;
+ protected String infoClassValue;
+ protected String warnMarkerClassValue;
+ protected String warnLabelClassValue;
+ protected String warnClassValue;
+ protected String styleValue;
+ protected String styleClassValue;
+
+ protected static String[] markers = { "passedMarker",
"errorMarker",
"fatalMarker", "infoMarker", "warnMarker" };
- private static String FACET_TAG_NAME = "f:facet";
+ protected static String FACET_TAG_NAME = "f:facet";
- private static String NAME_ATTRIBUTE_NAME = "name";
+ protected static String NAME_ATTRIBUTE_NAME = "name";
private nsIDOMElement td1; // passed marker
private nsIDOMElement td2; // passed label
@@ -81,57 +100,61 @@
private nsIDOMElement td9; // warn marker
private nsIDOMElement td10; // warn label
- private VpeCreationData creationData;
+ protected VpeCreationData creationData;
- nsIDOMDocument vis;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- vis = visualDocument;
-
- String passedLabelValue = ((Element) sourceNode)
+ passedLabelValue = ((Element) sourceNode)
.getAttribute(PASSED_LABEL_ATTRIBUTE_NAME);
- String labelClassValue = ((Element) sourceNode)
+ labelClassValue = ((Element) sourceNode)
.getAttribute(LABEL_CLASS_ATTRIBUTE_NAME);
- String markerClassValue = ((Element) sourceNode)
+ markerClassValue = ((Element) sourceNode)
.getAttribute(MARKER_CLASS_ATTRIBUTE_NAME);
- String markerStyleValue = ((Element) sourceNode)
+ markerStyleValue = ((Element) sourceNode)
.getAttribute(MARKER_STYLE_ATTRIBUTE_NAME);
- String errorMarkerClassValue = ((Element) sourceNode)
+ errorMarkerClassValue = ((Element) sourceNode)
.getAttribute(ERROR_MARKER_CLASS_ATTRIBUTE_NAME);
- String errorLabelClassValue = ((Element) sourceNode)
+ errorLabelClassValue = ((Element) sourceNode)
.getAttribute(ERROR_LABEL_CLASS_ATTRIBUTE_NAME);
- String errorClassValue = ((Element) sourceNode)
+ errorClassValue = ((Element) sourceNode)
.getAttribute(ERROR_CLASS_ATTRIBUTE_NAME);
- String fatalMarkerClassValue = ((Element) sourceNode)
+ fatalMarkerClassValue = ((Element) sourceNode)
.getAttribute(FATAL_MARKER_CLASS_ATTRIBUTE_NAME);
- String fatalLabelClassValue = ((Element) sourceNode)
+ fatalLabelClassValue = ((Element) sourceNode)
.getAttribute(FATAL_LABEL_CLASS_ATTRIBUTE_NAME);
- String fatalClassValue = ((Element) sourceNode)
+ fatalClassValue = ((Element) sourceNode)
.getAttribute(FATAL_CLASS_ATTRIBUTE_NAME);
- String infoMarkerClassValue = ((Element) sourceNode)
+ infoMarkerClassValue = ((Element) sourceNode)
.getAttribute(INFO_MARKER_CLASS_ATTRIBUTE_NAME);
- String infoLabelClassValue = ((Element) sourceNode)
+ infoLabelClassValue = ((Element) sourceNode)
.getAttribute(INFO_LABEL_CLASS_ATTRIBUTE_NAME);
- String infoClassValue = ((Element) sourceNode)
+ infoClassValue = ((Element) sourceNode)
.getAttribute(INFO_CLASS_ATTRIBUTE_NAME);
- String warnMarkerClassValue = ((Element) sourceNode)
+ warnMarkerClassValue = ((Element) sourceNode)
.getAttribute(WARN_MARKER_CLASS_ATTRIBUTE_NAME);
- String warnLabelClassValue = ((Element) sourceNode)
+ warnLabelClassValue = ((Element) sourceNode)
.getAttribute(WARN_LABEL_CLASS_ATTRIBUTE_NAME);
- String warnClassValue = ((Element) sourceNode)
+ warnClassValue = ((Element) sourceNode)
.getAttribute(WARN_CLASS_ATTRIBUTE_NAME);
- String styleValue = ((Element) sourceNode)
+ styleValue = ((Element) sourceNode)
.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
- String styleClassValue = ((Element) sourceNode)
+ styleClassValue = ((Element) sourceNode)
.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ createRichMessage(visualDocument, sourceNode);
+
+ return creationData;
+ }
+
+ protected void createRichMessage(nsIDOMDocument visualDocument,
+ Node sourceNode) {
+
// -------------------create common table
nsIDOMElement tableHeader = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
@@ -366,15 +389,40 @@
tr5.appendChild(td9);
tr5.appendChild(td10);
td10.appendChild(warnText);
+ }
- return creationData;
+ /**
+ * Checks, whether it is necessary to re-create an element at change of
+ * attribute
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceElement
+ * The current element of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @param visualNode
+ * The current node of the visual tree.
+ * @param data
+ * The arbitrary data, built by a method <code>create</code>
+ * @param name
+ * Atrribute name
+ * @param value
+ * Attribute value
+ * @return <code>true</code> if it is required to re-create an element at
+ * a modification of attribute, <code>false</code> otherwise.
+ */
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
}
/**
*
* @param td01
*/
- private void addNotFacetComponent(nsIDOMElement td01, Node sourceNode) {
+ protected void addNotFacetComponent(nsIDOMElement td01, Node sourceNode) {
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(td01);
creationData.addChildrenInfo(childrenInfo);
@@ -393,7 +441,7 @@
* Marker name
* @return True if marker name correct or false
*/
- private boolean searchInMarker(String markerName) {
+ protected boolean searchInMarker(String markerName) {
if (markerName == null)
return false;
@@ -409,7 +457,7 @@
* @param td
* @param elemFacet
*/
- private void createVisualFacet(nsIDOMElement td, Element elemFacet) {
+ protected void createVisualFacet(nsIDOMElement td, Element elemFacet) {
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(td);
creationData.addChildrenInfo(childrenInfo);
@@ -423,33 +471,6 @@
return;
}
}
-
- /**
- * Checks, whether it is necessary to re-create an element at change of
- * attribute
- *
- * @param pageContext
- * Contains the information on edited page.
- * @param sourceElement
- * The current element of the source tree.
- * @param visualDocument
- * The document of the visual tree.
- * @param visualNode
- * The current node of the visual tree.
- * @param data
- * The arbitrary data, built by a method <code>create</code>
- * @param name
- * Atrribute name
- * @param value
- * Attribute value
- * @return <code>true</code> if it is required to re-create an element at
- * a modification of attribute, <code>false</code> otherwise.
- */
- public boolean isRecreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
}
// HTML code component
Added:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
===================================================================
---
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
(rev 0)
+++
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java 2007-09-03
16:34:56 UTC (rev 3429)
@@ -0,0 +1,320 @@
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class RichFacesMessagesTemplate extends RichFacesMessageTemplate {
+
+ private static String LAYOUT_ATTRIBUTE_NAME = "layout";
+ private static String LAYOUT_ATTRIBUTE_VALUE_TABLE = "table";
+
+ private String layoutValue;
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+
+ passedLabelValue = ((Element) sourceNode)
+ .getAttribute(PASSED_LABEL_ATTRIBUTE_NAME);
+ labelClassValue = ((Element) sourceNode)
+ .getAttribute(LABEL_CLASS_ATTRIBUTE_NAME);
+ markerClassValue = ((Element) sourceNode)
+ .getAttribute(MARKER_CLASS_ATTRIBUTE_NAME);
+ markerStyleValue = ((Element) sourceNode)
+ .getAttribute(MARKER_STYLE_ATTRIBUTE_NAME);
+
+ errorMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(ERROR_MARKER_CLASS_ATTRIBUTE_NAME);
+ errorLabelClassValue = ((Element) sourceNode)
+ .getAttribute(ERROR_LABEL_CLASS_ATTRIBUTE_NAME);
+ errorClassValue = ((Element) sourceNode)
+ .getAttribute(ERROR_CLASS_ATTRIBUTE_NAME);
+
+ fatalMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(FATAL_MARKER_CLASS_ATTRIBUTE_NAME);
+ fatalLabelClassValue = ((Element) sourceNode)
+ .getAttribute(FATAL_LABEL_CLASS_ATTRIBUTE_NAME);
+ fatalClassValue = ((Element) sourceNode)
+ .getAttribute(FATAL_CLASS_ATTRIBUTE_NAME);
+
+ infoMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(INFO_MARKER_CLASS_ATTRIBUTE_NAME);
+ infoLabelClassValue = ((Element) sourceNode)
+ .getAttribute(INFO_LABEL_CLASS_ATTRIBUTE_NAME);
+ infoClassValue = ((Element) sourceNode)
+ .getAttribute(INFO_CLASS_ATTRIBUTE_NAME);
+
+ warnMarkerClassValue = ((Element) sourceNode)
+ .getAttribute(WARN_MARKER_CLASS_ATTRIBUTE_NAME);
+ warnLabelClassValue = ((Element) sourceNode)
+ .getAttribute(WARN_LABEL_CLASS_ATTRIBUTE_NAME);
+ warnClassValue = ((Element) sourceNode)
+ .getAttribute(WARN_CLASS_ATTRIBUTE_NAME);
+
+ styleValue = ((Element) sourceNode)
+ .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ styleClassValue = ((Element) sourceNode)
+ .getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+
+ layoutValue = ((Element) sourceNode)
+ .getAttribute(LAYOUT_ATTRIBUTE_NAME);
+
+ if (layoutValue != null
+ && LAYOUT_ATTRIBUTE_VALUE_TABLE.equalsIgnoreCase(layoutValue
+ .trim()))
+ createTableLayout(visualDocument, sourceNode);
+ else
+ createListLayout(visualDocument, sourceNode);
+
+ return creationData;
+ }
+
+ /**
+ * Create <rich:messages> with layout="table"
+ */
+ public void createTableLayout(nsIDOMDocument visualDocument, Node sourceNode) {
+
+ createRichMessage(visualDocument, sourceNode);
+
+ }
+
+ /**
+ * Create <rich:messages> with layout="list"
+ */
+ public void createListLayout(nsIDOMDocument visualDocument, Node sourceNode) {
+
+ nsIDOMElement table = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+
+ if (styleValue != null && !styleValue.trim().equals(""))
+ table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, styleValue);
+ if (styleClassValue != null && !styleClassValue.trim().equals(""))
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ styleClassValue);
+
+ creationData = new VpeCreationData(table);
+
+ nsIDOMElement tr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+
+ nsIDOMElement td = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ // create first td for PASSED
+ nsIDOMElement td1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ nsIDOMElement span1 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set markerClass
+ if (markerClassValue != null && !markerClassValue.trim().equals(""))
+ span1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ markerClassValue);
+
+ // set markerStyle
+ if (markerStyleValue != null && !markerStyleValue.trim().equals(""))
+ span1.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ markerStyleValue);
+
+ nsIDOMElement span2 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ if (labelClassValue != null && !labelClassValue.trim().equals(""))
+ span2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ labelClassValue);
+
+ nsIDOMText passedText = visualDocument
+ .createTextNode(passedLabelValue == null ? ""
+ : passedLabelValue);
+ // -----------------------------------------------------------
+
+ // Create second td for ERROR
+ nsIDOMElement td2 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ // set errorClass
+ if (errorClassValue != null && !errorClassValue.trim().equals(""))
+ td2
+ .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorClassValue);
+
+ nsIDOMElement span3 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set errorMarkerClass
+ if (errorMarkerClassValue != null
+ && !errorMarkerClassValue.trim().equals(""))
+ span3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorMarkerClassValue);
+
+ nsIDOMElement span4 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set errorLabelClass
+ if (errorLabelClassValue != null
+ && !errorLabelClassValue.trim().equals(""))
+ span4.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ errorLabelClassValue);
+
+ nsIDOMText errorText = visualDocument.createTextNode(ERROR_MESSAGE);
+ // -------------------------------------------------------------
+
+ // Create third td for FATAL
+ nsIDOMElement td3 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ // set fatalClass
+ if (fatalClassValue != null && !fatalClassValue.trim().equals(""))
+ td3
+ .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalClassValue);
+
+ nsIDOMElement span5 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set fatalMarkerClass
+ if (fatalMarkerClassValue != null
+ && !fatalMarkerClassValue.trim().equals(""))
+ span5.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalMarkerClassValue);
+
+ nsIDOMElement span6 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set fatalLabelClass
+ if (fatalLabelClassValue != null
+ && !fatalLabelClassValue.trim().equals(""))
+ span6.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ fatalLabelClassValue);
+
+ nsIDOMText fatalText = visualDocument.createTextNode(FATAL_MESSAGE);
+ // ---------------------------------------------------------------------------
+
+ // Create four td for INFO
+
+ nsIDOMElement td4 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ // set infoClass
+ if (infoClassValue != null && !infoClassValue.trim().equals(""))
+ td4.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, infoClassValue);
+
+ nsIDOMElement span7 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set infoMarkerClass
+ if (infoMarkerClassValue != null
+ && !infoMarkerClassValue.trim().equals(""))
+ span7.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoMarkerClassValue);
+
+ nsIDOMElement span8 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set infoLabelClass
+ if (infoLabelClassValue != null
+ && !infoLabelClassValue.trim().equals(""))
+ span8.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ infoLabelClassValue);
+
+ nsIDOMText infoText = visualDocument.createTextNode(INFO_MESSAGE);
+ // --------------------------------------------------------------------
+
+ // Create fifth for WARN
+
+ nsIDOMElement td5 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TD);
+
+ // set warnClass
+ if (warnClassValue != null && !warnClassValue.trim().equals(""))
+ td5.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, warnClassValue);
+
+ nsIDOMElement span9 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set warnMarkerClass
+ if (warnMarkerClassValue != null
+ && !warnMarkerClassValue.trim().equals(""))
+ span9.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnMarkerClassValue);
+
+ nsIDOMElement span10 = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+
+ // set warnLabelClass
+ if (warnLabelClassValue != null
+ && !warnLabelClassValue.trim().equals(""))
+ span10.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ warnLabelClassValue);
+
+ nsIDOMText warnText = visualDocument.createTextNode(WARNING_MESSAGE);
+ // ---------------------------------------------------------------------
+
+ NodeList nodeList = sourceNode.getChildNodes();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+
+ if (!(nodeList.item(i) instanceof Element))
+ continue;
+
+ Element elemFacet = (Element) nodeList.item(i);
+
+ if (elemFacet.getNodeName().equalsIgnoreCase(FACET_TAG_NAME)
+ && searchInMarker(elemFacet
+ .getAttribute(NAME_ATTRIBUTE_NAME))) {
+
+ String markerName = elemFacet.getAttribute(NAME_ATTRIBUTE_NAME)
+ .trim();
+
+ if (elemFacet.getChildNodes().getLength() != 0)
+ if (markers[0].equalsIgnoreCase(markerName)) {
+ createVisualFacet(span1, elemFacet);
+ } else if (markers[1].equalsIgnoreCase(markerName)) {
+ createVisualFacet(span3, elemFacet);
+ } else if (markers[2].equalsIgnoreCase(markerName)) {
+ createVisualFacet(span5, elemFacet);
+ } else if (markers[3].equalsIgnoreCase(markerName)) {
+ createVisualFacet(span7, elemFacet);
+ } else if (markers[4].equalsIgnoreCase(markerName)) {
+ createVisualFacet(span9, elemFacet);
+ }
+ }
+ }
+
+ addNotFacetComponent(td, sourceNode);
+
+ table.appendChild(tr);
+ tr.appendChild(td);
+
+ tr.appendChild(td1);
+ td1.appendChild(span1);
+ td1.appendChild(span2);
+ span2.appendChild(passedText);
+
+ tr.appendChild(td2);
+ td2.appendChild(span3);
+ td2.appendChild(span4);
+ span4.appendChild(errorText);
+
+ tr.appendChild(td3);
+ td3.appendChild(span5);
+ td3.appendChild(span6);
+ span6.appendChild(fatalText);
+
+ tr.appendChild(td4);
+ td4.appendChild(span7);
+ td4.appendChild(span8);
+ span8.appendChild(infoText);
+
+ tr.appendChild(td5);
+ td5.appendChild(span9);
+ td5.appendChild(span10);
+ span10.appendChild(warnText);
+ }
+}
\ No newline at end of file
Property changes on:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMessagesTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2007-09-03
16:33:58 UTC (rev 3428)
+++
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2007-09-03
16:34:56 UTC (rev 3429)
@@ -485,5 +485,20 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
+
+ <vpe:tag name="rich:messages" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesMessagesTemplate">
+
+ <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="yes"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
</vpe:templates>
\ No newline at end of file