Author: yzhishko
Date: 2009-12-09 08:56:08 -0500 (Wed, 09 Dec 2009)
New Revision: 19155
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractChapterTemplate.java
Modified:
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/SeamPdfFooterTemplate.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/SeamPdfTitleTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5415 fixed
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractChapterTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractChapterTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfAbstractChapterTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.mozilla.interfaces.nsIDOMNodeList;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public abstract class SeamPdfAbstractChapterTemplate extends
+ SeamPdfAbstractTemplate {
+
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ setTitle(pageContext, (Element) sourceNode, data);
+ }
+
+ private void setTitle(VpePageContext pageContext, Element sourceElement,
+ VpeCreationData data) {
+ nsIDOMNode visualTitleNode = getTitleForVisualNode(data.getNode());
+ if (visualTitleNode != null) {
+ nsIDOMElement headElement = getHeadElement(data);
+ nsIDOMNode parentNode = visualTitleNode.getParentNode();
+ if (parentNode != null) {
+ parentNode.removeChild(visualTitleNode);
+ headElement.appendChild(visualTitleNode);
+ }
+ }
+ }
+
+ private nsIDOMNode getTitleForVisualNode(nsIDOMNode visualNode) {
+ if (visualNode == null) {
+ return null;
+ }
+ nsIDOMNodeList children = visualNode.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ nsIDOMNode child = children.item(i);
+ if (HTML.TAG_SPAN.equalsIgnoreCase(child.getNodeName())) {
+ nsIDOMElement childElement = (nsIDOMElement) child
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ String attrType = childElement
+ .getAttribute(SeamUtil.SEAM_ATTR_TYPE_ID);
+ if (attrType != null
+ && SeamUtil.SEAM_ATTR_TYPE_ID_VALUE_PDF_TITLE
+ .equalsIgnoreCase(attrType)) {
+ return child;
+ }
+ }
+ }
+ return null;
+ }
+
+ protected abstract nsIDOMElement getHeadElement(VpeCreationData data);
+
+}
Modified:
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 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfChapterTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -25,16 +25,14 @@
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 {
+public class SeamPdfChapterTemplate extends SeamPdfAbstractChapterTemplate {
private static final String NUMBER = "number"; //$NON-NLS-1$
private nsIDOMElement visualElement;
private Element sourceElement;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
sourceElement = (Element) sourceNode;
@@ -57,33 +55,8 @@
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")) { //$NON-NLS-1$
- 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) {
+ @Override
+ protected nsIDOMElement getHeadElement(VpeCreationData data) {
nsIDOMNode visualNode = data.getNode();
nsIDOMNodeList children = visualNode.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
@@ -98,10 +71,4 @@
return null;
}
- @Override
- public void validate(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument, VpeCreationData data) {
- setTitle(pageContext, (Element) sourceNode, data);
- }
-
}
Modified:
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 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfDocumentTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -14,6 +14,9 @@
* @author yzhishko
*/
+import java.util.ArrayList;
+import java.util.List;
+
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;
@@ -21,6 +24,7 @@
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -29,7 +33,6 @@
private nsIDOMElement headElement;
private Element sourceElement;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
nsIDOMNode headNode = visualDocument.createElement(HTML.TAG_DIV);
@@ -45,7 +48,7 @@
return false;
}
headElement.removeAttribute("style"); //$NON-NLS-1$
- headElement.setAttribute("style", "margin-left:"
//$NON-NLS-1$//$NON-NLS-2$
+ headElement.setAttribute("style", "margin-left:"
//$NON-NLS-1$//$NON-NLS-2$
+ Float.toString(marginValues[0]) + ";margin-right:" //$NON-NLS-1$
+ Float.toString(marginValues[1]) + ";margin-top:" //$NON-NLS-1$
+ Float.toString(marginValues[2]) + ";margin-bottom:" //$NON-NLS-1$
@@ -92,21 +95,20 @@
private void setFooter(VpePageContext pageContext, Node sourceNode,
VpeCreationData data) {
- Node[] footers = SeamUtil.getChildsByName(pageContext, sourceNode,
- "p:footer"); //$NON-NLS-1$
- nsIDOMNode visualFooter = null;
- if (footers != null && footers.length != 0) {
- visualFooter = pageContext.getDomMapping().getVisualNode(
- footers[footers.length - 1]);
-
+ nsIDOMNode[] footers = findFootersForVisualDoc((nsIDOMElement) data
+ .getNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+ int footersLength = footers.length;
+ if (footersLength == 0) {
+ return;
}
+ nsIDOMNode visualFooter = footers[footersLength-1];
if (visualFooter != null) {
for (int i = 0; i < footers.length; i++) {
- nsIDOMNode visualFootersRepresent = pageContext.getDomMapping()
- .getVisualNode(footers[i]);
+ nsIDOMNode visualFootersRepresent = footers[i];
if (visualFootersRepresent != null
&& visualFootersRepresent != visualFooter) {
- nsIDOMNode parentNode = visualFootersRepresent.getParentNode();
+ nsIDOMNode parentNode = visualFootersRepresent
+ .getParentNode();
parentNode.removeChild(visualFootersRepresent);
}
}
@@ -117,4 +119,23 @@
}
}
}
+
+ private nsIDOMNode[] findFootersForVisualDoc(nsIDOMElement visualElement) {
+ nsIDOMNodeList children = visualElement
+ .getElementsByTagName(HTML.TAG_DIV);
+ List<nsIDOMElement> childrenElements = new ArrayList<nsIDOMElement>();
+ for (int i = 0; i < children.getLength(); i++) {
+ nsIDOMElement childElement = (nsIDOMElement) children.item(i)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ String attrType = childElement
+ .getAttribute(SeamUtil.SEAM_ATTR_TYPE_ID);
+ if (attrType != null
+ && SeamUtil.SEAM_ATTR_TYPE_ID_VALUE_PDF_FOOTER
+ .equalsIgnoreCase(attrType)) {
+ childrenElements.add(childElement);
+ }
+ }
+ return childrenElements.toArray(new nsIDOMElement[0]);
+ }
+
}
Modified:
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 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfFooterTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -29,7 +29,6 @@
private nsIDOMElement visualElement;
private Element sourceElement;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
sourceElement = (Element) sourceNode;
@@ -43,6 +42,8 @@
if (styleAttr != null && !"".equals(styleAttr)) { //$NON-NLS-1$
visualElement.setAttribute(HTML.ATTR_STYLE, styleAttr);
}
+ visualElement.setAttribute(SeamUtil.SEAM_ATTR_TYPE_ID,
+ SeamUtil.SEAM_ATTR_TYPE_ID_VALUE_PDF_FOOTER);
return new VpeCreationData(visualElement);
}
Modified:
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 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfSectionTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -30,14 +30,13 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-public class SeamPdfSectionTemplate extends SeamPdfAbstractTemplate {
+public class SeamPdfSectionTemplate extends SeamPdfAbstractChapterTemplate {
private nsIDOMElement visualElement;
private Element sourceElement;
private String sectionNumberString;
private String headNameString;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
visualElement = VisualDomUtil.createBorderlessContainer(visualDocument);
@@ -135,33 +134,8 @@
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")) { //$NON-NLS-1$
- 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) {
+ @Override
+ protected nsIDOMElement getHeadElement(VpeCreationData data) {
nsIDOMNode visualNode = data.getNode();
nsIDOMNodeList children = visualNode.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
@@ -181,10 +155,4 @@
return null;
}
- @Override
- public void validate(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument, VpeCreationData data) {
- setTitle(pageContext, (Element) sourceNode, data);
- }
-
}
Modified:
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 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTableTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -14,6 +14,7 @@
* @author yzhishko
*/
+import java.util.ArrayList;
import java.util.List;
import org.jboss.tools.jsf.vpe.seam.template.util.SeamUtil;
@@ -24,6 +25,7 @@
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -90,35 +92,22 @@
private void setColumns(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data) {
int numberOfColumns = getNumberOfColumns(sourceNode);
- List<VpeChildrenInfo> cellsList = data.getChildrenInfoList();
- if (cellsList == null) {
+ nsIDOMNode visualTable = ((nsIDOMElement) data.getNode()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
+ .getElementsByTagName(HTML.TAG_TABLE).item(0);
+ nsIDOMNode[] visualCells = getCells(data.getNode());
+ if (visualCells == null) {
return;
}
- VpeChildrenInfo childrenInfo = cellsList.get(0);
- List<Node> children = childrenInfo.getSourceChildren();
- if (children == null) {
+ int cellsLength = visualCells.length;
+ if (cellsLength == 0) {
return;
}
- Node[] cells = children.toArray(new Element[0]);
- 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);
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 visualCell = visualCells[i];
nsIDOMNode parentNode = null;
if (visualCell != null) {
parentNode = visualCell.getParentNode();
@@ -141,8 +130,7 @@
} else {
for (int j = 0; j < numberOfColumns - (colspanValue); j++) {
i++;
- visualCell = pageContext.getDomMapping()
- .getVisualNode(cells[i]);
+ visualCell = visualCells[i];
trVisualNode.appendChild(visualCell);
}
i -= numberOfColumns - (colspanValue);
@@ -216,4 +204,22 @@
return colspan;
}
+ private nsIDOMNode[] getCells(nsIDOMNode visualTable) {
+ nsIDOMNodeList children = visualTable.getChildNodes();
+ if (children == null) {
+ return null;
+ }
+ List<nsIDOMElement> childrenList = new ArrayList<nsIDOMElement>();
+ for (int i = 0; i < children.getLength(); i++) {
+ nsIDOMNode child = children.item(i);
+ if (child.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
+ if ("TD".equals(child.getNodeName())) { //$NON-NLS-1$
+ childrenList.add((nsIDOMElement) child
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+ }
+ }
+ }
+ return childrenList.toArray(new nsIDOMElement[0]);
+ }
+
}
Modified:
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 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/SeamPdfTitleTemplate.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -10,20 +10,23 @@
******************************************************************************/
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.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Node;
public class SeamPdfTitleTemplate extends SeamPdfAbstractTemplate {
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- nsIDOMNode visualNode = VisualDomUtil.createBorderlessContainer(visualDocument);
- return new VpeCreationData(visualNode);
+ nsIDOMElement visualElement = VisualDomUtil
+ .createBorderlessContainer(visualDocument);
+ visualElement.setAttribute(SeamUtil.SEAM_ATTR_TYPE_ID,
+ SeamUtil.SEAM_ATTR_TYPE_ID_VALUE_PDF_TITLE);
+ return new VpeCreationData(visualElement);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-12-09
13:55:11 UTC (rev 19154)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/template/util/SeamUtil.java 2009-12-09
13:56:08 UTC (rev 19155)
@@ -40,13 +40,16 @@
public static final String ATTR_URL = "url"; //$NON-NLS-1$
public final static String SEAM_ATTR_MARGINS = "margins"; //$NON-NLS-1$
public final static String[] POSSIBLE_ALIGNS = new String[] { "left",
//$NON-NLS-1$
- "right", "center", "justify", "justifyall" };
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
+ "right", "center", "justify", "justifyall" };
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
public final static String SEAM_ATTR_ALIGNMENT = "alignment"; //$NON-NLS-1$
public final static String SEAM_DIV_BASIC_STYLE_VALUE = "line-height: 142.0pt;
font-family: unknown;"; //$NON-NLS-1$
public final static String SEAM_SPAN_BASIC_STYLE_VALUE = "font-family:
unknown;"; //$NON-NLS-1$
public final static String SEAM_ATTR_HORIZONAL_ALIGNMENT =
"horizontalAlignment"; //$NON-NLS-1$
public final static String SEAM_ATTR_VERTICAL_ALIGNMENT = "verticalAlignment";
//$NON-NLS-1$
public final static String SEAM_ATTR_WIDTH_PERCENTAGE = "widthPercentage";
//$NON-NLS-1$
+ public final static String SEAM_ATTR_TYPE_ID_VALUE_PDF_TITLE = "pdf-title";
//$NON-NLS-1$
+ public final static String SEAM_ATTR_TYPE_ID = "TYPEID"; //$NON-NLS-1$
+ public final static String SEAM_ATTR_TYPE_ID_VALUE_PDF_FOOTER = "pdf-footer";
//$NON-NLS-1$
public static Node getParentByName(VpePageContext pageContext,
Node sourceNode, String parentName) {
@@ -55,8 +58,8 @@
while (parentNode != null) {
String parentSourcePrefix = parentNode.getPrefix();
- if(parentSourcePrefix==null) {
- parentSourcePrefix=""; //$NON-NLS-1$
+ if (parentSourcePrefix == null) {
+ parentSourcePrefix = ""; //$NON-NLS-1$
}
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(parentNode,
pageContext);
@@ -110,8 +113,8 @@
for (int i = 0; i < children.getLength(); i++) {
Node childNode = children.item(i);
String childSourcePrefix = childNode.getPrefix();
- if(childSourcePrefix==null) {
- childSourcePrefix=""; //$NON-NLS-1$
+ if (childSourcePrefix == null) {
+ childSourcePrefix = ""; //$NON-NLS-1$
}
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(childNode,
pageContext);
@@ -208,22 +211,22 @@
}
return " font-size : " + stringSizeAttr + "pt;"; //$NON-NLS-1$
//$NON-NLS-2$
}
-
- 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('\\',
'/'));
- }
-
+
+ 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('\\', '/'));
+ }
+
}