JBoss Tools SVN: r10683 - in trunk/jsf: plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template and 3 other directories.
by jbosstools-commits@lists.jboss.org
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 {
17 years, 6 months
JBoss Tools SVN: r10682 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-06 06:31:41 -0400 (Mon, 06 Oct 2008)
New Revision: 10682
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBID-2811 ESB Project wizard doesn't work at all.
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-06 10:03:45 UTC (rev 10681)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-06 10:31:41 UTC (rev 10682)
@@ -25,6 +25,7 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
@@ -155,7 +156,7 @@
private IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy(){
- Object obj = model.getProperty(FACETED_PROJECT_WORKING_COPY);
+ Object obj = model.getProperty(IFacetDataModelProperties.FACETED_PROJECT_WORKING_COPY);
if(obj instanceof IFacetedProjectWorkingCopy){
return (IFacetedProjectWorkingCopy)obj;
}
17 years, 6 months
JBoss Tools SVN: r10681 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core: src/org/jboss/tools/hibernate/jpt/core/internal and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-06 06:03:45 -0400 (Mon, 06 Oct 2008)
New Revision: 10681
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnitProperties.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitProperties.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitPropertyListListener.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/BasicHibernateProperties.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernateBasic.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePlatform.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJpaProperties.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateProperties.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2818
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2008-10-06 10:02:22 UTC (rev 10680)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2008-10-06 10:03:45 UTC (rev 10681)
@@ -7,11 +7,11 @@
org.eclipse.core.runtime,
org.eclipse.jpt.core,
org.eclipse.wst.validation,
- org.eclipse.jpt.eclipselink.core;bundle-version="1.0.0",
org.eclipse.jpt.utility;bundle-version="1.2.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: Hibernate Team
Export-Package: org.jboss.tools.hibernate.jpt.core.internal,
- org.jboss.tools.hibernate.jpt.core.internal.context
+ org.jboss.tools.hibernate.jpt.core.internal.context,
+ org.jboss.tools.hibernate.jpt.core.internal.context.basic
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePlatform.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePlatform.java 2008-10-06 10:02:22 UTC (rev 10680)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernatePlatform.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -27,9 +27,8 @@
return ID;
}
- /* use GenericJpaPlatform's methods while under progress
@Override
protected JpaFactory buildJpaFactory() {
return new HibernateFactory();
- }*/
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJpaProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJpaProperties.java 2008-10-06 10:02:22 UTC (rev 10680)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJpaProperties.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -10,11 +10,20 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.context;
+import java.util.ListIterator;
+
import org.eclipse.jpt.core.JpaProject;
import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.core.context.persistence.Property;
import org.eclipse.jpt.utility.internal.model.AbstractModel;
+import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
+import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
+import org.eclipse.jpt.utility.model.value.ListValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernateBasic;
/**
* @author Dmitry Geraskov
@@ -25,48 +34,75 @@
private PersistenceUnit persistenceUnit;
+ private BasicHibernateProperties basicHibernateProperties;
+
+ private ListValueModel<Property> propertiesAdapter;
+ private ListValueModel<Property> propertyListAdapter;
+
public HibernateJpaProperties(PersistenceUnit parent) {
super();
this.initialize(parent);
}
+
+ protected void initialize(PersistenceUnit parent) {
+ this.persistenceUnit = parent;
+ PropertyValueModel<PersistenceUnit> persistenceUnitHolder =
+ new SimplePropertyValueModel<PersistenceUnit>(this.persistenceUnit);
+
+ this.propertiesAdapter = this.buildPropertiesAdapter(persistenceUnitHolder);
+ this.propertyListAdapter = this.buildPropertyListAdapter(this.propertiesAdapter);
+
+ this.basicHibernateProperties = this.buildBasicProperties();
+ }
+
+ private ListValueModel<Property> buildPropertyListAdapter(ListValueModel<Property> propertiesAdapter) {
+ return new ItemPropertyListValueModelAdapter<Property>(propertiesAdapter, Property.VALUE_PROPERTY);
+ }
+
+ private ListValueModel<Property> buildPropertiesAdapter(PropertyValueModel<PersistenceUnit> subjectHolder) {
+ return new ListAspectAdapter<PersistenceUnit, Property>(subjectHolder, PersistenceUnit.PROPERTIES_LIST) {
+ @Override
+ protected ListIterator<Property> listIterator_() {
+ return this.subject.properties();
+ }
- /* (non-Javadoc)
- * @see org.eclipse.jpt.eclipselink.core.internal.context.PersistenceUnitProperties#getJpaProject()
- */
- public JpaProject getJpaProject() {
- return this.persistenceUnit.getJpaProject();
+ @Override
+ protected int size_() {
+ return this.subject.propertiesSize();
+ }
+ };
}
+
+ // ******** Behavior *********
+ public BasicHibernateProperties getBasicHibernate() {
+ return this.basicHibernateProperties;
+ }
+
+ private BasicHibernateProperties buildBasicProperties() {
+ return new HibernateBasic(this.persistenceUnit(), this.propertyListAdapter());
+ }
- /* (non-Javadoc)
- * @see org.eclipse.jpt.eclipselink.core.internal.context.PersistenceUnitProperties#itemIsProperty(org.eclipse.jpt.core.context.persistence.Property)
- */
- public boolean itemIsProperty(Property item) {
- throw new UnsupportedOperationException();
+ public ListValueModel<Property> propertyListAdapter() {
+ return this.propertyListAdapter;
}
- /* (non-Javadoc)
- * @see org.eclipse.jpt.eclipselink.core.internal.context.PersistenceUnitProperties#persistenceUnit()
- */
public PersistenceUnit persistenceUnit() {
return this.persistenceUnit;
}
+
+ public JpaProject getJpaProject() {
+ return this.persistenceUnit.getJpaProject();
+ }
- /* (non-Javadoc)
- * @see org.eclipse.jpt.eclipselink.core.internal.context.PersistenceUnitProperties#propertyIdFor(org.eclipse.jpt.core.context.persistence.Property)
- */
- public String propertyIdFor(Property property) {
+ public boolean itemIsProperty(Property item) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.eclipse.jpt.utility.model.listener.PropertyChangeListener#propertyChanged(org.eclipse.jpt.utility.model.event.PropertyChangeEvent)
- */
public void propertyChanged(PropertyChangeEvent event) {
throw new UnsupportedOperationException();
}
-
- protected void initialize(PersistenceUnit parent) {
- this.persistenceUnit = parent;
+
+ public String propertyIdFor(Property property) {
+ throw new UnsupportedOperationException();
}
-
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2008-10-06 10:02:22 UTC (rev 10680)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -13,6 +13,7 @@
import org.eclipse.jpt.core.context.persistence.Persistence;
import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceUnit;
import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
/**
* @author Dmitry Geraskov
@@ -36,9 +37,9 @@
this.hibernateProperties = new HibernateJpaProperties(this);
}
- /*
- * put getters for specific properties here
- *
- */
+ // ******** Behavior *********
+ public BasicHibernateProperties getBasicProperties() {
+ return this.hibernateProperties.getBasicHibernate();
+ }
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnitProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnitProperties.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnitProperties.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.core.context.persistence.Property;
+import org.eclipse.jpt.utility.internal.model.AbstractModel;
+import org.eclipse.jpt.utility.model.value.ListValueModel;
+
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public abstract class HibernatePersistenceUnitProperties extends AbstractModel implements PersistenceUnitProperties {
+
+ private PersistenceUnit persistenceUnit;
+
+ private PersistenceUnitPropertyListListener propertyListListener;
+
+ private Map<String, String> propertyNames;
+
+ protected HibernatePersistenceUnitProperties(
+ PersistenceUnit parent,
+ ListValueModel<Property> propertyListAdapter) {
+ super();
+ this.initialize(parent, propertyListAdapter);
+ }
+
+ protected void initialize(
+ PersistenceUnit parent,
+ ListValueModel<Property> propertyListAdapter) {
+ this.persistenceUnit = parent;
+
+ this.propertyListListener = new PersistenceUnitPropertyListListener(this);
+ propertyListAdapter.addListChangeListener(ListValueModel.LIST_VALUES, this.propertyListListener);
+
+ this.initializePropertyNames();
+ this.initializeProperties();
+ }
+
+ protected void initializePropertyNames() {
+ this.propertyNames = new HashMap<String, String>();
+ this.addPropertyNames(this.propertyNames);
+ }
+
+ /**
+ * Initializes properties with values from the persistence unit.
+ */
+ protected abstract void initializeProperties();
+
+ // ********** behavior **********
+ public PersistenceUnit persistenceUnit() {
+ return this.persistenceUnit;
+ }
+
+ public JpaProject getJpaProject() {
+ return this.persistenceUnit.getJpaProject();
+ }
+
+ public PersistenceUnitPropertyListListener propertyListListener() {
+ return this.propertyListListener;
+ }
+
+ private Map<String, String> propertyNames() {
+ return this.propertyNames;
+ }
+
+ /**
+ * Adds property names key/value pairs, used by the methods: itemIsProperty
+ * and propertyIdFor.
+ *
+ * key = EclipseLink property key; value = property id
+ */
+ protected abstract void addPropertyNames(Map<String, String> propertyNames);
+
+ /**
+ * Method used for identifying the given property.
+ */
+ public boolean itemIsProperty(Property item) {
+ if (item == null) {
+ throw new IllegalArgumentException("Property is null");
+ }
+ return this.propertyNames().keySet().contains(item.getName());
+ }
+
+ /**
+ * Returns the property name used for change notification of the given
+ * property.
+ */
+ public String propertyIdFor(Property property) {
+ String propertyId = this.propertyNames().get(property.getName());
+ if (propertyId == null) {
+ throw new IllegalArgumentException("Illegal property: " + property.toString());
+ }
+ return propertyId;
+ }
+
+ protected String hibernateKeyFor(String propertyId) {
+ for (String hibernateKey : this.propertyNames().keySet()) {
+ if (this.propertyNames().get(hibernateKey).equals(propertyId)) {
+ return hibernateKey;
+ }
+ }
+ throw new IllegalArgumentException("Illegal property: " + propertyId);
+ }
+
+ // ****** get/set String convenience methods *******
+ /**
+ * Returns the String value of the given Property from the PersistenceXml.
+ */
+ protected String getStringValue(String key) {
+ return this.getStringValue(key, null);
+ }
+
+ protected String getStringValue(String key, String keySuffix) {
+ String elKey = (keySuffix == null) ? key : key + keySuffix;
+ if (this.persistenceUnit().containsProperty(elKey)) {
+ // TOREVIEW - handle incorrect String in persistence.xml
+ return this.persistenceUnit().getProperty(elKey).getValue();
+ }
+ return null;
+ }
+
+ /**
+ * Put the given String value into the PersistenceXml.
+ * @param key
+ * EclipseLink Key
+ * @param keySuffix
+ * e.g. entity name
+ * @param newValue
+ * value to be associated with the key
+ * @param allowDuplicate
+ */
+ protected void putStringValue(String key, String keySuffix, String newValue, boolean allowDuplicate) {
+ String elKey = (keySuffix == null) ? key : key + keySuffix;
+ if (newValue == null) {
+ this.persistenceUnit().removeProperty(elKey);
+ }
+ else {
+ this.persistenceUnit().putProperty(elKey, newValue, allowDuplicate);
+ }
+ }
+
+ // ******** Convenience methods ********
+ /**
+ * Put into persistenceUnit properties.
+ *
+ * @param key -
+ * property name
+ * @param value -
+ * property value
+ */
+ @SuppressWarnings("unchecked")
+ protected void putProperty(String key, Object value) {
+ String elKey = this.hibernateKeyFor(key);
+ if (value == null)
+ this.removeProperty(elKey);
+ else
+ this.putProperty_(elKey, value);
+ }
+
+ private void putProperty_(String key, Object value) {
+ this.persistenceUnit().putProperty(key, value.toString(), false);
+ }
+
+ /**
+ * Removes a property with the given key.
+ */
+ protected void removeProperty(String key) {
+ this.persistenceUnit().removeProperty(key);
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnitProperties.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateProperties.java 2008-10-06 10:02:22 UTC (rev 10680)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateProperties.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.context;
-import org.eclipse.jpt.eclipselink.core.internal.context.PersistenceUnitProperties;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
/**
* @author Dmitry Geraskov
@@ -18,6 +18,6 @@
*/
public interface HibernateProperties extends PersistenceUnitProperties {
- // put getters for specific properties here
+ BasicHibernateProperties getBasicHibernate();
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitProperties.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitProperties.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.core.context.persistence.Property;
+import org.eclipse.jpt.utility.model.Model;
+import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface PersistenceUnitProperties extends Model, PropertyChangeListener {
+
+ /**
+ * Method used for identifying the given property.
+ */
+ boolean itemIsProperty(Property item);
+
+ /**
+ * Returns the property name used for change notification of the given property.
+ */
+ String propertyIdFor(Property property);
+
+ /**
+ * Return the PersistenceUnit of this Properties.
+ */
+ PersistenceUnit persistenceUnit();
+
+ /**
+ * Return the JPA project the PersistenceUnit belongs to.
+ */
+ JpaProject getJpaProject();
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitProperties.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitPropertyListListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitPropertyListListener.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitPropertyListListener.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import java.util.Iterator;
+
+import org.eclipse.jpt.core.context.persistence.Property;
+import org.eclipse.jpt.utility.model.Model;
+import org.eclipse.jpt.utility.model.event.ListChangeEvent;
+import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
+import org.eclipse.jpt.utility.model.listener.ListChangeListener;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class PersistenceUnitPropertyListListener implements ListChangeListener
+{
+ private PersistenceUnitProperties parent;
+
+ // ********** constructors / initialization **********
+ public PersistenceUnitPropertyListListener(PersistenceUnitProperties parent) {
+ this.parent = parent;
+ }
+
+ // ********** Behavior **********
+ protected boolean add(Property newItem, Model source) {
+ if (this.model().itemIsProperty(newItem)) {
+ String propertyName = this.model().propertyIdFor(newItem);
+ this.model().propertyChanged(
+ new PropertyChangeEvent(source, propertyName, null, newItem));
+ return true;
+ }
+ return false;
+ }
+
+ protected boolean remove(Property item, Model source) {
+ if (this.model().itemIsProperty(item)) {
+ String propertyName = this.model().propertyIdFor(item);
+ this.model().propertyChanged(
+ new PropertyChangeEvent(source, propertyName, item, null)); // oldItem is the removed property
+ return true;
+ }
+ return false;
+ }
+
+ // replace
+ protected Property set(Property newItem, Model source) {
+ if (this.model().itemIsProperty(newItem)) {
+ String propertyName = this.model().propertyIdFor(newItem);
+ this.model().propertyChanged(
+ new PropertyChangeEvent(source, propertyName, null, newItem)); // oldItem unknown
+ return newItem;
+ }
+ return null;
+ }
+
+ // ********** ListChangeListener implementation **********
+ public void itemsAdded(ListChangeEvent e) {
+ for (Iterator<Property> stream = this.items(e); stream.hasNext();) {
+ this.add(stream.next(), e.getSource());
+ }
+ }
+
+ public void itemsRemoved(ListChangeEvent e) {
+ for (Iterator<Property> stream = this.items(e); stream.hasNext();) {
+ this.remove(stream.next(), e.getSource());
+ }
+ }
+
+ public void itemsReplaced(ListChangeEvent e) {
+ // ItemAspectListValueModelAdapter(270) does not provide old value
+ for (Iterator<Property> newStream = this.items(e); newStream.hasNext();) {
+ this.set(newStream.next(), e.getSource());
+ }
+ }
+
+ public void itemsMoved(ListChangeEvent e) {
+ throw new UnsupportedOperationException("source: " + e.getSource() + " - aspect: " + e.getAspectName());
+ }
+
+ public void listCleared(ListChangeEvent e) {
+ throw new UnsupportedOperationException("source: " + e.getSource() + " - aspect: " + e.getAspectName());
+ }
+
+ public void listChanged(ListChangeEvent e) {
+ throw new UnsupportedOperationException("source: " + e.getSource() + " - aspect: " + e.getAspectName());
+ }
+
+ // ********** internal methods **********
+ private PersistenceUnitProperties model() {
+ return this.parent;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Iterator<Property> items(ListChangeEvent event) {
+ return (Iterator<Property>) event.items();
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/PersistenceUnitPropertyListListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/BasicHibernateProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/BasicHibernateProperties.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/BasicHibernateProperties.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.basic;
+
+import org.eclipse.jpt.utility.model.Model;
+import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface BasicHibernateProperties extends Model, PropertyChangeListener {
+
+ String getDefaultConfigurationFile();
+ String getConfigurationFile();
+ void setConfigurationFile(String newConfigFile);
+ static final String CONFIG_FILE_PROPERTY = "confFileProperty";
+ // Hibernate key string
+ static final String HIBERNATE_CONFIG_FILE = "hibernate.ejb.cfgfile";
+ static final String DEFAULT_CONFIG_FILE = "";
+
+ String getDefaultDialect();
+ String getDialect();
+ void setDialect(String newDialect);
+ static final String DIALECT_PROPERTY = "dialectProperty";
+ // Hibernate key string
+ static final String HIBERNATE_DIALECT = "hibernate.dialect";
+ static final String DEFAULT_DIALECT = "";
+
+ String getDefaultDriver();
+ String getDriver();
+ void setDriver(String newDriver);
+ static final String DRIVER_PROPERTY = "driverProperty";
+ // Hibernate key string
+ static final String HIBERNATE_DRIVER = "hibernate.connection.driver_class";
+ static final String DEFAULT_DRIVER = "";
+
+ String getDefaultUrl();
+ String getUrl();
+ void setUrl(String newUrl);
+ static final String URL_PROPERTY = "urlProperty";
+ // Hibernate key string
+ static final String HIBERNATE_URL = "hibernate.connection.url";
+ static final String DEFAULT_URL = "";
+
+ String getDefaultSchemaDefault();
+ String getSchemaDefault();
+ void setSchemaDefault(String newSchemaDefault);
+ static final String SCHEMA_DEFAULT_PROPERTY = "schemaDefaultProperty";
+ // Hibernate key string
+ static final String HIBERNATE_SCHEMA_DEFAULT = "hibernate.default_schema";
+ static final String DEFAULT_SCHEMA_DEFAULT = "";
+
+ String getDefaultCatalogDefault();
+ String getCatalogDefault();
+ void setCatalogDefault(String newCatalogDefault);
+ static final String CATALOG_DEFAULT_PROPERTY = "catalogDefaultProperty";
+ // Hibernate key string
+ static final String HIBERNATE_CATALOG = "hibernate.default_catalog";
+ static final String DEFAULT_CATALOG_DEFAULT = "";
+
+ String getDefaultUsername();
+ String getUsername();
+ void setUsername(String newUsername);
+ static final String USERNAME_PROPERTY = "usernameProperty";
+ // Hibernate key string
+ static final String HIBERNATE_USERNAME = "hibernate.connection.username";
+ static final String DEFAULT_USERNAME = "";
+
+ String getDefaultPassword();
+ String getPassword();
+ void setPassword(String newPassword);
+ static final String PASSWORD_PROPERTY = "passwordProperty";
+ // Hibernate key string
+ static final String HIBERNATE_PASSWORD = "hibernate.connection.password";
+ static final String DEFAULT_PASSWORD = "";
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/BasicHibernateProperties.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernateBasic.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernateBasic.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernateBasic.java 2008-10-06 10:03:45 UTC (rev 10681)
@@ -0,0 +1,302 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.basic;
+
+import java.util.Map;
+
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.core.context.persistence.Property;
+import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
+import org.eclipse.jpt.utility.model.value.ListValueModel;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnitProperties;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateBasic extends HibernatePersistenceUnitProperties
+ implements BasicHibernateProperties {
+
+ // ********** Hibernate properties **********
+ private String configFile;
+ private String dialect;
+ private String driver;
+ private String url;
+ private String schemaDefault;
+ private String catalogDefault;
+ private String username;
+ private String password;
+
+ // ********** constructors **********
+ public HibernateBasic(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) {
+ super(parent, propertyListAdapter);
+ }
+
+ // ********** initialization **********
+ /**
+ * Initializes properties with values from the persistence unit.
+ */
+ @Override
+ protected void initializeProperties() {
+ this.configFile =
+ this.getStringValue(HIBERNATE_CONFIG_FILE);
+ this.dialect =
+ this.getStringValue(HIBERNATE_DIALECT);
+ this.driver =
+ this.getStringValue(HIBERNATE_DRIVER);
+ this.url =
+ this.getStringValue(HIBERNATE_URL);
+ this.schemaDefault =
+ this.getStringValue(HIBERNATE_SCHEMA_DEFAULT);
+ this.catalogDefault =
+ this.getStringValue(HIBERNATE_CATALOG);
+ this.username =
+ this.getStringValue(HIBERNATE_USERNAME);
+ this.password =
+ this.getStringValue(HIBERNATE_PASSWORD);
+ }
+
+
+ // ********** behavior **********
+ @Override
+ protected void addPropertyNames(Map<String, String> propertyNames) {
+ propertyNames.put(
+ HIBERNATE_CONFIG_FILE,
+ CONFIG_FILE_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_DIALECT,
+ DIALECT_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_DRIVER,
+ DRIVER_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_URL,
+ URL_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_SCHEMA_DEFAULT,
+ SCHEMA_DEFAULT_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_CATALOG,
+ CATALOG_DEFAULT_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_USERNAME,
+ USERNAME_PROPERTY);
+ propertyNames.put(
+ HIBERNATE_PASSWORD,
+ PASSWORD_PROPERTY);
+ }
+
+ public void propertyChanged(PropertyChangeEvent event) {
+ String aspectName = event.getAspectName();
+ if (aspectName.equals(CONFIG_FILE_PROPERTY)) {
+ this.configurationFileChanged(event);
+ } else if (aspectName.equals(DIALECT_PROPERTY)) {
+ this.dialectChanged(event);
+ } else if (aspectName.equals(DRIVER_PROPERTY)) {
+ this.driverChanged(event);
+ } else if (aspectName.equals(URL_PROPERTY)) {
+ this.urlChanged(event);
+ } else if (aspectName.equals(SCHEMA_DEFAULT_PROPERTY)) {
+ this.schemaDefaultChanged(event);
+ } else if (aspectName.equals(CATALOG_DEFAULT_PROPERTY)) {
+ this.catalogDefaultChanged(event);
+ } else if (aspectName.equals(USERNAME_PROPERTY)) {
+ this.usernameChanged(event);
+ } else if (aspectName.equals(PASSWORD_PROPERTY)) {
+ this.passwordChanged(event);
+ }
+ }
+
+ // ********** Configuration File **********
+ public String getDefaultConfigurationFile() {
+ return DEFAULT_CONFIG_FILE;
+ }
+
+ public String getConfigurationFile() {
+ return this.configFile;
+ }
+
+ public void setConfigurationFile(String newConfigFile) {
+ String old = this.configFile;
+ this.configFile = newConfigFile;
+ this.putProperty(CONFIG_FILE_PROPERTY, newConfigFile);
+ this.firePropertyChanged(CONFIG_FILE_PROPERTY, old, newConfigFile);
+ }
+
+ private void configurationFileChanged(PropertyChangeEvent event) {
+ String newFile = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.configFile;
+ this.configFile = newFile;
+ this.firePropertyChanged(event.getAspectName(), old, newFile);
+ }
+
+ // ********** Dialect **********
+ public String getDefaultDialect() {
+ return DEFAULT_DIALECT;
+ }
+
+ public String getDialect() {
+ return this.dialect;
+ }
+
+ public void setDialect(String newDialect) {
+ String old = this.dialect;
+ this.dialect = newDialect;
+ this.putProperty(DIALECT_PROPERTY, newDialect);
+ this.firePropertyChanged(DIALECT_PROPERTY, old, newDialect);
+ }
+
+ private void dialectChanged(PropertyChangeEvent event) {
+ String newDialect = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.dialect;
+ this.dialect = newDialect;
+ this.firePropertyChanged(event.getAspectName(), old, newDialect);
+ }
+
+ // ********** Driver **********
+ public String getDefaultDriver() {
+ return DEFAULT_DRIVER;
+ }
+
+ public String getDriver() {
+ return this.driver;
+ }
+
+ public void setDriver(String newDriver) {
+ String old = this.driver;
+ this.driver = newDriver;
+ this.putProperty(DRIVER_PROPERTY, newDriver);
+ this.firePropertyChanged(DRIVER_PROPERTY, old, newDriver);
+ }
+
+ private void driverChanged(PropertyChangeEvent event) {
+ String newDriver = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.driver;
+ this.driver = newDriver;
+ this.firePropertyChanged(event.getAspectName(), old, newDriver);
+ }
+
+ // ********** Url **********
+ public String getDefaultUrl() {
+ return DEFAULT_URL;
+ }
+
+ public String getUrl() {
+ return this.url;
+ }
+
+ public void setUrl(String newUrl) {
+ String old = this.url;
+ this.url = newUrl;
+ this.putProperty(URL_PROPERTY, newUrl);
+ this.firePropertyChanged(URL_PROPERTY, old, newUrl);
+ }
+
+ private void urlChanged(PropertyChangeEvent event) {
+ String newUrl = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.url;
+ this.url = newUrl;
+ this.firePropertyChanged(event.getAspectName(), old, newUrl);
+ }
+
+ // ********** Default schema **********
+ public String getDefaultSchemaDefault() {
+ return DEFAULT_SCHEMA_DEFAULT;
+ }
+
+ public String getSchemaDefault() {
+ return schemaDefault;
+ }
+
+ public void setSchemaDefault(String newSchemaDefault) {
+ String old = this.schemaDefault;
+ this.schemaDefault = newSchemaDefault;
+ this.putProperty(SCHEMA_DEFAULT_PROPERTY, newSchemaDefault);
+ this.firePropertyChanged(SCHEMA_DEFAULT_PROPERTY, old, newSchemaDefault);
+ }
+
+ private void schemaDefaultChanged(PropertyChangeEvent event) {
+ String newSchemaDefault = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.schemaDefault;
+ this.schemaDefault = newSchemaDefault;
+ this.firePropertyChanged(event.getAspectName(), old, newSchemaDefault);
+ }
+
+ // ********** Default catalog **********
+ public String getDefaultCatalogDefault() {
+ return DEFAULT_CATALOG_DEFAULT;
+ }
+
+ public String getCatalogDefault() {
+ return catalogDefault;
+ }
+
+ public void setCatalogDefault(String newCatalogDefault) {
+ String old = this.catalogDefault;
+ this.catalogDefault = newCatalogDefault;
+ this.putProperty(CATALOG_DEFAULT_PROPERTY, newCatalogDefault);
+ this.firePropertyChanged(CATALOG_DEFAULT_PROPERTY, old, newCatalogDefault);
+ }
+
+ private void catalogDefaultChanged(PropertyChangeEvent event) {
+ String newCatalogDefault = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.catalogDefault;
+ this.catalogDefault = newCatalogDefault;
+ this.firePropertyChanged(event.getAspectName(), old, newCatalogDefault);
+ }
+
+ // ********** Username **********
+ public String getDefaultUsername() {
+ return DEFAULT_USERNAME;
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public void setUsername(String newUsername) {
+ String old = this.username;
+ this.username = newUsername;
+ this.putProperty(USERNAME_PROPERTY, newUsername);
+ this.firePropertyChanged(USERNAME_PROPERTY, old, newUsername);
+ }
+
+ private void usernameChanged(PropertyChangeEvent event) {
+ String newUsername = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.username;
+ this.username = newUsername;
+ this.firePropertyChanged(event.getAspectName(), old, newUsername);
+ }
+
+ // ********** Password **********
+ public String getDefaultPassword() {
+ return DEFAULT_PASSWORD;
+ }
+
+ public String getPassword() {
+ return this.password;
+ }
+
+ public void setPassword(String newPassword) {
+ String old = this.password;
+ this.password = newPassword;
+ this.putProperty(PASSWORD_PROPERTY, newPassword);
+ this.firePropertyChanged(PASSWORD_PROPERTY, old, newPassword);
+ }
+
+ private void passwordChanged(PropertyChangeEvent event) {
+ String newPassword = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue();
+ String old = this.password;
+ this.password = newPassword;
+ this.firePropertyChanged(event.getAspectName(), old, newPassword);
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernateBasic.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years, 6 months
JBoss Tools SVN: r10680 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui: src/org/jboss/tools/hibernate/jpt/ui/internal and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-06 06:02:22 -0400 (Mon, 06 Oct 2008)
New Revision: 10680
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateUiFactory.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java
Log:
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF 2008-10-05 20:23:55 UTC (rev 10679)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF 2008-10-06 10:02:22 UTC (rev 10680)
@@ -15,7 +15,10 @@
org.eclipse.datatools.connectivity;bundle-version="1.1.0",
org.eclipse.jdt.launching;bundle-version="3.4.0",
org.eclipse.wst.common.project.facet.ui;bundle-version="1.3.0",
- org.eclipse.wst.common.frameworks;bundle-version="1.1.200"
+ org.eclipse.wst.common.frameworks;bundle-version="1.1.200",
+ org.eclipse.jpt.utility;bundle-version="1.2.0",
+ org.eclipse.ui.forms;bundle-version="3.3.100",
+ org.jboss.tools.hibernate.jpt.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: Hibernate Team
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java 2008-10-06 10:02:22 UTC (rev 10680)
@@ -0,0 +1,316 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.ui.internal.persistence.details;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaPageComposite;
+import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
+import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
+import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
+import org.hibernate.eclipse.console.utils.DriverClassHelpers;
+import org.hibernate.eclipse.launch.PathHelper;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernatePropertiesComposite extends AbstractFormPane<BasicHibernateProperties> implements
+ JpaPageComposite<PersistenceUnit> {
+
+ private Text cfgFile;
+
+ /**
+ * @param subjectHolder
+ * @param container
+ * @param widgetFactory
+ */
+ public HibernatePropertiesComposite(PropertyValueModel<BasicHibernateProperties> subjectHolder,
+ Composite container, WidgetFactory widgetFactory) {
+ super(subjectHolder, container, widgetFactory);
+ }
+
+ protected void initializeLayout(Composite container) {
+
+ final DriverClassHelpers helper = new DriverClassHelpers();
+
+ Composite section = buildSection(container, "Basic properties");
+
+ final SimpleListValueModel<String> lvmDialect = new SimpleListValueModel<String>(Arrays.asList(helper
+ .getDialectNames()));
+ PropertyValueModel<BasicHibernateProperties> p = getSubjectHolder();
+ List<String> drivers = new ArrayList<String>();
+ BasicHibernateProperties props = p.getValue();
+ if (props != null) {
+ String dialectClass = helper.getDialectClass(props.getDialect());
+ String[] driverClasses = helper.getDriverClasses(dialectClass);
+ drivers.addAll(Arrays.asList(driverClasses));
+ }
+
+ final SimpleListValueModel<String> lvmDriver = new SimpleListValueModel<String>(drivers);
+
+ List<String> urls = new ArrayList<String>();
+ if (props != null) {
+ String driverClass = props.getDriver();
+ String[] connectionURLS = helper.getConnectionURLS(driverClass);
+ urls.addAll(Arrays.asList(connectionURLS));
+ }
+ final SimpleListValueModel<String> lvmUrl = new SimpleListValueModel<String>(urls);
+
+ WritablePropertyValueModel<String> dialectHolder = buildDialectHolder();
+ WritablePropertyValueModel<String> driverHolder = buildDriverHolder();
+ WritablePropertyValueModel<String> urlHolder = buildUrlHolder();
+
+ Button b = buildButton(section, HibernateConsoleMessages.CodeGenerationSettingsTab_browse, createSetupAction());
+ cfgFile = buildLabeledText(section,
+ HibernateConsoleMessages.ConsoleConfigurationPropertySource_config_file + ':', buildConfigFileHolder(),
+ b, null);
+
+ buildLabeledEditableCombo(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_database_dialect,
+ lvmDialect,
+ dialectHolder,
+ null);
+
+ buildLabeledEditableCombo(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_driver_class,
+ lvmDriver,
+ driverHolder,
+ null);
+
+ buildLabeledEditableCombo(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_connection_url,
+ lvmUrl,
+ urlHolder,
+ null);
+
+ dialectHolder.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChanged(PropertyChangeEvent event) {
+ String dialectClass = helper.getDialectClass((String) event.getNewValue());
+ String[] driverClasses = helper.getDriverClasses(dialectClass);
+ lvmDriver.clear();
+ lvmDriver.addAll(Arrays.asList(driverClasses));
+ }
+ });
+
+ driverHolder.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChanged(PropertyChangeEvent event) {
+ String driverClass = helper.getDialectClass((String) event.getNewValue());
+ String[] connectionURLS = helper.getConnectionURLS(driverClass);
+ lvmUrl.clear();
+ lvmUrl.addAll(Arrays.asList(connectionURLS));
+ }
+ });
+
+ buildLabeledText(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_default_schema,
+ buildSchemaDefaultHolder());
+
+ buildLabeledText(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_default_catalog,
+ buildCatalogDefaultHolder());
+
+ buildLabeledText(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_user_name,
+ buildUsernameHolder());
+
+ buildLabeledText(
+ section,
+ HibernateConsoleMessages.NewConfigurationWizardPage_password,
+ buildPasswordHolder());
+ }
+
+ private IPath getConfigurationFilePath() {
+ return PathHelper.pathOrNull(cfgFile.getText());
+ }
+
+ private Runnable createSetupAction() {
+ return new Runnable() {
+ public void run() {
+ IPath initialPath = getConfigurationFilePath();
+ IPath[] paths = DialogSelectionHelper.chooseFileEntries(getControl().getShell(), initialPath,
+ new IPath[0],
+ HibernateConsoleMessages.ConsoleConfigurationMainTab_select_hibernate_cfg_xml_file,
+ HibernateConsoleMessages.ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_cfg_xml,
+ new String[] { HibernateConsoleMessages.ConsoleConfigurationMainTab_cfg_xml }, false, false,
+ true);
+ if (paths != null && paths.length == 1) {
+ // TODO update to subpath
+ cfgFile.setText((paths[0]).toOSString());
+ }
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildConfigFileHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.CONFIG_FILE_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getConfigurationFile();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setConfigurationFile(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildDialectHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.DIALECT_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getDialect();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null; //$NON-NLS-1$
+ subject.setDialect(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildDriverHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.DRIVER_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getDriver();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setDriver(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildUrlHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.URL_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getUrl();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setUrl(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildSchemaDefaultHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.SCHEMA_DEFAULT_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getSchemaDefault();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setSchemaDefault(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildCatalogDefaultHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.CATALOG_DEFAULT_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getCatalogDefault();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setCatalogDefault(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildUsernameHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.USERNAME_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getUsername();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setUsername(value);
+ }
+ };
+ }
+
+ private WritablePropertyValueModel<String> buildPasswordHolder() {
+ return new PropertyAspectAdapter<BasicHibernateProperties, String>(getSubjectHolder(),
+ BasicHibernateProperties.PASSWORD_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return subject.getPassword();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if ("".equals(value))value = null;//$NON-NLS-1$
+ subject.setPassword(value);
+ }
+ };
+ }
+
+ public String getHelpID() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Image getPageImage() {
+ return null;
+ }
+
+ public String getPageText() {
+ return "Hibernate";
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePropertiesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java 2008-10-05 20:23:55 UTC (rev 10679)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernatePlatformUI.java 2008-10-06 10:02:22 UTC (rev 10680)
@@ -21,6 +21,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.ui.JpaUiFactory;
import org.eclipse.jpt.ui.internal.platform.generic.GenericPlatformUi;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
@@ -53,7 +54,12 @@
WizardDialog dialog = new WizardDialog(null, wizard);
dialog.open();
}
-
+
+ @Override
+ protected JpaUiFactory createJpaUiFactory() {
+ return new HibernateUiFactory();
+ }
+
public static ILaunchConfigurationWorkingCopy createDefaultLaunchConfig(String projectName) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateUiFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateUiFactory.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateUiFactory.java 2008-10-06 10:02:22 UTC (rev 10680)
@@ -0,0 +1,61 @@
+package org.jboss.tools.hibernate.jpt.ui.internal.platform;
+
+import java.util.ArrayList;
+import java.util.ListIterator;
+
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.ui.WidgetFactory;
+import org.eclipse.jpt.ui.details.JpaPageComposite;
+import org.eclipse.jpt.ui.internal.GenericJpaUiFactory;
+import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitConnectionComposite;
+import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitGeneralComposite;
+import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitPropertiesComposite;
+import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
+import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.HibernatePropertiesComposite;
+
+public class HibernateUiFactory extends GenericJpaUiFactory {
+
+ public ListIterator<JpaPageComposite<PersistenceUnit>> createPersistenceUnitComposites(
+ PropertyValueModel<PersistenceUnit> subjectHolder, Composite parent, WidgetFactory widgetFactory) {
+
+ ArrayList<JpaPageComposite<PersistenceUnit>> pages = new ArrayList<JpaPageComposite<PersistenceUnit>>(1);
+
+ pages.add(new PersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory));
+ pages.add(new PersistenceUnitConnectionComposite(subjectHolder, parent, widgetFactory));
+ pages.add(new PersistenceUnitPropertiesComposite(subjectHolder, parent, widgetFactory));
+
+ // ************Hibernate pages***************
+ PropertyValueModel<HibernatePersistenceUnit> hibernatePersistenceUnitHolder = this
+ .buildHibernatePersistenceUnitHolder(subjectHolder);
+
+ PropertyValueModel<BasicHibernateProperties> basicHolder = this.buildBasicHolder(hibernatePersistenceUnitHolder);
+ pages.add(new HibernatePropertiesComposite(basicHolder, parent, widgetFactory));
+
+ return pages.listIterator();
+ }
+
+ private PropertyValueModel<BasicHibernateProperties> buildBasicHolder(
+ PropertyValueModel<HibernatePersistenceUnit> subjectHolder) {
+ return new TransformationPropertyValueModel<HibernatePersistenceUnit, BasicHibernateProperties>(subjectHolder) {
+ @Override
+ protected BasicHibernateProperties transform_(HibernatePersistenceUnit value) {
+ return value.getBasicProperties();
+ }
+ };
+ }
+
+ private PropertyValueModel<HibernatePersistenceUnit> buildHibernatePersistenceUnitHolder(
+ PropertyValueModel<PersistenceUnit> subjectHolder) {
+ return new TransformationPropertyValueModel<PersistenceUnit, HibernatePersistenceUnit>(subjectHolder) {
+ @Override
+ protected HibernatePersistenceUnit transform_(PersistenceUnit value) {
+ return (HibernatePersistenceUnit) value;
+ }
+ };
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/platform/HibernateUiFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years, 6 months
JBoss Tools SVN: r10679 - workspace.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-05 16:23:55 -0400 (Sun, 05 Oct 2008)
New Revision: 10679
Added:
workspace/examples/
Log:
17 years, 6 months
JBoss Tools SVN: r10678 - trunk/vpe/plugins/org.jboss.tools.vpe.html/META-INF.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-04 07:59:07 -0400 (Sat, 04 Oct 2008)
New Revision: 10678
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.html/META-INF/MANIFEST.MF
Log:
org.jboss.tools.vpe.html.template package exported in project org.jboss.tools.vpe.html.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/META-INF/MANIFEST.MF 2008-10-04 08:50:10 UTC (rev 10677)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/META-INF/MANIFEST.MF 2008-10-04 11:59:07 UTC (rev 10678)
@@ -13,4 +13,5 @@
org.jboss.tools.common
Eclipse-LazyStart: true
Bundle-Localization: plugin
+Export-Package: org.jboss.tools.vpe.html.template
17 years, 6 months
JBoss Tools SVN: r10677 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-04 04:50:10 -0400 (Sat, 04 Oct 2008)
New Revision: 10677
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java
Log:
commented broken-down code
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java 2008-10-04 08:37:38 UTC (rev 10676)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java 2008-10-04 08:50:10 UTC (rev 10677)
@@ -22,7 +22,7 @@
/**
- * TODO There is code which doesn't compile . It was commented .
+ * TODO There was code which didn't compile . It was commented .
*/
/**
* A wrapper of VpeAbstractTemplate. Does the same, but ignores all attributes except id.
17 years, 6 months
JBoss Tools SVN: r10676 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-04 04:37:38 -0400 (Sat, 04 Oct 2008)
New Revision: 10676
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java
Log:
commented broken-down code
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java 2008-10-03 18:05:48 UTC (rev 10675)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfBodyTemplate.java 2008-10-04 08:37:38 UTC (rev 10676)
@@ -13,14 +13,18 @@
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.html.template.HtmlBodyTemplate;
+//import org.jboss.tools.vpe.html.template.HtmlBodyTemplate;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+
/**
+ * TODO There is code which doesn't compile . It was commented .
+ */
+/**
* A wrapper of VpeAbstractTemplate. Does the same, but ignores all attributes except id.
* @author yradtsevich
* @see HtmlBodyTemplate
@@ -28,11 +32,11 @@
public class JsfBodyTemplate extends VpeAbstractTemplate {
public static final String ID_ID = "id"; //$NON-NLS-1$
- private final HtmlBodyTemplate htmlBodyTemplate = new HtmlBodyTemplate();
+// private final HtmlBodyTemplate htmlBodyTemplate = new HtmlBodyTemplate();
- /**
- * @see org.jboss.tools.vpe.html.template.HtmlBodyTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
- */
+// /**
+// * @see org.jboss.tools.vpe.html.template.HtmlBodyTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+// */
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
sourceNode = sourceNode.cloneNode(true);
@@ -46,7 +50,8 @@
}
}
- return htmlBodyTemplate.create(pageContext, sourceNode, visualDocument);
+// return htmlBodyTemplate.create(pageContext, sourceNode, visualDocument);
+ return null;
}
// TODO: change to default implementation (remove)
17 years, 6 months
JBoss Tools SVN: r10675 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: .settings and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-03 14:05:48 -0400 (Fri, 03 Oct 2008)
New Revision: 10675
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.ui.prefs
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.jboss.tools.jst.web.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/
Log:
Added .settings folder to jsf2test project.
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test
___________________________________________________________________
Name: svn:ignore
- bin
AllTests.txt
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.ui.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.ui.prefs 2008-10-03 18:05:48 UTC (rev 10675)
@@ -0,0 +1,3 @@
+#Thu Oct 02 19:28:49 EEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jdt.core.prefs 2008-10-03 18:05:48 UTC (rev 10675)
@@ -0,0 +1,7 @@
+#Fri Dec 28 13:39:43 GMT+02:00 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-10-03 18:05:48 UTC (rev 10675)
@@ -0,0 +1,3 @@
+#Fri Dec 28 17:19:23 GMT+02:00 2007
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk1.5.0_13/owners=jst.java\:5.0
+eclipse.preferences.version=1
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.component 2008-10-03 18:05:48 UTC (rev 10675)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="jsf2Test">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+<property name="java-output-path" value="build/classes"/>
+<property name="context-root" value="jsf2Test"/>
+</wb-module>
+</project-modules>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-10-03 18:05:48 UTC (rev 10675)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.4"/>
+</faceted-project>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.jboss.tools.jst.web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.jboss.tools.jst.web.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/.settings/org.jboss.tools.jst.web.xml 2008-10-03 18:05:48 UTC (rev 10675)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<file-systems VERSION="2.0.0.GA" application-name="example_1_2_w_f"
+ model-entity="FileSystems" workspace-home="./WebContent/WEB-INF">
+ <file-system NAME="WEB-INF" location="%workspace.home%" model-entity="FileSystemFolder"/>
+ <file-system NAME="WEB-ROOT" info="Content-Type=Web"
+ location="%workspace.home%/.." model-entity="FileSystemFolder"/>
+ <file-system NAME="src" location="%workspace.home%/../../JavaSource" model-entity="FileSystemFolder"/>
+ <file-system NAME="lib" location="%workspace.home%/lib" model-entity="FileSystemFolder"/>
+ <file-system NAME="classes" location="%workspace.home%/classes" model-entity="FileSystemFolder"/>
+ <file-system NAME="build" location="%workspace.home%/../../ant" model-entity="FileSystemFolder"/>
+ <file-system NAME="lib-jsf-api.jar"
+ location="D:\doc\prj\jboss\svn\trunk\jsf\tests\org.jboss.tools.jsf.vpe.jsf.test\resources\jsf2test\WebContent\WEB-INF\lib\jsf-api.jar" model-entity="FileSystemJar"/>
+ <file-system NAME="lib-jsf-impl.jar"
+ location="D:\doc\prj\jboss\svn\trunk\jsf\tests\org.jboss.tools.jsf.vpe.jsf.test\resources\jsf2test\WebContent\WEB-INF\lib\jsf-impl.jar" model-entity="FileSystemJar"/>
+ <web SERVLET_VERSION="2.5" model-entity="JstWeb" model-path="/web.xml">
+ <module URI="/WEB-INF/faces-config.xml" model-entity="WebJSFModule"
+ model-path="/faces-config.xml" src="src" web-root="WEB-ROOT"/>
+ </web>
+</file-systems>
17 years, 6 months
JBoss Tools SVN: r10674 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-03 13:53:27 -0400 (Fri, 03 Oct 2008)
New Revision: 10674
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
MAX_IDLE time changed from 30 minutes to 15 seconds.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-10-03 17:44:39 UTC (rev 10673)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-10-03 17:53:27 UTC (rev 10674)
@@ -60,7 +60,7 @@
protected final static String EDITOR_ID = "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; //$NON-NLS-1$
/** The Constant MAX_IDLE. */
- private static final long MAX_IDLE = 30*60*1000L;
+ private static final long MAX_IDLE = 15*1000L;
/**
17 years, 6 months