Author: svasilyev
Date: 2007-10-16 12:22:23 -0400 (Tue, 16 Oct 2007)
New Revision: 4255
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDecorateTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeInsertTemplate.java
Log:
Sync with jbosstools_xulrunner branch
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/META-INF/MANIFEST.MF 2007-10-16
16:22:13 UTC (rev 4254)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/META-INF/MANIFEST.MF 2007-10-16
16:22:23 UTC (rev 4255)
@@ -12,7 +12,8 @@
org.jboss.tools.common,
org.jboss.tools.vpe,
org.eclipse.core.resources,
- org.jboss.tools.jst.jsp
+ org.jboss.tools.jst.jsp,
+ org.mozilla.xpcom
Export-Package: org.jboss.tools.jsf.vpe.facelets
Bundle-Version: 2.0.0
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java 2007-10-16
16:22:13 UTC (rev 4254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java 2007-10-16
16:22:23 UTC (rev 4255)
@@ -10,23 +10,24 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.template;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
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 VpeCompositionTemplate extends VpeDefineContainerTemplate {
- protected VpeCreationData createStub(String fileName, Node sourceElement, Document
visualDocument) {
- Element container = visualDocument.createElement("div");
+ protected VpeCreationData createStub(String fileName, Node sourceElement, nsIDOMDocument
visualDocument) {
+ nsIDOMElement container = visualDocument.createElement(HTML.TAG_DIV);
container.setAttribute("style", "border: 1px dashed #2A7F00");
VpeVisualDomBuilder.markIncludeElement(container);
- Element title = visualDocument.createElement("div");
- Element tag = visualDocument.createElement("span");
+ nsIDOMElement title = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMElement tag = visualDocument.createElement(HTML.TAG_SPAN);
tag.setAttribute("class", "__any__tag__caption");
tag.appendChild(visualDocument.createTextNode(sourceElement.getNodeName()));
title.appendChild(tag);
@@ -37,8 +38,8 @@
return new VpeCreationData(container);
}
-
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement,
Document visualDocument, Node visualNode, Object data, String name, String value) {
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument,nsIDOMElement visualNode, Object data, String name, String
value) {
return true;
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDecorateTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDecorateTemplate.java 2007-10-16
16:22:13 UTC (rev 4254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDecorateTemplate.java 2007-10-16
16:22:23 UTC (rev 4255)
@@ -10,24 +10,24 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.template;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
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.Node;
+import org.w3c.dom.NodeList;
public class VpeDecorateTemplate extends VpeDefineContainerTemplate {
- protected VpeCreationData createStub(String fileName, Node sourceElement, Document
visualDocument) {
- Element container = visualDocument.createElement("div");
+ protected VpeCreationData createStub(String fileName, Node sourceElement, nsIDOMDocument
visualDocument) {
+ nsIDOMElement container = visualDocument.createElement(HTML.TAG_DIV);
container.setAttribute("style", "border: 1px dashed #2A7F00");
VpeVisualDomBuilder.markIncludeElement(container);
- Element title = visualDocument.createElement("div");
- Element tag = visualDocument.createElement("span");
+ nsIDOMElement title = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMElement tag = visualDocument.createElement(HTML.TAG_SPAN);
tag.setAttribute("class", "__any__tag__caption");
tag.appendChild(visualDocument.createTextNode(sourceElement.getNodeName()));
title.appendChild(tag);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java 2007-10-16
16:22:13 UTC (rev 4254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineContainerTemplate.java 2007-10-16
16:22:23 UTC (rev 4255)
@@ -12,14 +12,12 @@
import java.util.HashSet;
import java.util.Set;
-
import org.eclipse.core.resources.IFile;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
import org.jboss.tools.vpe.editor.VpeIncludeInfo;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -30,11 +28,15 @@
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.template.VpeTemplate;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
public abstract class VpeDefineContainerTemplate extends VpeAbstractTemplate {
private static final String ATTR_TEMPLATE = "template";
- private static Set defineContainer = new HashSet();
+ private static Set<Node> defineContainer = new HashSet<Node>();
+ @Override
protected void init(Element templateElement) {
children = true;
modify = false;
@@ -42,7 +44,7 @@
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document
visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
String fileName = null;
Attr attr = ((Element)sourceNode).getAttributeNode(ATTR_TEMPLATE);
if (attr != null && attr.getNodeValue().trim().length() > 0) {
@@ -64,8 +66,8 @@
creationData.setData(null);
return creationData;
}
-
- public void validate(VpePageContext pageContext, Node sourceNode, Document
visualDocument, VpeCreationData creationData) {
+ @Override
+ public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument
visualDocument, VpeCreationData creationData) {
TemplateFileInfo templateFileInfo = (TemplateFileInfo)creationData.getData();
if (templateFileInfo != null) {
VpeIncludeInfo includeInfo = pageContext.getVisualBuilder().popIncludeStack();
@@ -82,8 +84,9 @@
pageContext.getEditPart().getController().getIncludeList().removeIncludeModel(templateFileInfo.templateFile);
}
}
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement visualNode, Object data, String name, String
value) {
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement,
Document visualDocument, Node visualNode, Object data, String name, String value) {
return true;
}
@@ -106,8 +109,8 @@
}
}
- private VpeCreationData createInclude(Document sourceDocument, Document visualDocument)
{
- Element visualNewElement = visualDocument.createElement("div");
+ private VpeCreationData createInclude(Document sourceDocument, nsIDOMDocument
visualDocument) {
+ nsIDOMElement visualNewElement = visualDocument.createElement(HTML.TAG_DIV);
VpeVisualDomBuilder.markIncludeElement(visualNewElement);
VpeCreationData creationData = new VpeCreationData(visualNewElement);
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(visualNewElement);
@@ -119,7 +122,7 @@
creationData.addChildrenInfo(childrenInfo);
return creationData;
}
-
+ @Override
public boolean containsText() {
return false;
}
@@ -129,7 +132,7 @@
}
- protected abstract VpeCreationData createStub(String fileName, Node sourceElement,
Document visualDocument);
+ protected abstract VpeCreationData createStub(String fileName, Node sourceElement,
nsIDOMDocument visualDocument);
static class TemplateFileInfo {
IFile templateFile;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2007-10-16
16:22:13 UTC (rev 4254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeDefineTemplate.java 2007-10-16
16:22:23 UTC (rev 4255)
@@ -10,16 +10,16 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.template;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+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.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
-import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
-import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
-
public class VpeDefineTemplate extends VpeAbstractTemplate {
protected void init(Element templateElement) {
@@ -28,9 +28,9 @@
initTemplateSections(templateElement, true, true, true, true, true);
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document
visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
if (VpeDefineContainerTemplate.isDefineContainer(sourceNode.getParentNode())) {
- Element visualNewElement = visualDocument.createElement("div");
+ nsIDOMElement visualNewElement = visualDocument.createElement(HTML.TAG_DIV);
return new VpeCreationData(visualNewElement);
}
return createStub((Element)sourceNode, visualDocument);
@@ -44,12 +44,12 @@
return true;
}
- private VpeCreationData createStub(Element sourceElement, Document visualDocument) {
- Element container = visualDocument.createElement("div");
+ private VpeCreationData createStub(Element sourceElement, nsIDOMDocument visualDocument)
{
+ nsIDOMElement container = visualDocument.createElement(HTML.TAG_DIV);
container.setAttribute("style", "border: 1px solid gray");
- Element title = visualDocument.createElement("div");
- Element tag = visualDocument.createElement("span");
+ nsIDOMElement title = visualDocument.createElement(HTML.TAG_DIV);
+ nsIDOMElement tag = visualDocument.createElement(HTML.TAG_SPAN);
tag.setAttribute("class", "__any__tag__caption");
tag.appendChild(visualDocument.createTextNode(sourceElement.getNodeName()));
title.appendChild(tag);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeInsertTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeInsertTemplate.java 2007-10-16
16:22:13 UTC (rev 4254)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeInsertTemplate.java 2007-10-16
16:22:23 UTC (rev 4255)
@@ -10,17 +10,19 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.facelets.template;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
import org.jboss.tools.vpe.editor.VpeIncludeInfo;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
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.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
public class VpeInsertTemplate extends VpeAbstractTemplate {
@@ -30,7 +32,7 @@
initTemplateSections(templateElement, false, true, false, false, false);
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document
visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
VpeVisualDomBuilder visualBuilder = pageContext.getVisualBuilder();
VpeIncludeInfo includeInfo = visualBuilder.getCurrentIncludeInfo();
if (includeInfo != null && includeInfo.getElement() != null) {
@@ -53,7 +55,7 @@
return creationData;
}
- public void validate(VpePageContext pageContext, Node sourceNode, Document
visualDocument, VpeCreationData creationData) {
+ public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument
visualDocument, VpeCreationData creationData) {
VpeIncludeInfo includeInfo = (VpeIncludeInfo)creationData.getData();
if (includeInfo != null) {
pageContext.getVisualBuilder().pushIncludeStack((VpeIncludeInfo)includeInfo);
@@ -79,7 +81,7 @@
return defineElement;
}
- private VpeCreationData createInsert(Element defineElement, Document visualDocument) {
+ private VpeCreationData createInsert(Element defineElement, nsIDOMDocument
visualDocument) {
VpeCreationData creationData = new VpeCreationData(null);
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(null);
childrenInfo.addSourceChild(defineElement);
@@ -87,8 +89,8 @@
return creationData;
}
- private VpeCreationData createStub(Element element, Document visualDocument) {
- Element visualNewElement = visualDocument.createElement("div");
+ private VpeCreationData createStub(Element element, nsIDOMDocument visualDocument) {
+ nsIDOMElement visualNewElement = visualDocument.createElement(HTML.TAG_DIV);
return new VpeCreationData(visualNewElement);
}
}