JBoss Rich Faces SVN: r1097 - in trunk/sandbox/calendar/design: funcspec and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-06-08 08:19:40 -0400 (Fri, 08 Jun 2007)
New Revision: 1097
Added:
trunk/sandbox/calendar/design/funcspec/
trunk/sandbox/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
Log:
Calendar func. spec. added
Added: trunk/sandbox/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 7 months
JBoss Rich Faces SVN: r1096 - in trunk/richfaces/common/src/main: resources/META-INF/skins and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-06-08 08:07:33 -0400 (Fri, 08 Jun 2007)
New Revision: 1096
Modified:
trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties
Log:
- "plain" skin fixed
- gradient image fixed
Modified: trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-06-08 11:06:13 UTC (rev 1095)
+++ trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-06-08 12:07:33 UTC (rev 1096)
@@ -207,7 +207,7 @@
}
String tmp = (String) skin.getParameter(context,name);
- if (tmp!=null && tmp.length() == 0) {
+ if (tmp!=null && tmp.length() != 0) {
return new Integer(HtmlColor.decode(tmp).getRGB());
} else {
return null;
Modified: trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties
===================================================================
--- trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties 2007-06-08 11:06:13 UTC (rev 1095)
+++ trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties 2007-06-08 12:07:33 UTC (rev 1096)
@@ -1,5 +1,5 @@
#Colors
-headerBackgroundColor=
+headerBackgroundColor=#{null}
headerGradientColor=#{null}
headerTextColor=#{null}
headerWeightFont=#{null}
17 years, 7 months
JBoss Rich Faces SVN: r1095 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-08 07:06:13 -0400 (Fri, 08 Jun 2007)
New Revision: 1095
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnIterator.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridUtils.java
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
added column iterator
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnIterator.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnIterator.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ColumnIterator.java 2007-06-08 11:06:13 UTC (rev 1095)
@@ -0,0 +1,81 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.richfaces.component.UIScrollableGrid;
+import org.richfaces.component.UIScrollableGridColumn;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ColumnIterator implements Iterator {
+
+
+ public static ColumnIterator frozen(UIScrollableGrid grid, GridRendererState state) {
+ return new ColumnIterator(0, GridUtils.getFrozenColumnsCount(grid), grid, state) {
+ public Object next() {
+ this.state.setFrozenPart(true);
+ return super.next();
+ }
+ };
+ }
+
+ public static ColumnIterator normal(UIScrollableGrid grid, GridRendererState state) {
+ return new ColumnIterator(GridUtils.getFrozenColumnsCount(grid), grid.getChildCount(), grid, state) {
+ public Object next() {
+ this.state.setFrozenPart(false);
+ return super.next();
+ }
+ };
+ }
+
+ public static ColumnIterator all(UIScrollableGrid grid, GridRendererState state) {
+ return new ColumnIterator(0, grid.getChildCount(), grid, state);
+ }
+
+ GridRendererState state;
+ private int index = 0;
+ private int start;
+ private int end;
+ private List kids;
+
+ private ColumnIterator(int start, int end, UIScrollableGrid grid, GridRendererState state) {
+ this.start = start;
+ this.end = end;
+ this.state = state;
+ this.kids = grid.getChildren();
+ rewind();
+ }
+
+ public boolean hasNext() {
+ return index < end;
+ }
+
+ public Object next() {
+ state.setCellIndex(index);
+ Object o = kids.get(index);
+
+ index++;
+
+ return o;
+ }
+
+ public UIScrollableGridColumn nextColumn() {
+ return (UIScrollableGridColumn) next();
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException("remove");
+ }
+
+ public void rewind() {
+ index = start;
+ state.setCellIndex(index);
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridUtils.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridUtils.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridUtils.java 2007-06-08 11:06:13 UTC (rev 1095)
@@ -0,0 +1,20 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import org.richfaces.component.UIScrollableGrid;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class GridUtils {
+
+ public static final String FROZEN_COL_COUNT_ATTR = "frozenColCount";
+
+ public static int getFrozenColumnsCount(UIScrollableGrid grid) {
+ return ((Integer)grid.getAttributes().get(FROZEN_COL_COUNT_ATTR)).intValue();
+ }
+
+}
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-06-08 10:28:09 UTC (rev 1094)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-06-08 11:06:13 UTC (rev 1095)
@@ -41,7 +41,6 @@
public abstract class ScrollableGridBaseRenderer extends CompositeRenderer {
-
private final String FOOTER_PART = "footer";
private final String HEADER_PART = "header";
@@ -202,7 +201,7 @@
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.TR_ELEMENT, grid);
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
getUtils().writeAttribute(writer, "id",row_id);
getUtils().writeAttribute(writer, "class","ClientUI_Grid_BR");
@@ -238,7 +237,7 @@
Collection collection = grid.getResponseData();
grid.setRowKey(rowKey);
ResponseWriter writer = context.getResponseWriter();
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
String row_id = null;
/*
@@ -297,6 +296,7 @@
}
};
+
public ScrollableGridBaseRenderer() {
addContributor(new SelectionRendererContributor());
}
@@ -362,7 +362,7 @@
System.out.println("ScrollableGridBaseRenderer.renderGridBody()");
System.out.println("");
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
state.setFrozenPart(isFrozen);
state.setClientId(grid.getClientId(context));
grid.walk(context, rowsRenderer, state);
@@ -382,7 +382,7 @@
state.setClientId(grid.getClientId(context));
state.setPart(HEADER_PART);
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
state.setFrozenPart(isFrozen);
state.setClientId(grid.getClientId(context));
state.setSepOffset(new Integer(0));
@@ -401,7 +401,7 @@
}
state.setClientId(grid.getClientId(context));
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
state.setFrozenPart(isFrozen);
ColumnWalker.iterateOverColumns(context, grid, colsRenderer, writer, state);
}
@@ -419,7 +419,7 @@
}
state.setClientId(grid.getClientId(context));
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
state.setFrozenPart(isFrozen);
int colsCount = ColumnWalker.iterateOverColumns(context, grid, footerCellRenderer, writer, state);
int rowsCount = grid.getRowCount();
@@ -653,7 +653,7 @@
public void setUpColumnsWidth(FacesContext context, UIScrollableGrid grid) throws IOException{
GridRendererState state = GridRendererState.getRendererState(context);
- state.setFrozenColumnCount(((Integer)grid.getAttributes().get("frozenColCount")).intValue());
+ state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
ColumnWalker.iterateOverColumns(context, grid, columnsWidthCounter, null, state);
ComponentVariables variables = ComponentsVariableResolver.getVariables(this, grid);
int sumWidth = state.getSumWidth() + 20;
17 years, 7 months
JBoss Rich Faces SVN: r1094 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-06-08 06:28:09 -0400 (Fri, 08 Jun 2007)
New Revision: 1094
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js
Log:
Updated a client part of selection.
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-06-08 09:19:38 UTC (rev 1093)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-06-08 10:28:09 UTC (rev 1094)
@@ -54,7 +54,7 @@
this.createControl(template);
this.registerEvents();
this.updateLayout();
- this.selectionManager = new ClientUI.controls.grid.SelectionManager(this.grid.getElement());
+ this.selectionManager = new ClientUI.controls.grid.SelectionManager(this.grid);
},
registerEvents: function() {
Event.observe(this.scrollBox.eventHScroll, "grid body hscroll", this._eventOnHScroll);
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-06-08 09:19:38 UTC (rev 1093)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-06-08 10:28:09 UTC (rev 1094)
@@ -186,17 +186,19 @@
});
Object.extend(ClientUI.controls.grid.SelectionManager.prototype, {
- initialize: function(gridElement) {
- this.rowPrefix = gridElement.id;
+ initialize: function(grid) {
+ var gridElement = grid.getElement();
+ this.prefix = gridElement.id;
this.selection = new ClientUI.controls.grid.Selection();
-// this.restoreState();
+ this.restoreState();
this.eventKeyPress = this.processKeyDown.bindAsEventListener(this);
Event.observe(document, "keypress", this.eventKeyPress);
- var frows = $(this.rowPrefix + ":f").rows;
- var nrows = $(this.rowPrefix + ":n").rows;
+ var frows = $(this.prefix + ":f").rows;
+ var nrows = $(this.prefix + ":n").rows;
+ this.rowCount = frows.length;
var rowIndex;
- for(var i = 0; i < frows.length; i++) {
- rowIndex = Number(frows[i].id.split(this.rowPrefix)[1].split(":")[2]);
+ for(var i = 0; i < this.rowCount; i++) {
+ rowIndex = Number(frows[i].id.split(this.prefix)[1].split(":")[2]);
this.addListener(frows[i], rowIndex);
this.addListener(nrows[i], rowIndex);
}
@@ -221,31 +223,29 @@
// }
},
-
- addListener: function(element, rowIndex) {
- Event.observe(element, "click", this.processClick.bindAsEventListener(this, rowIndex));
- },
-
-/* restoreState: function() {
- this.selection.initRanges(this.grid.options.selectionField.value);
- this.oldState = this.selection.getState();
+ restoreState: function() {
+ this.selection.initRanges($(this.prefix+":s").value);
var i = 0;
var j;
while(i < this.selection.ranges.length) {
j = this.selection.ranges[i].indexes[0];
while(j <= this.selection.ranges[i].indexes[1]) {
- var r = this.grid.getRowFromId(j);
- if(r) {
- r.addListener();
- }
+ var fElement = $(this.prefix + ":f:" + j);
+ var nElement = $(this.prefix + ":n:" + j);
+ fElement.style.backgroundColor = "#DDDDFF";
+ nElement.style.backgroundColor = "#DDDDFF";
j++;
}
i++;
}
},
- getGridSelection: function() {
+ addListener: function(element, rowIndex) {
+ Event.observe(element, "click", this.processClick.bindAsEventListener(this, rowIndex));
+ },
+
+/* getGridSelection: function() {
return this.selection.getRanges();
},*/
@@ -276,7 +276,11 @@
switch (event.keyCode || event.charCode) {
case Event.KEY_UP:
if (this.inFocus && activeRow && activeRow > 0) {
- rowIndex = activeRow - 1;
+ if(activeRow) {
+ rowIndex = this.rowCount - 1;
+ } else {
+ rowIndex = activeRow - 1;
+ }
if (!event.ctrlKey && !event.shiftKey) {
range = [rowIndex, rowIndex];
this.setSelection(range);
@@ -296,7 +300,11 @@
break;
case Event.KEY_DOWN:
if (this.inFocus && activeRow) {
- rowIndex = activeRow + 1;
+ if(activeRow == this.rowCount - 1) {
+ rowIndex = 0;
+ } else {
+ rowIndex = activeRow + 1;
+ }
if (!event.ctrlKey && !event.shiftKey) {
range = [rowIndex, rowIndex];
this.setSelection(range);
@@ -316,7 +324,7 @@
break;
case 65: case 97: // Ctrl-A
if (this.inFocus && event.ctrlKey) {
- range = [0, $(this.rowPrefix + ":f").rows.length];
+ range = [0, this.rowCount];
this.setSelection(range);
noDefault = true;
}
@@ -325,6 +333,7 @@
this.lostFocus();
}
if (noDefault) {
+ $(this.prefix+":s").value = this.selection.inspectRanges();
if (event.preventBubble) event.preventBubble();
Event.stop(event);
}
@@ -364,6 +373,7 @@
} else if (document.selection) {
document.selection.empty();
}
+ $(this.prefix+":s").value = this.selection.inspectRanges();
},
setShiftRow: function(event) {
@@ -384,7 +394,7 @@
for (; i <= range[1]; i++) {
this.addRowToSelection(i);
}
- for (; i < $(this.rowPrefix + ":f").rows.length; i++) {
+ for (; i < this.rowCount; i++) {
this.removeRowFromSelection(i);
}
},
@@ -397,16 +407,16 @@
addRowToSelection: function(rowIndex) {
this.selection.addId(rowIndex);
- var fElement = $(this.rowPrefix + ":f:" + rowIndex);
- var nElement = $(this.rowPrefix + ":n:" + rowIndex);
+ var fElement = $(this.prefix + ":f:" + rowIndex);
+ var nElement = $(this.prefix + ":n:" + rowIndex);
fElement.style.backgroundColor = "#DDDDFF";
nElement.style.backgroundColor = "#DDDDFF";
},
removeRowFromSelection: function(rowIndex) {
this.selection.removeId(rowIndex);
- var fElement = $(this.rowPrefix + ":f:" + rowIndex);
- var nElement = $(this.rowPrefix + ":n:" + rowIndex);
+ var fElement = $(this.prefix + ":f:" + rowIndex);
+ var nElement = $(this.prefix + ":n:" + rowIndex);
fElement.style.backgroundColor = "#FFFFFF";
nElement.style.backgroundColor = "#FFFFFF";
},
@@ -414,13 +424,13 @@
setActiveRow: function(rowIndex) {
var fElement, nElement;
if(this.activeRow) {
- fElement = $(this.rowPrefix + ":f:" + this.activeRow);
- nElement = $(this.rowPrefix + ":n:" + this.activeRow);
+ fElement = $(this.prefix + ":f:" + this.activeRow);
+ nElement = $(this.prefix + ":n:" + this.activeRow);
fElement.style.color = "#000000";
nElement.style.color = "#000000";
}
- fElement = $(this.rowPrefix + ":f:" + rowIndex);
- nElement = $(this.rowPrefix + ":n:" + rowIndex);
+ fElement = $(this.prefix + ":f:" + rowIndex);
+ nElement = $(this.prefix + ":n:" + rowIndex);
fElement.style.color = "#0000AA";
nElement.style.color = "#0000AA";
this.activeRow = rowIndex;
17 years, 7 months
JBoss Rich Faces SVN: r1093 - trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-08 05:19:38 -0400 (Fri, 08 Jun 2007)
New Revision: 1093
Modified:
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
Log:
Remove unnecessary commented code.
Modified: trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
===================================================================
--- trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-06-08 08:07:36 UTC (rev 1092)
+++ trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-06-08 09:19:38 UTC (rev 1093)
@@ -295,16 +295,6 @@
getUtils().writeScript(context, pane, "RichFaces.panelTabs['" + pane.getClientId(context) + "']=" + ScriptUtils.toScript(tabs) + ";");
}
-/* public String encodeHeaderSpacing(FacesContext context, UITabPanel pane) throws IOException {
- String headerSpacing = pane.getHeaderSpacing();
- Double decoded = HtmlDimensions.decode(headerSpacing);
- if (decoded.doubleValue() != 0) {
- return "width: " + HtmlUtil.qualifySize(headerSpacing);
- } else {
- return "";
- }
- } */
-
protected TabInfoCollector getTabInfoCollector() {
return collector;
}
17 years, 7 months
JBoss Rich Faces SVN: r1092 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-08 04:07:36 -0400 (Fri, 08 Jun 2007)
New Revision: 1092
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
Log:
now update rows is possible
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-08 07:44:11 UTC (rev 1091)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-08 08:07:36 UTC (rev 1092)
@@ -39,12 +39,12 @@
onSortComplete : function(request, event, data){
var options = request.getJSON("options");
- AjaxUpdater.updateRows(options,request, this, this.client_id);
+ Utils.AJAX.updateRows(options,request, this, this.client_id);
},
onScrollComplete : function(request, event, data){
var options = this.dataModel.getCurrentOptions();
- AjaxUpdater.updateRows(options,request,this,this.client_id);
+ Utils.AJAX.updateRows(options,request,this,this.client_id);
},
onSorted: function(sortEvent) {
17 years, 7 months
JBoss Rich Faces SVN: r1091 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-08 03:44:11 -0400 (Fri, 08 Jun 2007)
New Revision: 1091
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
Log:
now update rows is possible
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-07 22:46:35 UTC (rev 1090)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-08 07:44:11 UTC (rev 1091)
@@ -1,71 +1,101 @@
-var AjaxUpdater = {
+var Utils = {
- updateTr:function(trObj, innerHTML){
- if(trObj) {
- if(ClientUILib.isIE) {
- var theDoc = document;
- var createEl = theDoc.createElement;
- var tds = [];
- var i = 0;
- var pattern = '(?:<td.*?>)((\n|\r|.)*?)(?:<\/td>)';
- var rez = innerHTML.gsub(pattern, function(item) {
- tds[i++] = item[1];
- return ""; });
+ DOM: {
+
+ importNode: function(node, bKids) {
+
+ var nodeName = node.nodeName.toUpperCase();
+
+ switch(nodeName) {
+ case "TBODY":
+ case "TR":
+ case "TD":
+ {
+ var imported = document.createElement(nodeName);
+
+ this.copyAttributes(imported, node);
+
+ if (bKids) {
- var row = trObj.cloneNode(false);
- var count = i, td;
- for(i=0; i< count; i++) {
- td = createEl("TD");
- td.innerHTML = tds[i];
- td.className = "ClientUI_Grid_BC";
- row.insertBefore(td, null);
- }
- trObj.parentNode.replaceChild(row, trObj);
- }else {
- trObj.innerHTML = innerHTML;
+ for(var kid = node.firstChild; kid;
+ kid = kid.nextSibling) {
+
+ var importedKid = this.importNode(kid, true);
+
+ imported.appendChild(importedKid);
+ }
+ }
+ return imported;
+ }
+ default:
+ return (document.importNode(node, bKids));
}
- }
- },
-
- updateRows: function(options,request,grid,clientid){
- var theDoc = document;
- var getEl = theDoc.getElementById;
- var localOptions = options;
- var rowCount = grid.getBody().templFrozen.getElement().rows.length;
- var startRow = localOptions.startRow;
- var count = localOptions.count;
- var row, id, rowindex, i, el;
- var dataModel = grid.dataModel;
- var baseid = clientid;
+ },
- for(i=0; i<count; i++) {
- rowindex = startRow + i;
- if(rowindex >= rowCount){
- rowindex -= rowCount;
- }
+ copyAttributes : function(target, source) {
- id = baseid + ":f:" + rowindex;
- row = request.getElementById(id);
-
- if(ClientUILib.isIE) {
- el = getEl(id);
- this.updateTr(el,row.xml);
- }else {
- el = theDoc.getElementById(id);
- this.updateTr(el,row.innerHTML);
+ var attrs = source.attributes;
+
+ for(var i = 0 ; i < attrs.length; i++) {
+
+ var attributeNode = attrs[i];
+
+ if(attributeNode.specified) {
+
+ var newAttributeNode =
+ document.createAttribute(attributeNode.nodeName);
+
+ newAttributeNode.nodeValue = attributeNode.nodeValue;
+ target.setAttributeNode(newAttributeNode);
+ }
+
}
- id = baseid + ":n:" + rowindex;
- row = request.getElementById(id);
- if(ClientUILib.isIE) {
- el = getEl(id);
- this.updateTr(el,row.xml);
- }else {
- el = theDoc.getElementById(id);
- this.updateTr(el,row.innerHTML);
- }
+ },
+
+ replaceNode : function(id, request) {
+ var target = document.getElementById(id);
+ var src = request.getElementById(id);
+
+ var importProvider = ClientUILib.isIE ? this : document;
+
+ src = importProvider.importNode(src, true);
+
+ target.parentNode.replaceChild(src, target);
+
}
+ },
- dataModel.eventDataReady.fire(localOptions);
+ AJAX : {
+ updateRows: function(options,request,grid,clientid){
+ var theDoc = document;
+ var getEl = theDoc.getElementById;
+ var localOptions = options;
+ var rowCount = grid.getBody().templFrozen.getElement().rows.length;
+ var startRow = localOptions.startRow;
+ var count = localOptions.count;
+ var row, id, rowindex, i, el;
+ var dataModel = grid.dataModel;
+ var baseid = clientid;
+
+ for(i=0; i<count; i++) {
+ rowindex = startRow + i;
+ if(rowindex >= rowCount){
+ rowindex -= rowCount;
+ }
+
+ id = baseid + ":f:" + rowindex;
+
+ Utils.DOM.replaceNode(id, request);
+
+ id = baseid + ":n:" + rowindex;
+
+ Utils.DOM.replaceNode(id, request);
+ }
+
+ dataModel.eventDataReady.fire(localOptions);
+ }
}
+
+
}
\ No newline at end of file
17 years, 7 months
JBoss Rich Faces SVN: r1090 - in trunk/sandbox/calendar/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-06-07 18:46:35 -0400 (Thu, 07 Jun 2007)
New Revision: 1090
Added:
trunk/sandbox/calendar/src/main/config/component/calendar.xml
trunk/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/calendar/src/main/templates/org/
trunk/sandbox/calendar/src/main/templates/org/richfaces/
trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
calendar archetype created
Added: trunk/sandbox/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/sandbox/calendar/src/main/config/component/calendar.xml (rev 0)
+++ trunk/sandbox/calendar/src/main/config/component/calendar.xml 2007-06-07 22:46:35 UTC (rev 1090)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.Calendar</name>
+ <family>org.richfaces.Calendar</family>
+ <classname>org.richfaces.component.html.HtmlCalendar</classname>
+ <superclass>org.richfaces.component.UICalendar</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.CalendarRenderer</name>
+ <template>org/richfaces/htmlCalendar.jspx</template>
+ </renderer>
+ <tag>
+ <name>calendar</name>
+ <classname>org.richfaces.taglib.CalendarTag</classname>
+ <superclass>
+ org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+ </component>
+</components>
Added: trunk/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java (rev 0)
+++ trunk/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-06-07 22:46:35 UTC (rev 1090)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UICalendar extends UIComponentBase {
+
+ private static final String COMPONENT_TYPE = "org.richfaces.Calendar";
+
+ private static final String COMPONENT_FAMILY = "org.richfaces.Calendar";
+
+}
Added: trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx (rev 0)
+++ trunk/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-06-07 22:46:35 UTC (rev 1090)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ class="org.richfaces.renderkit.html.CalendarRenderer"
+ baseclass="org.ajax4jsf.framework.renderer.AjaxComponentRendererBase"
+ component="org.richfaces.component.UICalendar"
+ >
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}"
+ x:passThruWithExclusions="value,name,type,id"
+ >
+ </div>
+</f:root>
\ No newline at end of file
17 years, 7 months
JBoss Rich Faces SVN: r1089 - in trunk/richfaces: common/src/main/resources/META-INF/skins and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-06-07 18:14:41 -0400 (Thu, 07 Jun 2007)
New Revision: 1089
Modified:
trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java
Log:
Better "plain" skin handling
Modified: trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-06-07 19:37:01 UTC (rev 1088)
+++ trunk/richfaces/common/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-06-07 22:14:41 UTC (rev 1089)
@@ -39,7 +39,6 @@
import org.ajax4jsf.framework.skin.Skin;
import org.ajax4jsf.framework.skin.SkinFactory;
import org.ajax4jsf.framework.util.HtmlColor;
-import org.ajax4jsf.framework.util.HtmlDimensions;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
@@ -165,9 +164,9 @@
protected Object getDataToStore(FacesContext context, Object data) {
if (baseColor == null) {
- return new Data(context,data);
+ return new Data(context);
} else {
- return new Data(context,data,baseColor,gradientColor);
+ return new Data(context, baseColor, gradientColor);
}
}
@@ -180,20 +179,35 @@
public Data() {
}
- protected Data(FacesContext context, Object data) {
- this.headerBackgroundColor = getColorValueParameter(context, data, Skin.headerBackgroundColor);
- this.headerGradientColor = getColorValueParameter(context, data, "headerGradientColor");
+ protected Data(FacesContext context) {
+ this(context, Skin.headerBackgroundColor, "headerGradientColor");
}
- protected Data(FacesContext context, Object data, String baseColor, String gradientColor) {
- this.headerBackgroundColor = getColorValueParameter(context, data, baseColor);
- this.headerGradientColor = getColorValueParameter(context, data, gradientColor);
+ protected Data(FacesContext context, String baseColor, String gradientColor) {
+ this.headerBackgroundColor = getColorValueParameter(context, baseColor, false);
+ this.headerGradientColor = getColorValueParameter(context, gradientColor, false);
+
+ if (!(this.headerBackgroundColor == null && this.headerGradientColor == null)) {
+ if (this.headerBackgroundColor == null) {
+ this.headerBackgroundColor = getColorValueParameter(context, baseColor, true);
+ }
+
+ if (this.headerGradientColor == null) {
+ this.headerGradientColor = getColorValueParameter(context, gradientColor, true);
+ }
+ }
}
- private Integer getColorValueParameter(FacesContext context, Object data, String name) {
- Skin skin = SkinFactory.getInstance().getSkin(context);
+ private Integer getColorValueParameter(FacesContext context, String name, boolean useDefault) {
+ Skin skin;
+ if (useDefault) {
+ skin = SkinFactory.getInstance().getDefaultSkin(context);
+ } else {
+ skin = SkinFactory.getInstance().getSkin(context);
+ }
+
String tmp = (String) skin.getParameter(context,name);
- if (tmp!=null) {
+ if (tmp!=null && tmp.length() == 0) {
return new Integer(HtmlColor.decode(tmp).getRGB());
} else {
return null;
Modified: trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties
===================================================================
--- trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties 2007-06-07 19:37:01 UTC (rev 1088)
+++ trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties 2007-06-07 22:14:41 UTC (rev 1089)
@@ -1,50 +1,50 @@
#Colors
headerBackgroundColor=
-headerGradientColor=
-headerTextColor=
-headerWeightFont=
+headerGradientColor=#{null}
+headerTextColor=#{null}
+headerWeightFont=#{null}
-generalBackgroundColor=
-generalTextColor=
-generalSizeFont=
-generalFamilyFont=
+generalBackgroundColor=#{null}
+generalTextColor=#{null}
+generalSizeFont=#{null}
+generalFamilyFont=#{null}
-controlTextColor=
-controlBackgroundColor=
-additionalBackgroundColor=
+controlTextColor=#{null}
+controlBackgroundColor=#{null}
+additionalBackgroundColor=#{null}
-shadowBackgroundColor=
-shadowOpacity=
+shadowBackgroundColor=#{null}
+shadowOpacity=#{null}
-panelBorderColor=
-subBorderColor=
+panelBorderColor=#{null}
+subBorderColor=#{null}
-tabBackgroundColor=
-tabDisabledTextColor=
+tabBackgroundColor=#{null}
+tabDisabledTextColor=#{null}
-trimColor=
+trimColor=#{null}
-tipBackgroundColor=
-tipBorderColor=
+tipBackgroundColor=#{null}
+tipBorderColor=#{null}
-selectControlColor=
+selectControlColor=#{null}
-generalLinkColor=
-hoverLinkColor=
-visitedLinkColor=
+generalLinkColor=#{null}
+hoverLinkColor=#{null}
+visitedLinkColor=#{null}
# Fonts
-headerSizeFont=
-headerFamilyFont=
+headerSizeFont=#{null}
+headerFamilyFont=#{null}
-tabSizeFont=
-tabFamilyFont=
+tabSizeFont=#{null}
+tabFamilyFont=#{null}
-buttonSizeFont=
-buttonFamilyFont=
+buttonSizeFont=#{null}
+buttonFamilyFont=#{null}
-tableBackgroundColor=
-tableFooterBackgroundColor=
-tableSubfooterBackgroundColor=
-tableBorderColor=
\ No newline at end of file
+tableBackgroundColor=#{null}
+tableFooterBackgroundColor=#{null}
+tableSubfooterBackgroundColor=#{null}
+tableBorderColor=#{null}
\ No newline at end of file
Modified: trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java
===================================================================
--- trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java 2007-06-07 19:37:01 UTC (rev 1088)
+++ trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java 2007-06-07 22:14:41 UTC (rev 1089)
@@ -54,8 +54,13 @@
protected Object getDataToStore(FacesContext context, Object data) {
Skin skin = SkinFactory.getInstance().getSkin(context);
-
- String color = (String) skin.getParameter(context, "panelBorderColor");
+ String colorParameterName = "panelBorderColor";
+ String color = (String) skin.getParameter(context, colorParameterName);
+ if (color == null || color.length() == 0) {
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+ return new Integer(HtmlColor.decode(
+ (String) defaultSkin.getParameter(context, colorParameterName)).getRGB());
+ }
return new Integer(HtmlColor.decode(color).getRGB());
}
17 years, 7 months
JBoss Rich Faces SVN: r1088 - in trunk: richfaces-samples/skins/src/main/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-06-07 15:37:01 -0400 (Thu, 07 Jun 2007)
New Revision: 1088
Added:
trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties
Modified:
trunk/richfaces-samples/skins/src/main/java/org/richfaces/SkinBean.java
Log:
"plain" skin added
Added: trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties
===================================================================
--- trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties (rev 0)
+++ trunk/richfaces/common/src/main/resources/META-INF/skins/plain.skin.properties 2007-06-07 19:37:01 UTC (rev 1088)
@@ -0,0 +1,50 @@
+#Colors
+headerBackgroundColor=
+headerGradientColor=
+headerTextColor=
+headerWeightFont=
+
+generalBackgroundColor=
+generalTextColor=
+generalSizeFont=
+generalFamilyFont=
+
+controlTextColor=
+controlBackgroundColor=
+additionalBackgroundColor=
+
+shadowBackgroundColor=
+shadowOpacity=
+
+panelBorderColor=
+subBorderColor=
+
+tabBackgroundColor=
+tabDisabledTextColor=
+
+trimColor=
+
+tipBackgroundColor=
+tipBorderColor=
+
+selectControlColor=
+
+
+generalLinkColor=
+hoverLinkColor=
+visitedLinkColor=
+
+# Fonts
+headerSizeFont=
+headerFamilyFont=
+
+tabSizeFont=
+tabFamilyFont=
+
+buttonSizeFont=
+buttonFamilyFont=
+
+tableBackgroundColor=
+tableFooterBackgroundColor=
+tableSubfooterBackgroundColor=
+tableBorderColor=
\ No newline at end of file
Modified: trunk/richfaces-samples/skins/src/main/java/org/richfaces/SkinBean.java
===================================================================
--- trunk/richfaces-samples/skins/src/main/java/org/richfaces/SkinBean.java 2007-06-07 18:21:53 UTC (rev 1087)
+++ trunk/richfaces-samples/skins/src/main/java/org/richfaces/SkinBean.java 2007-06-07 19:37:01 UTC (rev 1088)
@@ -43,7 +43,8 @@
"emeraldTown",
"japanCherry",
"ruby",
- "wine"
+ "wine",
+ "plain"
};
private String defaultSkin = "blueSky";
17 years, 7 months