Author: nbelaevski
Date: 2007-11-29 15:58:01 -0500 (Thu, 29 Nov 2007)
New Revision: 4365
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
Log:
latest changes for listShuttle & orderingList
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2007-11-29
20:57:55 UTC (rev 4364)
+++
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentControlsHelper.java 2007-11-29
20:58:01 UTC (rev 4365)
@@ -70,12 +70,9 @@
private final static String DEFAULT_LABEL_DOWN = "Down";
private final static String DEFAULT_LABEL_BOTTOM = "Last";
- private final static String ATTRIBUTE_CLASS_BUTTON =
"rich-ordering-list-button";
- private final static String ATTRIBUTE_CLASS_BUTTON_DISABLED =
"rich-ordering-list-button-disabled";
-
protected static final OrderingComponentRendererBase.ControlsHelper[] HELPERS = new
OrderingComponentRendererBase.ControlsHelper[] {
new OrderingComponentRendererBase.ControlsHelper("top",
"TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTop.class.getName(), FACET_TOP,
- " rich-ordering-control-top", ATTRIBUTE_CLASS_TOP_CONTROL,
ATTRIBUTE_CLASS_BUTTON,
+ "-top", ATTRIBUTE_CLASS_TOP_CONTROL, "",
CONTROL_ID_TOP, ATTRIBUTE_CE_ONTOPCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -84,7 +81,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledTop",
"TOP_LABEL", DEFAULT_LABEL_TOP, OrderingListIconTopDisabled.class.getName(),
FACET_DIS_TOP,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL,
ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, "-disabled",
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_TOP), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -93,7 +90,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("up", "UP_LABEL",
DEFAULT_LABEL_UP, OrderingListIconUp.class.getName(), FACET_UP,
- " rich-ordering-control-up", ATTRIBUTE_CLASS_UP_CONTROL,
ATTRIBUTE_CLASS_BUTTON,
+ "-up", ATTRIBUTE_CLASS_UP_CONTROL, "",
CONTROL_ID_UP, ATTRIBUTE_CE_ONUPCLICK ,true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -102,7 +99,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledUp",
"UP_LABEL", DEFAULT_LABEL_UP, OrderingListIconUpDisabled.class.getName(),
FACET_DIS_UP,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL,
ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, "-disabled",
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_UP), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -111,7 +108,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("down",
"DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDown.class.getName(),
FACET_DOWN,
- " rich-ordering-control-down", ATTRIBUTE_CLASS_DOWN_CONTROL,
ATTRIBUTE_CLASS_BUTTON,
+ "-down", ATTRIBUTE_CLASS_DOWN_CONTROL, "",
CONTROL_ID_DOWN, ATTRIBUTE_CE_ONDOWNCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -120,7 +117,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledDown",
"DOWN_LABEL", DEFAULT_LABEL_DOWN, OrderingListIconDownDisabled.class.getName(),
FACET_DIS_DOWN,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL,
ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, "-disabled",
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_DOWN), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -129,7 +126,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("bottom",
"BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM, OrderingListIconBottom.class.getName(),
FACET_BOTTOM,
- " rich-ordering-control-bottom", ATTRIBUTE_CLASS_BOTTOM_CONTROL,
ATTRIBUTE_CLASS_BUTTON,
+ "-bottom", ATTRIBUTE_CLASS_BOTTOM_CONTROL, "",
CONTROL_ID_BOTTOM, ATTRIBUTE_CE_ONBOTTOMCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -138,7 +135,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledBottom",
"BOTTOM_LABEL", DEFAULT_LABEL_BOTTOM,
OrderingListIconBottomDisabled.class.getName(), FACET_DIS_BOTTOM,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL,
ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ "-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, "-disabled",
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_BOTTOM), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-29
20:57:55 UTC (rev 4364)
+++
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2007-11-29
20:58:01 UTC (rev 4365)
@@ -242,7 +242,8 @@
protected void renderDefaultControl(FacesContext context,
UIOrderingBaseComponent orderingList, ResponseWriter writer,
- boolean useFacet, OrderingComponentRendererBase.ControlsHelper helper, String
clientId, ResourceBundle bundle, boolean enabled)
+ boolean useFacet, OrderingComponentRendererBase.ControlsHelper helper, String
clientId, ResourceBundle bundle,
+ boolean enabled, String baseStyle, String baseControlStyle)
throws IOException {
UIComponent facet = orderingList.getFacet(helper.getFacetName());
String customEvent = null;
@@ -253,8 +254,11 @@
String styleFromAttribute = (String) attributes
.get(helper.styleFromAttribute);
- String currentStyle = helper.getStyleClassName();
+ String baseStyleLight = baseStyle.concat("-light");
+ String baseStylePress = baseStyle.concat("-press");
+
+ String currentStyle = baseControlStyle + helper.getStyleClassName();
if (styleFromAttribute != null) {
currentStyle = styleFromAttribute.concat(currentStyle);
}
@@ -272,16 +276,16 @@
if (!useFacet) {
writer.startElement(HTML.DIV_ELEM, orderingList);
- writer.writeAttribute(HTML.class_ATTRIBUTE, helper.getButtonStyleClass(), null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + helper.getButtonStyleClass(),
null);
if (helper.enable) {
- writer.writeAttribute(HTML.onmouseover_ATTRIBUTE,
"this.className='rich-ordering-list-button-light'", null);
- writer.writeAttribute(HTML.onmousedown_ATTRIBUTE,
"this.className='rich-ordering-list-button-press'", null);
- writer.writeAttribute(HTML.onmouseup_ATTRIBUTE,
"this.className='rich-ordering-list-button'", null);
- writer.writeAttribute(HTML.onmouseout_ATTRIBUTE,
"this.className='rich-ordering-list-button'", null);
+ writer.writeAttribute(HTML.onmouseover_ATTRIBUTE, "this.className='" +
baseStyleLight + "'", null);
+ writer.writeAttribute(HTML.onmousedown_ATTRIBUTE, "this.className='" +
baseStylePress + "'", null);
+ writer.writeAttribute(HTML.onmouseup_ATTRIBUTE, "this.className='" +
baseStyle + "'", null);
+ writer.writeAttribute(HTML.onmouseout_ATTRIBUTE, "this.className='" +
baseStyle + "'", null);
}
writer.startElement(HTML.DIV_ELEM, orderingList);
- writer.writeAttribute(HTML.class_ATTRIBUTE,
"rich-ordering-list-button-content", null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-content", null);
}
@@ -303,7 +307,7 @@
writer.endElement(HTML.IMG_ELEMENT);
- if (Boolean.TRUE.equals(attributes.get(SHOW_LABELS_ATTRIBUTE_NAME))) {
+ if (getUtils().isBooleanAttribute(orderingList, SHOW_LABELS_ATTRIBUTE_NAME)) {
String label = (String) attributes.get(helper.getLabelAttributeName());
if (label == null && bundle != null) {
@@ -370,7 +374,8 @@
protected void encodeControlFacet(FacesContext context,
UIOrderingBaseComponent orderingList, OrderingComponentRendererBase.ControlsHelper
helper,
- String clientId, ResponseWriter writer, boolean enabled) throws IOException {
+ String clientId, ResponseWriter writer, boolean enabled, String baseStyle,
+ String baseControlStyle) throws IOException {
Locale locale = null;
UIViewRoot viewRoot = context.getViewRoot();
@@ -400,7 +405,7 @@
}
} else {
renderDefaultControl(context, orderingList, writer, useFacet,
- helper, clientId, bundle ,enabled);
+ helper, clientId, bundle ,enabled, baseStyle, baseControlStyle);
}
}
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-29
20:57:55 UTC (rev 4364)
+++
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-29
20:58:01 UTC (rev 4365)
@@ -71,7 +71,7 @@
if (HELPERS[i].isRendered(context, orderingList)) {
//proper assumption about helpers ordering
encodeControlFacet(context, orderingList, HELPERS[i], clientId, writer,
- enabled);
+ enabled, "rich-ordering-list-button", "
rich-ordering-control");
}
}
}