Author: sdzmitrovich
Date: 2008-02-26 02:39:40 -0500 (Tue, 26 Feb 2008)
New Revision: 6570
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeAdapterUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/AttributeAdapter.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/ElementAdapter.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NamedNodeMapImpl.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeAdapter.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeListImpl.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/TextAdapter.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1718
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeAdapterUtil.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeAdapterUtil.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeAdapterUtil.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util;
+
+import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
+import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
+import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
+import org.jboss.tools.jsf.vpe.jsf.template.util.model.ElementAdapter;
+import org.jboss.tools.jsf.vpe.jsf.template.util.model.NodeAdapter;
+import org.jboss.tools.jsf.vpe.jsf.template.util.model.NodeListImpl;
+import org.jboss.tools.jsf.vpe.jsf.template.util.model.TextAdapter;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class NodeAdapterUtil {
+
+ static public NodeList reparseAttributeValue(Attr attr) {
+
+ IStructuredDocument newStructuredDocument = StructuredDocumentFactory
+ .getNewStructuredDocumentInstance(new JSPSourceParser());
+
+ newStructuredDocument.set(attr.getValue());
+
+ IDOMModel modelForJSP = new DOMModelForJSP();
+ modelForJSP.setStructuredDocument(newStructuredDocument);
+
+ IDOMDocument document = modelForJSP.getDocument();
+
+ NodeList list = document.getChildNodes();
+
+ NodeList adaptersList = getNodeAdapterList(list, ((IDOMAttr) attr)
+ .getValueRegionStartOffset());
+
+ return adaptersList;
+
+ }
+
+ static public NodeAdapter getNodeAdapter(Node node, int basicOffset) {
+ if (node == null)
+ return null;
+
+ if (node instanceof IDOMText)
+ return new TextAdapter((IDOMText) node, basicOffset);
+ else if (node instanceof IDOMElement)
+ return new ElementAdapter((IDOMElement) node, basicOffset);
+ else
+ return new NodeAdapter(node, basicOffset);
+ }
+
+ static public NodeList getNodeAdapterList(NodeList nodeList, int basicOffset) {
+
+ NodeListImpl newNodeList = new NodeListImpl();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+
+ newNodeList.appendNode(getNodeAdapter(node, basicOffset));
+
+ }
+
+ return newNodeList;
+
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/AttributeAdapter.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/AttributeAdapter.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/AttributeAdapter.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util.model;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
+import org.w3c.dom.TypeInfo;
+
+public class AttributeAdapter extends NodeAdapter implements IDOMAttr {
+
+ public AttributeAdapter(IDOMAttr basicAttr, int basicOffset) {
+ super(basicAttr, basicOffset);
+ }
+
+ public ITextRegion getEqualRegion() {
+
+ return ((IDOMAttr) basicNode).getEqualRegion();
+ }
+
+ public int getNameRegionEndOffset() {
+ return ((IDOMAttr) basicNode).getNameRegionEndOffset() + basicOffset;
+ }
+
+ public int getNameRegionStartOffset() {
+ return ((IDOMAttr) basicNode).getNameRegionStartOffset() + basicOffset;
+ }
+
+ public String getNameRegionText() {
+ return ((IDOMAttr) basicNode).getNameRegionText();
+ }
+
+ public int getNameRegionTextEndOffset() {
+ return ((IDOMAttr) basicNode).getNameRegionTextEndOffset()
+ + basicOffset;
+ }
+
+ public int getValueRegionStartOffset() {
+ return ((IDOMAttr) basicNode).getValueRegionStartOffset() + basicOffset;
+ }
+
+ public String getValueRegionText() {
+ return ((IDOMAttr) basicNode).getValueRegionText();
+ }
+
+ public boolean hasNameOnly() {
+ return ((IDOMAttr) basicNode).hasNameOnly();
+ }
+
+ public boolean hasNestedValue() {
+ return ((IDOMAttr) basicNode).hasNestedValue();
+ }
+
+ public boolean isGlobalAttr() {
+ return ((IDOMAttr) basicNode).isGlobalAttr();
+ }
+
+ public boolean isXMLAttr() {
+ return ((IDOMAttr) basicNode).isXMLAttr();
+ }
+
+ public String getName() {
+ return ((IDOMAttr) basicNode).getName();
+ }
+
+ public Element getOwnerElement() {
+ return ((IDOMAttr) basicNode).getOwnerElement();
+ }
+
+ public TypeInfo getSchemaTypeInfo() {
+ return ((IDOMAttr) basicNode).getSchemaTypeInfo();
+ }
+
+ public boolean getSpecified() {
+ return ((IDOMAttr) basicNode).getSpecified();
+ }
+
+ public String getValue() {
+ return ((IDOMAttr) basicNode).getValue();
+ }
+
+ public void setValue(String value) throws DOMException {
+ ((IDOMAttr) basicNode).setValue(value);
+
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/ElementAdapter.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/ElementAdapter.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/ElementAdapter.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util.model;
+
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
+
+public class ElementAdapter extends NodeAdapter implements IDOMElement {
+
+ public ElementAdapter(IDOMElement basicElement, int basicOffset) {
+ super(basicElement, basicOffset);
+ }
+
+ public int getEndStartOffset() {
+ return ((IDOMElement) basicNode).getEndStartOffset() + basicOffset;
+ }
+
+ public int getStartEndOffset() {
+ return ((IDOMElement) basicNode).getStartEndOffset() + basicOffset;
+ }
+
+ public boolean hasEndTag() {
+ return ((IDOMElement) basicNode).hasEndTag();
+ }
+
+ public boolean hasStartTag() {
+ return ((IDOMElement) basicNode).hasStartTag();
+ }
+
+ public boolean isCommentTag() {
+ return ((IDOMElement) basicNode).isCommentTag();
+ }
+
+ public boolean isEmptyTag() {
+ return ((IDOMElement) basicNode).isEmptyTag();
+ }
+
+ public boolean isEndTag() {
+ return ((IDOMElement) basicNode).isEndTag();
+ }
+
+ public boolean isGlobalTag() {
+ return ((IDOMElement) basicNode).isGlobalTag();
+ }
+
+ public boolean isImplicitTag() {
+ return ((IDOMElement) basicNode).isImplicitTag();
+ }
+
+ public boolean isJSPTag() {
+ return ((IDOMElement) basicNode).isJSPTag();
+ }
+
+ public boolean isStartTagClosed() {
+ return ((IDOMElement) basicNode).isStartTagClosed();
+ }
+
+ public boolean isXMLTag() {
+ return ((IDOMElement) basicNode).isXMLTag();
+ }
+
+ public void notifyEndTagChanged() {
+ ((IDOMElement) basicNode).notifyEndTagChanged();
+
+ }
+
+ public void notifyStartTagChanged() {
+ ((IDOMElement) basicNode).notifyStartTagChanged();
+
+ }
+
+ public void setCommentTag(boolean isCommentTag) {
+ ((IDOMElement) basicNode).setCommentTag(isCommentTag);
+
+ }
+
+ public void setEmptyTag(boolean isEmptyTag) {
+ ((IDOMElement) basicNode).setEmptyTag(isEmptyTag);
+
+ }
+
+ public void setIdAttribute(String name, boolean isId) {
+ ((IDOMElement) basicNode).setIdAttribute(name, isId);
+
+ }
+
+ public void setIdAttributeNS(String namespaceURI, String localName,
+ boolean isId) {
+ ((IDOMElement) basicNode).setIdAttributeNS(namespaceURI, localName,
+ isId);
+
+ }
+
+ public void setIdAttributeNode(Attr idAttr, boolean isId)
+ throws DOMException {
+ ((IDOMElement) basicNode).setIdAttributeNode(idAttr, isId);
+
+ }
+
+ public void setJSPTag(boolean isJSPTag) {
+ ((IDOMElement) basicNode).setJSPTag(isJSPTag);
+
+ }
+
+ public String getAttribute(String name) {
+
+ return ((IDOMElement) basicNode).getAttribute(name);
+ }
+
+ public String getAttributeNS(String namespaceURI, String localName)
+ throws DOMException {
+ return ((IDOMElement) basicNode)
+ .getAttributeNS(namespaceURI, localName);
+ }
+
+ public Attr getAttributeNode(String name) {
+ return new AttributeAdapter((IDOMAttr) ((IDOMElement) basicNode)
+ .getAttributeNode(name), basicOffset);
+ }
+
+ public Attr getAttributeNodeNS(String namespaceURI, String localName)
+ throws DOMException {
+ return new AttributeAdapter((IDOMAttr) ((IDOMElement) basicNode)
+ .getAttributeNodeNS(namespaceURI, localName), basicOffset);
+ }
+
+ public NodeList getElementsByTagName(String name) {
+ return createNodeAdapterList(((IDOMElement) basicNode)
+ .getElementsByTagName(name));
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
+ throws DOMException {
+ return createNodeAdapterList(((IDOMElement) basicNode)
+ .getElementsByTagNameNS(namespaceURI, localName));
+ }
+
+ public TypeInfo getSchemaTypeInfo() {
+ return ((IDOMElement) basicNode).getSchemaTypeInfo();
+ }
+
+ public String getTagName() {
+ return ((IDOMElement) basicNode).getTagName();
+ }
+
+ public boolean hasAttribute(String name) {
+ return ((IDOMElement) basicNode).hasAttribute(name);
+ }
+
+ public boolean hasAttributeNS(String namespaceURI, String localName)
+ throws DOMException {
+ return ((IDOMElement) basicNode)
+ .hasAttributeNS(namespaceURI, localName);
+ }
+
+ public void removeAttribute(String name) throws DOMException {
+ ((IDOMElement) basicNode).removeAttribute(name);
+ }
+
+ public void removeAttributeNS(String namespaceURI, String localName)
+ throws DOMException {
+
+ ((IDOMElement) basicNode).removeAttributeNS(namespaceURI, localName);
+ }
+
+ public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
+ return new AttributeAdapter((IDOMAttr) ((IDOMElement) basicNode)
+ .removeAttributeNode(oldAttr), basicOffset);
+ }
+
+ public void setAttribute(String name, String value) throws DOMException {
+ //((IDOMElement) basicNode).setAttribute(name, value);
+
+ }
+
+ public void setAttributeNS(String namespaceURI, String qualifiedName,
+ String value) throws DOMException {
+ // ((IDOMElement) basicNode).setAttributeNS(namespaceURI, qualifiedName,
+ // value);
+
+ }
+
+ public Attr setAttributeNode(Attr newAttr) throws DOMException {
+ return new AttributeAdapter((IDOMAttr) ((IDOMElement) basicNode)
+ .setAttributeNode(newAttr), basicOffset);
+ }
+
+ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
+ return new AttributeAdapter((IDOMAttr) ((IDOMElement) basicNode)
+ .setAttributeNodeNS(newAttr), basicOffset);
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NamedNodeMapImpl.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NamedNodeMapImpl.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NamedNodeMapImpl.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.wst.xml.core.internal.document.AttrImpl;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class NamedNodeMapImpl implements NamedNodeMap, NodeList {
+
+ private List<Node> nodes = null;
+
+ public NamedNodeMapImpl() {
+ nodes = new ArrayList<Node>();
+ }
+
+ public int getLength() {
+ if (nodes == null)
+ return 0;
+ return nodes.size();
+ }
+
+ public Node getNamedItem(String name) {
+ if (name == null)
+ return null;
+ if (nodes == null)
+ return null;
+
+ int length = nodes.size();
+ for (int i = 0; i < length; i++) {
+ Node node = nodes.get(i);
+ if (node == null)
+ continue;
+ if (name.equalsIgnoreCase(node.getLocalName()))
+ return node;
+ }
+
+ return null;
+ }
+
+ public Node getNamedItemNS(String uri, String name) {
+ if (name == null)
+ return null;
+ if (nodes == null)
+ return null;
+
+ int length = nodes.size();
+ for (int i = 0; i < length; i++) {
+ Node node = nodes.get(i);
+ if (node == null)
+ continue;
+ String localName = node.getLocalName();
+ if (localName == null || !localName.equalsIgnoreCase(name))
+ continue;
+ String nodeURI = node.getNamespaceURI();
+ if (nodeURI == null) {
+ if (nodeURI != null)
+ continue;
+ } else {
+ if (nodeURI == null || !nodeURI.equals(nodeURI))
+ continue;
+ }
+
+ return node;
+ }
+
+ return null;
+ }
+
+ public Node item(int index) {
+ if (nodes == null)
+ return null;
+ return nodes.get(index);
+ }
+
+ public Node removeNamedItem(String name) throws DOMException {
+
+ if (name == null)
+ return null;
+ if (nodes == null)
+ return null;
+
+ int length = nodes.size();
+ for (int i = 0; i < length; i++) {
+ Node node = nodes.get(i);
+ if (node == null)
+ continue;
+ if (!name.equalsIgnoreCase(node.getLocalName()))
+ continue;
+
+ nodes.remove(i);
+
+ return node;
+ }
+
+ return null;
+ }
+
+ public Node removeNamedItemNS(String uri, String name) throws DOMException {
+ if (name == null)
+ return null;
+ if (nodes == null)
+ return null;
+
+ int length = nodes.size();
+ for (int i = 0; i < length; i++) {
+ Node node = nodes.get(i);
+ if (node == null)
+ continue;
+ String localName = node.getLocalName();
+ if (localName == null || !localName.equals(name))
+ continue;
+ String nodeURI = node.getNamespaceURI();
+ if (uri == null) {
+ if (nodeURI != null)
+ continue;
+ } else {
+ if (nodeURI == null || !nodeURI.equals(uri))
+ continue;
+ }
+
+ nodes.remove(i);
+
+ return node;
+ }
+
+ return null;
+ }
+
+ public Node setNamedItem(Node node) throws DOMException {
+ if (node == null)
+ return null;
+
+ Node oldNode = removeNamedItem(node.getLocalName());
+
+ nodes.add(node);
+
+ return oldNode;
+ }
+
+ public Node setNamedItemNS(Node node) throws DOMException {
+ if (node == null)
+ return null;
+
+ String name = node.getLocalName();
+ String uri = node.getNamespaceURI();
+ Node oldNode = removeNamedItemNS(uri, name);
+ nodes.add(node);
+ return oldNode;
+ }
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeAdapter.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeAdapter.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeAdapter.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,373 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util.model;
+
+import java.util.Collection;
+
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
+import org.w3c.dom.UserDataHandler;
+
+public class NodeAdapter implements IDOMNode {
+
+ protected Node basicNode;
+
+ protected Node parentNode;
+
+ protected int basicOffset;
+
+ public NodeAdapter(Node basicNode, int basicOffset) {
+
+ this.basicNode = basicNode;
+ this.basicOffset = basicOffset;
+
+ }
+
+ // implementation of Node interface methods
+ public Node appendChild(Node newChild) throws DOMException {
+ return basicNode.appendChild(newChild);
+ }
+
+ public Node cloneNode(boolean deep) {
+ return basicNode.cloneNode(deep);
+ }
+
+ public short compareDocumentPosition(Node other) throws DOMException {
+ return basicNode.compareDocumentPosition(other);
+ }
+
+ public NamedNodeMap getAttributes() {
+
+ NamedNodeMap basicAttributes = basicNode.getAttributes();
+ NamedNodeMap newAttributes = new NamedNodeMapImpl();
+
+ for (int i = 0; i < basicAttributes.getLength(); i++) {
+
+ IDOMAttr attr = (IDOMAttr) basicAttributes.item(0);
+
+ newAttributes.setNamedItem(new AttributeAdapter(attr, basicOffset));
+
+ }
+
+ return newAttributes;
+ }
+
+ public String getBaseURI() {
+ return basicNode.getBaseURI();
+ }
+
+ public NodeList getChildNodes() {
+
+ return createNodeAdapterList(basicNode.getChildNodes());
+
+ }
+
+ public Object getFeature(String feature, String version) {
+ return basicNode.getFeature(feature, version);
+ }
+
+ public Node getFirstChild() {
+
+ return getNodeAdapter(basicNode.getFirstChild());
+
+ }
+
+ public Node getLastChild() {
+
+ return getNodeAdapter(basicNode.getLastChild());
+
+ }
+
+ public String getLocalName() {
+ return basicNode.getLocalName();
+ }
+
+ public String getNamespaceURI() {
+ return basicNode.getNamespaceURI();
+ }
+
+ public Node getNextSibling() {
+
+ return getNodeAdapter(basicNode.getNextSibling());
+
+ }
+
+ public String getNodeName() {
+ return basicNode.getNodeName();
+ }
+
+ public short getNodeType() {
+ return basicNode.getNodeType();
+ }
+
+ public String getNodeValue() throws DOMException {
+ return basicNode.getNodeValue();
+ }
+
+ public Document getOwnerDocument() {
+ return basicNode.getOwnerDocument();
+ }
+
+ public Node getParentNode() {
+ return basicNode.getParentNode();
+ }
+
+ public String getPrefix() {
+ return basicNode.getPrefix();
+ }
+
+ public Node getPreviousSibling() {
+ return getNodeAdapter(basicNode.getPreviousSibling());
+ }
+
+ public String getTextContent() throws DOMException {
+ return basicNode.getTextContent();
+ }
+
+ public Object getUserData(String key) {
+ return basicNode.getUserData(key);
+ }
+
+ public boolean hasAttributes() {
+ return basicNode.hasAttributes();
+ }
+
+ public boolean hasChildNodes() {
+ return basicNode.hasChildNodes();
+ }
+
+ public Node insertBefore(Node newChild, Node refChild) throws DOMException {
+ return insertBefore(newChild, refChild);
+ }
+
+ public boolean isDefaultNamespace(String namespaceURI) {
+ return false;
+ }
+
+ public boolean isEqualNode(Node arg) {
+ return basicNode.isEqualNode(arg);
+ }
+
+ public boolean isSameNode(Node other) {
+ return basicNode.isSameNode(other);
+ }
+
+ public boolean isSupported(String feature, String version) {
+ return basicNode.isSupported(feature, version);
+ }
+
+ public String lookupNamespaceURI(String prefix) {
+ return basicNode.lookupNamespaceURI(prefix);
+ }
+
+ public String lookupPrefix(String namespaceURI) {
+ return basicNode.lookupPrefix(namespaceURI);
+ }
+
+ public void normalize() {
+
+ basicNode.normalize();
+ }
+
+ public Node removeChild(Node oldChild) throws DOMException {
+ return basicNode.removeChild(oldChild);
+ }
+
+ public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
+ return basicNode.replaceChild(newChild, oldChild);
+ }
+
+ public void setNodeValue(String nodeValue) throws DOMException {
+ basicNode.setNodeValue(nodeValue);
+ }
+
+ public void setPrefix(String prefix) throws DOMException {
+ basicNode.setPrefix(prefix);
+ }
+
+ public void setTextContent(String textContent) throws DOMException {
+ basicNode.setTextContent(textContent);
+ }
+
+ public Object setUserData(String key, Object data, UserDataHandler handler) {
+ return basicNode.setUserData(key, data, handler);
+ }
+
+ // implementation of IDOMNode interface methods
+
+ public IStructuredDocumentRegion getEndStructuredDocumentRegion() {
+ return ((IDOMNode) basicNode).getEndStructuredDocumentRegion();
+ }
+
+ public IStructuredDocumentRegion getFirstStructuredDocumentRegion() {
+ return ((IDOMNode) basicNode).getFirstStructuredDocumentRegion();
+ }
+
+ public IStructuredDocumentRegion getLastStructuredDocumentRegion() {
+ return ((IDOMNode) basicNode).getLastStructuredDocumentRegion();
+ }
+
+ public IDOMModel getModel() {
+ return ((IDOMNode) basicNode).getModel();
+ }
+
+ public ITextRegion getNameRegion() {
+ return ((IDOMNode) basicNode).getNameRegion();
+ }
+
+ public String getSource() {
+ return ((IDOMNode) basicNode).getSource();
+ }
+
+ public IStructuredDocumentRegion getStartStructuredDocumentRegion() {
+ return ((IDOMNode) basicNode).getStartStructuredDocumentRegion();
+ }
+
+ public IStructuredDocument getStructuredDocument() {
+ return getStructuredDocument();
+ }
+
+ public ITextRegion getValueRegion() {
+ return ((IDOMNode) basicNode).getValueRegion();
+ }
+
+ public String getValueSource() {
+ return ((IDOMNode) basicNode).getValueSource();
+ }
+
+ public boolean isChildEditable() {
+ return ((IDOMNode) basicNode).isChildEditable();
+ }
+
+ public boolean isClosed() {
+ return ((IDOMNode) basicNode).isClosed();
+ }
+
+ public boolean isContainer() {
+ return ((IDOMNode) basicNode).isContainer();
+ }
+
+ public boolean isDataEditable() {
+ return ((IDOMNode) basicNode).isDataEditable();
+ }
+
+ public boolean isId() {
+ return ((IDOMNode) basicNode).isId();
+ }
+
+ public void setChildEditable(boolean editable) {
+ ((IDOMNode) basicNode).setChildEditable(editable);
+ }
+
+ public void setDataEditable(boolean editable) {
+ ((IDOMNode) basicNode).setDataEditable(editable);
+ }
+
+ public void setEditable(boolean editable, boolean deep) {
+ ((IDOMNode) basicNode).setEditable(editable, deep);
+
+ }
+
+ public void setSource(String source) throws InvalidCharacterException {
+
+ ((IDOMNode) basicNode).setSource(source);
+ }
+
+ public void setValueSource(String source) {
+ ((IDOMNode) basicNode).setValueSource(source);
+
+ }
+
+ public boolean contains(int testPosition) {
+ return ((IDOMNode) basicNode).contains(testPosition);
+ }
+
+ public int getEndOffset() {
+ return ((IDOMNode) basicNode).getEndOffset() + basicOffset;
+ }
+
+ public int getLength() {
+ return ((IDOMNode) basicNode).getLength();
+ }
+
+ public int getStartOffset() {
+ return ((IDOMNode) basicNode).getStartOffset()+ basicOffset;
+ }
+
+ public void addAdapter(INodeAdapter adapter) {
+ ((IDOMNode) basicNode).addAdapter(adapter);
+ }
+
+ public INodeAdapter getAdapterFor(Object type) {
+ return ((IDOMNode) basicNode).getAdapterFor(type);
+ }
+
+ public Collection getAdapters() {
+ return ((IDOMNode) basicNode).getAdapters();
+ }
+
+ public INodeAdapter getExistingAdapter(Object type) {
+ return ((IDOMNode) basicNode).getExistingAdapter(type);
+ }
+
+ public void notify(int eventType, Object changedFeature, Object oldValue,
+ Object newValue, int pos) {
+ ((IDOMNode) basicNode).notify();
+
+ }
+
+ public void removeAdapter(INodeAdapter adapter) {
+ ((IDOMNode) basicNode).removeAdapter(adapter);
+ }
+
+ protected NodeAdapter getNodeAdapter(Node node) {
+ if (node == null)
+ return null;
+
+ if (node instanceof IDOMText)
+ return new TextAdapter((IDOMText) node, basicOffset);
+ else if (node instanceof IDOMElement)
+ return new ElementAdapter((IDOMElement) node, basicOffset);
+ else
+ return new NodeAdapter(node, basicOffset);
+ }
+
+ protected NodeList createNodeAdapterList(NodeList nodeList) {
+
+ NodeListImpl newNodeList = new NodeListImpl();
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+
+ newNodeList.appendNode(getNodeAdapter(node));
+
+ }
+
+ return newNodeList;
+
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeListImpl.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeListImpl.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/NodeListImpl.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class NodeListImpl implements NodeList {
+
+ private List<Node> nodes;
+
+ public NodeListImpl() {
+ nodes = new ArrayList<Node>();
+ }
+
+ public int getLength() {
+ return nodes.size();
+ }
+
+ public Node item(int index) {
+ return nodes.get(index);
+ }
+
+ public Node appendNode(Node node) {
+
+ if (node == null)
+ return null;
+
+ nodes.add(node);
+ return node;
+ }
+
+}
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/TextAdapter.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/TextAdapter.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/model/TextAdapter.java 2008-02-26
07:39:40 UTC (rev 6570)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jsf.template.util.model;
+
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Text;
+
+public class TextAdapter extends NodeAdapter implements IDOMText {
+
+ public TextAdapter(IDOMText basicText, int basicOffset) {
+ super(basicText, basicOffset);
+ // TODO Auto-generated constructor stub
+ }
+
+ public void appendText(Text text) {
+ ((IDOMText) basicNode).appendText(text);
+
+ }
+
+ public String getWholeText() {
+ return ((IDOMText) basicNode).getWholeText();
+ }
+
+ public boolean isElementContentWhitespace() {
+ return ((IDOMText) basicNode).isElementContentWhitespace();
+ }
+
+ public boolean isInvalid() {
+ return ((IDOMText) basicNode).isInvalid();
+ }
+
+ public Text replaceWholeText(String content) throws DOMException {
+ return ((IDOMText) basicNode).replaceWholeText(content);
+ }
+
+ public Text splitText(int offset) throws DOMException {
+ return ((IDOMText) basicNode).splitText(offset);
+ }
+
+ public void appendData(String arg) throws DOMException {
+ ((IDOMText) basicNode).appendData(arg);
+
+ }
+
+ public void deleteData(int offset, int count) throws DOMException {
+ ((IDOMText) basicNode).deleteData(offset, count);
+
+ }
+
+ public String getData() throws DOMException {
+ return ((IDOMText) basicNode).getData();
+ }
+
+ public void insertData(int offset, String arg) throws DOMException {
+ ((IDOMText) basicNode).insertData(offset, arg);
+
+ }
+
+ public void replaceData(int offset, int count, String arg)
+ throws DOMException {
+ ((IDOMText)basicNode).replaceData(offset, count, arg);
+
+ }
+
+ public void setData(String data) throws DOMException {
+ ((IDOMText)basicNode).setData(data);
+
+ }
+
+ public String substringData(int offset, int count) throws DOMException {
+ return ((IDOMText) basicNode).substringData(offset, count);
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-26
07:38:46 UTC (rev 6569)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-02-26
07:39:40 UTC (rev 6570)
@@ -166,134 +166,136 @@
</vpe:template>
</vpe:tag>
-<!-- Проблема с указанием в качестве value HTML-тега (25 of 4) -->
- <vpe:tag name="h:outputText" case-sensitive="yes">
- <vpe:if test="attrpresent('value')">
- <vpe:template children="no" modify="yes">
- <span class="{@styleClass}" style="{@style}"
title="{tagstring()}">
- <vpe:value expr="{jsfvalue(@value)}"/>
- </span>
- <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:textFormating>
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:if>
- <vpe:if test="attrpresent('binding')">
- <vpe:template children="no" modify="yes">
- <span class="{@styleClass}" style="{@style}"
title="{tagstring()}">
- <vpe:value expr="{jsfvalue(@binding)}"/>
- </span>
- <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:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler"
/>
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:if>
- <vpe:template children="yes" modify="yes">
- <span class="{@styleClass}" style="{@style}"
title="{tagstring()}"/>
- <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:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler"
/>
- <vpe:format type="UnderlineFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat"
handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BoldFormatHandler"
/>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
+ <vpe:tag name="h:outputText" case-sensitive="yes">
+ <vpe:template children="yes" modify="no"
+ class="org.jboss.tools.jsf.vpe.jsf.template.JsfOutputTextTemplate">
+ </vpe:template>
+ <!-- <vpe:if test="attrpresent('value')">
+ <vpe:template children="no" modify="yes">
+ <span class="{@styleClass}" style="{@style}"
title="{tagstring()}">
+ <vpe:value expr="{jsfvalue(@value)}"/>
+ </span>
+ <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:textFormating>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:if>
+ <vpe:if test="attrpresent('binding')">
+ <vpe:template children="no" modify="yes">
+ <span class="{@styleClass}" style="{@style}"
title="{tagstring()}">
+ <vpe:value expr="{jsfvalue(@binding)}"/>
+ </span>
+ <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:textFormating>
+ <vpe:format type="BlockFormat"
+ handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler"
/>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="yes" modify="yes">
+ <span class="{@styleClass}" style="{@style}"
title="{tagstring()}"/>
+ <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:textFormating>
+ <vpe:format type="BlockFormat"
+ handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler"
/>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BoldFormat"
handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BoldFormatHandler"
/>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ -->
</vpe:tag>
-
<!-- Проблема с подстановкой значений вложенных параметров (26 of 4) -->
<vpe:tag name="h:outputFormat" case-sensitive="yes">
<vpe:template children="no" modify="yes">
@@ -496,34 +498,67 @@
</vpe:tag>
<vpe:tag name="h:outputLink" case-sensitive="yes">
- <vpe:template children="yes" modify="yes">
- <a href="javascript:return false;" class="{@styleClass}"
style="{@style}"/>
- <vpe:textFormating>
- <vpe:format type="UnderlineFormat" setDefault="true">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
- </vpe:textFormating>
- </vpe:template>
- </vpe:tag>
-
+ <vpe:if test="(@disabled='true')">
+ <vpe:template children="yes" modify="yes">
+ <span class="{@styleClass}"
+ style="{@style}" dir="{@dir}">
+ </span>
+ <vpe:textFormating>
+ <vpe:format type="UnderlineFormat"
+ setDefault="true">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:if>
+ <vpe:template children="yes" modify="yes">
+ <a href="javascript:return false;" class="{@styleClass}"
+ style="{@style}" />
+ <vpe:textFormating>
+ <vpe:format type="UnderlineFormat" setDefault="true">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+
+ </vpe:tag>
+
<vpe:tag name="h:outputLabel" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
<label style="{@style}" class="{@styleClass}"
title="{tagstring()}" for="{@for}">