Author: dmaliarevich
Date: 2008-03-12 07:21:12 -0400 (Wed, 12 Mar 2008)
New Revision: 6885
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1744, dir attribute added, caption style fixed,
code adjustment.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java 2008-03-12
11:21:02 UTC (rev 6884)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java 2008-03-12
11:21:12 UTC (rev 6885)
@@ -201,7 +201,7 @@
info = new VpeChildrenInfo(group);
creatorInfo.addChildrenInfo(info);
}
-
+
for (int i = 0; i < sourceElements.getColumnCount(); i++) {
SourceColumnElements column = sourceElements.getColumn(i);
info.addSourceChild(column.getColumn());
@@ -416,4 +416,5 @@
}
return null;
}
+
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2008-03-12
11:21:02 UTC (rev 6884)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2008-03-12
11:21:12 UTC (rev 6885)
@@ -78,7 +78,7 @@
}
}
- nsIDOMNode cell = null;
+ nsIDOMElement cell = null;
int columnsCount = getColumnsCount(sourceParent);
if (isHeader) {
cell = makeCell(columnsCount, HTML.TAG_TH, visualDocument);
@@ -111,10 +111,10 @@
return sourceNode.getParentNode();
}
- private void setCellClass(nsIDOMNode cell, String className) {
+ private void setCellClass(nsIDOMElement cell, String className) {
if (cell != null) {
if (className != null && className.trim().length() > 0) {
- ((nsIDOMElement)cell).setAttribute("class", className);
+ cell.setAttribute("class", className);
}
}
}
@@ -126,16 +126,16 @@
* @param cell the cell
* @param captionStyle the caption style
*/
- private void setCaptionStyle(Node sourceParent, nsIDOMNode cell, String captionStyle) {
+ private void setCaptionStyle(Node sourceParent, nsIDOMElement cell, String captionStyle)
{
if (cell != null) {
String resultStyle = "";
- if (captionStyle != null && captionStyle.trim().length() > 0) {
+ if (captionStyle != null) {
+ if (!(captionStyle.lastIndexOf("width") > -1)) {
+ resultStyle += "width: 100%; ";
+ }
resultStyle += captionStyle;
}
-// if (!(captionStyle.lastIndexOf("width") > -1)) {
-// resultStyle += "width: 100%; ";
-// }
- ((nsIDOMElement)cell).setAttribute(HTML.ATTR_STYLE, resultStyle);
+ cell.setAttribute(HTML.ATTR_STYLE, resultStyle);
}
}
@@ -162,7 +162,7 @@
return count;
}
- private nsIDOMNode makeCell(int columnCount, String cellTag, nsIDOMDocument
visualDocument) {
+ private nsIDOMElement makeCell(int columnCount, String cellTag, nsIDOMDocument
visualDocument) {
nsIDOMElement visualCell = visualDocument.createElement(cellTag);
if (columnCount > 1) {
visualCell.setAttribute("colspan", "" + columnCount);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-03-12
11:21:02 UTC (rev 6884)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-03-12
11:21:12 UTC (rev 6885)
@@ -149,7 +149,7 @@
static final String ATTR_DATATABLE_FOOTER_CLASS = "footerClass";
static final String ATTR_DATATABLE_ROW_CLASSES = "rowClasses";
static final String ATTR_DATATABLE_COLUMN_CLASSES = "columnClasses";
- static final String[] ATTR_DATATABLE_PROPERTIES = {"width",
"bgcolor","border","cellpadding","cellspacing","frame","rules","class","style","title"};
+ static final String[] ATTR_DATATABLE_PROPERTIES = {"width",
"bgcolor","border","cellpadding","cellspacing","frame","rules","class","style","title",
"dir"};
public static final String ATTR_LINK_HREF = "href";
public static final String ATTR_LINK_REL = "rel";