Author: dmaliarevich
Date: 2009-04-09 04:44:06 -0400 (Thu, 09 Apr 2009)
New Revision: 14623
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4110, Update any template automatically on
attribute adding/removing.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-04-09
07:03:18 UTC (rev 14622)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-04-09
08:44:06 UTC (rev 14623)
@@ -1117,50 +1117,12 @@
public void setAttribute(Element sourceElement, String name, String value) {
VpeElementMapping elementMapping = (VpeElementMapping) domMapping
.getNodeMapping(sourceElement);
+ /*
+ *
https://jira.jboss.org/jira/browse/JBIDE-4110
+ * Update any template automatically on attribute adding.
+ */
if (elementMapping != null) {
- if (elementMapping.isIfDependencyFromAttribute(name)) {
- updateElement(sourceElement);
- } else {
- VpeTemplate template = elementMapping.getTemplate();
- if (elementMapping.getBorder() != null) {
- updateElement(sourceElement);
- } else if (template.recreateAtAttrChange(pageContext,
- sourceElement, getVisualDocument(),
- (nsIDOMElement) elementMapping.getVisualNode(),
- elementMapping.getData(), name, value)) {
- updateElement(sourceElement);
- } else {
- nsIDOMElement visualElement = (nsIDOMElement) elementMapping
- .getVisualNode();
- if (visualElement != null) {
- String visualElementName = visualElement.getNodeName();
- if (HTML.TAG_SELECT.equalsIgnoreCase(visualElementName)) {
- updateElement(sourceElement);
- return;
- } else if (HTML.TAG_OPTION
- .equalsIgnoreCase(visualElementName)) {
- updateElement(sourceElement.getParentNode());
- return;
- } else if (HTML.TAG_INPUT
- .equalsIgnoreCase(visualElementName)) {
- updateElement(sourceElement);
- // Fixes JBIDE-1744 author dmaliarevich
- // unified h:dataTable border lookup
- // after attribute change and
- // after visual editor refresh
- } else if (HTML.TAG_TABLE
- .equalsIgnoreCase(visualElementName)) {
- updateElement(sourceElement);
- }
- // End of fix
- }
- // setXmlnsAttribute(elementMapping, name, value);
- template.setAttribute(pageContext, sourceElement,
- getVisualDocument(), visualElement, elementMapping
- .getData(), name, value);
- resetTooltip(sourceElement, visualElement);
- }
- }
+ updateElement(sourceElement);
}
}
@@ -1291,27 +1253,12 @@
public void removeAttribute(Element sourceElement, String name) {
VpeElementMapping elementMapping = (VpeElementMapping) domMapping
.getNodeMapping(sourceElement);
+ /*
+ *
https://jira.jboss.org/jira/browse/JBIDE-4110
+ * Update any template automatically on attribute deleting.
+ */
if (elementMapping != null) {
- if (elementMapping.isIfDependencyFromAttribute(name)) {
- updateElement(sourceElement);
- } else {
- VpeTemplate template = elementMapping.getTemplate();
- if (template.recreateAtAttrChange(pageContext, sourceElement,
- getVisualDocument(), (nsIDOMElement) elementMapping
- .getVisualNode(), elementMapping.getData(),
- name, null)) {
- updateElement(sourceElement);
- }
- // else {
- // removeXmlnsAttribute(elementMapping, name);
- // template.removeAttribute(pageContext, sourceElement,
- // visualDocument, (nsIDOMElement) elementMapping
- // .getVisualNode(), elementMapping.getData(),
- // name);
- // resetTooltip(sourceElement, (nsIDOMElement) elementMapping
- // .getVisualNode());
- // }
- }
+ updateElement(sourceElement);
}
}