Author: dmaliarevich
Date: 2008-01-24 12:46:40 -0500 (Thu, 24 Jan 2008)
New Revision: 5950
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/orderingList/orderingList.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesOrderingList.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1579
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/orderingList/orderingList.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/orderingList/orderingList.css 2008-01-24
16:27:11 UTC (rev 5949)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/orderingList/orderingList.css 2008-01-24
17:46:40 UTC (rev 5950)
@@ -1,132 +1,3 @@
-.dr-table {
- border-top: 1px solid;
- border-left: 1px solid;
- border-color: #C4C0B9;
-}
-
-.dr-table-cell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- font-size: 11px;
- color: #000000;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-subtable-cell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- font-size: 11px;
- color: #000000;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-table-header {
- background-color: #D4CFC7;
- background-position: top left;
- background-repeat: repeat-x;
-}
-
-.dr-table-header-continue {
- background-color: #D4CFC7;
-}
-
-.dr-table-headercell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- color: #000000;
- text-align: center;
- font-weight: bold;
- font-size: 11px;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-table-subheader {
- background-color: #F1EEE9;
-}
-
-.dr-table-subheadercell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- text-align: center;
- font-size: 11px;
- font-color: #000000;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-table-footercell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- color: #000000;
- text-align: center;
- font-weight: bold;
- font-size: 11px;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-table-subfootercell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- text-align: center;
- font-size: 11px;
- color: #000000;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-subtable-header {
- background-color: #F1EEE9;
-}
-
-.dr-subtable-headercell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- text-align: center;
- font-size: 11px;
- color: #000000;
- font-family: Arial, Verdana, sans-serif;
-}
-
-.dr-subtable-footercell {
- border-right: 1px solid;
- border-bottom: 1px solid;
- border-color: #C4C0B9;
- padding: 4px 4px 4px 4px;
- text-align: center;
-}
-
-.dr-spr {
- display: block;
-}
-
-.dr-table-hidden {
- overflow: hidden;
- border: solid 1px #C4C0C9;
-}
-
-.dr-default-caption-text {
- font-size:14px;
- text-align:center;
- font-weight: bold;
-}
-
-.dr-default-control-button-text {
- font-size:11px;
- text-align:left;
-}
-
.dr-buttons-border {
border:1px solid;
margin-bottom:3px;
@@ -137,7 +8,7 @@
white-space: normal;
word-wrap: break-word;
font-weight: bold;
- font-size:14px;
+ font-size:12px;
}
/* BUTTONS DIV */
@@ -150,41 +21,36 @@
}
.rich-ordering-controls {
- border:0px solid;
- margin-bottom:3px;
+ font-family:Arial,Verdana,sans-serif;
+ margin-bottom:2px;
+ background-repeat: repeat-x;
}
.rich-ordering-control-top {
- border:1px solid;
- margin-bottom:3px;
+
}
.rich-ordering-control-bottom {
- border:1px solid;
- margin-bottom:3px;
+
}
.rich-ordering-control-up {
- border:1px solid;
- margin-bottom:3px;
+
}
.rich-ordering-control-down {
- border:1px solid;
- margin-bottom:3px;
+
}
.rich-ordering-list-button {
- background-attachment: scroll;
- color:#000000;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
cursor: pointer;
- border-width:0px;
}
.rich-ordering-list-button-content {
+ font-family:Arial,Verdana,sans-serif;
padding:0pt 4px 0pt 1px;
font-size:11px;
text-align:left;
white-space:nowrap;
- border-width:0px;
+ /*border-width:0px;*/
}
a.rich-ordering-list-button-selection:visited,
a.rich-ordering-list-button-selection:link,
a.rich-ordering-list-button-a-disabled:visited,
a.rich-ordering-list-button-a-disabled:link {
@@ -196,76 +62,60 @@
margin-right:2px;
vertical-align:middle;
}
+*/
-
/* TABLE CONTENT */
+
.rich-ordering-list-body {
- border:0pt solid;
+ /*border:0pt solid;*/
}
.rich-ordering-list-output {
- background-color:#FFFFFF;
+ font-family:Arial,Verdana,sans-serif;
border-color:#C0C0C0;
border-width:1px;
width: 100%;
}
.rich-ordering-list-content {
+ font-family:Arial,Verdana,sans-serif;
overflow:hidden;
width:100%;
}
.rich-ordering-list-header {
+ font-family:Arial,Verdana,sans-serif;
overflow:hidden;
width:100%;
- font-family:Arial,Verdana,sans-serif;
font-size:11px;
text-align: center;
}
.rich-ordering-list-footer {
+ font-family:Arial,Verdana,sans-serif;
overflow:hidden;
width:100%;
- font-family:Arial,Verdana,sans-serif;
font-size:11px;
text-align: center;
}
.rich-ordering-list-table-header {
-
+ background-repeat: repeat-x;
}
.rich-ordering-list-table-header-cell{
- background-color: #E3DED5;
- background-repeat: repeat-x;
- background-attachment: scroll;
- border-bottom-color:#C4C0C9;
- border-bottom-width:1px;
- border-right-color:#C4C0C9;
- border-right-width:1px;
- color:#000000;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
text-align: center;
-
}
.rich-ordering-list-table-footer {
-
+ background-repeat: repeat-x;
}
.rich-ordering-list-table-footer-cell{
- background-color: #E3DED5;
- background-repeat: repeat-x;
- background-attachment: scroll;
- border-bottom-color:#C4C0C9;
- border-bottom-width:1px;
- border-right-color:#C4C0C9;
- border-right-width:1px;
- color:#000000;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
text-align: center;
-
}
.rich-ordering-list-items {
@@ -273,14 +123,12 @@
}
.rich-ordering-list-row {
-
+ font-size:11px;
}
.rich-ordering-list-cell {
- color:#000000;
font-family:Arial,Verdana,sans-serif;
font-size:11px;
- padding:2px;
white-space:normal;
text-align: center;
width: 100%;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2008-01-24
16:27:11 UTC (rev 5949)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2008-01-24
17:46:40 UTC (rev 5950)
@@ -167,4 +167,7 @@
/** HTML_ATTR_VALIGN_MIDDLE_VALUE */
public static final String HTML_ATTR_VALIGN_MIDDLE_VALUE = "middle";
+
+ /** HTML_ATTR_BACKGROUND */
+ public static final String HTML_ATTR_BACKGROUND = "background";
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesOrderingList.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesOrderingList.java 2008-01-24
16:27:11 UTC (rev 5949)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesOrderingList.java 2008-01-24
17:46:40 UTC (rev 5950)
@@ -28,10 +28,7 @@
final static String DEFAULT_LIST_HEIGHT = "150px";
final static String DEFAULT_LIST_WIDTH = "300px";
-// final static String DEFAULT_LIST_HEIGHT = "100%";
-// final static String DEFAULT_LIST_WIDTH = "100%";
-// final static String DEFAULT_LIST_HEIGHT = "150px";
-// final static String DEFAULT_LIST_WIDTH = "250px";
+
final static String DEFAULT_HEIGHT = "200px";
final static String DEFAULT_WIDTH = "300px";
@@ -49,7 +46,6 @@
final static String CAPTION_STYLE = "captionStyle";
final static String SPACE = " ";
- private static String STYLE_FOR_CAPTOION_LABEL = "white-space: normal; word-wrap:
break-word; font-weight: bold; font-size:14px;";
private static String STYLE_FOR_LOW_SCROLL = "overflow: scroll; width: 100%;
height: 17px;";
private static String STYLE_FOR_RIGHT_SCROLL = "overflow: scroll; width: 17px;
height: 100%;";
@@ -139,8 +135,6 @@
String listWidth = sourceElement.getAttribute(LIST_WIDTH);
String listHeight = sourceElement.getAttribute(LIST_HEIGHT);
- String controlsClass = sourceElement.getAttribute(CONTROLS_CLASS);
-
String controlsType = sourceElement.getAttribute(CONTROLS_TYPE);
String controlsHorizontalAlign =
sourceElement.getAttribute(CONTROLS_HORIZONTAL_ALIGN);
String controlsVerticalAlign = sourceElement.getAttribute(CONTROLS_VERTICAL_ALIGN);
@@ -155,26 +149,18 @@
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
VpeCreationData creationData = new VpeCreationData(tableCommon);
-/*
- nsIDOMElement captionRow = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
- */
+
nsIDOMElement dataRow = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
- tableCommon.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, (listWidth == null ?
DEFAULT_LIST_WIDTH : width));
- tableCommon.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT, (listHeight == null ?
DEFAULT_LIST_HEIGHT : height));
+ tableCommon.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, (width == null ?
DEFAULT_WIDTH : width));
+ tableCommon.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT, (height == null ?
DEFAULT_HEIGHT : height));
tableCommon.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_LIST_BODY_CLASS);
- //tableCommon.appendChild(captionRow);
tableCommon.appendChild(dataRow);
- // ---------------------row1------------------------
- /*
- nsIDOMElement captionRow_TD = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- captionRow.appendChild(captionRow_TD);
-*/
+ // ---------------------caption td------------------------
+
nsIDOMElement captionRow_TD_DIV = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
captionRow_TD_DIV.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_CAPTION_CLASS);
@@ -185,15 +171,13 @@
Element captionFacet = ComponentUtil.getFacet(sourceElement, CAPTION_FACET);
if (null != captionFacet) {
// Creating table caption with facet content
- nsIDOMElement fecetDiv = encodeFacetsToDiv(captionFacet, false, CSS_CAPTION_CLASS,
null, creationData, visualDocument);
+ nsIDOMElement fecetDiv = encodeFacetsToDiv(captionFacet, false, CSS_CAPTION_CLASS,
"", creationData, visualDocument);
captionRow_TD_DIV.appendChild(fecetDiv);
} else {
captionRow_TD_DIV.appendChild(visualDocument.createTextNode(captionLabel));
}
- //captionRow_TD.appendChild(captionRow_TD_DIV);
-
- // ---------------------row2 ---- with list table and buttons------------------------
+ // ---------------------row with list table and buttons------------------------
nsIDOMElement dataRow_leftTD = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
dataRow.appendChild(dataRow_leftTD);
@@ -217,18 +201,22 @@
// ---------------------buttons------------------------
if (!"none".equalsIgnoreCase(controlsType)) {
nsIDOMElement controlsDiv = createControlsDiv(creationData, visualDocument,
sourceElement);
- buttonsTD.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_CONTROLS_CLASS +
CSS_BUTTON_VALIGN_CLASS + controlsClass);
+ buttonsTD.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_BUTTON_VALIGN_CLASS);
buttonsTD.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR, "center");
- buttonsTD.setAttribute(HtmlComponentUtil.HTML_ATTR_VALIGN, ("center"
- .equalsIgnoreCase(controlsVerticalAlign) ? "middle"
- : controlsVerticalAlign));
+
+ if ((null != controlsVerticalAlign) &&
("".equals(controlsVerticalAlign))){
+ buttonsTD.setAttribute(HtmlComponentUtil.HTML_ATTR_VALIGN, ("center"
+ .equalsIgnoreCase(controlsVerticalAlign) ? "middle"
+ : controlsVerticalAlign));
+ }
+
buttonsTD.appendChild(controlsDiv);
}
// --------------------------------------------
// ---------------------listTable------------------------
nsIDOMElement listDiv = createListTableDiv(visualDocument, sourceElement, creationData,
pageContext);
- //tableListTD.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_LIST_OUTPUT_CLASS);
tableListTD.appendChild(captionRow_TD_DIV);
tableListTD.appendChild(listDiv);
// --------------------------------------------
@@ -236,6 +224,16 @@
return creationData;
}
+ /**
+ * Creates the list table div.
+ *
+ * @param visualDocument the visual document
+ * @param sourceElement the source element
+ * @param creationData the creation data
+ * @param pageContext the page context
+ *
+ * @return the element
+ */
private nsIDOMElement createListTableDiv(nsIDOMDocument visualDocument,
Element sourceElement, VpeCreationData creationData, VpePageContext pageContext) {
@@ -249,9 +247,7 @@
nsIDOMElement tr2 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
- //listOutputDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
CSS_LIST_OUTPUT_CLASS);
listOutputDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
"overflow:hidden;width:100%;");
- //listTable.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_LIST_CONTENT_CLASS);
listTable.appendChild(tr1);
listTable.appendChild(tr2);
listOutputDiv.appendChild(listTable);
@@ -290,10 +286,18 @@
sourceElement);
tr1_TD1.appendChild(contentDiv);
- //return listTable;
return listOutputDiv;
}
+ /**
+ * Creates the controls div.
+ *
+ * @param creationData the creation data
+ * @param visualDocument the visual document
+ * @param sourceElement the source element
+ *
+ * @return the element
+ */
private nsIDOMElement createControlsDiv( VpeCreationData creationData, nsIDOMDocument
visualDocument,
Element sourceElement) {
@@ -313,9 +317,12 @@
boolean showButtonLabels = ComponentUtil.string2boolean(showButtonLabelsStr);
boolean fastOrderControlsVisible =
ComponentUtil.string2boolean(fastOrderControlsVisibleStr);
boolean orderControlsVisible = ComponentUtil.string2boolean(orderControlsVisibleStr);
-
+ String controlsClass = sourceElement.getAttribute(CONTROLS_CLASS);
+
nsIDOMElement buttonsDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- buttonsDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_CONTROLS_CLASS + "
" + CSS_BUTTON_LAYOUT_CLASS);
+ buttonsDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_CONTROLS_CLASS + " " + controlsClass + " "
+ + CSS_BUTTON_LAYOUT_CLASS);
Element top_control_facet = ComponentUtil.getFacet(sourceElement, TOP_CONTROL_FACET);
Element up_control_facet = ComponentUtil.getFacet(sourceElement, UP_CONTROL_FACET);
@@ -354,19 +361,20 @@
return buttonsDiv;
}
+
/**
- * Creates control button with image and label.
+ * Creates the single button div.
*
- * @param visualDocument
- * visual document
- * @param btnName
- * the button label
- * @param imgName
- * path to the image
- * @param showButtonLabels
- * show button label flag
+ * @param creationData the creation data
+ * @param visualDocument the visual document
+ * @param btnName the btn name
+ * @param imgName the img name
+ * @param showButtonLabels the show button labels
+ * @param buttonFacet the button facet
+ * @param cssStyleName the css style name
+ * @param customStyleClass the custom style class
*
- * @return the button
+ * @return the ns idom element
*/
private nsIDOMElement createSingleButtonDiv(VpeCreationData creationData,
nsIDOMDocument visualDocument, String btnName, String imgName,
@@ -384,14 +392,12 @@
nsIDOMElement img = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- div1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-buttons-border");
+ div1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-buttons-border" +
" " + cssStyleName + " " + customStyleClass);
div2.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_CLASS);
- a.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_SELECTION_CLASS);
- div3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_CONTENT_CLASS + "
" + cssStyleName + " " + customStyleClass);
+ String resourceFolder = RichFacesTemplatesActivator.getPluginResourcePath();
+ String divStyle = "width: 100%;background-image: url(file://" +
resourceFolder + BUTTON_BG + ");";
- String resourceFolder = RichFacesTemplatesActivator.getPluginResourcePath();
- String divStyle = "background-image: url(file://" + resourceFolder +
BUTTON_BG + ");";
div2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, divStyle);
div1.appendChild(div2);
@@ -400,10 +406,12 @@
nsIDOMElement fecetDiv = encodeFacetsToDiv(buttonFacet, true, cssStyleName,
customStyleClass, creationData, visualDocument);
div2.appendChild(fecetDiv);
} else {
+ a.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_SELECTION_CLASS);
+ div3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_CONTENT_CLASS);
div2.appendChild(a);
a.appendChild(div3);
- // Creating button with image and label
- img.setAttribute("src", "file://" + resourceFolder + imgName);
+ // Creating button with image and label
+ img.setAttribute("src", "file:///" +
ComponentUtil.getAbsoluteResourcePath(imgName));
img.setAttribute(HTML.ATTR_WIDTH, "15");
img.setAttribute(HTML.ATTR_HEIGHT, "15");
div3.appendChild(img);
@@ -415,12 +423,17 @@
}
+ /**
+ * Creates the result list.
+ *
+ * @param creationData the creation data
+ * @param visualDocument the visual document
+ * @param sourceElement the source element
+ *
+ * @return the element
+ */
private nsIDOMElement createResultList(VpeCreationData creationData, nsIDOMDocument
visualDocument,
Element sourceElement) {
- /*
- nsIDOMElement outputDiv = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
- */
nsIDOMElement contentDiv = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
@@ -456,7 +469,7 @@
nsIDOMElement tr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
thead.appendChild(tr);
String styleClass = encodeStyleClass(null,
- CSS_TABLE_HEADER_CLASS + " " + CSS_TABLE_HEADER_CELL_CLASS, null,
+ CSS_HEADER_CLASS + " " + CSS_TABLE_HEADER_CLASS, null,
headerClass);
if (styleClass != null) {
tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
@@ -464,7 +477,7 @@
}
encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
columnsHeaders,
- CSS_TABLE_HEADER_CLASS + " " + CSS_TABLE_HEADER_CELL_CLASS,
+ CSS_TABLE_HEADER_CELL_CLASS,
headerClass, HEADER, HtmlComponentUtil.HTML_TAG_TD);
}
}
@@ -521,7 +534,9 @@
contentDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
CSS_LIST_OUTPUT_CLASS + " " + CSS_LIST_CONTENT_CLASS);
contentTable.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- CSS_LIST_ITEMS_CLASS + listClass);
+ CSS_LIST_ITEMS_CLASS + " " + (null == listClass ? "" :
listClass));
+
+ contentTable.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "1");
ComponentUtil.copyAttributes(sourceElement, contentTable);
contentTable.removeAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT);
@@ -531,7 +546,7 @@
for (int i = 0; i < NUM_ROW; i++) {
List<Node> children = ComponentUtil.getChildren(sourceElement);
nsIDOMElement tr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_LIST_ROW_CLASS + rowClasses);
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_LIST_ROW_CLASS + " "
+ (null == rowClasses ? "" : rowClasses) );
VpeChildrenInfo trInfo = new VpeChildrenInfo(tr);
tbody.appendChild(tr);
creationData.addChildrenInfo(trInfo);
@@ -572,7 +587,19 @@
//return outputDiv;
}
- protected nsIDOMElement encodeFacetsToDiv(Element facetBody,
+ /**
+ * Encodes facets to div.
+ *
+ * @param facetBody the facet body
+ * @param isControlFacet the is control facet
+ * @param cssStyleName the css style name
+ * @param customStyleClass the custom style class
+ * @param creationData the creation data
+ * @param visualDocument the visual document
+ *
+ * @return the element
+ */
+ private nsIDOMElement encodeFacetsToDiv(Element facetBody,
boolean isControlFacet, String cssStyleName,
String customStyleClass, VpeCreationData creationData,
nsIDOMDocument visualDocument) {
@@ -608,21 +635,32 @@
creationData.addChildrenInfo(child);
if (isControlFacet) {
- tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_CLASS);
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_BUTTON_CONTENT_CLASS + "
" + cssStyleName + " " + customStyleClass);
+
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_BUTTON_CLASS);
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_BUTTON_CONTENT_CLASS + " " + cssStyleName + " "
+ + customStyleClass);
+
+ fecetDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_BUTTON_CLASS + " " + CSS_BUTTON_CONTENT_CLASS + " "
+ + cssStyleName + " " + customStyleClass);
+
}
-
}
if (isControlFacet) {
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_CONTROLS_CLASS + "
" + CSS_BUTTON_CONTENT_CLASS);
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_BUTTON_CONTENT_CLASS);
} else {
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_CAPTION_CLASS);
+ table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ CSS_CAPTION_CLASS);
}
table.appendChild(tbody);
fecetDiv.appendChild(table);
return fecetDiv;
+ //return table;
}
/**
@@ -638,7 +676,7 @@
* @param facetBodyClass
* @param element
*/
- protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
+ private void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
nsIDOMElement parentTheadOrTfood, int columns,
nsIDOMDocument visualDocument, Element facetBody,
String skinFirstRowClass, String skinCellClass,
@@ -698,7 +736,7 @@
* @param facetName
* @param element
*/
- public static void encodeHeaderOrFooterFacets(VpeCreationData creationData,
+ private static void encodeHeaderOrFooterFacets(VpeCreationData creationData,
nsIDOMElement parentTr, nsIDOMDocument visualDocument,
ArrayList<Element> headersOrFooters, String skinCellClass,
String headerClass, String facetName, String element) {
@@ -707,22 +745,15 @@
String columnHeaderClass = column.getAttribute(classAttribute);
nsIDOMElement td = visualDocument.createElement(element);
parentTr.appendChild(td);
+
+ td.setAttribute(HtmlComponentUtil.HTML_ATTR_BACKGROUND, "file:///"
+ + ComponentUtil.getAbsoluteResourcePath(HEADER_CELL_BG));
+
String styleClass = encodeStyleClass(null, skinCellClass,
headerClass, columnHeaderClass);
td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
td.setAttribute("scop", "col");
- nsIDOMElement div1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
- String resourceFolder = RichFacesTemplatesActivator
- .getPluginResourcePath();
- String div1Style = "background-image: url(file://" + resourceFolder
- + HEADER_CELL_BG + ");";
- div1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- styleClass);
- div1.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, div1Style);
- td.appendChild(div1);
-
String colspan = column
.getAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN);
if (colspan != null && colspan.length() > 0) {
@@ -730,8 +761,7 @@
}
Element facetBody = ComponentUtil.getFacet(column, facetName);
-// VpeChildrenInfo child = new VpeChildrenInfo(td);
- VpeChildrenInfo child = new VpeChildrenInfo(div1);
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
child.addSourceChild(facetBody);
creationData.addChildrenInfo(child);
}
@@ -742,7 +772,7 @@
* @param parentSourceElement
* @return list of columns
*/
- public static ArrayList<Element> getColumns(Element parentSourceElement) {
+ private static ArrayList<Element> getColumns(Element parentSourceElement) {
ArrayList<Element> columns = new ArrayList<Element>();
NodeList children = parentSourceElement.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
@@ -761,7 +791,7 @@
* @param facetName
* @return list of columns with facet
*/
- public static ArrayList<Element> getColumnsWithFacet(
+ private static ArrayList<Element> getColumnsWithFacet(
ArrayList<Element> columns, String facetName) {
ArrayList<Element> columnsWithFacet = new ArrayList<Element>();
for (Element column : columns) {
@@ -781,7 +811,7 @@
* @param custom
* @return
*/
- public static String encodeStyleClass(Object parentPredefined,
+ private static String encodeStyleClass(Object parentPredefined,
Object predefined, Object parent, Object custom) {
StringBuffer styleClass = new StringBuffer();
// Construct predefined classes
@@ -809,7 +839,7 @@
* @param columns
* @return
*/
- protected int getColumnsCount(Element sourceElement,
+ private int getColumnsCount(Element sourceElement,
ArrayList<Element> columns) {
int count = 0;
// check for exact value in component
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-01-24
16:27:11 UTC (rev 5949)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-01-24
17:46:40 UTC (rev 5950)
@@ -347,10 +347,6 @@
<vpe:tag name="rich:orderingList" case-sensitive="yes">
<vpe:template children="yes" modify="no"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesOrderingList">
- <vpe:resize>
- <vpe:width width-attr="listWidth" />
- <vpe:height height-attr="listHeight" />
- </vpe:resize>
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes">