Author: yzhishko
Date: 2009-11-27 11:29:12 -0500 (Fri, 27 Nov 2009)
New Revision: 18888
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChart.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChartSeriesNested.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChart.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChartSeriesNested.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChart.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChartSeriesNested.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1452 templates for seam-pdf components were
added
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChart.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChart.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChartSeriesNested.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/barChart/barChartSeriesNested.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChart.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChart.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChartSeriesNested.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/lineChart/lineChartSeriesNested.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChart.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChart.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChartSeriesNested.png
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/resources/pieChart/pieChartSeriesNested.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -10,8 +10,14 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.seam;
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/**
@@ -63,4 +69,16 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
+
+ public static String getPluginResourcePath() {
+ Bundle bundle = Platform.getBundle(PLUGIN_ID);
+ URL url = null;
+ try {
+ url = bundle == null ? null :
FileLocator.resolve(bundle.getEntry("/resources")); //$NON-NLS-1$
+ } catch (IOException e) {
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
+ }
+ return (url == null) ? null : url.getPath();
+ }
+
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamDecorateTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -3,7 +3,7 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
-import org.jboss.tools.jsf.vpe.seam.template.util.Seam;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeDefineContainerTemplate;
@@ -25,8 +25,8 @@
/*
* Reading attributes
*/
- String fileName = sourceElement.getAttribute(Seam.ATTR_TEMPLATE);
- String styleClass = sourceElement.getAttribute(Seam.ATTR_STYLE_CLASS);
+ String fileName = sourceElement.getAttribute(SeamUtil.ATTR_TEMPLATE);
+ String styleClass = sourceElement.getAttribute(SeamUtil.ATTR_STYLE_CLASS);
String style = sourceElement.getAttribute(HTML.ATTR_STYLE);
/*
@@ -53,7 +53,7 @@
public IRegion getSourceRegionForOpenOn(VpePageContext pageContext,
Node sourceNode, nsIDOMNode domNode) {
Element sourceElement = (Element) sourceNode;
- Node paramAttr = sourceElement.getAttributeNode(Seam.ATTR_TEMPLATE);
+ Node paramAttr = sourceElement.getAttributeNode(SeamUtil.ATTR_TEMPLATE);
return new Region(NodesManagingUtil.getStartOffsetNode(paramAttr),0);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamFormattedTextTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -83,7 +83,7 @@
SeamTemplatesActivator.getPluginLog().logError(e);
}
- nsIDOMParser parserDom = parserDom = (nsIDOMParser) getComponentManager()
+ nsIDOMParser parserDom = (nsIDOMParser) getComponentManager()
.createInstanceByContractID(CID_DOMPARSER, null,
nsIDOMParser.NS_IDOMPARSER_IID);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamGraphicImageTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -13,7 +13,7 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
-import org.jboss.tools.jsf.vpe.seam.template.util.Seam;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
@@ -71,16 +71,16 @@
if (sourceElement.hasAttribute(HTML.ATTR_STYLE)) {
img.setAttribute(HTML.ATTR_STYLE, sourceElement.getAttribute(HTML.ATTR_STYLE));
}
- if (sourceElement.hasAttribute(Seam.ATTR_STYLE_CLASS)) {
- img.setAttribute(HTML.ATTR_CLASS,
sourceElement.getAttribute(Seam.ATTR_STYLE_CLASS));
+ if (sourceElement.hasAttribute(SeamUtil.ATTR_STYLE_CLASS)) {
+ img.setAttribute(HTML.ATTR_CLASS,
sourceElement.getAttribute(SeamUtil.ATTR_STYLE_CLASS));
}
if (sourceElement.hasAttribute(HTML.ATTR_VALUE)) {
img.setAttribute(HTML.ATTR_SRC, VpeStyleUtil.addFullPathToImgSrc(
sourceElement.getAttribute(HTML.ATTR_VALUE), pageContext,
true));
- } else if (sourceElement.hasAttribute(Seam.ATTR_URL)) {
+ } else if (sourceElement.hasAttribute(SeamUtil.ATTR_URL)) {
img.setAttribute(HTML.ATTR_SRC, VpeStyleUtil.addFullPathToImgSrc(
- sourceElement.getAttribute(Seam.ATTR_URL), pageContext,
+ sourceElement.getAttribute(SeamUtil.ATTR_URL), pageContext,
true));
}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public abstract class SeamPdfAbstractTemplate extends VpeAbstractTemplate {
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer");
+ if (footers != null && footers.length != 0) {
+ Node parentPdfDocumentNode = SeamUtil.getParentByName(pageContext,
+ sourceNode, "p:document");
+ if (parentPdfDocumentNode != null) {
+ return parentPdfDocumentNode;
+ }
+ }
+ return super
+ .getNodeForUpdate(pageContext, sourceNode, visualNode, data);
+ }
+
+ protected final void copySizeAttrs(nsIDOMElement visualElement,
+ Element sourceElement) {
+ String width = sourceElement.getAttribute(HTML.ATTR_WIDTH);
+ String height = sourceElement.getAttribute(HTML.ATTR_HEIGHT);
+ if (width != null) {
+ String styleAttrValue = visualElement.getAttribute(HTML.ATTR_STYLE);
+ if (styleAttrValue == null) {
+ visualElement.setAttribute(HTML.ATTR_STYLE, "width:" + width);
+ } else {
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttrValue
+ + "; width:" + width);
+ }
+ }
+ if (height != null) {
+ String styleAttrValue = visualElement.getAttribute(HTML.ATTR_STYLE);
+ if (styleAttrValue == null) {
+ visualElement.setAttribute(HTML.ATTR_STYLE, "height:" + height);
+ } else {
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttrValue
+ + "; height:" + height);
+ }
+ }
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAnchorTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfAnchorTemplate extends SeamPdfAbstractTemplate {
+
+ private static final String ATTR_REF = "reference";
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+ nsIDOMElement visualElement = visualDocument.createElement(HTML.TAG_A);
+ if (sourceElement.hasAttribute(HTML.ATTR_NAME)) {
+ visualElement.setAttribute(HTML.ATTR_NAME, sourceElement
+ .getAttribute(HTML.ATTR_NAME));
+ visualElement.setAttribute(HTML.ATTR_STYLE,
+ "color:black; text-decoration:none");
+ }
+ if (sourceElement.hasAttribute(ATTR_REF)) {
+ visualElement.setAttribute(HTML.ATTR_HREF, sourceElement
+ .getAttribute(ATTR_REF));
+ visualElement.removeAttribute(HTML.ATTR_STYLE);
+ }
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfBarChartTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,31 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfBarChartTemplate extends SeamPdfAbstractTemplate {
+
+ private static String BAR_CHART = "/barChart/barChart.png"; //$NON-NLS-1$
+ private static String BAR_CHART_SERIES_NESTED =
"/barChart/barChartSeriesNested.png"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement visualElement = visualDocument.createElement(HTML.TAG_IMG);
+ Node[] seriesNodes = SeamUtil.getChildsByName(pageContext, sourceNode,
"p:series");
+ if (seriesNodes!=null && seriesNodes.length!=0) {
+ SeamUtil.setImg(visualElement, BAR_CHART_SERIES_NESTED);
+ }else {
+ SeamUtil.setImg(visualElement, BAR_CHART);
+ }
+ copySizeAttrs(visualElement, (Element)sourceNode);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfCellTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfCellTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_TD);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ copyAttrs(visualElement, sourceElement);
+ visualElement.setAttribute(HTML.ATTR_STYLE, "border-width: 2px; border-color:
black; border-style: solid");
+ return new VpeCreationData(visualElement);
+ }
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node nodeForUpdate = super.getNodeForUpdate(pageContext, sourceNode,
+ visualNode, data);
+ if (nodeForUpdate == null) {
+ nodeForUpdate = SeamUtil.getParentByName(pageContext, sourceNode,
+ "p:table");
+ }
+ return nodeForUpdate;
+ }
+
+ private void copyAttrs(nsIDOMElement visualElement, Element sourceElement) {
+ String attr = sourceElement.getAttribute(HTML.ATTR_COLSPAN);
+ if (attr != null) {
+ visualElement.setAttribute(HTML.ATTR_COLSPAN, attr);
+ }
+ attr = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_HORIZONAL_ALIGNMENT);
+ if (attr != null) {
+ visualElement.setAttribute(HTML.ATTR_ALIGN, attr);
+ }
+ attr = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_VERTICAL_ALIGNMENT);
+ if (attr != null) {
+ visualElement.setAttribute(HTML.ATTR_VALIGN, attr);
+ }
+ attr = sourceElement.getAttribute("noWrap");
+ if (attr != null) {
+ visualElement.setAttribute("nowrap", attr);
+ }
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SeamPdfChapterTemplate extends SeamPdfAbstractTemplate {
+
+ private static final String NUMBER = "number";
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ visualElement = VisualDomUtil.createBorderlessContainer(visualDocument);
+ nsIDOMNode headNode = visualDocument.createElement(HTML.TAG_H1);
+ String chapterNumber = sourceElement.getAttribute(NUMBER);
+ if (chapterNumber != null) {
+ try {
+ Integer.parseInt(chapterNumber);
+ } catch (NumberFormatException e) {
+ chapterNumber = "1";
+ }
+ } else {
+ chapterNumber = "1";
+ }
+ nsIDOMText chapterNumberNode = visualDocument
+ .createTextNode(chapterNumber + ". ");
+ headNode.appendChild(chapterNumberNode);
+ visualElement.appendChild(headNode);
+ return new VpeCreationData(visualElement);
+ }
+
+ private void setTitle(VpePageContext pageContext, Element sourceElement,
+ VpeCreationData data) {
+ Node sourceTitleNode = null;
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i) instanceof Element) {
+ if (children.item(i).getNodeName().endsWith(":title")) {
+ sourceTitleNode = children.item(i);
+ }
+ }
+ }
+ nsIDOMNode visualTitleNode = null;
+ if (sourceTitleNode != null) {
+ visualTitleNode = pageContext.getDomMapping().getVisualNode(
+ sourceTitleNode);
+ }
+ if (visualTitleNode != null) {
+ nsIDOMElement headElement = getHeadElement(data);
+ nsIDOMNode parentNode = visualTitleNode.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualTitleNode);
+ headElement.appendChild(visualTitleNode);
+ }
+ }
+ }
+
+ private nsIDOMElement getHeadElement(VpeCreationData data) {
+ nsIDOMNode visualNode = data.getNode();
+ nsIDOMNodeList children = visualNode.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeType() == nsIDOMNode.ELEMENT_NODE) {
+ if (children.item(i).getNodeName()
+ .equalsIgnoreCase(HTML.TAG_H1)) {
+ return (nsIDOMElement) children.item(i).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setTitle(pageContext, (Element) sourceNode, data);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfDocumentTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement headElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode headNode = visualDocument.createElement(HTML.TAG_DIV);
+ headElement = (nsIDOMElement) headNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ sourceElement = (Element) sourceNode;
+ setMarginValues();
+ return new VpeCreationData(headElement);
+ }
+
+ private boolean setMarginValues(float... marginValues) {
+ if (marginValues.length != 4) {
+ return false;
+ }
+ headElement.removeAttribute("style");
+ headElement.setAttribute("style", "margin-left:"
+ + Float.toString(marginValues[0]) + ";margin-right:"
+ + Float.toString(marginValues[1]) + ";margin-top:"
+ + Float.toString(marginValues[2]) + ";margin-bottom:"
+ + Float.toString(marginValues[3]) + ";");
+ return true;
+ }
+
+ private float[] parseMarginValues(String stringMarginValues)
+ throws NumberFormatException {
+ String[] parts = stringMarginValues.split("\\s");
+ float[] values = new float[parts.length];
+ for (int i = 0; i < parts.length; i++) {
+ values[i] = Float.valueOf(parts[i]);
+ }
+ return values;
+ }
+
+ private void setDefaultMargingValues() {
+ setMarginValues(36.0f, 36.0f, 36.0f, 36.0f);
+ }
+
+ private void setMarginValues() {
+ String marginsAttrValue = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_MARGINS);
+ try {
+ if (marginsAttrValue != null && !"".equals(marginsAttrValue)) {
+ float[] floatMarginValues = parseMarginValues(marginsAttrValue);
+ if (!setMarginValues(floatMarginValues)) {
+ setDefaultMargingValues();
+ }
+ } else {
+ setDefaultMargingValues();
+ }
+ } catch (NumberFormatException e) {
+ setDefaultMargingValues();
+ }
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setFooter(pageContext, sourceNode, data);
+ }
+
+ private void setFooter(VpePageContext pageContext, Node sourceNode,
+ VpeCreationData data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer");
+ nsIDOMNode visualFooter = null;
+ if (footers != null && footers.length != 0) {
+ visualFooter = pageContext.getDomMapping().getVisualNode(
+ footers[footers.length - 1]);
+
+ }
+ if (visualFooter != null) {
+ for (int i = 0; i < footers.length; i++) {
+ nsIDOMNode visualFootersRepresent = pageContext.getDomMapping()
+ .getVisualNode(footers[i]);
+ if (visualFootersRepresent != null
+ && visualFootersRepresent != visualFooter) {
+ nsIDOMNode parentNode = visualFootersRepresent.getParentNode();
+ parentNode.removeChild(visualFootersRepresent);
+ }
+ }
+ nsIDOMNode parentNode = visualFooter.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualFooter);
+ data.getNode().appendChild(visualFooter);
+ }
+ }
+ }
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFontTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,25 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+public class SeamPdfFontTemplate extends SeamPdfAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_SPAN);
+ String styleAttrValue = SeamUtil.getStyleAttr(sourceNode);
+ nsIDOMElement visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttrValue);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfFooterTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_DIV);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ SeamUtil.setAlignment(sourceElement, visualElement);
+ Node parentFontNode = SeamUtil.getParentByName(pageContext, sourceNode,
+ "p:font");
+ String styleAttr = SeamUtil.getStyleAttr(parentFontNode);
+ if (styleAttr != null && !"".equals(styleAttr)) {
+ visualElement.setAttribute(HTML.ATTR_STYLE, styleAttr);
+ }
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfLineChartTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,33 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfLineChartTemplate extends SeamPdfAbstractTemplate {
+
+ private static String LINE_CHART = "/lineChart/lineChart.png"; //$NON-NLS-1$
+ private static String LINE_CHART_SERIES_NESTED =
"/lineChart/lineChartSeriesNested.png"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement visualElement = visualDocument
+ .createElement(HTML.TAG_IMG);
+ Node[] seriesNodes = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:series");
+ if (seriesNodes != null && seriesNodes.length != 0) {
+ SeamUtil.setImg(visualElement, LINE_CHART_SERIES_NESTED);
+ } else {
+ SeamUtil.setImg(visualElement, LINE_CHART);
+ }
+ copySizeAttrs(visualElement, (Element)sourceNode);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListItemTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,19 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+public class SeamPdfListItemTemplate extends SeamPdfAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_LI);
+ return new VpeCreationData(visualNode);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfListTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,41 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfListTemplate extends SeamPdfAbstractTemplate {
+
+ private static List<String> NUMBERED_VALUES;
+ static{
+ NUMBERED_VALUES = new ArrayList<String>(0);
+ NUMBERED_VALUES.add("numbered");
+ NUMBERED_VALUES.add("greek");
+ NUMBERED_VALUES.add("roman");
+ NUMBERED_VALUES.add("zapfdingbats");
+ NUMBERED_VALUES.add("zapfdingbats_number");
+ }
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ String styleAttr = ((Element)sourceNode).getAttribute(HTML.ATTR_STYLE);
+ if (isNumberedAttr(styleAttr)) {
+ return new VpeCreationData(visualDocument.createElement(HTML.TAG_OL));
+ }
+ return new VpeCreationData(visualDocument.createElement(HTML.TAG_UL));
+ }
+
+ private boolean isNumberedAttr (String styleAttr){
+ if (styleAttr!=null) {
+ return NUMBERED_VALUES.contains(styleAttr);
+ }
+ return false;
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfParagraphTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfParagraphTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+ private nsIDOMDocument visualDocument;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ this.visualDocument = visualDocument;
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_DIV);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ processFirstChild();
+ SeamUtil.setAlignment(sourceElement, visualElement);
+ return new VpeCreationData(visualElement);
+ }
+
+ private void processFirstChild() {
+ Node firstChild = sourceElement.getFirstChild();
+ if (firstChild != null) {
+ if (firstChild.getNodeType() == Node.TEXT_NODE) {
+ String nodeValue = firstChild.getNodeValue();
+ nodeValue = nodeValue.replace(" ", "").replace("\n",
"")
+ .replace("\t", "").replace("\r", "");
+ if (!nodeValue.equals("")) {
+ nsIDOMNode brNode = visualDocument
+ .createElement(HTML.TAG_BR);
+ visualElement.appendChild(brNode);
+ }
+ }
+ }
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfPieChartTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,33 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfPieChartTemplate extends SeamPdfAbstractTemplate {
+
+ private static String PIE_CHART = "/pieChart/pieChart.png"; //$NON-NLS-1$
+ private static String PIE_CHART_SERIES_NESTED =
"/pieChart/pieChartSeriesNested.png"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement visualElement = visualDocument
+ .createElement(HTML.TAG_IMG);
+ Node[] seriesNodes = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:series");
+ if (seriesNodes != null && seriesNodes.length != 0) {
+ SeamUtil.setImg(visualElement, PIE_CHART_SERIES_NESTED);
+ } else {
+ SeamUtil.setImg(visualElement, PIE_CHART);
+ }
+ copySizeAttrs(visualElement, (Element)sourceNode);
+ return new VpeCreationData(visualElement);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import java.util.StringTokenizer;
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SeamPdfSectionTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+ private String sectionNumberString;
+ private String headNameString;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ visualElement = VisualDomUtil.createBorderlessContainer(visualDocument);
+ sourceElement = (Element) sourceNode;
+ sectionNumberString = calculateSectionNumber(pageContext, sourceElement);
+ headNameString = calculateHeadName(sectionNumberString);
+ nsIDOMNode headNode = visualDocument.createElement(headNameString);
+ nsIDOMText textNode = visualDocument
+ .createTextNode(sectionNumberString);
+ headNode.appendChild(textNode);
+ visualElement.appendChild(headNode);
+ return new VpeCreationData(visualElement);
+ }
+
+ private String calculateSectionNumber(VpePageContext pageContext,
+ Element sourceElement) {
+ StringBuffer chapterNumberBuffer = new StringBuffer();
+ calculateNumberFromTree(pageContext, sourceElement, chapterNumberBuffer);
+ Node parentSection = SeamUtil.getParentByName(pageContext,
+ sourceElement, "p:chapter");
+ if (parentSection != null) {
+ int chapterNumber = getChapterNumber(parentSection);
+ chapterNumberBuffer
+ .insert(0, Integer.toString(chapterNumber) + ".");
+ }
+ return chapterNumberBuffer.toString();
+ }
+
+ private String calculateHeadName(String sectionNumberString) {
+ StringTokenizer tokenizer = new StringTokenizer(sectionNumberString,
+ ".", false);
+ int headNumber = 0;
+ while (tokenizer.hasMoreElements()) {
+ tokenizer.nextToken();
+ headNumber++;
+ }
+ if (headNumber > 6) {
+ headNumber = 6;
+ }
+ return "H" + Integer.toString(headNumber);
+ }
+
+ private void calculateNumberFromTree(VpePageContext pageContext,
+ Element sourceElement, StringBuffer sectionNumberString) {
+ Node parentSection = SeamUtil.getParentByName(pageContext,
+ sourceElement, "p:section");
+ if (parentSection != null) {
+ int sectionNum = 0;
+ NodeList children = parentSection.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeName().endsWith(":section")) {
+ sectionNum++;
+ if (children.item(i) == sourceElement) {
+ sectionNumberString.insert(0, Integer
+ .toString(sectionNum)
+ + ".");
+ break;
+ }
+ }
+ }
+ calculateNumberFromTree(pageContext, (Element) parentSection,
+ sectionNumberString);
+ } else {
+ Node parentChapter = SeamUtil.getParentByName(pageContext,
+ sourceElement, "p:chapter");
+ int sectionNum = 0;
+ NodeList children = parentChapter.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeName().endsWith(":section")) {
+ sectionNum++;
+ if (children.item(i) == sourceElement) {
+ sectionNumberString.insert(0, Integer
+ .toString(sectionNum)
+ + ".");
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ private int getChapterNumber(Node chapterNode) {
+ int chapterNumber = 1;
+ String chapterNumberString = ((Element) chapterNode)
+ .getAttribute("number");
+ if (chapterNumberString != null) {
+ try {
+ chapterNumber = Integer.parseInt(chapterNumberString);
+ } catch (NumberFormatException e) {
+ chapterNumber = 1;
+ }
+ } else {
+ chapterNumber = 1;
+ }
+ return chapterNumber;
+ }
+
+ private void setTitle(VpePageContext pageContext, Element sourceElement,
+ VpeCreationData data) {
+ Node sourceTitleNode = null;
+ NodeList children = sourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i) instanceof Element) {
+ if (children.item(i).getNodeName().endsWith(":title")) {
+ sourceTitleNode = children.item(i);
+ }
+ }
+ }
+ nsIDOMNode visualTitleNode = null;
+ if (sourceTitleNode != null) {
+ visualTitleNode = pageContext.getDomMapping().getVisualNode(
+ sourceTitleNode);
+ }
+ if (visualTitleNode != null) {
+ nsIDOMElement headElement = getHeadElement(data);
+ nsIDOMNode parentNode = visualTitleNode.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualTitleNode);
+ headElement.appendChild(visualTitleNode);
+ }
+ }
+ }
+
+ private nsIDOMElement getHeadElement(VpeCreationData data) {
+ nsIDOMNode visualNode = data.getNode();
+ nsIDOMNodeList children = visualNode.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ if (children.item(i).getNodeType() == nsIDOMNode.ELEMENT_NODE) {
+ String nodeName = children.item(i).getNodeName();
+ if (HTML.TAG_H1.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H2.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H3.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H4.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H5.equalsIgnoreCase(nodeName)
+ || HTML.TAG_H6.equalsIgnoreCase(nodeName)) {
+ return (nsIDOMElement) children.item(i).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setTitle(pageContext, (Element) sourceNode, data);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfTableTemplate extends SeamPdfAbstractTemplate {
+
+ private nsIDOMElement visualElement;
+ private Element sourceElement;
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ sourceElement = (Element) sourceNode;
+ nsIDOMNode visualNode = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMNode tableNode = visualDocument.createElement(HTML.TAG_TABLE);
+ nsIDOMElement visualTable = (nsIDOMElement) tableNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualNode.appendChild(tableNode);
+ visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualTable.setAttribute(HTML.ATTR_WIDTH, getWidthPerc(sourceElement));
+ visualTable.setAttribute(HTML.ATTR_ALIGN, getAlignment(sourceElement));
+ visualTable.setAttribute(HTML.ATTR_CELLSPACING, "0px");
+ return new VpeCreationData(visualElement);
+ }
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setColumns(pageContext, sourceNode, visualDocument, data);
+ }
+
+ private int getNumberOfColumns(Node sourceTableNode) {
+ int columnsNumber = 1;
+ String columnsNumberString = ((Element) sourceTableNode)
+ .getAttribute("columns");
+ if (columnsNumberString != null) {
+ try {
+ columnsNumber = Integer.parseInt(columnsNumberString);
+ if (columnsNumber < 1) {
+ columnsNumber = 1;
+ }
+ } catch (NumberFormatException e) {
+ columnsNumber = 1;
+ }
+ } else {
+ columnsNumber = 1;
+ }
+ return columnsNumber;
+ }
+
+ private void setColumns(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ int numberOfColumns = getNumberOfColumns(sourceNode);
+ Node[] cells = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:cell");
+ int cellsLength = cells.length;
+ if (numberOfColumns > cellsLength) {
+ for (int i = 0; i < cells.length; i++) {
+ nsIDOMNode visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ nsIDOMNode parentNode = visualCell.getParentNode();
+ parentNode.removeChild(visualCell);
+ }
+ return;
+ }
+ nsIDOMNode visualTable = ((nsIDOMElement) data.getNode()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
+ .getElementsByTagName(HTML.TAG_TABLE).item(0);
+ if (cellsLength != 0) {
+ nsIDOMNode trVisualNode = visualDocument.createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ int posCounter = 0;
+ for (int i = 0; i < cellsLength; i++) {
+ nsIDOMNode visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ nsIDOMNode parentNode = visualCell.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualCell);
+ trVisualNode.appendChild(visualCell);
+ int colspanValue = getColspanValue(visualCell);
+ posCounter++;
+ if (colspanValue > 1 && posCounter % numberOfColumns != 0) {
+ int posInRow = posCounter - 1;
+ int numEndCells = numberOfColumns - posInRow;
+ if (numEndCells <= colspanValue) {
+ colspanValue = numEndCells;
+ trVisualNode = visualDocument
+ .createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ posCounter = 0;
+ continue;
+ } else {
+ for (int j = 0; j < numberOfColumns
+ - (colspanValue); j++) {
+ i++;
+ visualCell = pageContext.getDomMapping()
+ .getVisualNode(cells[i]);
+ trVisualNode.appendChild(visualCell);
+ }
+ i -= numberOfColumns - (colspanValue);
+ posCounter += colspanValue - 1;
+ }
+ }
+ }
+ if ((posCounter % numberOfColumns == 0)
+ && ((i + 1) != cellsLength)) {
+ trVisualNode = visualDocument.createElement(HTML.TAG_TR);
+ visualTable.appendChild(trVisualNode);
+ posCounter = 0;
+ }
+ }
+ if (trVisualNode.getChildNodes().getLength() != numberOfColumns) {
+ trVisualNode.getParentNode().removeChild(trVisualNode);
+ }
+ }
+ }
+
+ private String getWidthPerc(Element sourceElement) {
+ String width = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_WIDTH_PERCENTAGE);
+ if (width != null) {
+ try {
+ int intWidth = Integer.parseInt(width);
+ if (intWidth < 1 || intWidth > 100) {
+ width = "100%";
+ } else {
+ width = Integer.toString(intWidth) + "%";
+ }
+ } catch (NumberFormatException e) {
+ width = "100%";
+ }
+ } else {
+ width = "100%";
+ }
+ return width;
+ }
+
+ private String getAlignment(Element sourceElement) {
+ String align = sourceElement
+ .getAttribute(SeamUtil.SEAM_ATTR_HORIZONAL_ALIGNMENT);
+ if (align != null) {
+ for (int i = 0; i < SeamUtil.POSSIBLE_ALIGNS.length; i++) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i].equalsIgnoreCase(align)) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i]
+ .equalsIgnoreCase("justifyall")) {
+ return HTML.VALUE_ALIGN_JUSTIFY;
+ }
+ return align;
+ }
+ }
+ }
+ return HTML.VALUE_ALIGN_CENTER;
+ }
+
+ private int getColspanValue(nsIDOMNode visualNode) {
+ int colspan = 1;
+ nsIDOMElement visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ String colspanString = visualElement.getAttribute(HTML.ATTR_COLSPAN);
+ if (colspanString != null) {
+ try {
+ colspan = Integer.parseInt(colspanString);
+ if (colspan < 1) {
+ colspan = 1;
+ }
+ } catch (NumberFormatException e) {
+ colspan = 1;
+ }
+ }
+ return colspan;
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTextTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template;
+
+/**
+ * @author yzhishko
+ */
+
+import org.jboss.tools.jsf.vpe.jsf.template.AbstractOutputJsfTemplate;
+import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class SeamPdfTextTemplate extends AbstractOutputJsfTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element element = (Element) sourceNode;
+
+ // create container
+ final nsIDOMElement container;
+ container = VisualDomUtil.createBorderlessContainer(visualDocument);
+
+ VpeCreationData creationData = new VpeCreationData(container);
+
+ processOutputAttribute(pageContext, visualDocument, element, container,
+ creationData);
+
+ return creationData;
+ }
+
+ @Override
+ public Node getNodeForUpdate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMNode visualNode, Object data) {
+ Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
+ "p:footer");
+ if (footers != null && footers.length != 0) {
+ Node parentPdfDocumentNode = SeamUtil.getParentByName(pageContext,
+ sourceNode, "p:document");
+ if (parentPdfDocumentNode != null) {
+ return parentPdfDocumentNode;
+ }
+ }
+ return super
+ .getNodeForUpdate(pageContext, sourceNode, visualNode, data);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,19 @@
+package org.jboss.tools.jsf.vpe.seam.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+public class SeamPdfTitleTemplate extends SeamPdfAbstractTemplate {
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMNode visualNode = VisualDomUtil.createBorderlessContainer(visualDocument);
+ return new VpeCreationData(visualNode);
+ }
+
+}
Deleted:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.seam.template.util;
-
-/**
- * Class contains Seam tags and general attributes.
- *
- * @author dmaliarevich
- *
- */
-public class Seam {
-
- public static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
- public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
- public static final String ATTR_URL = "url"; //$NON-NLS-1$
-
-}
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
(from rev 18775,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/Seam.java)
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.seam.template.util;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.jsf.vpe.seam.SeamTemplatesActivator;
+import org.jboss.tools.jst.web.tld.TaglibData;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.XmlUtil;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Class contains Seam tags, general attributes and static methods usually used
+ * in Seam template classes.
+ *
+ * @author dmaliarevich
+ *
+ */
+public class SeamUtil {
+
+ public static final String ATTR_TEMPLATE = "template"; //$NON-NLS-1$
+ public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_URL = "url"; //$NON-NLS-1$
+ public final static String SEAM_ATTR_MARGINS = "margins";
+ public final static String[] POSSIBLE_ALIGNS = new String[] { "left",
+ "right", "center", "justify", "justifyall" };
+ public final static String SEAM_ATTR_ALIGNMENT = "alignment";
+ public final static String SEAM_DIV_BASIC_STYLE_VALUE = "line-height: 142.0pt;
font-family: unknown;";
+ public final static String SEAM_SPAN_BASIC_STYLE_VALUE = "font-family:
unknown;";
+ public final static String SEAM_ATTR_HORIZONAL_ALIGNMENT =
"horizontalAlignment";
+ public final static String SEAM_ATTR_VERTICAL_ALIGNMENT =
"verticalAlignment";
+ public final static String SEAM_ATTR_WIDTH_PERCENTAGE = "widthPercentage";
+
+ public static Node getParentByName(VpePageContext pageContext,
+ Node sourceNode, String parentName) {
+
+ Node parentNode = sourceNode.getParentNode();
+
+ while (parentNode != null) {
+ String parentSourcePrefix = parentNode.getPrefix();
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
+ pageContext);
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
+ parentSourcePrefix, taglibs);
+
+ String parentNodeName = parentNode.getNodeName();
+ if (sourceNodeTaglib != null) {
+ String sourceNodeUri = sourceNodeTaglib.getUri();
+ String templateTaglibPrefix = VpeTemplateManager.getInstance()
+ .getTemplateTaglibPrefix(sourceNodeUri);
+
+ if (templateTaglibPrefix != null) {
+ parentNodeName = templateTaglibPrefix
+ + ":" + parentNode.getLocalName(); //$NON-NLS-1$
+ }
+ }
+ if (parentNodeName.equals(parentName)) {
+ return parentNode;
+ }
+ parentNode = parentNode.getParentNode();
+ }
+ return null;
+ }
+
+ public static void setAlignment(Element sourceElement,
+ nsIDOMElement visualElement) {
+ String align = sourceElement.getAttribute(SeamUtil.SEAM_ATTR_ALIGNMENT);
+ if (align != null) {
+ visualElement.setAttribute(HTML.ATTR_ALIGN, HTML.VALUE_ALIGN_LEFT);
+ for (int i = 0; i < SeamUtil.POSSIBLE_ALIGNS.length; i++) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i].equalsIgnoreCase(align)) {
+ if (SeamUtil.POSSIBLE_ALIGNS[i]
+ .equalsIgnoreCase("justifyall")) {
+ visualElement.setAttribute(HTML.ATTR_ALIGN,
+ HTML.VALUE_ALIGN_JUSTIFY);
+ return;
+ }
+ visualElement.setAttribute(HTML.ATTR_ALIGN,
+ SeamUtil.POSSIBLE_ALIGNS[i]);
+ return;
+ }
+ }
+ }
+ }
+
+ public static void getChildsByName(VpePageContext pageContext,
+ Node sourceNode, String childName, List<Node> childNodes) {
+ NodeList children = sourceNode.getChildNodes();
+ if (children != null) {
+ for (int i = 0; i < children.getLength(); i++) {
+ Node childNode = children.item(i);
+ String childSourcePrefix = childNode.getPrefix();
+ List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(childNode,
+ pageContext);
+
+ TaglibData sourceNodeTaglib = XmlUtil.getTaglibForPrefix(
+ childSourcePrefix, taglibs);
+
+ String childNodeName = childNode.getNodeName();
+ if (sourceNodeTaglib != null) {
+ String sourceNodeUri = sourceNodeTaglib.getUri();
+ String templateTaglibPrefix = VpeTemplateManager
+ .getInstance().getTemplateTaglibPrefix(
+ sourceNodeUri);
+
+ if (templateTaglibPrefix != null) {
+ childNodeName = templateTaglibPrefix
+ + ":" + childNode.getLocalName(); //$NON-NLS-1$
+ }
+ }
+ if (childNodeName.equals(childName)) {
+ childNodes.add(childNode);
+ }
+ getChildsByName(pageContext, childNode, childName, childNodes);
+ }
+ }
+ }
+
+ public static Node[] getChildsByName(VpePageContext pageContext,
+ Node sourceNode, String childName) {
+ List<Node> footerNodes = new ArrayList<Node>(0);
+ getChildsByName(pageContext, sourceNode, childName, footerNodes);
+ return footerNodes.toArray(new Node[0]);
+ }
+
+ public static String getStyleAttr(Node sourceFontNode) {
+ if (sourceFontNode == null
+ || !sourceFontNode.getNodeName().endsWith(":font")) {
+ return null;
+ }
+ String styleAttrValue = getFontFamily(sourceFontNode)
+ + getSize(sourceFontNode) + parseFontStyleValue(sourceFontNode);
+ return styleAttrValue;
+ }
+
+ private static String parseFontStyleValue(Node sourceFontNode) {
+ StringBuffer styleAttrValue = new StringBuffer("");
+ String stringValueToParse = ((Element) sourceFontNode)
+ .getAttribute(HTML.ATTR_STYLE);
+ if (stringValueToParse != null) {
+ int boldPos = stringValueToParse.indexOf("bold");
+ if (boldPos != -1) {
+ styleAttrValue.append(" font-weight : bold;");
+ }
+ int italicPos = stringValueToParse.indexOf("italic");
+ if (italicPos != -1) {
+ styleAttrValue.append(" font-style : italic;");
+ }
+ int underLinePos = stringValueToParse.indexOf("underline");
+ if (underLinePos != -1) {
+ styleAttrValue.append(" text-decoration : underline;");
+ }
+ int lineThroughPos = stringValueToParse.indexOf("line-through");
+ if (lineThroughPos != -1) {
+ styleAttrValue.append(" text-decoration : line-through;");
+ }
+ }
+ return styleAttrValue.toString();
+ }
+
+ private static String getFontFamily(Node sourceFontNode) {
+ String fontFamily = "unknown";
+ String stringName = ((Element) sourceFontNode)
+ .getAttribute(HTML.ATTR_NAME);
+ if (stringName != null) {
+ fontFamily = stringName;
+ }
+ return " font-family : " + fontFamily + ";";
+ }
+
+ private static String getSize(Node sourceFontNode) {
+ String stringSizeAttr = ((Element) sourceFontNode)
+ .getAttribute(HTML.ATTR_SIZE);
+ if (stringSizeAttr != null) {
+ try {
+ int intSize = Integer.parseInt(stringSizeAttr);
+ if (intSize < 0) {
+ return "";
+ }
+ } catch (NumberFormatException e) {
+ return "";
+ }
+ } else {
+ return "";
+ }
+ return " font-size : " + stringSizeAttr + "pt;";
+ }
+
+ public static String getAbsoluteResourcePath(String resourcePathInPlugin) {
+ String pluginPath = SeamTemplatesActivator.getPluginResourcePath();
+ IPath pluginFile = new Path(pluginPath);
+ File file = pluginFile.append(resourcePathInPlugin).toFile();
+ if (file.exists()) {
+ return file.getAbsolutePath();
+ } else {
+ throw new IllegalArgumentException("Can't get path for "
//$NON-NLS-1$
+ + resourcePathInPlugin);
+ }
+ }
+
+ public static void setImg(nsIDOMElement img, String fileImageName) {
+ img.setAttribute(HTML.ATTR_SRC, "file://" //$NON-NLS-1$
+ + getAbsoluteResourcePath(fileImageName).replace('\\',
'/'));
+ }
+
+}
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 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -5,6 +5,8 @@
prefix="s" />
<vpe:template-taglib
uri="http://jboss.com/products/seam/mail"
prefix="m" />
+ <vpe:template-taglib
uri="http://jboss.com/products/seam/pdf"
+ prefix="p" />
<vpe:tag name="s:button" case-sensitive="yes">
<!--
@@ -360,12 +362,13 @@
<vpe:tag name="m:message" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <div/>
+ <div />
</vpe:template>
</vpe:tag>
<vpe:tag name="m:body" case-sensitive="yes">
- <vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.seam.template.SeamMailBodyTemplate"/>
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamMailBodyTemplate" />
</vpe:tag>
<vpe:tag name="m:from" case-sensitive="yes">
@@ -400,4 +403,214 @@
<vpe:template children="no" modify="no" />
</vpe:tag>
+ <vpe:tag name="p:document" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfDocumentTemplate" />
+ </vpe:tag>
+
+ <vpe:tag name="p:paragraph" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:title')">
+ <vpe:template children="yes" modify="yes">
+ <span class="vpe-text" />
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfParagraphTemplate"
/>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:text" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="no"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfTextTemplate">
+ <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:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:newPage" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="no">
+ <div style="page-break-before: always;" />
+ <vpe:drop container="no" />
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:image" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:anchor" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfAnchorTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:footer" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfFooterTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:header" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:pageNumber" case-sensitive="yes">
+ <vpe:if
test="hasinparents('p:header')|hasinparents('p:footer')">
+ <vpe:template children="no" modify="no">
+ <span class="vpe-text">1</span>
+ </vpe:template>
+ <vpe:drop container="no" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:chapter" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfChapterTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:title" case-sensitive="yes">
+ <vpe:if
test="hasinparents('p:chapter')|hasinparents('p:section')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfTitleTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:section" case-sensitive="yes">
+ <vpe:if
test="hasinparents('p:chapter')|hasinparents('p:section')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfSectionTemplate">
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:table" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfTableTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:cell" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:table')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfCellTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:list" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfListTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:listItem" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:list')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfListItemTemplate"
/>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:font" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfFontTemplate" />
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:barchart" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfBarChartTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:linechart" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfLineChartTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:piechart" case-sensitive="yes">
+ <vpe:if test="hasinparents('p:document')">
+ <vpe:template children="no" modify="yes"
+ class="org.jboss.tools.jsf.vpe.seam.template.SeamPdfPieChartTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:series" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:data" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:barcode" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:color" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
+ <vpe:tag name="p:stroke" case-sensitive="yes">
+ <vpe:template children="no" modify="no" />
+ </vpe:tag>
+
</vpe:templates>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:anchor id="referenceAnchor" reference="#reason1">Reason
1</p:anchor>
+ <p:anchor id="unreferenceAnchor" name="reason1">It's the
quickest way to get "rich"</p:anchor>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/anchor.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<tests>
+ <test id="referenceAnchor">
+ <A HREF="#reason1">
+ <SPAN CLASS="vpe-text">Reason 1</SPAN>
+ </A>
+ </test>
+ <test id="unreferenceAnchor">
+ <A NAME="reason1" STYLE="color: black; text-decoration:
none;">
+ <SPAN CLASS="vpe-text">It's the quickest way to get
"rich"</SPAN>
+ </A>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document subject="subject" title="title"
author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:barchart id="barchartID1" width="508"
height="615"></p:barchart>
+ <p:barchart id="barchartID2">
+ <p:series></p:series>
+ </p:barchart>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barChart.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="barchartID1">
+ <IMG SRC="/.*resources/barChart/barChart.png/" STYLE="width: 508px;
height: 615px;" />
+ </test>
+ <test id="barchartID2">
+ <IMG SRC="/.*resources/barChart/barChartSeriesNested.png/" />
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/barCode.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:barcode id="id1">Not rendered</p:barcode>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<p:document subject="subject" title="title"
author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+ margins="50 60 70 80"
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:table headerRows="1" id="tableID">
+ <p:cell horizontalAlignment="center"
id="cellID">1</p:cell>
+ </p:table>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/cell.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,9 @@
+<tests>
+ <test id="cellID">
+ <TD ALIGN="center" STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 1
+</SPAN>
+ </TD>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,17 @@
+<p:document id="footerID" subject="subject"
title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:chapter id="chapterID1">
+ <p:title>
+ Chapter title
+ </p:title>
+ </p:chapter>
+ <p:chapter number="3" alignment="center"
id="chapterID2">
+ <p:section>
+ <p:title>
+ <p:paragraph>Section Title</p:paragraph>
+ </p:title>
+ </p:section>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/chapter.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,33 @@
+<tests>
+ <test id="chapterID1">
+ <SPAN CLASS="vpe-text">
+ <H1>
+ 1.
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ Chapter title
+</SPAN>
+ </SPAN>
+ </H1>
+ </SPAN>
+ </test>
+ <test id="chapterID2">
+ <SPAN CLASS="vpe-text">
+ <H1>
+ 3.
+</H1>
+ <SPAN CLASS="vpe-text">
+ <H2>
+ 3.1.
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify:
read-write;">
+ <SPAN CLASS="vpe-text">
+ Section Title
+</SPAN>
+ </SPAN>
+ </SPAN>
+ </H2>
+ </SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/color.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:color id="id1">Not rendered</p:color>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/data.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:data id="id1">Not rendered</p:data>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,11 @@
+<p:document id="documentID1" subject="subject"
title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ Document 1 goes here
+</p:document>
+<p:document id="documentID2" subject="subject"
title="title"
+ author="author" type="pdf" creator="creator"
pageSize="LETTER"
+ orientation="portrait"
xmlns:p="http://jboss.com/products/seam/pdf">
+ Document 2 goes here
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/document.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="documentID1">
+ <DIV STYLE="margin: 70px 60px 80px 50px;">
+ <SPAN CLASS="vpe-text">
+ Document 1 goes here
+</SPAN>
+ </DIV>
+ </test>
+ <test id="documentID2">
+ <DIV STYLE="margin: 36px;">
+ <SPAN CLASS="vpe-text">
+ Document 2 goes here
+</SPAN>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,10 @@
+<p:document id="fontID" subject="subject" title="title"
author="author"
+ type="html" creator="creator" pageSize="LETTER"
orientation="portrait"
+ margins="50 60 70 80"
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:font size="34" style="italic" name="courier">
+ <p:paragraph>
+ <p:footer alignment="center">
+ <p:pageNumber></p:pageNumber>
+ </p:footer>Paragraph Text</p:paragraph>
+ </p:font>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/font.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,19 @@
+<tests>
+ <test id="fontID">
+ <DIV STYLE="margin: 70px 60px 80px 50px;">
+ <SPAN STYLE="font-family: courier; font-size: 34pt; font-style:
italic;">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Paragraph Text
+</SPAN>
+ </DIV>
+ </SPAN>
+ <DIV ALIGN="center"
+ STYLE="font-family: courier; font-size: 34pt; font-style: italic;">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify:
read-only;">
+ 1
+</SPAN>
+ </DIV>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<p:document id="footerID" subject="subject"
title="title" author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+ margins="50 60 70 80"
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:paragraph>
+ <p:footer alignment="center">
+ <p:pageNumber></p:pageNumber>
+ </p:footer>Paragraph Text</p:paragraph>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/footer.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="footerID">
+ <DIV STYLE="margin: 70px 60px 80px 50px;">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Paragraph Text
+</SPAN>
+ </DIV>
+ <DIV ALIGN="center">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify:
read-only;">
+ 1
+</SPAN>
+ </DIV>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/header.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:header id="id1">Not rendered</p:header>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/image.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:image id="id1">Not rendered</p:image>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document subject="subject" title="title"
author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:linechart id="linechartID1" width="508"
height="615"></p:linechart>
+ <p:linechart id="linechartID2">
+ <p:series></p:series>
+ </p:linechart>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/lineChart.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="linechartID1">
+ <IMG SRC="/.*resources/lineChart/lineChart.png/" STYLE="width: 508px;
height: 615px;" />
+ </test>
+ <test id="linechartID2">
+ <IMG SRC="/.*resources/lineChart/lineChartSeriesNested.png/" />
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,20 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait"
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:list style="numbered" id="listID1">
+ <p:listItem>Item 1</p:listItem>
+ <p:listItem>Item 2</p:listItem>
+ <p:listItem>Item 3</p:listItem>
+ <p:listItem>Item 4</p:listItem>
+ </p:list>
+ <p:list id="listID2">
+ <p:listItem>Item 1</p:listItem>
+ <p:listItem>Item 2</p:listItem>
+ <p:listItem>Item 3</p:listItem>
+ <p:listItem>Item 4</p:listItem>
+ </p:list>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/list.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,50 @@
+<tests>
+ <test id="listID1">
+ <OL>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 1
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 2
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 3
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 4
+</SPAN>
+ </LI>
+ </OL>
+ </test>
+ <test id="listID2">
+ <UL>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 1
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 2
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 3
+</SPAN>
+ </LI>
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 4
+</SPAN>
+ </LI>
+ </UL>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,11 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait"
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:list style="numbered">
+ <p:listItem id="listItemID1">Item 1</p:listItem>
+ </p:list>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/listItem.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,9 @@
+<tests>
+ <test id="listItemID1">
+ <LI>
+ <SPAN CLASS="vpe-text">
+ Item 1
+</SPAN>
+ </LI>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,10 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait"
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:newPage id="newPageID">
+ </p:newPage>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/newPage.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<tests>
+ <test id="newPageID">
+ <DIV STYLE="page-break-before: always; -moz-user-modify: read-only;">
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<p:document id="footerID" subject="subject"
title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:footer alignment="center">
+ <p:pageNumber id="pageNumberID"></p:pageNumber>
+ </p:footer>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pageNumber.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="pageNumberID">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+ 1
+</SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait"
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:paragraph id="paragraphID1">
+ <p:text value="Paragraph"></p:text>
+ </p:paragraph>
+ <p:chapter>
+ <p:title>
+ <p:paragraph id="paragraphID2">Paragraph inside
title</p:paragraph>
+ </p:title>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/paragraph.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="paragraphID1">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Paragraph
+</SPAN>
+ </DIV>
+ </test>
+ <test id="paragraphID2">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify:
read-write;">
+ <SPAN CLASS="vpe-text">
+ Paragraph inside title
+</SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document subject="subject" title="title"
author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:piechart id="piechartID1" width="508"
height="615"></p:piechart>
+ <p:piechart id="piechartID2">
+ <p:series></p:series>
+ </p:piechart>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/pieChart.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,8 @@
+<tests>
+ <test id="piechartID1">
+ <IMG SRC="/.*resources/pieChart/pieChart.png/" STYLE="width: 508px;
height: 615px;" />
+ </test>
+ <test id="piechartID1">
+ <IMG SRC="/.*resources/pieChart/pieChartSeriesNested.png/" />
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,12 @@
+<p:document id="footerID" subject="subject"
title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:chapter number="3" alignment="center">
+ <p:section id="sectionID">
+ <p:title>
+ <p:paragraph>Section Title</p:paragraph>
+ </p:title>
+ </p:section>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/section.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,16 @@
+<tests>
+ <test id="sectionID">
+ <SPAN CLASS="vpe-text">
+ <H2>
+ 3.1.
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify:
read-write;">
+ <SPAN CLASS="vpe-text">
+ Section Title
+</SPAN>
+ </SPAN>
+ </SPAN>
+ </H2>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/series.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:series id="id1">Not rendered</p:series>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/stroke.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,6 @@
+<p:document subject="subject" title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:stroke id="id1">Not rendered</p:stroke>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,15 @@
+<p:document subject="subject" title="title"
author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+ margins="50 60 70 80"
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:table columns="3" headerRows="1" id="tableID">
+ <p:cell>1</p:cell>
+ <p:cell>2</p:cell>
+ <p:cell>3</p:cell>
+ <p:cell>4</p:cell>
+ <p:cell colspan="2">5</p:cell>
+ <p:cell>6</p:cell>
+ <p:cell colspan="2">7</p:cell>
+ <p:cell>8</p:cell>
+ <p:cell>9</p:cell>
+ </p:table>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/table.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,49 @@
+<tests>
+ <test id="tableID">
+ <DIV>
+ <TABLE WIDTH="100%" CELLSPACING="0px"
ALIGN="center">
+ <TR>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 1
+</SPAN>
+ </TD>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 2
+</SPAN>
+ </TD>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 3
+</SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 4
+</SPAN>
+ </TD>
+ <TD COLSPAN="2" STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 5
+</SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 6
+</SPAN>
+ </TD>
+ <TD COLSPAN="2" STYLE="border: 2px solid black;">
+ <SPAN CLASS="vpe-text">
+ 7
+</SPAN>
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,11 @@
+<p:document subject="subject" title="title"
author="author" type="html"
+ creator="creator" pageSize="LETTER"
orientation="portrait"
+
xmlns:p="http://jboss.com/products/seam/pdf"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <p:paragraph>
+ <p:text value="Text value" id="textID"></p:text>
+ </p:paragraph>
+</p:document>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/text.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="textID">
+ <SPAN CLASS="vpe-text">
+ Text value
+</SPAN>
+ </test>
+</tests>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,17 @@
+<p:document id="footerID" subject="subject"
title="title"
+ author="author" type="html" creator="creator"
pageSize="LETTER"
+ orientation="portrait" margins="50 60 70 80"
+
xmlns:p="http://jboss.com/products/seam/pdf">
+ <p:chapter>
+ <p:title id="titleID1">
+ Chapter title
+ </p:title>
+ </p:chapter>
+ <p:chapter number="3" alignment="center"
id="chapterID2">
+ <p:section>
+ <p:title id="titleID2">
+ <p:paragraph>Section Title</p:paragraph>
+ </p:title>
+ </p:section>
+ </p:chapter>
+</p:document>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/resources/SeamTest/WebContent/pages/components/pdf/title.xhtml.xml 2009-11-27
16:29:12 UTC (rev 18888)
@@ -0,0 +1,18 @@
+<tests>
+ <test id="titleID1">
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text">
+ Chapter title
+</SPAN>
+ </SPAN>
+ </test>
+ <test id="titleID2">
+ <SPAN CLASS="vpe-text">
+ <SPAN CLASS="vpe-text" STYLE="-moz-user-modify:
read-write;">
+ <SPAN CLASS="vpe-text">
+ Section Title
+</SPAN>
+ </SPAN>
+ </SPAN>
+ </test>
+</tests>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamComponentContentTest.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -125,47 +125,145 @@
public void testTaskId() throws Throwable {
performInvisibleTagTest("components/taskId.xhtml", "id1");
//$NON-NLS-1$ //$NON-NLS-2$
}
-
- //mail components
-
- public void testMailMessage() throws Throwable{
+
+ // mail components
+
+ public void testMailMessage() throws Throwable {
performContentTest("components/mail/message.xhtml");
}
-
- public void testMailBody() throws Throwable{
+
+ public void testMailBody() throws Throwable {
performContentTest("components/mail/body.xhtml");
}
-
- public void testMailFrom() throws Throwable{
+
+ public void testMailFrom() throws Throwable {
performInvisibleTagTest("components/mail/from.xhtml", "id1");
}
-
- public void testMailTo() throws Throwable{
+
+ public void testMailTo() throws Throwable {
performInvisibleTagTest("components/mail/to.xhtml", "id1");
}
-
- public void testMailSubject() throws Throwable{
+
+ public void testMailSubject() throws Throwable {
performInvisibleTagTest("components/mail/subject.xhtml", "id1");
}
-
- public void testMailAttachment() throws Throwable{
+
+ public void testMailAttachment() throws Throwable {
performInvisibleTagTest("components/mail/attachment.xhtml",
"id1");
}
-
- public void testMailBcc() throws Throwable{
+
+ public void testMailBcc() throws Throwable {
performInvisibleTagTest("components/mail/bcc.xhtml", "id1");
}
-
- public void testMailCc() throws Throwable{
+
+ public void testMailCc() throws Throwable {
performInvisibleTagTest("components/mail/cc.xhtml", "id1");
}
-
- public void testMailHeader() throws Throwable{
+
+ public void testMailHeader() throws Throwable {
performInvisibleTagTest("components/mail/header.xhtml", "id1");
}
-
- public void testMailReplyTo() throws Throwable{
+
+ public void testMailReplyTo() throws Throwable {
performInvisibleTagTest("components/mail/replyTo.xhtml", "id1");
}
-
+
+ // pdf components
+
+ public void testPdfDocument() throws Throwable {
+ performContentTest("components/pdf/document.xhtml");
+ }
+
+ public void testPdfParagraph() throws Throwable {
+ performContentTest("components/pdf/paragraph.xhtml");
+ }
+
+ public void testPdfText() throws Throwable {
+ performContentTest("components/pdf/text.xhtml");
+ }
+
+ public void testPdfFont() throws Throwable {
+ performContentTest("components/pdf/font.xhtml");
+ }
+
+ public void testPdfNewPage() throws Throwable {
+ performContentTest("components/pdf/newPage.xhtml");
+ }
+
+ public void testPdfImage() throws Throwable {
+ performInvisibleTagTest("components/pdf/image.xhtml", "id1");
+ }
+
+ public void testPdfAnchor() throws Throwable {
+ performContentTest("components/pdf/anchor.xhtml");
+ }
+
+ public void testPdfHeader() throws Throwable {
+ performInvisibleTagTest("components/pdf/header.xhtml", "id1");
+ }
+
+ public void testPdfFooter() throws Throwable {
+ performContentTest("components/pdf/footer.xhtml");
+ }
+
+ public void testPdfPageNumber() throws Throwable {
+ performContentTest("components/pdf/pageNumber.xhtml");
+ }
+
+ public void testPdfChapter() throws Throwable {
+ performContentTest("components/pdf/chapter.xhtml");
+ }
+
+ public void testPdfSection() throws Throwable {
+ performContentTest("components/pdf/section.xhtml");
+ }
+
+ public void testPdfList() throws Throwable {
+ performContentTest("components/pdf/list.xhtml");
+ }
+
+ public void testPdfListItem() throws Throwable {
+ performContentTest("components/pdf/listItem.xhtml");
+ }
+
+ public void testPdfTable() throws Throwable {
+ performContentTest("components/pdf/table.xhtml");
+ }
+
+ public void testPdfCell() throws Throwable {
+ performContentTest("components/pdf/cell.xhtml");
+ }
+
+ public void testPdfBarChart() throws Throwable {
+ performContentTest("components/pdf/barChart.xhtml");
+ }
+
+ public void testPdfLineChart() throws Throwable {
+ performContentTest("components/pdf/lineChart.xhtml");
+ }
+
+ public void testPdfPieChart() throws Throwable {
+ performContentTest("components/pdf/pieChart.xhtml");
+ }
+
+ public void testPdfSeries() throws Throwable {
+ performInvisibleTagTest("components/pdf/series.xhtml", "id1");
+ }
+
+ public void testPdfData() throws Throwable {
+ performInvisibleTagTest("components/pdf/data.xhtml", "id1");
+ }
+
+ public void testPdfColor() throws Throwable {
+ performInvisibleTagTest("components/pdf/color.xhtml", "id1");
+ }
+
+ public void testPdfStroke() throws Throwable {
+ performInvisibleTagTest("components/pdf/stroke.xhtml", "id1");
+ }
+
+ public void testPdfBarCode() throws Throwable {
+ performInvisibleTagTest("components/pdf/barCode.xhtml", "id1");
+ }
+
}
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 2009-11-27
16:22:04 UTC (rev 18887)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2009-11-27
16:29:12 UTC (rev 18888)
@@ -60,6 +60,11 @@
public static final String TAG_LABEL = "label"; //$NON-NLS-1$
public static final String TAG_A = "a"; //$NON-NLS-1$
public static final String TAG_H1 = "h1"; //$NON-NLS-1$
+ public static final String TAG_H2 = "h2"; //$NON-NLS-1$
+ public static final String TAG_H3 = "h3"; //$NON-NLS-1$
+ public static final String TAG_H4 = "h4"; //$NON-NLS-1$
+ public static final String TAG_H5 = "h5"; //$NON-NLS-1$
+ public static final String TAG_H6 = "h6"; //$NON-NLS-1$
public static final String TAG_FORM = "form"; //$NON-NLS-1$
/**Use this class if you want to wrap a text node in a span that
@@ -118,6 +123,7 @@
public static final String VALUE_ALIGN_BOTTOM = "bottom"; //$NON-NLS-1$
public static final String VALUE_ALIGN_MIDDLE = "middle"; //$NON-NLS-1$
public static final String VALUE_ALIGN_CENTER = "center"; //$NON-NLS-1$
+ public static final String VALUE_ALIGN_JUSTIFY = "justify"; //$NON-NLS-1$
public static final String VALUE_CLASS_DELIMITER = " "; //$NON-NLS-1$
public static final String VALUE_STYLE_DELIMITER = ";"; //$NON-NLS-1$
public static final String VALUE_TYPE_TEXT = "text"; //$NON-NLS-1$