Author: vmolotkov
Date: 2007-11-15 11:06:19 -0500 (Thu, 15 Nov 2007)
New Revision: 4009
Modified:
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
new control list style
Modified:
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-15
15:48:28 UTC (rev 4008)
+++
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-15
16:06:19 UTC (rev 4009)
@@ -300,16 +300,11 @@
String clientId = orderingList.getClientId(context);
ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.DIV_ELEM, orderingList);
- writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button_layout", null);
-
for (int i = 0; i < HELPERS.length; i++) {
if (HELPERS[i].isRendered(context, orderingList)) {
encodeControlFacet(context, orderingList, HELPERS[i], clientId, writer);
}
}
-
- writer.endElement(HTML.DIV_ELEM);
}
protected void encodeControlFacet(FacesContext context, UIOrderingList orderingList,
ControlsHelper helper, String clientId, ResponseWriter writer)
@@ -345,18 +340,28 @@
if (encodeDiv) {
writer.startElement(HTML.DIV_ELEM, orderingList);
+ writer.writeAttribute(HTML.id_ATTRIBUTE, clientId + helper.getIdSuffix(), null);
//FIXME:
writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button_border", null);
+
writer.startElement(HTML.DIV_ELEM, orderingList);
writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button", null);
- writer.writeAttribute("onmousedown",
+ writer.writeAttribute(HTML.onmouseover_ATTRIBUTE,
"this.className='ol_button_light'", null);
+ writer.writeAttribute(HTML.onmousedown_ATTRIBUTE,
"this.className='ol_button_press'", null);
+ writer.writeAttribute(HTML.onmouseup_ATTRIBUTE,
"this.className='ol_button'", null);
+ writer.writeAttribute(HTML.onmouseout_ATTRIBUTE,
"this.className='ol_button'", null);
+
+ writer.startElement(HTML.DIV_ELEM, orderingList);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button_content", null);
+
+ /*writer.writeAttribute("onmousedown",
"Element.removeClassName(this, 'ol_button'); Element.addClassName(this,
'ol_button_clicked'); ", null);
writer.writeAttribute("onmouseup",
- "Element.removeClassName(this, 'ol_button_clicked');
Element.addClassName(this, 'ol_button'); ", null);
+ "Element.removeClassName(this, 'ol_button_clicked');
Element.addClassName(this, 'ol_button'); ", null);*/
}
if (htmlElem != null) {
writer.startElement(htmlElem, orderingList);
- writer.writeAttribute(HTML.id_ATTRIBUTE, clientId + helper.getIdSuffix(), null);
+ //writer.writeAttribute(HTML.id_ATTRIBUTE, clientId + helper.getIdSuffix(), null);
if (customEvent != null) {
writer.writeAttribute(HTML.onclick_ATTRIBUTE, customEvent, null);
}
@@ -368,16 +373,18 @@
if (isButton) {
writer.writeAttribute("style", "font-size: 1.5em;", null);
currentStyle = helper.buttonStyle.concat(currentStyle);
- writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
+ //writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
if (!helper.enable) {
writer.writeAttribute(HTML.DISABLED_ATTR, "true", null);
}
} else {
- writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
+ //writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
writer.startElement(HTML.IMG_ELEMENT, orderingList);
- writer.writeAttribute("border", "0", null);
- writer.writeAttribute("alt", helper.getFacetName(), null);
- writer.writeAttribute("src",
getResource(helper.getImageURI()).getUri(context, null), null);
+ writer.writeAttribute(HTML.width_ATTRIBUTE, "15", null);
+ writer.writeAttribute(HTML.height_ATTRIBUTE, "15", null);
+ writer.writeAttribute(HTML.border_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.alt_ATTRIBUTE, helper.getFacetName(), null);
+ writer.writeAttribute(HTML.src_ATTRIBUTE,
getResource(helper.getImageURI()).getUri(context, null), null);
writer.endElement(HTML.IMG_ELEMENT);
}
@@ -390,6 +397,7 @@
if (encodeDiv) {
writer.endElement(HTML.DIV_ELEM);
writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
}
}
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-15
15:48:28 UTC (rev 4008)
+++
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-15
16:06:19 UTC (rev 4009)
@@ -129,63 +129,39 @@
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconUp"
/>
</u:style>
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
</u:selector>
<u:selector name=".ol_control_bn_down">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconDown" />
</u:style>
</u:selector>
<u:selector name=".ol_control_bn_top">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconTop" />
</u:style>
</u:selector>
<u:selector name=".ol_control_bn_bottom">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconBottom" />
</u:style>
</u:selector>
<u:selector name=".ol_control_dbn_up">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="disabled" value="true"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconUpDisabled" />
</u:style>
</u:selector>
<u:selector name=".ol_control_dbn_down">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconDownDisabled" />
</u:style>
</u:selector>
<u:selector name=".ol_control_dbn_top">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconTopDisabled" />
</u:style>
</u:selector>
<u:selector name=".ol_control_dbn_bottom">
- <u:style name="width" value="18px"/>
- <u:style name="height" value="18px"/>
- <u:style name="border" value="1"/>
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled"
/>
</u:style>
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js 2007-11-15
15:48:28 UTC (rev 4008)
+++
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/Control.js 2007-11-15
16:06:19 UTC (rev 4009)
@@ -9,10 +9,10 @@
}
Control.CLASSES = {
- first : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"},
- down : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"},
- up : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"},
- last : {hidden : "ol_button ol_control_hidden", shown : "ol_button
ol_control_shown"}
+ first : {hidden : "ol_button_border ol_control_hidden", shown :
"ol_button_border ol_control_shown"},
+ down : {hidden : "ol_button_border ol_control_hidden", shown :
"ol_button_border ol_control_shown"},
+ up : {hidden : "ol_button_border ol_control_hidden", shown :
"ol_button_border ol_control_shown"},
+ last : {hidden : "ol_button_border ol_control_hidden", shown :
"ol_button_border ol_control_shown"}
};
Control.prototype.doShow = function() {
@@ -45,11 +45,11 @@
}
Control.prototype.doHideNode = function(node) {
- node.parentNode.className = Control.CLASSES[this.action].hidden;
+ node.className = Control.CLASSES[this.action].hidden;
}
Control.prototype.doShowNode = function(node) {
- node.parentNode.className = Control.CLASSES[this.action].shown;
+ node.className = Control.CLASSES[this.action].shown;
}
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-15
15:48:28 UTC (rev 4008)
+++
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-15
16:06:19 UTC (rev 4009)
@@ -19,7 +19,7 @@
}
Shuttle = function(containerId, contentTableId, headerTableId, focusKeeperId,
valueKeeperId,
- controlsId, onclickControlId) {
+ ids, onclickControlId) {
this.container = document.getElementById(containerId);
this.shuttleTable = document.getElementById(contentTableId);
this.shuttleTbody = this.shuttleTable.tBodies[0];
@@ -47,7 +47,7 @@
this.focusKeeper.onkeydown = function(e) {
obj.onkeydownHandler(window.event || e);
}
- this.init(containerId, contentTableId, headerTableId, controlsId, onclickControlId);
+ this.init(containerId, contentTableId, headerTableId, ids, onclickControlId);
}
Shuttle.ASC = "acs";
Modified:
trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
---
trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-15
15:48:28 UTC (rev 4008)
+++
trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-15
16:06:19 UTC (rev 4009)
@@ -53,10 +53,7 @@
</td>
<td class="ol_center_button_col_valign">
<div class="ol_button_layout">
- <div class="ol_button_border"><div class="ol_button"
onmouseover="this.className='ol_button_light'"
onmousedown="this.className='ol_button_press'"
onmouseup="this.className='ol_button'"
onmouseout="this.className='ol_button'"><div
class="ol_button_content"><img src="img/up.gif"
width="15" height="15" alt=""
border="0"/></div></div></div>
- <div class="ol_button_border"><div class="ol_button"
onmouseover="this.className='ol_button_light'"
onmousedown="this.className='ol_button_press'"
onmouseup="this.className='ol_button'"
onmouseout="this.className='ol_button'"><div
class="ol_button_content"><img src="img/down.gif"
width="15" height="15" alt=""
border="0"/></div></div></div>
- <div class="ol_button_border"><div class="ol_button"
onmouseover="this.className='ol_button_light'"
onmousedown="this.className='ol_button_press'"
onmouseup="this.className='ol_button'"
onmouseout="this.className='ol_button'"><div
class="ol_button_content"><img src="img/top.gif"
width="15" height="15" alt=""
border="0"/></div></div></div>
- <div class="ol_button_border"><div class="ol_button"
onmouseover="this.className='ol_button_light'"
onmousedown="this.className='ol_button_press'"
onmouseup="this.className='ol_button'"
onmouseout="this.className='ol_button'"><div
class="ol_button_content"><img src="img/bottom.gif"
width="15" height="15" alt=""
border="0"/></div></div></div>
+ <f:call name="encodeControlsFacets" />
</div>
<f:clientId var="clientId"/>
</td>