Author: mareshkau
Date: 2008-07-31 11:17:08 -0400 (Thu, 31 Jul 2008)
New Revision: 9455
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
JBIDE-2584
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 2008-07-31
15:09:02 UTC (rev 9454)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-07-31
15:17:08 UTC (rev 9455)
@@ -452,45 +452,42 @@
nsIDOMNode visualNewNode =creationData.getNode();
-// nsIDOMElement visualNewElement = null;
- //TODO Max Areshkau process it's correctly
-// if(creationData.getNode()!=null) {
-//
-// visualNewElement = (nsIDOMElement) creationData
-// .getNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-// }
-//
-// if ((visualNewElement != null) && template.hasImaginaryBorder()) {
-//
-// visualNewElement.setAttribute(HTML.ATTR_STYLE, visualNewElement
-// .getAttribute(HTML.ATTR_STYLE)
-// + VpeStyleUtil.SEMICOLON_STRING + DOTTED_BORDER);
-//
-// }
-//
-// if (visualNewElement != null)
-// correctVisualAttribute(visualNewElement);
-
+ nsIDOMElement border = null;
+ if(visualNewNode!=null &&
visualNewNode.getNodeType()==nsIDOMNode.ELEMENT_NODE) {
+
+ nsIDOMElement visualNewElement = (nsIDOMElement) creationData
+ .getNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ if ((visualNewElement != null) && template.hasImaginaryBorder()) {
- nsIDOMElement border = null;
+ visualNewElement.setAttribute(HTML.ATTR_STYLE, visualNewElement
+ .getAttribute(HTML.ATTR_STYLE)
+ + VpeStyleUtil.SEMICOLON_STRING + DOTTED_BORDER);
+
+ }
+ if (visualNewElement != null) {
+ correctVisualAttribute(visualNewElement);
+ }
+ if (YES_STRING.equals(VpePreference.SHOW_BORDER_FOR_ALL_TAGS
+ .getValue())
+ && visualNewElement != null) {
+ boolean block = true;
+ if (template.getTagDescription(null, null, null,
+ visualNewElement, null).getDisplayType() ==
VpeTagDescription.DISPLAY_TYPE_INLINE) {
+ block = false;
+ }
+ border = createBorder(sourceNode, visualNewElement, block);
+ }
+ if (!isCurrentMainDocument() && visualNewElement != null) {
+ setReadOnlyElement(visualNewElement);
+ }
+ }
+
if(sourceNode instanceof Element && visualNewNode!= null
&&visualNewNode.getNodeType()==nsIDOMNode.ELEMENT_NODE) {
setTooltip((Element) sourceNode,
(nsIDOMElement)visualNewNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
}
-// if (YES_STRING.equals(VpePreference.SHOW_BORDER_FOR_ALL_TAGS
-// .getValue())
-// && visualNewElement != null) {
-// boolean block = true;
-// if (template.getTagDescription(null, null, null,
-// visualNewElement, null).getDisplayType() ==
VpeTagDescription.DISPLAY_TYPE_INLINE) {
-// block = false;
-// }
-// border = createBorder(sourceNode, visualNewElement, block);
-// }
-// if (!isCurrentMainDocument() && visualNewElement != null) {
-// setReadOnlyElement(visualNewElement);
-// }
if (registerFlag) {
VpeElementMapping elementMapping = new VpeElementMapping(
sourceNode, visualNewNode, border,