diff options
author | Derrell Lipman <derrell@samba.org> | 2007-01-03 20:17:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:36:09 -0500 |
commit | 626bb8efb0c825f332c937ffaaadc9b402079539 (patch) | |
tree | 1c95f69d157b24f64edff470143f5f55a09cfca6 /webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/ui/table/DefaultDataRowRenderer.js | |
parent | eeddcf8cc8eb655d7c40f1fd5f7fd422529f4f98 (diff) | |
download | samba-626bb8efb0c825f332c937ffaaadc9b402079539.tar.gz samba-626bb8efb0c825f332c937ffaaadc9b402079539.tar.bz2 samba-626bb8efb0c825f332c937ffaaadc9b402079539.zip |
r20517: re-add cleaned-up webapps
(This used to be commit 5a3d6ad0b7cf0ecf8b57b4088b19f7d4291c990b)
Diffstat (limited to 'webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/ui/table/DefaultDataRowRenderer.js')
-rw-r--r-- | webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/ui/table/DefaultDataRowRenderer.js | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/ui/table/DefaultDataRowRenderer.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/ui/table/DefaultDataRowRenderer.js new file mode 100644 index 0000000000..8fd2198cd4 --- /dev/null +++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/ui/table/DefaultDataRowRenderer.js @@ -0,0 +1,106 @@ +/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2006 by STZ-IDA, Germany, http://www.stz-ida.de + + License: + LGPL 2.1: http://www.gnu.org/licenses/lgpl.html + + Authors: + * Til Schneider (til132) + +************************************************************************ */ + +/* ************************************************************************ + +#module(ui_table) + +************************************************************************ */ + +/** + * The default data row renderer. + */ +qx.OO.defineClass("qx.ui.table.DefaultDataRowRenderer", qx.ui.table.DataRowRenderer, +function() { + qx.ui.table.DataRowRenderer.call(this); +}); + + +/** Whether the focused row should be highlighted. */ +qx.OO.addProperty({ name:"highlightFocusRow", type:"boolean", allowNull:false, defaultValue:true}); + +/** + * Whether the focused row and the selection should be grayed out when the table + * hasn't the focus. + */ +qx.OO.addProperty({ name:"visualizeFocusedState", type:"boolean", allowNull:false, defaultValue:true}); + + +// overridden +qx.Proto.updateDataRowElement = function(rowInfo, rowElem) { + var clazz = qx.ui.table.DefaultDataRowRenderer; + + if (rowInfo.focusedRow && this.getHighlightFocusRow()) { + if (rowInfo.table.getFocused() || !this.getVisualizeFocusedState()) { + rowElem.style.backgroundColor = rowInfo.selected ? clazz.BGCOL_FOCUSED_SELECTED : clazz.BGCOL_FOCUSED; + } else { + rowElem.style.backgroundColor = rowInfo.selected ? clazz.BGCOL_FOCUSED_SELECTED_BLUR : clazz.BGCOL_FOCUSED_BLUR; + } + } else { + if (rowInfo.selected) { + if (rowInfo.table.getFocused() || !this.getVisualizeFocusedState()) { + rowElem.style.backgroundColor = clazz.BGCOL_SELECTED; + } else { + rowElem.style.backgroundColor = clazz.BGCOL_SELECTED_BLUR; + } + } else { + rowElem.style.backgroundColor = (rowInfo.row % 2 == 0) ? clazz.BGCOL_EVEN : clazz.BGCOL_ODD; + } + } + rowElem.style.color = rowInfo.selected ? clazz.COL_SELECTED : clazz.COL_NORMAL; +} + + +qx.Proto._createRowStyle_array_join = function(rowInfo, htmlArr) { + var clazz = qx.ui.table.DefaultDataRowRenderer; + + htmlArr.push(clazz.ARRAY_JOIN_BG_COLOR); + if (rowInfo.focusedRow && this.getHighlightFocusRow()) { + if (rowInfo.table.getFocused() || !this.getVisualizeFocusedState()) { + htmlArr.push(rowInfo.selected ? clazz.BGCOL_FOCUSED_SELECTED : clazz.BGCOL_FOCUSED); + } else { + htmlArr.push(rowInfo.selected ? clazz.BGCOL_FOCUSED_SELECTED_BLUR : clazz.BGCOL_FOCUSED_BLUR); + } + } else { + if (rowInfo.selected) { + if (rowInfo.table.getFocused() || !this.getVisualizeFocusedState()) { + htmlArr.push(clazz.BGCOL_SELECTED); + } else { + htmlArr.push(clazz.BGCOL_SELECTED_BLUR); + } + } else { + htmlArr.push((rowInfo.row % 2 == 0) ? clazz.BGCOL_EVEN : clazz.BGCOL_ODD); + } + } + htmlArr.push(clazz.ARRAY_JOIN_COLOR); + htmlArr.push(rowInfo.selected ? clazz.COL_SELECTED : clazz.COL); +} + + +qx.Class.BGCOL_FOCUSED_SELECTED = "#5a8ad3"; +qx.Class.BGCOL_FOCUSED_SELECTED_BLUR = "#b3bac6"; +qx.Class.BGCOL_FOCUSED = "#ddeeff"; +qx.Class.BGCOL_FOCUSED_BLUR = "#dae0e7"; +qx.Class.BGCOL_SELECTED = "#335ea8"; +qx.Class.BGCOL_SELECTED_BLUR = "#989ea8"; +qx.Class.BGCOL_EVEN = "#faf8f3"; +qx.Class.BGCOL_ODD = "white"; +qx.Class.COL_SELECTED = "white"; +qx.Class.COL_NORMAL = "black"; + +qx.Class.ARRAY_JOIN_BG_COLOR = ";background-color:"; +qx.Class.ARRAY_JOIN_COLOR = ';color:'; |