Author: sdzmitrovich
Date: 2008-10-06 06:49:27 -0400 (Mon, 06 Oct 2008)
New Revision: 10683
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataScroller.xhtml
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/template/RichFacesCalendarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/contextMenu.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
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-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -13,6 +13,8 @@
/**
* Util class which contains basic html tags.
*
+ * @deprecated use org.jboss.tools.vpe.editor.util.HTML and
+ * org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces
* @author Max Areshkau
*
*/
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -20,7 +20,7 @@
import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -66,7 +66,6 @@
final static int CALENDAR_IMAGE_WIDTH = 20;
final static int CALENDAR_CUSTOM_IMAGE_WIDTH = 40;
final static int CALENDAR_BUTTON_WIDTH = 80;
- final static String ATTRIBUTE_TEXT = "text"; //$NON-NLS-1$
static final String DEFAULT_DATE_PATTERN = "MMMM, yyyy"; //$NON-NLS-1$
static final String HEADER = "header"; //$NON-NLS-1$
@@ -76,17 +75,13 @@
/*rich:calendar attributes*/
static final String BUTTON_LABEL = "buttonLabel"; //$NON-NLS-1$
static final String BUTTON_ICON = "buttonIcon"; //$NON-NLS-1$
- static final String DIRECTION = "direction"; //$NON-NLS-1$
static final String ENABLE_MANUAL_INPUT = "enableManualInput"; //$NON-NLS-1$
static final String CELL_HEIGHT = "cellHeight"; //$NON-NLS-1$
static final String CELL_WIDTH = "cellWidth"; //$NON-NLS-1$
static final String DATE_PATTERN = "datePattern"; //$NON-NLS-1$
- static final String VALUE = "value"; //$NON-NLS-1$
- static final String DISABLED = "disabled"; //$NON-NLS-1$
static final String HORIZONTAL_OFFSET = "horizontalOffset"; //$NON-NLS-1$
static final String VERTICAL_OFFSET = "verticalOffset"; //$NON-NLS-1$
static final String LOCALE = "locale"; //$NON-NLS-1$
- static final String POPUP = "popup"; //$NON-NLS-1$
static final String SHOW_APPLY_BUTTON = "showApplyButton"; //$NON-NLS-1$
static final String SHOW_INPUT = "showInput"; //$NON-NLS-1$
static final String SHOW_SHOW_WEEKS_DAY_BAR = "showWeekDaysBar";
//$NON-NLS-1$
@@ -204,14 +199,14 @@
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, "calendar");
//$NON-NLS-1$
nsIDOMElement div = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ .createElement(HTML.TAG_DIV);
nsIDOMElement resultTable = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ .createElement(HTML.TAG_TABLE);
nsIDOMElement resultTD = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
nsIDOMElement resultTR = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
resultTD.appendChild(div);
resultTR.appendChild(resultTD);
@@ -222,10 +217,10 @@
nsIDOMElement calendar;
nsIDOMElement calendarWithPopup;
- if ("false".equalsIgnoreCase(popup)) { //$NON-NLS-1$
- if ("true".equalsIgnoreCase(disabled)) { //$NON-NLS-1$
+ if (Constants.FALSE.equalsIgnoreCase(popup)) {
+ if (Constants.TRUE.equalsIgnoreCase(disabled)) {
calendar = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ .createElement(HTML.TAG_DIV);
} else {
calendar = createCalendar(visualDocument, creationData, source);
}
@@ -237,19 +232,19 @@
if (showPopupCalendar) {
if (attrPresents(direction) && directions.keySet().contains(direction)) {
nsIDOMElement table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ .createElement(HTML.TAG_TABLE);
nsIDOMElement top_tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement bottom_tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement top_left_td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
nsIDOMElement top_right_td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
nsIDOMElement bottom_left_td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
nsIDOMElement bottom_right_td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
top_tr.appendChild(top_left_td);
top_tr.appendChild(top_right_td);
@@ -259,10 +254,10 @@
table.appendChild(bottom_tr);
div.appendChild(table);
- top_left_td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, STYLE_TOP_LEFT);
- top_right_td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, STYLE_TOP_RIGHT);
- bottom_left_td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
STYLE_BOTTOM_LEFT);
- bottom_right_td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
STYLE_BOTTOM_RIGHT);
+ top_left_td.setAttribute(HTML.ATTR_STYLE, STYLE_TOP_LEFT);
+ top_right_td.setAttribute(HTML.ATTR_STYLE, STYLE_TOP_RIGHT);
+ bottom_left_td.setAttribute(HTML.ATTR_STYLE, STYLE_BOTTOM_LEFT);
+ bottom_right_td.setAttribute(HTML.ATTR_STYLE, STYLE_BOTTOM_RIGHT);
switch (directions.get(direction)) {
case DIRECTIONS_BOTTOM_RIGHT_INT:
@@ -296,13 +291,13 @@
div.appendChild(calendarWithPopup);
// hide unparsed facets
nsIDOMElement hiddenDiv = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
- hiddenDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH + " : " + CALENDAR_WIDTH
//$NON-NLS-1$
+ .createElement(HTML.TAG_DIV);
+ hiddenDiv.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + CALENDAR_WIDTH
+ "px; overflow: hidden; display: none;"); //$NON-NLS-1$
nsIDOMElement hiddenTable = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ .createElement(HTML.TAG_TABLE);
Element headerFacet = ComponentUtil.getFacet(source, HEADER);
nsIDOMElement optionalHeader = null;
@@ -331,22 +326,22 @@
private nsIDOMElement createCalendarWithPopup(
nsIDOMDocument visualDocument, Element source) {
nsIDOMElement table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ .createElement(HTML.TAG_TABLE);
nsIDOMElement tr1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement td1_1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
nsIDOMElement td1_2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
nsIDOMElement tr2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement td2_1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
- table.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH + " : 100%"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + " : 100%"); //$NON-NLS-1$
tr1.appendChild(td1_1);
tr1.appendChild(td1_2);
@@ -356,17 +351,17 @@
table.appendChild(tr2);
nsIDOMElement div = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ .createElement(HTML.TAG_DIV);
int divWidth = CALENDAR_WIDTH + CALENDAR_IMAGE_WIDTH;
div.appendChild(table);
if (!Constants.FALSE.equalsIgnoreCase(showInput)) {
nsIDOMElement input = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR, ATTRIBUTE_TEXT);
- input.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_R_C_INPUT);
- input.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH + " : " //$NON-NLS-1$
+ .createElement(HTML.TAG_INPUT);
+ input.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+ input.setAttribute(HTML.ATTR_CLASS, CSS_R_C_INPUT);
+ input.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ CALENDAR_INPUT_WIDTH + "px;"); //$NON-NLS-1$
if (Constants.TRUE.equals(enableManualInput)) {
@@ -377,7 +372,7 @@
}
if (attrPresents(value)) {
- input.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR, value);
+ input.setAttribute(HTML.ATTR_VALUE, value);
}
td1_1.appendChild(input);
@@ -386,34 +381,34 @@
if (attrPresents(buttonLabel)) {
nsIDOMElement button = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- button.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR,
- HtmlComponentUtil.HTML_TAG_BUTTON);
- button.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR, buttonLabel);
- button.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_R_C_BUTTON);
- if ("true".equalsIgnoreCase(disabled)) { //$NON-NLS-1$
- button.setAttribute(HtmlComponentUtil.HTML_ATTR_DISABLED, "true");
//$NON-NLS-1$
+ .createElement(HTML.TAG_INPUT);
+ button.setAttribute(HTML.ATTR_TYPE,
+ HTML.VALUE_BUTTON_TYPE);
+ button.setAttribute(HTML.ATTR_VALUE, buttonLabel);
+ button.setAttribute(HTML.ATTR_CLASS, CSS_R_C_BUTTON);
+ if (Constants.TRUE.equalsIgnoreCase(disabled)) {
+ button.setAttribute(HTML.ATTR_DISABLED, Constants.TRUE);
}
- button.setAttribute(VPE_USER_TOGGLE_ID_ATTR, ""+showPopupCalendar);
//$NON-NLS-1$
+ button.setAttribute(VPE_USER_TOGGLE_ID_ATTR, Constants.EMPTY+showPopupCalendar);
td1_2.appendChild(button);
divWidth = CALENDAR_WIDTH + CALENDAR_BUTTON_WIDTH;
} else {
nsIDOMElement image = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
- image.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_IMG);
+ image.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_BUTTON);
if (attrPresents(buttonIcon)) {
- image.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, buttonIcon);
+ image.setAttribute(HTML.ATTR_SRC, buttonIcon);
divWidth = CALENDAR_WIDTH + CALENDAR_CUSTOM_IMAGE_WIDTH;
} else {
ComponentUtil.setImg(image, BUTTON_IMG);
divWidth = CALENDAR_WIDTH + CALENDAR_IMAGE_WIDTH;
}
- image.setAttribute(VPE_USER_TOGGLE_ID_ATTR, ""+showPopupCalendar);
//$NON-NLS-1$
+ image.setAttribute(VPE_USER_TOGGLE_ID_ATTR, Constants.EMPTY+showPopupCalendar);
td1_2.appendChild(image);
}
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH + " : " //$NON-NLS-1$
+ div.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ divWidth + "px; overflow: hidden;"); //$NON-NLS-1$
return div;
}
@@ -452,21 +447,21 @@
*/
private nsIDOMElement createCalendar(nsIDOMDocument visualDocument, VpeCreationData
creationData, Element sourceElement) {
nsIDOMElement div = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH + " : " + CALENDAR_WIDTH //$NON-NLS-1$
+ .createElement(HTML.TAG_DIV);
+ div.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + CALENDAR_WIDTH
+ "px; overflow: hidden;"); //$NON-NLS-1$
nsIDOMElement table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TABLE);
+ table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_EXTERIOR);
nsIDOMElement tbody = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ .createElement(HTML.TAG_TBODY);
Element headerFacet = ComponentUtil.getFacet(sourceElement, HEADER);
nsIDOMElement optionalHeader = null;
if (null != headerFacet) {
@@ -481,10 +476,10 @@
nsIDOMElement calendarBody = createCalendarBody(visualDocument);
nsIDOMElement footer = null;
- if (!"false".equals(showHeader)) { //$NON-NLS-1$
+ if (!Constants.FALSE.equals(showHeader)) {
header = createCalendarHeader(visualDocument);
}
- if (!"false".equals(showFooter)) { //$NON-NLS-1$
+ if (!Constants.FALSE.equals(showFooter)) {
footer = createCalendarFooter(visualDocument);
}
@@ -521,16 +516,16 @@
private nsIDOMElement createCalendarOptionalHeaderOrFooter(
nsIDOMDocument visualDocument, VpeCreationData creationData, Element facetBody,
boolean isHeader) {
nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, "" + COLUMN);
//$NON-NLS-1$
+ .createElement(HTML.TAG_TD);
+ td.setAttribute(HTML.ATTR_COLSPAN, Constants.EMPTY + COLUMN);
tr.appendChild(td);
if (isHeader) {
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_R_C_HEADER_OPTIONAL);
+ td.setAttribute(HTML.ATTR_CLASS, CSS_R_C_HEADER_OPTIONAL);
} else {
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_R_C_FOOTER_OPTIONAL);
+ td.setAttribute(HTML.ATTR_CLASS, CSS_R_C_FOOTER_OPTIONAL);
}
VpeChildrenInfo child = new VpeChildrenInfo(td);
@@ -546,13 +541,13 @@
*/
private nsIDOMElement createCalendarHeader(nsIDOMDocument visualDocument) {
nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, "" + COLUMN);
//$NON-NLS-1$
+ .createElement(HTML.TAG_TD);
+ td.setAttribute(HTML.ATTR_COLSPAN, Constants.EMPTY + COLUMN);
String[] array;
- if ("false".equalsIgnoreCase(popup)) { //$NON-NLS-1$
+ if (Constants.FALSE.equalsIgnoreCase(popup)) {
array = HEADER_CONTENT;
} else {
array = HEADER_CONTENT_ON_POPUP;
@@ -572,30 +567,30 @@
array[2] = sdf.format(date);
nsIDOMElement table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, FILL_WIDTH);
+ .createElement(HTML.TAG_TABLE);
+ table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_WIDTH, FILL_WIDTH);
nsIDOMElement tbody = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ .createElement(HTML.TAG_TBODY);
nsIDOMElement tr1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
- tr1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TR);
+ tr1.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_HEADER);
for (int i = 0; i < array.length; i++) {
nsIDOMElement td1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TD);
+ td1.setAttribute(HTML.ATTR_CLASS,
i == 2 ? CSS_R_C_MONTH : CSS_R_C_TOOL);
// close tool
if (i == 5) {
td1.setAttribute(VPE_USER_TOGGLE_ID_ATTR, "0"); //$NON-NLS-1$
- td1.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, "cursor: pointer;");
//$NON-NLS-1$
+ td1.setAttribute(HTML.ATTR_STYLE, "cursor: pointer;"); //$NON-NLS-1$
}
nsIDOMText text1 = visualDocument.createTextNode(array[i]);
@@ -619,25 +614,25 @@
*/
private nsIDOMElement createCalendarFooter(nsIDOMDocument visualDocument) {
nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, "" + COLUMN);
//$NON-NLS-1$
+ .createElement(HTML.TAG_TD);
+ td.setAttribute(HTML.ATTR_COLSPAN, Constants.EMPTY + COLUMN);
nsIDOMElement table = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
//$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0"); //$NON-NLS-1$
- table.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, FILL_WIDTH);
+ .createElement(HTML.TAG_TABLE);
+ table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_WIDTH, FILL_WIDTH);
nsIDOMElement tr1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
- tr1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TR);
+ tr1.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_FOOTER);
nsIDOMElement td1 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td1.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TD);
+ td1.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_TOOLFOOTER);
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); //$NON-NLS-1$
@@ -649,22 +644,22 @@
tr1.appendChild(td1);
nsIDOMElement td2 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td2.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, FILL_WIDTH);
+ .createElement(HTML.TAG_TD);
+ td2.setAttribute(HTML.ATTR_WIDTH, FILL_WIDTH);
tr1.appendChild(td2);
nsIDOMElement td3 = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- td3.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, FILL_WIDTH);
- td3.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TD);
+ td3.setAttribute(HTML.ATTR_WIDTH, FILL_WIDTH);
+ td3.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_TOOLFOOTER);
- td3.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR,
- HtmlComponentUtil.HTML_ALIGN_RIGHT_VALUE);
+ td3.setAttribute(HTML.ATTR_ALIGN,
+ HTML.VALUE_RIGHT_ALIGN);
String nodeText;
- if ("false".equalsIgnoreCase(showApplyButton)) { //$NON-NLS-1$
+ if (Constants.FALSE.equalsIgnoreCase(showApplyButton)) {
if ("hidden".equalsIgnoreCase(todayControlMode)) { //$NON-NLS-1$
- nodeText = ""; //$NON-NLS-1$
+ nodeText = Constants.EMPTY;
} else {
nodeText = TODAY;
}
@@ -695,36 +690,36 @@
private nsIDOMElement createCalendarBody(nsIDOMDocument visualDocument) {
nsIDOMElement tbody = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ .createElement(HTML.TAG_TBODY);
nsIDOMElement bodyTR = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
Calendar cal1 = getCalendarWithLocale();
cal1.set(Calendar.WEEK_OF_MONTH, Calendar.SATURDAY);
// Create week days row
- if (!"false".equalsIgnoreCase(showWeekDaysBar)) { //$NON-NLS-1$
+ if (!Constants.FALSE.equalsIgnoreCase(showWeekDaysBar)) {
for (int i = 0; i < COLUMN; i++) {
nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- if ((i == 0) && (!"false".equalsIgnoreCase(showWeeksBar))) {
//$NON-NLS-1$
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TD);
+ if ((i == 0) && (!Constants.FALSE.equalsIgnoreCase(showWeeksBar))) {
+ td.setAttribute(HTML.ATTR_CLASS,
WEEK_DAY_HTML_CLASS_ATTR);
nsIDOMElement br = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_BR);
+ .createElement(HTML.TAG_BR);
td.appendChild(br);
bodyTR.appendChild(td);
} else if ( i > 0) {
if (holidays.contains(weeks[i - 1])) {
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ td.setAttribute(HTML.ATTR_CLASS,
HOL_WEEK_DAY_HTML_CLASS_ATTR);
} else {
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ td.setAttribute(HTML.ATTR_CLASS,
WEEK_DAY_HTML_CLASS_ATTR);
}
- nsIDOMText text = visualDocument.createTextNode(i == 0 ? "" //$NON-NLS-1$
+ nsIDOMText text = visualDocument.createTextNode(i == 0 ? Constants.EMPTY
: weeks[i - 1]);
td.appendChild(text);
bodyTR.appendChild(td);
@@ -750,15 +745,15 @@
for (int i = NUM_WEEK_ON_PAGE; i > 0; i--) {
nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ .createElement(HTML.TAG_TR);
- if (!"false".equalsIgnoreCase(showWeeksBar)) { //$NON-NLS-1$
+ if (!Constants.FALSE.equalsIgnoreCase(showWeeksBar)) {
// Week in year
nsIDOMElement weekTD = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- weekTD.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ .createElement(HTML.TAG_TD);
+ weekTD.setAttribute(HTML.ATTR_CLASS,
CSS_R_C_WEEK);
- nsIDOMText weekText = visualDocument.createTextNode("" //$NON-NLS-1$
+ nsIDOMText weekText = visualDocument.createTextNode(Constants.EMPTY
+ cal.get(Calendar.WEEK_OF_YEAR));
weekTD.appendChild(weekText);
tr.appendChild(weekTD);
@@ -769,9 +764,9 @@
for (int j = NUM_DAYS_IN_WEEK; j > 0; j--) {
nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
+ .createElement(HTML.TAG_TD);
- String currentAttr = ""; //$NON-NLS-1$
+ String currentAttr = Constants.EMPTY;
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
@@ -803,21 +798,21 @@
}
}
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, currentAttr);
+ td.setAttribute(HTML.ATTR_CLASS, currentAttr);
if (attrPresents(cellWidth) && attrPresents(cellHeight)) {
- td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH + ":" + cellWidth //$NON-NLS-1$
- + "px;" + HtmlComponentUtil.HTML_ATR_HEIGHT //$NON-NLS-1$
- + ":" + cellHeight + "px;"); //$NON-NLS-1$ //$NON-NLS-2$
+ td.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + cellWidth
+ + "px;" + HTML.STYLE_PARAMETER_HEIGHT //$NON-NLS-1$
+ + Constants.COLON + cellHeight + "px;"); //$NON-NLS-1$
} else if (attrPresents(cellWidth)) {
- td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_WIDTH +":" + cellWidth + "px;");
//$NON-NLS-1$ //$NON-NLS-2$
+ td.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH +Constants.COLON + cellWidth + "px;");
//$NON-NLS-1$
} else if (attrPresents(cellHeight)) {
- td.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
- HtmlComponentUtil.HTML_ATR_HEIGHT+":" + cellHeight + "px;");
//$NON-NLS-1$ //$NON-NLS-2$
+ td.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_HEIGHT+Constants.COLON + cellHeight + "px;");
//$NON-NLS-1$
}
- nsIDOMText text = visualDocument.createTextNode("" //$NON-NLS-1$
+ nsIDOMText text = visualDocument.createTextNode(Constants.EMPTY
+ cal.get(Calendar.DAY_OF_MONTH));
td.appendChild(text);
tr.appendChild(td);
@@ -839,9 +834,9 @@
String name, String value) {
super.setAttribute(pageContext, sourceElement, visualDocument,
visualNode, data, name, value);
- if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_VALUE_ATTR)) {
- String popup = sourceElement.getAttribute(POPUP);
- if (popup != null && popup.equalsIgnoreCase("false"))
//$NON-NLS-1$
+ if (name.equalsIgnoreCase(RichFaces.ATTR_VALUE)) {
+ String popup = sourceElement.getAttribute(RichFaces.ATTR_POPUP);
+ if (popup != null && popup.equalsIgnoreCase(Constants.FALSE))
return;
nsIDOMElement element = (nsIDOMElement) visualNode
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
@@ -849,7 +844,7 @@
nsIDOMNode tableNode = list.item(0);
nsIDOMElement input = (nsIDOMElement) tableNode
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- input.setAttribute(HtmlComponentUtil.HTML_VALUE_ATTR, value);
+ input.setAttribute(HTML.ATTR_VALUE, value);
}
}
@@ -863,9 +858,9 @@
nsIDOMNode visualNode, Object data, String name) {
super.removeAttribute(pageContext, sourceElement, visualDocument,
visualNode, data, name);
- if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_VALUE_ATTR)) {
- String popup = sourceElement.getAttribute(POPUP);
- if (popup != null && popup.equalsIgnoreCase("false"))
//$NON-NLS-1$
+ if (name.equalsIgnoreCase(RichFaces.ATTR_VALUE)) {
+ String popup = sourceElement.getAttribute(RichFaces.ATTR_POPUP);
+ if (popup != null && popup.equalsIgnoreCase(Constants.FALSE))
return;
nsIDOMElement element = (nsIDOMElement) visualNode
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
@@ -873,7 +868,7 @@
nsIDOMNode tableNode = list.item(0);
nsIDOMElement input = (nsIDOMElement) tableNode
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- input.removeAttribute(HtmlComponentUtil.HTML_VALUE_ATTR);
+ input.removeAttribute(HTML.ATTR_VALUE);
}
}
@@ -886,17 +881,17 @@
Element source = (Element) sourceNode;
buttonLabel = source.getAttribute(BUTTON_LABEL);
buttonIcon = source.getAttribute(BUTTON_ICON);
- direction = source.getAttribute(DIRECTION);
+ direction = source.getAttribute(RichFaces.ATTR_DIRECTION);
cellHeight = source.getAttribute(CELL_HEIGHT);
cellWidth = source.getAttribute(CELL_WIDTH);
datePattern = source.getAttribute(DATE_PATTERN);
- value = source.getAttribute(VALUE);
- disabled = source.getAttribute(DISABLED);
+ value = source.getAttribute(RichFaces.ATTR_VALUE);
+ disabled = source.getAttribute(RichFaces.ATTR_DISABLED);
enableManualInput = source.getAttribute(ENABLE_MANUAL_INPUT);
horizontalOffset = source.getAttribute(HORIZONTAL_OFFSET);
verticalOffset = source.getAttribute(VERTICAL_OFFSET);
locale = source.getAttribute(LOCALE);
- popup = source.getAttribute(POPUP);
+ popup = source.getAttribute(RichFaces.ATTR_POPUP);
showApplyButton = source.getAttribute(SHOW_APPLY_BUTTON);
showInput = source.getAttribute(SHOW_INPUT);
showWeekDaysBar = source.getAttribute(SHOW_SHOW_WEEKS_DAY_BAR);
@@ -915,7 +910,7 @@
* @return true, if successful
*/
private boolean attrPresents(String attr) {
- return ((null != attr) && (!"".equals(attr))); //$NON-NLS-1$
+ return ((null != attr) && (attr.length()!=0));
}
/**
@@ -930,7 +925,7 @@
}
SimpleDateFormat sdf = new SimpleDateFormat("EE"); //$NON-NLS-1$
- String dayOfWeek = ""; //$NON-NLS-1$
+ String dayOfWeek = Constants.EMPTY;
for (int i = 0; i < NUM_DAYS_IN_WEEK; i++) {
dayOfWeek = sdf.format(cal.getTime());
weeks[i] = dayOfWeek;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -1,12 +1,12 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+/*******************************************************************************
+ * 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
@@ -19,7 +19,6 @@
import java.util.Map;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
@@ -27,8 +26,8 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementData;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -181,12 +180,12 @@
final Element source = (Element) sourceNode;
prepareData(source);
- final nsIDOMElement rootDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
//Fix
https://jira.jboss.org/jira/browse/JBIDE-2430 issue with resizement.
- rootDiv.setAttribute("style", "width : "+sourceWidth);
//$NON-NLS-1$ //$NON-NLS-2$
- final nsIDOMElement secondDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- secondDiv.setAttribute("align", this.sourceAlign); //$NON-NLS-1$
+ rootDiv.setAttribute(HTML.ATTR_STYLE,
HTML.STYLE_PARAMETER_WIDTH+Constants.COLON+sourceWidth);
+ final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
+ secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv"));
//$NON-NLS-1$
String secondDivSubStyle = "; position: {0}; z-index: {1} ;";
//$NON-NLS-1$
if (isToggle) {
@@ -195,18 +194,18 @@
secondDivSubStyle = MessageFormat.format(secondDivSubStyle,
"static", "0"); //$NON-NLS-1$ //$NON-NLS-2$
}
// TODO add ATTR_STYLE.
- secondDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + this.sourceListWidth
- + VpeStyleUtil.SEMICOLON_STRING + secondDivSubStyle + sourceStyle);
- final nsIDOMElement thirdDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ secondDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH +
Constants.COLON + this.sourceListWidth
+ + Constants.SEMICOLON + secondDivSubStyle + sourceStyle);
+ final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("thirdDiv"));
//$NON-NLS-1$
- thirdDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING + this.sourceWidth
+ thirdDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH +
Constants.COLON + this.sourceWidth
+ "; z-index: 1;"); //$NON-NLS-1$
- final nsIDOMElement firstInput =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- firstInput.setAttribute(HTML.ATTR_TYPE, "text"); //$NON-NLS-1$
+ final nsIDOMElement firstInput = visualDocument.createElement(HTML.TAG_INPUT);
+ firstInput.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
;
- firstInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get("firstInput")
+ " " + sourceInputClass); //$NON-NLS-1$ //$NON-NLS-2$
+ firstInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get("firstInput")
+ Constants.WHITE_SPACE + sourceInputClass); //$NON-NLS-1$
firstInput.setAttribute("autocomplete", "off"); //$NON-NLS-1$
//$NON-NLS-2$
- firstInput.setAttribute(HTML.ATTR_STYLE, "width: " +
calculateWithForDiv(this.sourceWidth, 17) + VpeStyleUtil.SEMICOLON_STRING //$NON-NLS-1$
+ firstInput.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH+
Constants.COLON + calculateWithForDiv(this.sourceWidth, 17) + Constants.SEMICOLON
+ sourceInputStyle);
String value = null;
if (ComponentUtil.isNotBlank(this.sourceDefaultLabel)) {
@@ -218,21 +217,21 @@
if (value != null) {
firstInput.setAttribute(RichFaces.ATTR_VALUE, value);
}
- final nsIDOMElement secondInput =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- secondInput.setAttribute(HTML.ATTR_TYPE, "text"); //$NON-NLS-1$
+ final nsIDOMElement secondInput = visualDocument.createElement(HTML.TAG_INPUT);
+ secondInput.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
;
secondInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_INPUT));
- secondInput.setAttribute("readonly", String.valueOf(Boolean.TRUE));
//$NON-NLS-1$
+ secondInput.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
secondInput.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR,
String.valueOf(0));
if (this.sourceButtonStyle != null) {
secondInput.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
}
//
- final nsIDOMElement thirdInput =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- thirdInput.setAttribute(HTML.ATTR_TYPE, "text"); //$NON-NLS-1$
+ final nsIDOMElement thirdInput = visualDocument.createElement(HTML.TAG_INPUT);
+ thirdInput.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
;
thirdInput.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("thirdInput")); //$NON-NLS-1$
- thirdInput.setAttribute("readonly", String.valueOf(Boolean.TRUE));
//$NON-NLS-1$
+ thirdInput.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
thirdInput.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR,
String.valueOf(0));
if (this.sourceButtonStyle != null) {
thirdInput.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
@@ -243,9 +242,9 @@
// thirdInput.setAttribute(HTML.ATTR_STYLE,
thirdInput.getAttribute(HTML.ATTR_STYLE) + " ; background-image: url("
// + this.sourceButtonIcon + ")");
// }
- final nsIDOMElement forthEmptyDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement forthEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
forthEmptyDiv.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("forthEmptyDiv")); //$NON-NLS-1$
- forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, VpeStyleUtil.PARAMETER_WIDTH +
VpeStyleUtil.COLON_STRING
+ forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH +
Constants.COLON
+ calculateWithForDiv(this.sourceWidth, 10));
forthEmptyDiv.appendChild(visualDocument.createTextNode("Struts"));
//$NON-NLS-1$
@@ -278,26 +277,26 @@
*/
private nsIDOMNode createToogleDiv(VpePageContext pageContext, Element source,
nsIDOMDocument visualDocument) {
- final nsIDOMElement thirdEmptyDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement thirdEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
- thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, this.sourceListStyle +
VpeStyleUtil.SEMICOLON_STRING
+ thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, this.sourceListStyle +
Constants.SEMICOLON
+ " z-index: 3; position: absolute; visibility: visible; top: 16px;
left: 0px;"); //$NON-NLS-1$
thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS,
styleClasess.get("thirdEmptyDiv") + " " + this.sourceListClass);
//$NON-NLS-1$ //$NON-NLS-2$
thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, "z-index: 3; position: absolute;
visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
- final nsIDOMElement shadovDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement shadovDiv = visualDocument.createElement(HTML.TAG_DIV);
- final nsIDOMElement positionDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement positionDiv = visualDocument.createElement(HTML.TAG_DIV);
positionDiv.setAttribute(HTML.ATTR_CLASS,
"rich-combobox-list-position"); //$NON-NLS-1$
- final nsIDOMElement decorationDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement decorationDiv = visualDocument.createElement(HTML.TAG_DIV);
decorationDiv.setAttribute(HTML.ATTR_CLASS,
"rich-combobox-list-decoration"); //$NON-NLS-1$
// decorationDiv.setAttribute(HTML.ATTR_STYLE,
// "height: 54px; width: 208px;");
- final nsIDOMElement scrollDiv =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ final nsIDOMElement scrollDiv = visualDocument.createElement(HTML.TAG_DIV);
scrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-scroll");
//$NON-NLS-1$
final List<Element> items =
ComponentUtil.getSelectItems(source.getChildNodes());
int defaultHeight = LIST_ITEM_HEIGHT_DEFAULT_VALUE;
@@ -308,7 +307,10 @@
final String listHeight = ComponentUtil.isNotBlank(this.sourceListHeight) ?
this.sourceListHeight : String.valueOf(defaultHeight)
+ "px"; //$NON-NLS-1$
- scrollDiv.setAttribute(HTML.ATTR_STYLE, "height: "+listHeight+";
width: " + calculateWithForDiv(sourceListWidth, 2)); //$NON-NLS-1$ //$NON-NLS-2$
+ scrollDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_HEIGHT
+ + Constants.COLON + listHeight + Constants.SEMICOLON
+ + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + calculateWithForDiv(sourceListWidth, 2));
final List<Element> selectItems =
ComponentUtil.getSelectItems(source.getChildNodes());
@@ -320,11 +322,11 @@
shadovDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow");
//$NON-NLS-1$
- final nsIDOMElement table =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ final nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
- String width = ""; //$NON-NLS-1$
+ String width = Constants.EMPTY;
try {
int w = ComponentUtil.parseWidthHeightValue(sourceListWidth);
@@ -333,22 +335,25 @@
} catch (ParseException e) {
width = "217"; //$NON-NLS-1$
}
- table.setAttribute(HTML.ATTR_STYLE, "width: " + width + "px ;
height: 63px;"); //$NON-NLS-1$ //$NON-NLS-2$
+ table.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH
+ + Constants.COLON + width + Constants.PIXEL
+ + Constants.SEMICOLON + HTML.STYLE_PARAMETER_HEIGHT
+ + Constants.COLON + "63px;"); //$NON-NLS-1$
- final nsIDOMElement tr1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
- final nsIDOMElement tr2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ final nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
- final nsIDOMElement tr1_td1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- final nsIDOMElement tr1_td2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement tr1_td1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr1_td2 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement tr2_td1 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- final nsIDOMElement tr2_td2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement tr2_td1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr2_td2 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement tr1_td1_img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- final nsIDOMElement tr1_td2_img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement tr1_td1_img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement tr1_td2_img = visualDocument.createElement(HTML.TAG_IMG);
- final nsIDOMElement tr2_td1_img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- final nsIDOMElement tr2_td2_img =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ final nsIDOMElement tr2_td1_img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement tr2_td2_img = visualDocument.createElement(HTML.TAG_IMG);
tr1_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tl");
//$NON-NLS-1$
tr1_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tr");
//$NON-NLS-1$
@@ -376,16 +381,16 @@
tr2.appendChild(tr2_td2);
tr1_td1.appendChild(tr1_td1_img);
-
tr1_td1.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+ tr1_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
tr1_td2.appendChild(tr1_td2_img);
-
tr1_td2.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+ tr1_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
tr2_td1.appendChild(tr2_td1_img);
-
tr2_td1.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+ tr2_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
tr2_td2.appendChild(tr2_td2_img);
-
tr2_td2.appendChild(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_BR));
+ tr2_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
return thirdEmptyDiv;
}
@@ -399,7 +404,7 @@
* @return the ns IDOM node
*/
private nsIDOMNode createSelectItem(Element e, nsIDOMDocument visualDocument) {
- final nsIDOMElement item =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+ final nsIDOMElement item = visualDocument.createElement(HTML.TAG_SPAN);
item.setAttribute(HTML.ATTR_CLASS, "rich-combobox-item " +
sourceItemClass); //$NON-NLS-1$
item.appendChild(visualDocument.createTextNode(ComponentUtil.getSelectItemValue(e)));
@@ -498,7 +503,7 @@
String returnValue = getDefaultInputClass();
String tmp = getAttribute(sourceElement, RichFaces.ATTR_INPUT_CLASS);
if (tmp.length() != 0) {
- returnValue = new StringBuffer().append(returnValue).append(" ")
//$NON-NLS-1$
+ returnValue = new
StringBuffer().append(returnValue).append(Constants.WHITE_SPACE)
.append(tmp).toString();
}
return returnValue;
@@ -591,19 +596,19 @@
* @param source the source
*/
private void prepareData(Element source) {
- this.sourceAlign = source.getAttribute("align"); //$NON-NLS-1$
+ this.sourceAlign = source.getAttribute(RichFaces.ATTR_ALIGN);
if (ComponentUtil.isBlank(this.sourceAlign)) {
this.sourceAlign = DEFAULT_ALIGN;
}
- this.sourceListWidth = source.getAttribute("listWidth"); //$NON-NLS-1$
+ this.sourceListWidth = source.getAttribute(RichFaces.ATTR_LIST_WIDTH);
if (ComponentUtil.isBlank(this.sourceListWidth)) {
this.sourceListWidth = DEFAULT_LIST_WIDTH;
}
- this.sourceListHeight = source.getAttribute("listHeight");
//$NON-NLS-1$
+ this.sourceListHeight = source.getAttribute(RichFaces.ATTR_LIST_HEIGHT);
- this.sourceWidth = source.getAttribute("width"); //$NON-NLS-1$
+ this.sourceWidth = source.getAttribute(RichFaces.ATTR_WIDTH);
if (ComponentUtil.isBlank(this.sourceWidth)) {
this.sourceWidth = DEFAULT_LIST_WIDTH;
@@ -612,10 +617,10 @@
}
if (ComponentUtil.isNotBlank(this.sourceWidth) && (this.sourceWidth !=
DEFAULT_LIST_WIDTH)) {
- if(!this.sourceWidth.endsWith("px")){ //$NON-NLS-1$
+ if(!this.sourceWidth.endsWith(Constants.PIXEL)){
try {
int intValue = Integer.parseInt(this.sourceWidth);
- this.sourceWidth = String.valueOf(intValue)+"px";
//$NON-NLS-1$
+ this.sourceWidth = String.valueOf(intValue)+Constants.PIXEL;
} catch (NumberFormatException e) {
this.sourceListWidth = DEFAULT_LIST_WIDTH;
}
@@ -623,7 +628,7 @@
}
this.sourceDefaultLabel = ComponentUtil.getAttribute(source,
"defaultLabel"); //$NON-NLS-1$
- this.sourceValue = ComponentUtil.getAttribute(source, "value");
//$NON-NLS-1$
+ this.sourceValue = ComponentUtil.getAttribute(source, RichFaces.ATTR_VALUE);
this.sourceButtonStyle = ComponentUtil.getAttribute(source,
"buttonStyle"); //$NON-NLS-1$
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -11,9 +11,11 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -28,11 +30,11 @@
public class RichFacesDataFilterSliderTemplate extends AbstractRichFacesTemplate {
/** IMAGE_SPACER */
- final static String IMAGE_SPACER = "/common/spacer.gif";
+ final static String IMAGE_SPACER = "/common/spacer.gif"; //$NON-NLS-1$
- final static String CENTER_SLIDER = "/dataFilterSlider/pos.gif";
+ final static String CENTER_SLIDER = "/dataFilterSlider/pos.gif";
//$NON-NLS-1$
- final static String STYLE_PATH = "/dataFilterSlider/dataFilterSlider.css";
+ final static String STYLE_PATH = "/dataFilterSlider/dataFilterSlider.css";
//$NON-NLS-1$
final static int DEFAULT_WIDTH = 260;
@@ -41,28 +43,24 @@
final static int DEFAULT_HEIGHT = 20;
- final static String DEFAULT_SLIDER_POSITION = "left: -38px; width: 114px;";
+ final static String DEFAULT_SLIDER_POSITION = "left: -38px; width: 114px;";
//$NON-NLS-1$
- final static String DEFAULT_SLIDER_WIDTH = "7px";
+ final static String DEFAULT_SLIDER_WIDTH = "7px"; //$NON-NLS-1$
- final static String DEFAULT_SLIDER_HEIGHT = "8px";
+ final static String DEFAULT_SLIDER_HEIGHT = "8px"; //$NON-NLS-1$
- final static String DEFAULT_SLIDER_BORDER = "0px";
+ final static String DEFAULT_SLIDER_BORDER = "0px"; //$NON-NLS-1$
- final static String PIXEL_PREFIX = "px";
+ final static String FIELD_STYLE_CLASS_ATR = "fieldStyleClass"; //$NON-NLS-1$
- final static String PERCENT_PREFIX = "%";
+ final static String HANDLE_STYLE_CLASS_ATR = "handleStyleClass";
//$NON-NLS-1$
- final static String FIELD_STYLE_CLASS_ATR = "fieldStyleClass";
+ final static String RANGE_STYLE_CLASS_ATR = "rangeStyleClass"; //$NON-NLS-1$
- final static String HANDLE_STYLE_CLASS_ATR = "handleStyleClass";
+ final static String TRACK_STYLE_CLASS_ATR = "trackStyleClass"; //$NON-NLS-1$
- final static String RANGE_STYLE_CLASS_ATR = "rangeStyleClass";
+ final static String TRAILER_STYLE_CLASS_ATR = "trailerStyleClass";
//$NON-NLS-1$
- final static String TRACK_STYLE_CLASS_ATR = "trackStyleClass";
-
- final static String TRAILER_STYLE_CLASS_ATR = "trailerStyleClass";
-
/**
* Constructor.
*/
@@ -85,10 +83,11 @@
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
int numWidth = 0;
- ComponentUtil.setCSSLink(pageContext, STYLE_PATH,
"richFacesDataFilterSlider");
+ ComponentUtil.setCSSLink(pageContext, STYLE_PATH,
"richFacesDataFilterSlider"); //$NON-NLS-1$
Element sourceElement = (Element) sourceNode;
- String style = ComponentUtil.getAttribute(sourceElement,
HtmlComponentUtil.HTML_STYLE_ATTR);
- String width = sourceElement.getAttribute(HtmlComponentUtil.HTML_ATR_WIDTH);
+ String style = ComponentUtil.getAttribute(sourceElement,
+ RichFaces.ATTR_STYLE);
+ String width = sourceElement.getAttribute(RichFaces.ATTR_WIDTH);
if (width != null) {
numWidth = getSize(width);
if (numWidth < DEFAULT_WIDTH) {
@@ -97,34 +96,34 @@
} else {
numWidth = DEFAULT_WIDTH;
}
- String defaultStyle = style + ";" + HtmlComponentUtil.HTML_ATR_WIDTH + "
: " + numWidth + "px ; ";
- nsIDOMElement parentDiv = createDIV(visualDocument,
"slider-container", defaultStyle);
+ String defaultStyle = style + Constants.SEMICOLON + HTML.STYLE_PARAMETER_WIDTH +
Constants.COLON + numWidth + "px ; "; //$NON-NLS-1$
+ nsIDOMElement parentDiv = createDIV(visualDocument,
"slider-container", defaultStyle); //$NON-NLS-1$
String rangeStyleClass =
ComponentUtil.getAttribute(sourceElement, RANGE_STYLE_CLASS_ATR);
- nsIDOMElement rangeDiv = createDIV(visualDocument, "range " +
rangeStyleClass,
- HtmlComponentUtil.HTML_ATR_WIDTH + " : " + (numWidth - DEFAULT_PARAGRAPH) +
"px;");
- nsIDOMElement rangeDecorDiv = createDIV(visualDocument, "range-decor",
null);
+ nsIDOMElement rangeDiv = createDIV(visualDocument, "range " +
rangeStyleClass, //$NON-NLS-1$
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + (numWidth - DEFAULT_PARAGRAPH) +
"px;"); //$NON-NLS-1$
+ nsIDOMElement rangeDecorDiv = createDIV(visualDocument, "range-decor", null);
//$NON-NLS-1$
String trailerStyleClass = ComponentUtil.getAttribute(sourceElement,
TRAILER_STYLE_CLASS_ATR);
- nsIDOMElement trailerDiv = createDIV(visualDocument, "trailer "
+ nsIDOMElement trailerDiv = createDIV(visualDocument, "trailer "
//$NON-NLS-1$
+ trailerStyleClass, DEFAULT_SLIDER_POSITION);
String trackStyleClass = ComponentUtil.getAttribute(sourceElement,
TRACK_STYLE_CLASS_ATR);
nsIDOMElement trackDiv = createDIV(visualDocument,
- "track " + trackStyleClass, HtmlComponentUtil.HTML_ATR_WIDTH
- + " : " + (numWidth - DEFAULT_PARAGRAPH) + "px;");
+ "track " + trackStyleClass, HTML.STYLE_PARAMETER_WIDTH //$NON-NLS-1$
+ + Constants.COLON + (numWidth - DEFAULT_PARAGRAPH) + "px;");
//$NON-NLS-1$
String handleStyleClass =
ComponentUtil.getAttribute(sourceElement,HANDLE_STYLE_CLASS_ATR);
- nsIDOMElement handleDiv = createDIV(visualDocument, "handle " +
handleStyleClass, null);
+ nsIDOMElement handleDiv = createDIV(visualDocument, "handle " +
handleStyleClass, null); //$NON-NLS-1$
- nsIDOMElement img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
ComponentUtil.setImg(img, CENTER_SLIDER);
- img.setAttribute(HtmlComponentUtil.HTML_ATR_WIDTH, DEFAULT_SLIDER_WIDTH);
- img.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR,DEFAULT_SLIDER_BORDER);
- img.setAttribute(HtmlComponentUtil.HTML_ATR_HEIGHT, DEFAULT_SLIDER_HEIGHT);
+ img.setAttribute(HTML.ATTR_WIDTH, DEFAULT_SLIDER_WIDTH);
+ img.setAttribute(HTML.ATTR_BORDER,DEFAULT_SLIDER_BORDER);
+ img.setAttribute(HTML.ATTR_HEIGHT, DEFAULT_SLIDER_HEIGHT);
/* Set input component */
- nsIDOMElement input = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_INPUT);
- input.setAttribute(HtmlComponentUtil.HTML_TYPE_ATTR, "text");
+ nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
+ input.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
setAttributesToInputElement(input, sourceElement);
@@ -136,24 +135,24 @@
trackDiv.appendChild(handleDiv);
handleDiv.appendChild(img);
- nsIDOMElement tableSpacer2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- tableSpacer2.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "0px");
- tableSpacer2.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0px");
- tableSpacer2.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0px");
- tableSpacer2.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%" );
- tableSpacer2.setAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR, "100%" );
+ nsIDOMElement tableSpacer2 = visualDocument.createElement(HTML.TAG_TABLE);
+ tableSpacer2.setAttribute(HTML.ATTR_CELLSPACING, "0px"); //$NON-NLS-1$
+ tableSpacer2.setAttribute(HTML.ATTR_CELLPADDING, "0px"); //$NON-NLS-1$
+ tableSpacer2.setAttribute(HTML.ATTR_BORDER, "0px"); //$NON-NLS-1$
+ tableSpacer2.setAttribute(HTML.ATTR_WIDTH, "100%" ); //$NON-NLS-1$
+ tableSpacer2.setAttribute(HTML.ATTR_HEIGHT, "100%" ); //$NON-NLS-1$
- nsIDOMElement trSpacer2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement trSpacer2 = visualDocument.createElement(HTML.TAG_TR);
- nsIDOMElement tdSpacer2 = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- tdSpacer2.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR, "right");
- tdSpacer2.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,"font-family: Arial,
Verdana, sans-serif; font-size: 5px; color: white;");
+ nsIDOMElement tdSpacer2 = visualDocument.createElement(HTML.TAG_TD);
+ tdSpacer2.setAttribute(HTML.ATTR_ALIGN, HTML.VALUE_RIGHT_ALIGN);
+ tdSpacer2.setAttribute(HTML.ATTR_STYLE,"font-family: Arial, Verdana, sans-serif;
font-size: 5px; color: white;"); //$NON-NLS-1$
trSpacer2.appendChild(tdSpacer2);
- nsIDOMElement imageSpacer2 =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement imageSpacer2 = visualDocument.createElement(HTML.TAG_IMG);
ComponentUtil.setImg(imageSpacer2, IMAGE_SPACER);
- imageSpacer2.setAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR, "100%");
- imageSpacer2.setAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR, "100%");
+ imageSpacer2.setAttribute(HTML.ATTR_WIDTH, "100%"); //$NON-NLS-1$
+ imageSpacer2.setAttribute(HTML.ATTR_HEIGHT, "100%"); //$NON-NLS-1$
tdSpacer2.appendChild(imageSpacer2);
tableSpacer2.appendChild(trSpacer2);
@@ -186,38 +185,38 @@
if (name.equalsIgnoreCase(RANGE_STYLE_CLASS_ATR)) {
nsIDOMElement range = getRangeElement(element);
- range.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
- range.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "range");
+ range.removeAttribute(HTML.ATTR_CLASS);
+ range.setAttribute(HTML.ATTR_CLASS, "range"); //$NON-NLS-1$
} else if (name.equalsIgnoreCase(TRAILER_STYLE_CLASS_ATR)) {
nsIDOMElement trailer = getTrailerElement(element);
- trailer.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
- trailer.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "trailer");
+ trailer.removeAttribute(HTML.ATTR_CLASS);
+ trailer.setAttribute(HTML.ATTR_CLASS, "trailer"); //$NON-NLS-1$
} else if (name.equalsIgnoreCase(TRACK_STYLE_CLASS_ATR)) {
nsIDOMElement track = getTrackElement(element);
- track.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
- track.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "track");
+ track.removeAttribute(HTML.ATTR_CLASS);
+ track.setAttribute(HTML.ATTR_CLASS, "track"); //$NON-NLS-1$
} else if (name.equalsIgnoreCase(HANDLE_STYLE_CLASS_ATR)) {
nsIDOMElement handle = getHandleElement(element);
- handle.removeAttribute(HtmlComponentUtil.HTML_CLASS_ATTR);
- handle.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "handle");
+ handle.removeAttribute(HTML.ATTR_CLASS);
+ handle.setAttribute(HTML.ATTR_CLASS, "handle"); //$NON-NLS-1$
} else if (name.equalsIgnoreCase(FIELD_STYLE_CLASS_ATR)) {
nsIDOMElement field = getInputElement(element);
setAttributesToInputElement( field, sourceElement );
- } else if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_ATR_WIDTH)) {
+ } else if (name.equalsIgnoreCase(RichFaces.ATTR_WIDTH)) {
nsIDOMElement range = getRangeElement(element);
String style = ComponentUtil.getAttribute(sourceElement,
- HtmlComponentUtil.HTML_STYLE_ATTR);
- element.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style + ";"
- + HtmlComponentUtil.HTML_ATR_WIDTH + " : " + DEFAULT_WIDTH
- + "px ; ");
+ RichFaces.ATTR_STYLE);
+ element.setAttribute(HTML.ATTR_STYLE, style + Constants.SEMICOLON
+ + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + DEFAULT_WIDTH
+ + "px ; "); //$NON-NLS-1$
String rangeStyle = ComponentUtil.getAttribute(range,
- HtmlComponentUtil.HTML_STYLE_ATTR);
- range.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, rangeStyle
- + ";" + HtmlComponentUtil.HTML_ATR_WIDTH + " : "
- + (DEFAULT_WIDTH - DEFAULT_PARAGRAPH) + "px;");
- } else if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_STYLE_ATTR)) {
+ HTML.ATTR_STYLE);
+ range.setAttribute(HTML.ATTR_STYLE, rangeStyle
+ + Constants.SEMICOLON + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + (DEFAULT_WIDTH - DEFAULT_PARAGRAPH) + "px;"); //$NON-NLS-1$
+ } else if (name.equalsIgnoreCase(RichFaces.ATTR_STYLE)) {
String width = sourceElement
- .getAttribute(HtmlComponentUtil.HTML_ATR_WIDTH);
+ .getAttribute(RichFaces.ATTR_WIDTH);
if (width != null) {
numWidth = getSize(width);
if (numWidth < DEFAULT_WIDTH) {
@@ -226,9 +225,9 @@
} else {
numWidth = DEFAULT_WIDTH;
}
- String style = HtmlComponentUtil.HTML_ATR_WIDTH + " : " + numWidth
- + "px ; ";
- element.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+ String style = HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + numWidth
+ + "px ; "; //$NON-NLS-1$
+ element.setAttribute(HTML.ATTR_STYLE, style);
} else {
element.removeAttribute(name);
}
@@ -254,7 +253,7 @@
int numWidth = 0;
- if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_ATR_WIDTH)) {
+ if (name.equalsIgnoreCase(RichFaces.ATTR_WIDTH)) {
int size = getSize(value);
if (size < DEFAULT_WIDTH) {
size = DEFAULT_WIDTH;
@@ -263,41 +262,41 @@
nsIDOMElement trackDiv = getTrackElement(parentDiv);
String style = ComponentUtil.getAttribute(parentDiv,
- HtmlComponentUtil.HTML_STYLE_ATTR);
- style = style + HtmlComponentUtil.HTML_ATR_WIDTH + " : " + size
- + PIXEL_PREFIX + ";";
- parentDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+ HTML.ATTR_STYLE);
+ style = style + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + size
+ + Constants.PIXEL + Constants.SEMICOLON;
+ parentDiv.setAttribute(HTML.ATTR_STYLE, style);
String rangeStyle = ComponentUtil.getAttribute(rangeDiv,
- HtmlComponentUtil.HTML_STYLE_ATTR);
- rangeDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, rangeStyle
- + HtmlComponentUtil.HTML_ATR_WIDTH + " : "
- + (size - DEFAULT_PARAGRAPH) + "px;");
+ HTML.ATTR_STYLE);
+ rangeDiv.setAttribute(HTML.ATTR_STYLE, rangeStyle
+ + Constants.SEMICOLON + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + (size - DEFAULT_PARAGRAPH) + "px;"); //$NON-NLS-1$
String trackStyle = ComponentUtil.getAttribute(trackDiv,
- HtmlComponentUtil.HTML_STYLE_ATTR);
- trackDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, trackStyle
- + HtmlComponentUtil.HTML_ATR_WIDTH + " : "
- + (size - DEFAULT_PARAGRAPH) + "px;");
+ HTML.ATTR_STYLE);
+ trackDiv.setAttribute(HTML.ATTR_STYLE, trackStyle
+ + Constants.SEMICOLON + HTML.STYLE_PARAMETER_WIDTH+ Constants.COLON
+ + +(size - DEFAULT_PARAGRAPH) + "px;"); //$NON-NLS-1$
} else if (name.equalsIgnoreCase(RANGE_STYLE_CLASS_ATR)) {
nsIDOMElement range = getRangeElement(parentDiv);
- range.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "range "
+ range.setAttribute(HTML.ATTR_CLASS, "range " //$NON-NLS-1$
+ value);
} else if (name.equalsIgnoreCase(TRACK_STYLE_CLASS_ATR)) {
nsIDOMElement track = getTrackElement(parentDiv);
- track.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "track "
+ track.setAttribute(HTML.ATTR_CLASS, "track " //$NON-NLS-1$
+ value);
} else if (name.equalsIgnoreCase(TRAILER_STYLE_CLASS_ATR)) {
nsIDOMElement trailer = getTrailerElement(parentDiv);
- trailer.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "trailer "
+ trailer.setAttribute(HTML.ATTR_CLASS, "trailer " //$NON-NLS-1$
+ value);
} else if (name.equalsIgnoreCase(HANDLE_STYLE_CLASS_ATR)) {
nsIDOMElement handle = getHandleElement(parentDiv);
- handle.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "handle "
+ handle.setAttribute(HTML.ATTR_CLASS, "handle " //$NON-NLS-1$
+ value);
} else if (name.equalsIgnoreCase(FIELD_STYLE_CLASS_ATR)) {
- } else if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_STYLE_ATTR)) {
+ } else if (name.equalsIgnoreCase(RichFaces.ATTR_STYLE)) {
String width = sourceElement
- .getAttribute(HtmlComponentUtil.HTML_ATR_WIDTH);
+ .getAttribute(RichFaces.ATTR_WIDTH);
if (width != null) {
numWidth = getSize(width);
if (numWidth < DEFAULT_WIDTH) {
@@ -306,9 +305,9 @@
} else {
numWidth = DEFAULT_WIDTH;
}
- String style = HtmlComponentUtil.HTML_ATR_WIDTH + " : " + numWidth
- + "px ; " + value;
- parentDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+ String style = HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + numWidth
+ + "px ; " + value; //$NON-NLS-1$
+ parentDiv.setAttribute(HTML.ATTR_STYLE, style);
} else {
parentDiv.setAttribute(name, value);
}
@@ -322,12 +321,12 @@
* @param style
*/
private nsIDOMElement createDIV(nsIDOMDocument visualDocument, String styleClass, String
style) {
- nsIDOMElement div = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
if (styleClass != null) {
- div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ div.setAttribute(HTML.ATTR_CLASS, styleClass);
}
if (style != null) {
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+ div.setAttribute(HTML.ATTR_STYLE, style);
}
return div;
}
@@ -340,11 +339,11 @@
*/
private int getSize(String size) {
String num = size;
- int pos = num.indexOf(PIXEL_PREFIX);
+ int pos = num.indexOf(Constants.PIXEL);
if (pos != -1) {
num = num.substring(0, pos);
}
- pos = num.indexOf(PERCENT_PREFIX);
+ pos = num.indexOf(Constants.PERCENT);
if (pos != -1) {
num = num.substring(0, pos);
}
@@ -479,19 +478,19 @@
private void setAttributesToInputElement( nsIDOMElement inputElement, Element
sourceElement) {
String styleClass = getAttribute(FIELD_STYLE_CLASS_ATR, sourceElement);
- String value = getAttribute("handleValue", sourceElement);
+ String value = getAttribute("handleValue", sourceElement); //$NON-NLS-1$
if ( value.length() == 0 ) {
- value = "N/A";
+ value = "N/A"; //$NON-NLS-1$
}
inputElement.setAttribute(
- HtmlComponentUtil.HTML_CLASS_ATTR,
- new StringBuffer().append("slider-input-field").append("
").append(styleClass).toString()
+ HTML.ATTR_CLASS,
+ new
StringBuffer().append("slider-input-field").append(Constants.WHITE_SPACE).append(styleClass).toString()
//$NON-NLS-1$
);
inputElement.setAttribute(
- HtmlComponentUtil.HTML_VALUE_ATTR,
+ HTML.ATTR_VALUE,
value
);
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -11,10 +11,12 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -34,35 +36,33 @@
final static int SCROLL_CELL = 3;
- final static String STYLE_PATH = "dataTableScroller/dataTableScroller.css";
+ final static String STYLE_PATH = "dataTableScroller/dataTableScroller.css";
//$NON-NLS-1$
/**
* Default size component This parameter need for calculate default number
* of cells
*/
- final static String DEFAULT_STYLE_WIDTH = "width : 400px;";
+ final static String DEFAULT_STYLE_WIDTH = "width : 400px;"; //$NON-NLS-1$
/**
* Minimal size component This parameter need for calculate minimal number
* of cells
*/
- final static String MIN_STYLE_WIDTH = "width : 225px;";
+ final static String MIN_STYLE_WIDTH = "width : 225px;"; //$NON-NLS-1$
- final static String RIGHT_DOUBLE_SCROLL_SYMBOL = ">>";
+ final static String RIGHT_DOUBLE_SCROLL_SYMBOL = ">>"; //$NON-NLS-1$
- final static String RIGHT_SINGLE_SCROLL_SYMBOL = ">";
+ final static String RIGHT_SINGLE_SCROLL_SYMBOL = ">"; //$NON-NLS-1$
- final static String LEFT_DOUBLE_SCROLL_SYMBOL = "<<";
+ final static String LEFT_DOUBLE_SCROLL_SYMBOL = "<<"; //$NON-NLS-1$
- final static String LEFT_SINGLE_SCROLL_SYMBOL = "<";
+ final static String LEFT_SINGLE_SCROLL_SYMBOL = "<"; //$NON-NLS-1$
/**
* Minimal cells in datascroller
*/
final static int MIN_NUM_CELLS = 9;
- final static String PIXEL_PREFIX = "px";
-
/**
*
* Constructor.
@@ -87,22 +87,22 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
Element source = (Element) sourceNode;
ComponentUtil.setCSSLink(pageContext, STYLE_PATH,
- "richFacesDataScrollerTable");
- nsIDOMElement div = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- String style = source.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
- div.setAttribute("class", "dr-div-heigth");
+ "richFacesDataScrollerTable"); //$NON-NLS-1$
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+ String style = source.getAttribute(RichFaces.ATTR_STYLE);
+ div.setAttribute(HTML.ATTR_CLASS, "dr-div-heigth"); //$NON-NLS-1$
if (style == null) {
style = DEFAULT_STYLE_WIDTH;
}
- nsIDOMElement table = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-dscr-t dr-tbpnl-cntnt");
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR, "1");
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR, "0");
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR, "0");
- nsIDOMElement tbody = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TBODY);
- nsIDOMElement tr = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TR);
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+ table.setAttribute(HTML.ATTR_CLASS,
+ "dr-dscr-t dr-tbpnl-cntnt"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, "1"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ nsIDOMElement tbody = visualDocument.createElement(HTML.TAG_TBODY);
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
tbody.appendChild(tr);
table.appendChild(tbody);
@@ -111,7 +111,7 @@
nsIDOMElement child1 = createCell(visualDocument, false, LEFT_DOUBLE_SCROLL_SYMBOL,
SCROLL_CELL);
nsIDOMElement child2 = createCell(visualDocument, false, LEFT_SINGLE_SCROLL_SYMBOL,
SCROLL_CELL);
/* Add empty cells */
- nsIDOMElement child3 = createCell(visualDocument, false, "", EMPTY_CELL);
+ nsIDOMElement child3 = createCell(visualDocument, false, Constants.EMPTY, EMPTY_CELL);
tr.appendChild(child1);
tr.appendChild(child2);
tr.appendChild(child3);
@@ -127,11 +127,11 @@
size /= (minSize / MIN_NUM_CELLS);
/* Add number cells in datascroller */
for (int i = 0; i < (size - 6); i++) {
- nsIDOMElement child = createCell(visualDocument, (i == 0 ? true : false), ""
+ (i + 1), NUM_CELL);
+ nsIDOMElement child = createCell(visualDocument, (i == 0 ? true : false),
Constants.EMPTY + (i + 1), NUM_CELL);
tr.appendChild(child);
}
/* Add empty cell */
- child1 = createCell(visualDocument, false, "", EMPTY_CELL);
+ child1 = createCell(visualDocument, false, Constants.EMPTY, EMPTY_CELL);
/* Add scroll cells */
child2 = createCell(visualDocument, false, RIGHT_SINGLE_SCROLL_SYMBOL,
SCROLL_CELL);
@@ -141,7 +141,7 @@
tr.appendChild(child2);
tr.appendChild(child3);
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+ div.setAttribute(HTML.ATTR_STYLE, style);
div.appendChild(table);
return creationData;
}
@@ -158,21 +158,21 @@
* @return Element
*/
private nsIDOMElement createCell(nsIDOMDocument visualDocument, boolean active, String
text, int sellType) {
- nsIDOMElement td = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
- td.setAttribute(HtmlComponentUtil.HTML_ALIGN_ATTR, "center");
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
+ td.setAttribute(HTML.ATTR_ALIGN, HTML.VALUE_ALIGN_CENTER);
nsIDOMText d = visualDocument.createTextNode(text);
if (sellType == NUM_CELL) {
- td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- (active ? "dr-dscr-act" : "dr-dscr-inact"));
+ td.setAttribute(HTML.ATTR_CLASS,
+ (active ? "dr-dscr-act" : "dr-dscr-inact")); //$NON-NLS-1$
//$NON-NLS-2$
td.appendChild(d);
} else if (sellType == EMPTY_CELL) {
td
- .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-dscr-button");
+ .setAttribute(HTML.ATTR_CLASS,
+ "dr-dscr-button"); //$NON-NLS-1$
} else {
td
- .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-dscr-button");
+ .setAttribute(HTML.ATTR_CLASS,
+ "dr-dscr-button"); //$NON-NLS-1$
td.appendChild(d);
}
return td;
@@ -201,7 +201,7 @@
nsIDOMElement element = (nsIDOMElement)
visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
int size = 45;
- if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_STYLE_ATTR)) {
+ if (name.equalsIgnoreCase(RichFaces.ATTR_STYLE)) {
String str = getWidth(value);
size = getSize(str);
int minSize = getSize(getWidth(MIN_STYLE_WIDTH));
@@ -226,10 +226,10 @@
}
// Add cells in datascroller
for (int i = 0; i < (size - nodesLength); i++) {
- nsIDOMElement cell = createCell(visualDocument, false, "" + (nodesLength
- 5 + i), NUM_CELL);
+ nsIDOMElement cell = createCell(visualDocument, false,Constants.EMPTY +
(nodesLength - 5 + i), NUM_CELL);
tr.appendChild(cell);
}
- nsIDOMElement child1 = createCell(visualDocument, false, "", EMPTY_CELL);
+ nsIDOMElement child1 = createCell(visualDocument, false, Constants.EMPTY,
EMPTY_CELL);
nsIDOMElement child2 = createCell(visualDocument, false,RIGHT_SINGLE_SCROLL_SYMBOL,
SCROLL_CELL);
nsIDOMElement child3 = createCell(visualDocument, false, RIGHT_DOUBLE_SCROLL_SYMBOL,
SCROLL_CELL);
tr.appendChild(child1);
@@ -249,14 +249,14 @@
* @return size
*/
private String getWidth(String style) {
- String[] sub = style.split(";");
+ String[] sub = style.split(Constants.SEMICOLON);
for (int i = 0; i < sub.length; i++) {
sub[i] = sub[i].trim();
sub[i] = sub[i].toLowerCase();
- int pos = sub[i].indexOf(HtmlComponentUtil.HTML_ATR_WIDTH);
+ int pos = sub[i].indexOf(HTML.STYLE_PARAMETER_WIDTH);
if (pos != -1) {
if (pos == 0 || sub[i].charAt(pos - 1) != '-') {
- pos = sub[i].indexOf(":");
+ pos = sub[i].indexOf(Constants.COLON);
return sub[i].substring(pos + 1);
}
}
@@ -275,7 +275,7 @@
return 0;
}
String num = size;
- int pos = size.indexOf(PIXEL_PREFIX);
+ int pos = size.indexOf(Constants.PIXEL);
if (pos != -1) {
num = size.substring(0, pos);
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -14,10 +14,13 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -27,33 +30,34 @@
public class RichFacesDataTableTemplate extends VpeAbstractTemplate {
-
+ private static final String ATTR_BREAK_BEFORE = "breakBefore"; //$NON-NLS-1$
+
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- nsIDOMElement table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
ComponentUtil.copyAttributes(sourceNode, table);
VpeCreationData creationData = new VpeCreationData(table);
- ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css",
"richFacesDataTable");
- String tableClass = sourceElement.getAttribute("styleClass");
- table.setAttribute("class", "dr-table rich-table " +
(tableClass==null?"":tableClass));
+ ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css",
"richFacesDataTable"); //$NON-NLS-1$ //$NON-NLS-2$
+ String tableClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ table.setAttribute(HTML.ATTR_CLASS, "dr-table rich-table " +
(tableClass==null?Constants.EMPTY:tableClass)); //$NON-NLS-1$
// Encode colgroup definition.
ArrayList<Element> columns = getColumns(sourceElement);
int columnsLength = getColumnsCount(sourceElement, columns);
- nsIDOMElement colgroup = visualDocument.createElement("colgroup");
- colgroup.setAttribute("span", String.valueOf(columnsLength));
+ nsIDOMElement colgroup = visualDocument.createElement(HTML.TAG_COLGROUP);
+ colgroup.setAttribute(HTML.TAG_SPAN, String.valueOf(columnsLength));
table.appendChild(colgroup);
- String columnsWidth = sourceElement.getAttribute("columnsWidth");
+ String columnsWidth = sourceElement.getAttribute(RichFaces.ATTR_COLUMNS_WIDTH);
if (null != columnsWidth) {
- String[] widths = columnsWidth.split(",");
+ String[] widths = columnsWidth.split(Constants.COMMA);
for (int i = 0; i < widths.length; i++) {
- nsIDOMElement col = visualDocument.createElement("col");
- col.setAttribute("width", widths[i]);
+ nsIDOMElement col = visualDocument.createElement(HTML.TAG_COL);
+ col.setAttribute(HTML.ATTR_WIDTH, widths[i]);
colgroup.appendChild(col);
}
}
@@ -62,60 +66,60 @@
encodeCaption(creationData, sourceElement, visualDocument, table);
// Encode Header
- Node header = ComponentUtil.getFacet((Element)sourceElement, "header",true);
- ArrayList<Element> columnsHeaders = getColumnsWithFacet(columns,
"header");
+ Node header = ComponentUtil.getFacet((Element)sourceElement,
RichFaces.NAME_FACET_HEADER,true);
+ ArrayList<Element> columnsHeaders = getColumnsWithFacet(columns,
RichFaces.NAME_FACET_HEADER);
if(header!=null || !columnsHeaders.isEmpty()) {
- nsIDOMElement thead = visualDocument.createElement("thead");
+ nsIDOMElement thead = visualDocument.createElement(HTML.TAG_THEAD);
table.appendChild(thead);
- String headerClass = (String) sourceElement.getAttribute("headerClass");
+ String headerClass = (String)
sourceElement.getAttribute(RichFaces.ATTR_HEADER_CLASS);
if(header != null) {
encodeTableHeaderOrFooterFacet(creationData, thead, columnsLength, visualDocument,
header,
- "dr-table-header rich-table-header",
- "dr-table-header-continue rich-table-header-continue",
- "dr-table-headercell rich-table-headercell",
- headerClass, "td");
+ "dr-table-header rich-table-header", //$NON-NLS-1$
+ "dr-table-header-continue rich-table-header-continue", //$NON-NLS-1$
+ "dr-table-headercell rich-table-headercell", //$NON-NLS-1$
+ headerClass, HTML.TAG_TD);
}
if(!columnsHeaders.isEmpty()) {
- nsIDOMElement tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
thead.appendChild(tr);
- String styleClass = encodeStyleClass(null, "dr-table-subheader
rich-table-subheader", null, headerClass);
+ String styleClass = encodeStyleClass(null, "dr-table-subheader
rich-table-subheader", null, headerClass); //$NON-NLS-1$
if(styleClass!=null) {
- tr.setAttribute("class", styleClass);
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
encodeHeaderOrFooterFacets(creationData, tr, visualDocument, columnsHeaders,
- "dr-table-subheadercell rich-table-subheadercell",
- headerClass, "header", "td");
+ "dr-table-subheadercell rich-table-subheadercell", //$NON-NLS-1$
+ headerClass, RichFaces.NAME_FACET_HEADER, HTML.TAG_TD);
}
}
// Encode Footer
- Element footer = ComponentUtil.getFacet(sourceElement, "footer");
- ArrayList<Element> columnsFooters = getColumnsWithFacet(columns,
"footer");
+ Element footer = ComponentUtil.getFacet(sourceElement, RichFaces.NAME_FACET_FOOTER);
+ ArrayList<Element> columnsFooters = getColumnsWithFacet(columns,
RichFaces.NAME_FACET_FOOTER);
if (footer != null || !columnsFooters.isEmpty()) {
- nsIDOMElement tfoot = visualDocument.createElement("tfoot");
+ nsIDOMElement tfoot = visualDocument.createElement(HTML.TAG_TFOOT);
table.appendChild(tfoot);
- String footerClass = (String) sourceElement.getAttribute("footerClass");
+ String footerClass = (String)
sourceElement.getAttribute(RichFaces.ATTR_FOOTER_CLASS);
if(!columnsFooters.isEmpty()) {
- nsIDOMElement tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
tfoot.appendChild(tr);
- String styleClass = encodeStyleClass(null, "dr-table-subfooter
rich-table-subfooter", null, footerClass);
+ String styleClass = encodeStyleClass(null, "dr-table-subfooter
rich-table-subfooter", null, footerClass); //$NON-NLS-1$
if(styleClass!=null) {
- tr.setAttribute("class", styleClass);
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
encodeHeaderOrFooterFacets(creationData, tr, visualDocument, columnsFooters,
- "dr-table-subfootercell rich-table-subfootercell",
- footerClass, "footer", "td");
+ "dr-table-subfootercell rich-table-subfootercell", //$NON-NLS-1$
+ footerClass, RichFaces.NAME_FACET_FOOTER, HTML.TAG_TD);
}
if (footer != null) {
encodeTableHeaderOrFooterFacet(creationData, tfoot, columnsLength, visualDocument,
footer,
- "dr-table-footer rich-table-footer",
- "dr-table-footer-continue rich-table-footer-continue",
- "dr-table-footercell rich-table-footercell",
- footerClass, "td");
+ "dr-table-footer rich-table-footer", //$NON-NLS-1$
+ "dr-table-footer-continue rich-table-footer-continue", //$NON-NLS-1$
+ "dr-table-footercell rich-table-footercell", //$NON-NLS-1$
+ footerClass,HTML.TAG_TD);
}
}
- nsIDOMElement tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement(HTML.TAG_TBODY);
table.appendChild(tbody);
// Create mapping to Encode body
@@ -124,18 +128,18 @@
nsIDOMElement tr = null;
VpeChildrenInfo trInfo = null;
for (Node child : children) {
- if(child.getNodeName().endsWith(":column")) {
- String breakBefore = ((Element)child).getAttribute("breakBefore");
- if(breakBefore!=null && breakBefore.equalsIgnoreCase("true")) {
+ if(child.getNodeName().endsWith(RichFaces.TAG_COLUMN)) {
+ String breakBefore = ((Element)child).getAttribute(ATTR_BREAK_BEFORE);
+ if(breakBefore!=null && breakBefore.equalsIgnoreCase(Constants.TRUE)) {
tr = null;
}
if(tr==null) {
- tr = visualDocument.createElement("tr");
+ tr = visualDocument.createElement(HTML.TAG_TR);
if(firstRow) {
- tr.setAttribute("class", "dr-table-firstrow
rich-table-firstrow");
+ tr.setAttribute(HTML.ATTR_CLASS, "dr-table-firstrow
rich-table-firstrow"); //$NON-NLS-1$
firstRow = false;
} else {
- tr.setAttribute("class", "dr-table-row rich-table-row");
+ tr.setAttribute(HTML.ATTR_CLASS, "dr-table-row rich-table-row");
//$NON-NLS-1$
}
trInfo = new VpeChildrenInfo(tr);
tbody.appendChild(tr);
@@ -143,10 +147,10 @@
}
trInfo.addSourceChild(child);
- } else if(child.getNodeName().endsWith(":columnGroup")) {
+ } else if(child.getNodeName().endsWith(RichFaces.TAG_COLUMN_GROUP)) {
RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)child,
visualDocument, tbody);
tr = null;
- } else if(child.getNodeName().endsWith(":subTable")) {
+ } else if(child.getNodeName().endsWith(RichFaces.TAG_SUB_TABLE)) {
RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)child,
visualDocument, tbody);
tr = null;
} else {
@@ -162,21 +166,21 @@
protected void encodeCaption(VpeCreationData creationData, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement table) {
//Encode caption
- Element captionFromFacet = ComponentUtil.getFacet(sourceElement, "caption");
+ Element captionFromFacet = ComponentUtil.getFacet(sourceElement,
RichFaces.NAME_FACET_CAPTION);
if (captionFromFacet != null) {
- String captionClass = (String) table.getAttribute("captionClass");
- String captionStyle = (String) table.getAttribute("captionStyle");
+ String captionClass = (String) table.getAttribute(RichFaces.ATTR_CAPTION_CLASS);
+ String captionStyle = (String) table.getAttribute(RichFaces.ATTR_CAPTION_STYLE);
- nsIDOMElement caption = visualDocument.createElement("caption");
+ nsIDOMElement caption = visualDocument.createElement(HTML.TAG_CAPTION);
table.appendChild(caption);
if (captionClass != null && captionClass.length()>0) {
- captionClass = "dr-table-caption rich-table-caption " + captionClass;
+ captionClass = "dr-table-caption rich-table-caption " + captionClass;
//$NON-NLS-1$
} else {
- captionClass = "dr-table-caption rich-table-caption";
+ captionClass = "dr-table-caption rich-table-caption"; //$NON-NLS-1$
}
- caption.setAttribute("class", captionClass);
+ caption.setAttribute(HTML.ATTR_CLASS, captionClass);
if (captionStyle != null && captionStyle.length()>0) {
- caption.setAttribute("style", captionStyle);
+ caption.setAttribute(HTML.ATTR_STYLE, captionStyle);
}
VpeChildrenInfo cap = new VpeChildrenInfo(caption);
@@ -188,16 +192,16 @@
public static void encodeHeaderOrFooterFacets(VpeCreationData creationData,
nsIDOMElement parentTr, nsIDOMDocument visualDocument, ArrayList<Element>
headersOrFooters, String skinCellClass, String headerClass, String facetName, String
element) {
for (Element column : headersOrFooters) {
- String classAttribute = facetName + "Class";
+ String classAttribute = facetName + "Class"; //$NON-NLS-1$
String columnHeaderClass = column.getAttribute(classAttribute);
nsIDOMElement td = visualDocument.createElement(element);
parentTr.appendChild(td);
String styleClass = encodeStyleClass(null, skinCellClass, headerClass,
columnHeaderClass);
- td.setAttribute("class", styleClass);
- td.setAttribute("scop", "col");
- String colspan = column.getAttribute("colspan");
+ td.setAttribute(HTML.ATTR_CLASS, styleClass);
+ td.setAttribute(HTML.ATTR_SCOPE, "col"); //$NON-NLS-1$
+ String colspan = column.getAttribute("colspan"); //$NON-NLS-1$
if(colspan!=null && colspan.length()>0) {
- td.setAttribute("colspan", colspan);
+ td.setAttribute(HTML.ATTR_COLSPAN, colspan);
}
Node facetBody = ComponentUtil.getFacet(column, facetName,true);
@@ -208,35 +212,35 @@
}
protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
nsIDOMElement parentTheadOrTfood, int columns, nsIDOMDocument visualDocument, Node
facetBody, String skinFirstRowClass, String skinRowClass, String skinCellClass, String
facetBodyClass, String element) {
- boolean isColumnGroup = facetBody.getNodeName().endsWith(":columnGroup");
- boolean isSubTable = facetBody.getNodeName().endsWith(":subTable");
+ boolean isColumnGroup = facetBody.getNodeName().endsWith(RichFaces.TAG_COLUMN_GROUP);
+ boolean isSubTable = facetBody.getNodeName().endsWith(RichFaces.TAG_SUB_TABLE);
if(isColumnGroup) {
RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)facetBody,
visualDocument, parentTheadOrTfood);
} else if(isSubTable) {
RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)facetBody,
visualDocument, parentTheadOrTfood);
} else {
- nsIDOMElement tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
parentTheadOrTfood.appendChild(tr);
String styleClass = encodeStyleClass(null, skinFirstRowClass, facetBodyClass, null);
if(styleClass!=null) {
- tr.setAttribute("class", styleClass);
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
String style = ComponentUtil.getHeaderBackgoundImgStyle();
- tr.setAttribute("style", style);
+ tr.setAttribute(HTML.ATTR_STYLE, style);
nsIDOMElement td = visualDocument.createElement(element);
tr.appendChild(td);
styleClass = encodeStyleClass(null, skinCellClass, facetBodyClass, null);
if(styleClass!=null) {
- td.setAttribute("class", styleClass);
+ td.setAttribute(HTML.ATTR_CLASS, styleClass);
}
if (columns>0) {
- td.setAttribute("colspan", String.valueOf(columns));
+ td.setAttribute(HTML.ATTR_COLSPAN, String.valueOf(columns));
}
- td.setAttribute("scope", "colgroup");
+ td.setAttribute(HTML.ATTR_SCOPE, "colgroup"); //$NON-NLS-1$
VpeChildrenInfo child = new VpeChildrenInfo(td);
child.addSourceChild(facetBody);
@@ -249,7 +253,7 @@
NodeList children = parentSourceElement.getChildNodes();
for(int i=0; i<children.getLength(); i++) {
Node child = children.item(i);
- if((child instanceof Element) &&
child.getNodeName().endsWith(":column")) {
+ if((child instanceof Element) &&
child.getNodeName().endsWith(RichFaces.TAG_COLUMN)) {
columns.add((Element)child);
}
}
@@ -271,13 +275,13 @@
StringBuffer styleClass = new StringBuffer();
// Construct predefined classes
if (null != parentPredefined) {
- styleClass.append(parentPredefined).append(" ");
+ styleClass.append(parentPredefined).append(Constants.WHITE_SPACE);
} else if (null != predefined) {
- styleClass.append(predefined).append(" ");
+ styleClass.append(predefined).append(Constants.WHITE_SPACE);
}
// Append class from parent component.
if (null != parent) {
- styleClass.append(parent).append(" ");
+ styleClass.append(parent).append(Constants.WHITE_SPACE);
}
if (null != custom) {
styleClass.append(custom);
@@ -292,7 +296,7 @@
int count = 0;
// check for exact value in component
try {
- count = Integer.parseInt(sourceElement.getAttribute("columns"));
+ count = Integer.parseInt(sourceElement.getAttribute(RichFaces.ATTR_COLUMNS));
} catch (NumberFormatException e) {
count = calculateRowColumns(sourceElement, columns);
}
@@ -308,7 +312,7 @@
int currentLength = 0;
for (Element column : columns) {
if (ComponentUtil.isRendered(column)) {
- if (column.getNodeName().endsWith(":columnGroup")) {
+ if (column.getNodeName().endsWith(RichFaces.TAG_COLUMN_GROUP)) {
// Store max calculated value of previous rows.
count = Math.max(currentLength,count);
// Calculate number of columns in row.
@@ -316,20 +320,20 @@
// Store max calculated value
count = Math.max(currentLength,count);
currentLength = 0;
- } else if (column.getNodeName().equals(sourceElement.getPrefix() +
":column")) {
+ } else if (column.getNodeName().equals(sourceElement.getPrefix() + Constants.COLON +
RichFaces.TAG_COLUMN)) {
// For new row, save length of previous.
- if (Boolean.getBoolean(column.getAttribute("breakBefore"))) {
+ if (Boolean.getBoolean(column.getAttribute(ATTR_BREAK_BEFORE))) {
count = Math.max(currentLength,count);
currentLength = 0;
}
- String colspanStr = column.getAttribute("colspan");
+ String colspanStr = column.getAttribute("colspan"); //$NON-NLS-1$
Integer colspan = null;
try {
currentLength += Integer.parseInt(colspanStr);
} catch (NumberFormatException e) {
currentLength++;
}
- } else if (column.getNodeName().endsWith(":column")) {
+ } else if (column.getNodeName().endsWith(RichFaces.TAG_COLUMN)) {
// UIColumn always have colspan == 1.
currentLength++;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -9,10 +9,8 @@
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.tools.jsf.vpe.richfaces.template.util;
-
/**
* contain rich faces tags and general attributes.
*
@@ -20,62 +18,64 @@
*/
public class RichFaces {
- /**
- * The Constructor.
- */
- private RichFaces() {
- }
+ /**
+ * The Constructor.
+ */
+ private RichFaces() {
+ }
- /** jsf tags which are used with richFaces. */
- public static final String TAG_COLUMN = "column"; //$NON-NLS-1$
+ /** jsf tags which are used with richFaces. */
+ public static final String TAG_COLUMN = "column"; //$NON-NLS-1$
+ /** The Constant TAG_FACET. */
+ public static final String TAG_FACET = "facet"; //$NON-NLS-1$
+ public static final String TAG_COLUMN_GROUP = "columnGroup"; //$NON-NLS-1$
+ public static final String TAG_SUB_TABLE = "subTable"; //$NON-NLS-1$
- /** The Constant TAG_FACET. */
- public static final String TAG_FACET = "facet"; //$NON-NLS-1$
+ /** The Constant ATTR_NAME. */
+ public static final String ATTR_NAME = "name"; //$NON-NLS-1$
+ /** The Constant ATTR_STYLE. */
+ public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
+ /** The Constant ATTR_WIDTH. */
+ public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$
+ /** The Constant ATTR_VALUE. */
+ public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
+ /** The Constant ATTR_INPUT_SIZE. */
+ public static final String ATTR_INPUT_SIZE = "inputSize"; //$NON-NLS-1$
+ /** The Constant ATTR_INPUT_CLASS. */
+ public static final String ATTR_INPUT_CLASS = "inputClass"; //$NON-NLS-1$
+ /** The Constant ATTR_INPUT_STYLE. */
+ public static final String ATTR_INPUT_STYLE = "inputStyle"; //$NON-NLS-1$
+ /** The Constant ATTR_ROW_CLASSES. */
+ public static final String ATTR_ROW_CLASSES = "rowClasses"; //$NON-NLS-1$
+ /** The Constant ATTR_COLUMN_CLASSES. */
+ public static final String ATTR_COLUMN_CLASSES = "columnClasses";
//$NON-NLS-1$
+ /** The Constant ATTR_CONTROLS_TYPE. */
+ public static final String ATTR_CONTROLS_TYPE = "controlsType"; //$NON-NLS-1$
+ /** The Constant ATTR_SHOW_BUTTON_LABELS. */
+ public static final String ATTR_SHOW_BUTTON_LABELS = "showButtonLabels";
//$NON-NLS-1$
+ /** The Constant ATTR_DEFAULT_LABEL. */
+ public static final String ATTR_DEFAULT_LABEL = "defaultLabel"; //$NON-NLS-1$
+ /** The Constant ATTR_ADD_CONTROL_LABEL. */
+ public static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel";
//$NON-NLS-1$
+ /** The Constant ATTR_STYLE_CLASS. */
+ public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_SELECT_ITEM_LABEL = "itemLabel";
//$NON-NLS-1$
+ public static final String ATTR_SELECT_ITEM_VALUE = "itemValue";
//$NON-NLS-1$
+ public static final String ATTR_DISABLED = "disabled";//$NON-NLS-1$
+ public static final String ATTR_POPUP = "popup";//$NON-NLS-1$
+ public static final String ATTR_DIRECTION = "direction"; //$NON-NLS-1$
+ public static final String ATTR_ALIGN = "align"; //$NON-NLS-1$
+ public static final String ATTR_LIST_WIDTH = "listWidth"; //$NON-NLS-1$
+ public static final String ATTR_LIST_HEIGHT = "listHeight"; //$NON-NLS-1$
+ public static final String ATTR_COLUMNS_WIDTH = "columnsWidth"; //$NON-NLS-1$
+ public static final String ATTR_HEADER_CLASS = "headerClass"; //$NON-NLS-1$
+ public static final String ATTR_FOOTER_CLASS = "footerClass"; //$NON-NLS-1$
+ public static final String ATTR_CAPTION_CLASS = "captionClass"; //$NON-NLS-1$
+ public static final String ATTR_CAPTION_STYLE = "captionStyle"; //$NON-NLS-1$
+ public static final String ATTR_COLUMNS = "columns"; //$NON-NLS-1$
- /** The Constant ATTR_NAME. */
- public static final String ATTR_NAME = "name"; //$NON-NLS-1$
+ public static final String NAME_FACET_HEADER = "header"; //$NON-NLS-1$
+ public static final String NAME_FACET_FOOTER = "footer"; //$NON-NLS-1$
+ public static final String NAME_FACET_CAPTION = "caption"; //$NON-NLS-1$
- /** The Constant ATTR_STYLE. */
- public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
-
- /** The Constant ATTR_WIDTH. */
- public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$
-
- /** The Constant ATTR_VALUE. */
- public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
-
- /** The Constant ATTR_INPUT_SIZE. */
- public static final String ATTR_INPUT_SIZE = "inputSize"; //$NON-NLS-1$
-
- /** The Constant ATTR_INPUT_CLASS. */
- public static final String ATTR_INPUT_CLASS = "inputClass"; //$NON-NLS-1$
-
- /** The Constant ATTR_INPUT_STYLE. */
- public static final String ATTR_INPUT_STYLE = "inputStyle"; //$NON-NLS-1$
-
- /** The Constant ATTR_ROW_CLASSES. */
- public static final String ATTR_ROW_CLASSES = "rowClasses"; //$NON-NLS-1$
-
- /** The Constant ATTR_COLUMN_CLASSES. */
- public static final String ATTR_COLUMN_CLASSES = "columnClasses";
//$NON-NLS-1$
-
- /** The Constant ATTR_CONTROLS_TYPE. */
- public static final String ATTR_CONTROLS_TYPE = "controlsType";
//$NON-NLS-1$
-
- /** The Constant ATTR_SHOW_BUTTON_LABELS. */
- public static final String ATTR_SHOW_BUTTON_LABELS = "showButtonLabels";
//$NON-NLS-1$
-
- /** The Constant ATTR_DEFAULT_LABEL. */
- public static final String ATTR_DEFAULT_LABEL = "defaultLabel";
//$NON-NLS-1$
-
- /** The Constant ATTR_ADD_CONTROL_LABEL. */
- public static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel";
//$NON-NLS-1$
-
- /** The Constant ATTR_STYLE_CLASS. */
- public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
-
- public static final String ATTR_SELECT_ITEM_LABEL = "itemLabel";
//$NON-NLS-1$
-
- public static final String ATTR_SELECT_ITEM_VALUE = "itemValue";
//$NON-NLS-1$
-
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/contextMenu.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/contextMenu.xhtml 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/contextMenu.xhtml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -10,7 +10,7 @@
</head>
<body>
<rich:contextMenu event="oncontextmenu" attached="true"
- submitMode="none">
+ submitMode="none" id="contextMenu">
<rich:menuItem value="Zoom In" onclick="enlarge();"
id="zin"></rich:menuItem>
<rich:menuItem value="Zoom Out" onclick="decrease();"
id="zout"></rich:menuItem>
</rich:contextMenu>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -10,6 +10,6 @@
</head>
<body>
<!-- Data Filter Slider -->
- <rich:dataFilterSlider startRange="1" endRange="1000"
increment="100" trailer="false" />
+ <rich:dataFilterSlider startRange="1" endRange="1000"
increment="100" trailer="false" id="dataFilterSlider"/>
</body>
</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataFilterSlider.xhtml.xml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -0,0 +1,27 @@
+<tests>
+ <test id="dataFilterSlider">
+ <DIV CLASS="slider-container" STYLE="width: 260px;">
+ <DIV CLASS="range" STYLE="width: 200px;">
+ <DIV CLASS="range-decor">
+ <DIV CLASS="trailer" STYLE="left: -38px; width: 114px;">
+ <DIV CLASS="track" STYLE="width: 200px;">
+ <DIV CLASS="handle">
+ <IMG WIDTH="7" HEIGHT="8" BORDER="0" />
+ </DIV>
+ <TABLE WIDTH="100%" HEIGHT="100%"
CELLSPACING="0"
+ CELLPADDING="0" BORDER="0">
+ <TR>
+ <TD ALIGN="right"
+ STYLE="font-family: Arial,Verdana,sans-serif; font-size: 5px; color:
white;">
+ <IMG WIDTH="100%" HEIGHT="100%" />
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ <INPUT TYPE="text" CLASS="slider-input-field"
VALUE="N/A" />
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataScroller.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataScroller.xhtml 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataScroller.xhtml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -1,16 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://richfaces.org/rich">
-
-<head>
-</head>
-<body>
- <!-- Data Scroller -->
- <rich:datascroller>
- </rich:datascroller>
-</body>
-</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -9,72 +9,71 @@
<head>
</head>
<body>
- <!-- Data Table -->
- <rich:dataTable
onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
- onRowMouseOut="this.style.backgroundColor='#F2F2F2'"
cellpadding="0"
- cellspacing="0" width="700" border="0"
value="table">
+<h1>dataTable</h1>
- <f:facet name="header">
- <rich:columnGroup>
- <rich:column rowspan="2">
- <rich:spacer />
- </rich:column>
- <rich:column colspan="3">
- <h:outputText value="Expenses" />
- </rich:column>
- <rich:column rowspan="2">
- <h:outputText value="subtotals" />
- </rich:column>
- <rich:column breakBefore="true">
- <h:outputText value="Meals" />
- </rich:column>
- <rich:column>
- <h:outputText value="Hotels" />
- </rich:column>
- <rich:column>
- <h:outputText value="Transport" />
- </rich:column>
- </rich:columnGroup>
- </f:facet>
- <rich:column colspan="5">
- <h:outputText value="Minsk" />
- </rich:column>
+<rich:dataTable cellpadding="0" cellspacing="0"
width="700" border="0"
+ var="row" value="#{bean.dtList}" rowKeyVar="rowKey"
id="dataTable">
- <rich:subTable
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
- onRowMouseOut="this.style.backgroundColor='F9F9F9'"
value="SubTable">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column rowspan="2">
+ <rich:spacer />
+ </rich:column>
+ <rich:column colspan="3">
+ <h:outputText value="FIELDS" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="field1" />
+ </rich:column>
<rich:column>
- <h:outputText value="25-Aug-97"></h:outputText>
+ <h:outputText value="field2" />
</rich:column>
<rich:column>
- <h:outputText value="30"></h:outputText>
+ <h:outputText value="field3" />
</rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field1}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field2}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field3}">
+ </h:outputText>
+ </rich:column>
+
+ </rich:columnGroup>
+
+
+
+ <f:facet name="footer">
+
+ <rich:columnGroup>
+ <rich:column></rich:column>
<rich:column>
- <h:outputText value="30"></h:outputText>
+ <h:outputText value="footer1" />
</rich:column>
<rich:column>
- <h:outputText value="100"></h:outputText>
+ <h:outputText value="footer2" />
</rich:column>
<rich:column>
- <h:outputText value="20"></h:outputText>
+ <h:outputText value="footer3" />
</rich:column>
- </rich:subTable>
- <f:facet name="footer">
- <rich:columnGroup>
- <rich:column><h:outputText
value="Totals"></h:outputText></rich:column>
- <rich:column>
- <h:outputText value="30"></h:outputText>
- </rich:column>
- <rich:column>
- <h:outputText value="50"></h:outputText>
- </rich:column>
- <rich:column>
- <h:outputText value="10"></h:outputText>
- </rich:column>
- <rich:column>
- <h:outputText value="20"></h:outputText>
- </rich:column>
- </rich:columnGroup>
- </f:facet>
- </rich:dataTable>
+
+ </rich:columnGroup>
+ </f:facet>
+
+</rich:dataTable>
+
</body>
</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataTable.xhtml.xml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -0,0 +1,64 @@
+<tests>
+ <test id="dataTable">
+ <TABLE WIDTH="700" CELLSPACING="0" CELLPADDING="0"
BORDER="0"
+ VAR="row" VALUE="#{bean.dtList}" ROWKEYVAR="rowKey"
ID="dataTable"
+ CLASS="dr-table rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <THEAD>
+ <TR CLASS="dr-table-header rich-table-header">
+ <TD CLASS="dr-table-headercell rich-table-headercell"
ROWSPAN="2">
+ <IMG WIDTH="1" HEIGHT="1" />
+ </TD>
+ <TD CLASS="dr-table-headercell rich-table-headercell"
COLSPAN="3">
+ <SPAN> FIELDS</SPAN>
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-header-continue rich-table-header-continue">
+ <TD CLASS="dr-table-headercell rich-table-headercell"
+ BREAKBEFORE="true">
+ <SPAN> field1</SPAN>
+ </TD>
+ <TD CLASS="dr-table-headercell rich-table-headercell">
+ <SPAN> field2</SPAN>
+ </TD>
+ <TD CLASS="dr-table-headercell rich-table-headercell">
+ <SPAN> field3</SPAN>
+ </TD>
+ </TR>
+ </THEAD>
+ <TFOOT>
+ <TR CLASS="dr-table-footer rich-table-footer">
+ <TD CLASS="dr-table-footercell rich-table-footercell">
+ <BR />
+ </TD>
+ <TD CLASS="dr-table-footercell rich-table-footercell">
+ <SPAN> footer1</SPAN>
+ </TD>
+ <TD CLASS="dr-table-footercell rich-table-footercell">
+ <SPAN> footer2</SPAN>
+ </TD>
+ <TD CLASS="dr-table-footercell rich-table-footercell">
+ <SPAN> footer3</SPAN>
+ </TD>
+ </TR>
+ </TFOOT>
+ <TBODY>
+ <TR CLASS="dr-table-cell rich-table-cell">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <SPAN> #{rowKey}</SPAN>
+ </TD>
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <SPAN> #{row.field1}</SPAN>
+ </TD>
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <SPAN> #{row.field2}</SPAN>
+ </TD>
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <SPAN> #{row.field3}</SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Copied:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml
(from rev 10675,
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataScroller.xhtml)
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+<body>
+<h:form>
+ <h1>datascroller</h1>
+ <rich:datascroller id="datascroller" for="dataTable"
align="top" >
+ </rich:datascroller>
+
+ <rich:dataTable cellpadding="0" cellspacing="0"
width="700" border="0"
+ var="row" value="#{bean.dtList}" rowKeyVar="rowKey"
id="dataTable"
+ rows="2">
+
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column rowspan="2">
+ <rich:spacer />
+ </rich:column>
+ <rich:column colspan="3">
+ <h:outputText value="FIELDS" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="field1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field3" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field1}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field2}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field3}">
+ </h:outputText>
+ </rich:column>
+
+ </rich:columnGroup>
+
+
+
+ <f:facet name="footer">
+
+ <rich:columnGroup>
+ <rich:column></rich:column>
+ <rich:column>
+ <h:outputText value="footer1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer3" />
+ </rich:column>
+
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/datascroller.xhtml.xml 2008-10-06
10:49:27 UTC (rev 10683)
@@ -0,0 +1,31 @@
+<tests>
+ <test id="datascroller">
+ <DIV CLASS="dr-div-heigth" STYLE="width: 400px;">
+ <TABLE CELLSPACING="1" CELLPADDING="0" BORDER="0"
+ CLASS="dr-dscr-t dr-tbpnl-cntnt">
+ <TBODY>
+ <TR>
+ <TD ALIGN="center"
CLASS="dr-dscr-button"><<</TD>
+ <TD ALIGN="center"
CLASS="dr-dscr-button"><</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-button"><BR />
+ </TD>
+ <TD ALIGN="center" CLASS="dr-dscr-act">1</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">2</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">3</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">4</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">5</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">6</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">7</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">8</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">9</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-inact">10</TD>
+ <TD ALIGN="center" CLASS="dr-dscr-button"><BR />
+ </TD>
+ <TD ALIGN="center"
CLASS="dr-dscr-button">></TD>
+ <TD ALIGN="center"
CLASS="dr-dscr-button">>></TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </test>
+</tests>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -54,15 +54,16 @@
}
public void testContextMenu() throws Throwable {
- assertTrue("it is necessary to add a body of the test ",
false);//$NON-NLS-1$
+ performInvisibleTagTest("components/contextMenu.xhtml",
"contextMenu");//$NON-NLS-1$ //$NON-NLS-2$
}
public void testDataFilterSlider() throws Throwable {
- assertTrue("it is necessary to add a body of the test ",
false);//$NON-NLS-1$
+ performContentTest("components/dataFilterSlider.xhtml");//$NON-NLS-1$
}
public void testDatascroller() throws Throwable {
- assertTrue("it is necessary to add a body of the test ",
false);//$NON-NLS-1$
+
+ performContentTest("components/datascroller.xhtml");//$NON-NLS-1$
}
public void testColumns() throws Throwable {
@@ -93,8 +94,9 @@
assertTrue("it is necessary to add a body of the test ",
false);//$NON-NLS-1$
}
- public void testDataTable() throws Throwable {
- assertTrue("it is necessary to add a body of the test ",
false);//$NON-NLS-1$
+ public void _testDataTable() throws Throwable {
+ performContentTest("components/dataTable.xhtml");//$NON-NLS-1$
+
}
public void testSubTable() throws Throwable {
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-10-06
10:31:41 UTC (rev 10682)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-10-06
10:49:27 UTC (rev 10683)
@@ -66,7 +66,7 @@
public void testDataScroller() throws PartInitException, Throwable {
performTestForVpeComponent((IFile) TestUtil.getComponentPath(
- "components/dataScroller.xhtml", RichFacesAllTests.IMPORT_PROJECT_NAME));
//$NON-NLS-1$
+ "components/datascroller.xhtml", RichFacesAllTests.IMPORT_PROJECT_NAME));
//$NON-NLS-1$
}
public void testDataTable() throws PartInitException, Throwable {