Author: dmaliarevich
Date: 2008-11-05 04:59:06 -0500 (Wed, 05 Nov 2008)
New Revision: 11518
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFPageTemplate.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-3020,
https://jira.jboss.org/jira/browse/JBIDE-3039,
https://jira.jboss.org/jira/browse/JBIDE-3036, templates were added.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/META-INF/MANIFEST.MF 2008-11-05
09:58:32 UTC (rev 11517)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/META-INF/MANIFEST.MF 2008-11-05
09:59:06 UTC (rev 11518)
@@ -6,9 +6,10 @@
Bundle-Version: 2.1.0
Bundle-Localization: plugin
Require-Bundle: org.jboss.tools.vpe,
- org.eclipse.ui,
+ org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.jst.jsp,
- org.mozilla.xpcom
+ org.mozilla.xpcom,
+ org.jboss.tools.jsf.vpe.richfaces;bundle-version="2.1.0"
Eclipse-LazyStart: true
Bundle-Vendor: Red Hat, Inc.
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFPageTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFPageTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFPageTemplate.java 2008-11-05
09:59:06 UTC (rev 11518)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.ajax4jsf.template;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+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 Ajax4JSFPageTemplate extends VpeAbstractTemplate {
+
+ private static final String HEAD_FACET_NAME = "head"; //$NON-NLS-1$
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+ nsIDOMElement divHtml = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMElement divHead = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMElement divBody = visualDocument.createElement(HTML.TAG_DIV);
+ VpeCreationData creationData = new VpeCreationData(divHtml);
+
+ /*
+ * Encoding label value
+ */
+ Element headFacet = ComponentUtil.getFacet(sourceElement,
+ HEAD_FACET_NAME);
+ if (null != headFacet) {
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(divHead);
+ childrenInfo.addSourceChild(headFacet);
+ divHtml.appendChild(divHead);
+ creationData.addChildrenInfo(childrenInfo);
+ }
+
+ VpeChildrenInfo divBodyInfo = new VpeChildrenInfo(divBody);
+ creationData.addChildrenInfo(divBodyInfo);
+ divHtml.appendChild(divBody);
+ for (Node child : ComponentUtil.getChildren(sourceElement, true)) {
+ divBodyInfo.addSourceChild(child);
+ }
+
+ return creationData;
+ }
+
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFPageTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-11-05
09:58:32 UTC (rev 11517)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-11-05
09:59:06 UTC (rev 11518)
@@ -5,8 +5,8 @@
<vpe:template-taglib
uri="http://richfaces.org/a4j" prefix="a4j"
/>
<vpe:tag name="a4j:page" case-sensitive="yes">
- <vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id,style,dir"/>
+ <vpe:template children="yes" modify="yes"
hasImaginaryBorder="yes"
+ class="org.jboss.tools.jsf.vpe.ajax4jsf.template.Ajax4JSFPageTemplate">
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
@@ -20,7 +20,8 @@
<vpe:tag name="a4j:region" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id"/>
+ <div id="{@id}" class="{@styleClass}"
style="{@style}" title="{tagstring()}">
+ </div>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
@@ -182,7 +183,8 @@
<vpe:tag name="a4j:form" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id"/>
+ <div id="{@id}" class="{@styleClass}"
style="{@style}" title="{tagstring()}">
+ </div>
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes" />