JBoss Rich Faces SVN: r2607 - trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-30 09:24:36 -0400 (Thu, 30 Aug 2007)
New Revision: 2607
Added:
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ValueBindingExpression.java
Log:
RF-734
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ValueBindingExpression.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ValueBindingExpression.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ValueBindingExpression.java 2007-08-30 13:24:36 UTC (rev 2607)
@@ -0,0 +1,42 @@
+package org.richfaces.model.internal;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ *
+ * Expression evaluated by invoking EL-expression in context of base object
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+final class ValueBindingExpression extends Expression {
+ private final FacesContext context;
+
+ private Map requestMap;
+ private String var;
+ private ValueBinding binding;
+
+ /**
+ * @param n
+ * @param application
+ * @param requestMap
+ * @param expressionString
+ * @param context
+ * @param var
+ */
+ ValueBindingExpression(FacesContext context, String expressionString, String var) {
+ super(expressionString);
+ this.context = context;
+ this.var = var;
+ binding = context.getApplication().createValueBinding(expressionString);
+ requestMap = context.getExternalContext().getRequestMap();
+ }
+
+ public Object evaluate(Object base) {
+ requestMap.put(var, base);
+ return binding.getValue(context);
+ }
+}
\ No newline at end of file
16 years, 8 months
JBoss Rich Faces SVN: r2606 - in trunk: framework/api/src/main/java/org/richfaces/event/sort and 15 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-30 09:14:59 -0400 (Thu, 30 Aug 2007)
New Revision: 2606
Added:
trunk/ui/dataTable/src/main/java/org/richfaces/util/
trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java
trunk/ui/dataTable/src/test/java/org/richfaces/util/
trunk/ui/dataTable/src/test/java/org/richfaces/util/ColumnUtilTest.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/Expression.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/JavaBeanWrapper.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/NullExpression.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ObjectWrapperFactory.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/SimplePropertyExpression.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/JavaBeanWrapperTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/NullExpressionTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ObjectWrapperFactoryTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/SimplePropertyExpressionTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ValueBindingExpressionTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/WrappedBeanComparatorTest.java
Modified:
trunk/framework/api/src/main/java/org/richfaces/component/Column.java
trunk/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java
trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml
trunk/ui/dataTable/src/main/config/component/colgroup.xml
trunk/ui/dataTable/src/main/config/component/column.xml
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/SelectionRendererContributorTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasicTest.java
Log:
RF-734
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Column.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Column.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Column.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -50,11 +50,8 @@
public abstract void setSortable(boolean sortable);
- /*
- * name of sort field bound to this column
- public abstract String getName();
- public abstract void setName(String name);
+ public abstract void setSortExpression(String sortExpression);
+ public abstract String getSortExpression();
- */
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -18,4 +18,5 @@
*/
public interface SortListener extends FacesListener {
public void processSort(SortEvent e);
+
}
Modified: trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml 2007-08-30 13:14:59 UTC (rev 2606)
@@ -44,12 +44,12 @@
<c:set var="renderFooter" value="#{true}"/>
- <sg:scrollableDataTable value="#{dataModel2}"
+ <sg:scrollableDataTable value="#{jiraService.channel.issues}"
var="issues"
frozenColCount="3"
first="0"
rows="40"
- width="800px"
+ width="1800px"
columnClasses="col"
height="500px" hideWhenScrolling="false">
@@ -70,7 +70,7 @@
</dt:column>
- <dt:column width="200px">
+ <dt:column width="200px" sortExpression="#{issues.key.value}">
<f:facet name="header">
<h:outputText value="Key"></h:outputText>
@@ -86,7 +86,7 @@
</dt:column>
- <dt:column width="200px">
+ <dt:column width="200px" sortExpression="#{issues.summary}">
<f:facet name="header">
<h:outputText value="Summary"></h:outputText>
Modified: trunk/ui/dataTable/src/main/config/component/colgroup.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/colgroup.xml 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/dataTable/src/main/config/component/colgroup.xml 2007-08-30 13:14:59 UTC (rev 2606)
@@ -56,6 +56,11 @@
<description></description>
<defaultvalue>true</defaultvalue>
</property>
+ <property disabled="true" hidden="true">
+ <name>sortExpression</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
<!--
<property>
<name>param</name>
Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/dataTable/src/main/config/component/column.xml 2007-08-30 13:14:59 UTC (rev 2606)
@@ -73,6 +73,12 @@
<description></description>
<defaultvalue>true</defaultvalue>
</property>
+ <property>
+ <name>sortExpression</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+
<!--
<property>
<name>param</name>
Added: trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java (rev 0)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,62 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.util;
+
+import javax.faces.el.ValueBinding;
+
+import org.richfaces.component.UIColumn;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ColumnUtil {
+
+ /**
+ * Extract sort expression from the column
+ *
+ * @param column
+ * @return logical representation of sort field assigned to column component given
+ * In case of EL-expression, an expression string is returned instead of value - so that EL-expression can be evaluated later;
+ * If there's literal value of dedicated attribute is specified, return it;
+ * If attribute is not set, fall aback to component id
+ */
+
+ public static String getColumnSorting(UIColumn column) {
+
+ ValueBinding binding = column.getValueBinding("sortExpression");
+
+ if (binding != null) {
+ return binding.getExpressionString();
+ }
+
+ String sorting = column.getSortExpression();
+
+ if (sorting != null) {
+ return sorting;
+ }
+
+
+ return column.getId();
+ }
+
+}
Added: trunk/ui/dataTable/src/test/java/org/richfaces/util/ColumnUtilTest.java
===================================================================
--- trunk/ui/dataTable/src/test/java/org/richfaces/util/ColumnUtilTest.java (rev 0)
+++ trunk/ui/dataTable/src/test/java/org/richfaces/util/ColumnUtilTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,76 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.util;
+
+import java.util.Collections;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UIColumn;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ColumnUtilTest extends AbstractAjax4JsfTestCase {
+
+ private UIColumn column;
+
+ public ColumnUtilTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ column = (UIColumn) application.createComponent(UIColumn.COMPONENT_TYPE);
+ }
+
+ public void tearDown() throws Exception {
+ column = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.richfaces.util.ColumnUtil#getColumnSorting(org.richfaces.component.UIColumn)}.
+ */
+ public void testGetColumnSorting() {
+ String id = "aaa";
+ column.setId(id);
+ String expression = "#{aaaaaa.aaa}";
+ String literal = "zzzzz";
+
+ assertEquals(id, ColumnUtil.getColumnSorting(column));
+
+ column.setValueBinding("sortExpression", application.createValueBinding(expression));
+
+// /externalContext.getRequestMap().put("aaaaaa", Collections.singletonMap("aaa", "000"));
+
+ assertEquals(expression, ColumnUtil.getColumnSorting(column));
+ column.setValueBinding("sortExpression", null);
+
+ column.setSortExpression(literal);
+
+ assertEquals(literal, ColumnUtil.getColumnSorting(column));
+
+
+ }
+
+}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -6,7 +6,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -37,8 +36,7 @@
import org.richfaces.model.ScrollableTableDataModel;
import org.richfaces.model.ScrollableTableDataRange;
import org.richfaces.model.SortOrder;
-import org.richfaces.model.impl.ArrayDataModel;
-import org.richfaces.model.impl.ListDataModel;
+import org.richfaces.model.internal.ComponentSortableDataModel;
/**
@@ -176,35 +174,8 @@
}
model = (ScrollableTableDataModel) value;
- } else if (value instanceof List) {
-
- if (log.isDebugEnabled()) {
- log.debug("Found instanceof " + value.getClass() + " - will wrap it into " + ListDataModel.class);
- }
-
- model = new ListDataModel((List) value);
-
- }else if (value instanceof Object[]) {
-
- if (log.isDebugEnabled()) {
- log.debug("Found instanceof " + value.getClass() + " - will wrap it into " + ArrayDataModel.class);
- }
-
- model = new ArrayDataModel((Object[]) value);
-
- } else if (value == null) {
- if (log.isDebugEnabled()) {
- log.debug("Found null value - will wrap it into empty " + ListDataModel.class);
- }
-
- model = new ListDataModel(Collections.EMPTY_LIST);
} else {
-
- if (log.isDebugEnabled()) {
- log.debug("Found instanceof " + value.getClass() + " - will wrap it into singleton " + ListDataModel.class);
- }
-
- model = new ListDataModel(Collections.singletonList(value));
+ model = new ComponentSortableDataModel(getVar(), value);
}
if (isCacheable()) {
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -8,15 +8,16 @@
import java.util.LinkedList;
import java.util.List;
-import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.Column;
+import org.richfaces.component.UIColumn;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.model.SortField;
import org.richfaces.model.SortOrder;
+import org.richfaces.util.ColumnUtil;
/**
+ * Implementation of sortListener for multi-column sorting
* @author Maksim Kaszynski
*
*/
@@ -34,11 +35,10 @@
UIScrollableDataTable grid = (UIScrollableDataTable) e.getComponent();
int columnIndex = e.getSortColumn();
- UIComponent column =
- (UIComponent) grid.getChildren().get(columnIndex);
+ UIColumn column =
+ (UIColumn) grid.getChildren().get(columnIndex);
- //TODO: replace with getName?
- String name = column.getId();
+ String name = ColumnUtil.getColumnSorting(column);
SortOrder sortOrder = grid.getSortOrder();
if (sortOrder == null) {
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -3,14 +3,13 @@
*/
package org.richfaces.event.sort;
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.component.Column;
+import org.richfaces.component.UIColumn;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.model.SortField;
import org.richfaces.model.SortOrder;
+import org.richfaces.util.ColumnUtil;
/**
* @author Maksim Kaszynski
@@ -29,11 +28,10 @@
public void processSort(SortEvent e) {
UIScrollableDataTable grid = (UIScrollableDataTable) e.getComponent();
int columnIndex = e.getSortColumn();
- UIComponent column =
- (UIComponent) grid.getChildren().get(columnIndex);
+ UIColumn column =
+ (UIColumn) grid.getChildren().get(columnIndex);
- //TODO: replace with getName?
- String name = column.getId();
+ String name = ColumnUtil.getColumnSorting(column);
SortOrder sortOrder = grid.getSortOrder();
if (sortOrder == null) {
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,141 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.model.ScrollableTableDataModel;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortOrder;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ComponentSortableDataModel extends ScrollableTableDataModel {
+
+
+ /**
+ * Wrap every list element with reflective sorting object, perform sorting, and then unwrap.
+ * @param context
+ * @param collection
+ * @param sortOrder
+ * @return
+ */
+ protected List prepareCollection(FacesContext context, List collection, SortOrder sortOrder) {
+
+ ObjectWrapperFactory factory = new ObjectWrapperFactory(context, var, sortOrder);
+ final SortField [] fields = sortOrder.getFields();
+
+
+ factory.wrapList(collection);
+
+ Collections.sort(collection, new WrappedBeanComparator(fields));
+
+ factory.unwrapList(collection);
+
+
+ return collection;
+ }
+
+
+
+ private List wrappedList;
+ private String var;
+
+ public ComponentSortableDataModel(String var, Object value) {
+ this.var = var;
+ setWrappedData(value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.model.ScrollableTableDataModel#loadData(int, int, org.richfaces.model.SortOrder)
+ */
+ public List loadData(int startRow, int endRow, SortOrder sortOrder) {
+
+
+ List sortedCollection = sortOrder != null ?
+ prepareCollection(FacesContext.getCurrentInstance(), new ArrayList(wrappedList), sortOrder) : wrappedList;
+
+
+ int rc = getRowCount();
+ if (startRow < 0) {
+ startRow = 0;
+ }
+
+ if (endRow > rc) {
+ endRow = rc;
+ }
+
+ return sortedCollection.subList(startRow, endRow);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ public int getRowCount() {
+ // TODO Auto-generated method stub
+ return wrappedList.size();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getWrappedData()
+ */
+ public Object getWrappedData() {
+ // TODO Auto-generated method stub
+ return wrappedList;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object value) {
+ if (value == null) {
+
+ wrappedList = new ArrayList();
+
+ } else if (value instanceof Object[]) {
+
+ Object [] array = (Object[]) value;
+
+ wrappedList = new ArrayList(array.length);
+
+ for (int i = 0; i < array.length; i++) {
+ wrappedList.add(array[i]);
+ }
+
+ } else if (value instanceof Collection) {
+
+ wrappedList = new ArrayList((Collection) value);
+
+ } else {
+ wrappedList = new ArrayList(1);
+ wrappedList.add(value);
+ }
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/Expression.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/Expression.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/Expression.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,50 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+/**
+ * Base interface for expressions (Literal, EL, or empty)
+ * @author Maksim Kaszynski
+ *
+ */
+abstract class Expression {
+ /**
+ * this is expression string
+ */
+ private String expressionString;
+
+ public Expression(String n) {
+ expressionString = n;
+ }
+
+ /**
+ *
+ * @param base
+ * @return result of expression evaluation
+ */
+ public abstract Object evaluate(Object base);
+
+ public String getExpressionString() {
+ return expressionString;
+ }
+
+}
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/JavaBeanWrapper.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/JavaBeanWrapper.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/JavaBeanWrapper.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.Map;
+/**
+ * Object used in sorting - contains of base object, and its properties evaluated with EL
+ * @author Maksim Kaszynski
+ *
+ */
+class JavaBeanWrapper {
+ private Object wrappedObject;
+ private Map properties;
+
+ public JavaBeanWrapper(Object o, Map props) {
+ wrappedObject = o;
+ properties = props;
+ }
+
+ public Object getProperty(String expression) {
+ return properties.get(expression);
+ }
+
+ public Object getWrappedObject() {
+ return wrappedObject;
+ }
+}
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/NullExpression.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/NullExpression.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/NullExpression.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,18 @@
+package org.richfaces.model.internal;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+final class NullExpression extends Expression {
+ /**
+ * @param n
+ */
+ NullExpression(String n) {
+ super(n);
+ }
+
+ public Object evaluate(Object base) {
+ return null;
+ }
+}
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ObjectWrapperFactory.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ObjectWrapperFactory.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ObjectWrapperFactory.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,144 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.Application;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.el.PropertyResolver;
+import javax.faces.webapp.UIComponentTag;
+
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortOrder;
+/**
+ *
+ * class responsible for packaging objects with their properties evaluated using EL.
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+class ObjectWrapperFactory {
+
+ interface ObjectConvertor {
+ public Object convert(Object o);
+ }
+
+ private Expression [] expressions;
+ private FacesContext context;
+ private String var;
+ private Object varValue;
+
+ public ObjectWrapperFactory(FacesContext context, final String var, SortOrder sortOrder) {
+
+ this.context = context;
+
+ Application application = context.getApplication();
+ PropertyResolver resolver = application.getPropertyResolver();
+
+ this.var = var;
+
+ SortField[] sortFields = sortOrder.getFields();
+
+ expressions = new Expression[sortFields.length];
+
+ for (int i = 0; i < sortFields.length; i++) {
+ final SortField field = sortFields[i];
+ final String name = field.getName();
+
+ if (UIComponentTag.isValueReference(name)) {
+
+ expressions[i] = new ValueBindingExpression(context, name, var);
+
+ } else if (name.startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
+
+ expressions[i] = new NullExpression(name);
+
+ } else {
+
+ expressions[i] = new SimplePropertyExpression(name, resolver);
+ }
+ }
+
+
+
+ }
+
+ void convertList(List list, ObjectConvertor c) {
+ int l = list.size();
+
+ for (int i = 0; i < l; i++) {
+ Object o = list.get(i);
+ list.set(i, c.convert(o));
+ }
+ }
+
+ public List unwrapList(List list) {
+
+ convertList(list, new ObjectConvertor() {
+ public Object convert(Object o) {
+ return unwrapObject(o);
+ }
+ });
+
+ if (varValue != null){
+ context.getExternalContext().getRequestMap().put(var, varValue);
+ } else {
+ context.getExternalContext().getRequestMap().remove(var);
+ }
+
+ return list;
+ }
+
+ public Object unwrapObject(Object wrapper) {
+ return ((JavaBeanWrapper) wrapper).getWrappedObject();
+ }
+
+ public List wrapList(List list) {
+
+ varValue = context.getExternalContext().getRequestMap().get(var);
+
+ convertList(list, new ObjectConvertor() {
+ public Object convert(Object o) {
+ return wrapObject(o);
+ }
+ });
+
+ return list;
+ }
+
+ public JavaBeanWrapper wrapObject(Object o) {
+ Map props = new HashMap();
+ for (int i = 0; i < expressions.length; i++) {
+ Expression expression = expressions[i];
+
+ props.put(expression.getExpressionString(), expression.evaluate(o));
+ }
+
+ return new JavaBeanWrapper(o, props);
+
+ }
+
+}
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/SimplePropertyExpression.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/SimplePropertyExpression.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/SimplePropertyExpression.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,37 @@
+package org.richfaces.model.internal;
+
+import javax.faces.el.EvaluationException;
+import javax.faces.el.PropertyResolver;
+
+/**
+ * Expression evaluated by applying application
+ * property resolver to the base object
+ * @author Maksim Kaszynski
+ *
+ */
+final class SimplePropertyExpression extends Expression {
+ /**
+ *
+ */
+ private final PropertyResolver resolver;
+
+ /**
+ * @param n
+ * @param resolver
+ */
+ SimplePropertyExpression(String n, PropertyResolver resolver) {
+ super(n);
+ this.resolver = resolver;
+ }
+
+ public Object evaluate(Object base) {
+ Object o = null;
+ try {
+ return resolver.getValue(base, getExpressionString());
+ } catch (EvaluationException e) {
+
+ }
+
+ return o;
+ }
+}
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/WrappedBeanComparator.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,54 @@
+package org.richfaces.model.internal;
+
+import java.util.Comparator;
+
+import org.richfaces.model.SortField;
+
+/**
+ * Comparator for {@link JavaBeanWrapper} objects.
+ * Compares them using {@link SortField} sequence.
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+final class WrappedBeanComparator implements Comparator {
+ /**
+ *
+ */
+ private final SortField[] fields;
+
+ /**
+ * @param fields
+ */
+ WrappedBeanComparator(SortField[] fields) {
+ this.fields = fields;
+ }
+
+ public int compare(Object o1, Object o2) {
+
+ int result = 0;
+ JavaBeanWrapper w1 = (JavaBeanWrapper) o1;
+ JavaBeanWrapper w2 = (JavaBeanWrapper) o2;
+
+ for (int i = 0; i < fields.length && result == 0; i++) {
+
+ String prop = fields[i].getName();
+ Boolean asc = fields[i].getAscending();
+
+ Object p1 = w1.getProperty(prop);
+ Object p2 = w2.getProperty(prop);
+
+ if (p1 instanceof Comparable) {
+ result = ((Comparable) p1).compareTo(p2);
+ }
+
+ if (asc != null && !asc.booleanValue()) {
+ result = -result;
+ }
+
+ }
+
+
+ return result;
+ }
+}
\ No newline at end of file
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -21,6 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.component.Column;
+import org.richfaces.component.UIColumn;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.event.scroll.ScrollEvent;
import org.richfaces.event.sort.SortEvent;
@@ -28,6 +29,7 @@
import org.richfaces.model.SortOrder;
import org.richfaces.renderkit.CompositeRenderer;
import org.richfaces.renderkit.RendererContributor;
+import org.richfaces.util.ColumnUtil;
import org.richfaces.utils.TemplateLoader;
@@ -173,11 +175,10 @@
Boolean sorting = null;
- UIComponent column =
- (UIComponent) grid.getChildren().get(columnIndex);
+ UIColumn column =
+ (UIColumn) grid.getChildren().get(columnIndex);
- //TODO: replace with getName?
- String name = column.getId();
+ String name = ColumnUtil.getColumnSorting(column);
SortOrder sortOrder = grid.getSortOrder();
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ComponentSortableDataModelTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,228 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UIScrollableDataTable;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortOrder;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ComponentSortableDataModelTest extends AbstractAjax4JsfTestCase {
+
+ private ComponentSortableDataModel model;
+ private UIScrollableDataTable table;
+ private List l;
+ private Object [] a;
+ private Object o;
+ private SortOrder sortOrder;
+ /**
+ * @param name
+ */
+ public ComponentSortableDataModelTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ table = (UIScrollableDataTable) application.createComponent(UIScrollableDataTable.COMPONENT_TYPE);
+ table.setVar("item");
+ model = new ComponentSortableDataModel("item", null);
+
+ facesContext.getViewRoot().getChildren().add(table);
+
+ l = createList();
+ a = createArray();
+ o = o(20);
+
+
+ sortOrder = new SortOrder(new SortField[] {new SortField("name", 0, Boolean.TRUE)});
+
+ //model = new ComponentSortableDataModel()
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ model = null;
+ table = null;
+
+ l = null;
+ a = null;
+ o = null;
+ }
+
+ List createList() {
+ List l = new ArrayList(10);
+ for (int i = 0; i < 10; i++) {
+ l.add(o(i));
+ }
+ return l;
+ }
+
+ Object [] createArray() {
+ Object [] a = new Object[100];
+ for(int i = 0; i < a.length; i++) {
+ a[i] = o(i);
+ }
+
+ return a;
+ }
+
+ TestObj o(int i) {
+ return new TestObj(Integer.toString(i));
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ComponentSortableDataModel#getRowCount()}.
+ */
+ public final void testGetRowCount() {
+
+ model.setWrappedData(l);
+ assertEquals(l.size(), model.getRowCount());
+
+ model.setWrappedData(a);
+ assertEquals(a.length, model.getRowCount());
+
+ model.setWrappedData(o);
+ assertEquals(1, model.getRowCount());
+
+ model.setWrappedData(null);
+ assertEquals(0, model.getRowCount());
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ComponentSortableDataModel#loadData(int, int, org.richfaces.model.SortOrder)}.
+ */
+ public final void testLoadData() {
+ model.setWrappedData(l);
+ List loaded = model.loadData(0, 5, null);
+ assertEquals(5, loaded.size());
+ loaded = model.loadData(0, 10, null);
+ assertEquals(10, loaded.size());
+ loaded = model.loadData(0, 30, null);
+ assertEquals(10, loaded.size());
+ loaded = model.loadData(5, 30, null);
+ assertEquals(5, loaded.size());
+
+ model.setWrappedData(l);
+ loaded = model.loadData(0, 5, sortOrder);
+ assertEquals(5, loaded.size());
+ loaded = model.loadData(0, 10, sortOrder);
+ assertEquals(10, loaded.size());
+ loaded = model.loadData(0, 30, sortOrder);
+ assertEquals(10, loaded.size());
+ loaded = model.loadData(5, 30, sortOrder);
+ assertEquals(5, loaded.size());
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ComponentSortableDataModel#prepareCollection(javax.faces.context.FacesContext, java.util.List, org.richfaces.model.SortOrder)}.
+ */
+ public final void testPrepareCollection() {
+ model.setWrappedData(l);
+
+ int size = l.size();
+
+ List prepared = model.prepareCollection(facesContext, l, sortOrder);
+ assertSame(l, prepared);
+ assertEquals(size, prepared.size());
+
+ Iterator iter = prepared.iterator();
+
+ //must be 10 elements in collection
+ assertTrue(iter.hasNext());
+
+ TestObj prev = (TestObj) iter.next();
+
+ while(iter.hasNext()) {
+
+ TestObj next = (TestObj) iter.next();
+
+ assertTrue(next.getName().compareTo(prev.getName()) > 0);
+
+
+ prev = next;
+
+ }
+
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ComponentSortableDataModel#ComponentSortableDataModel(javax.faces.component.UIData, java.lang.Object)}.
+ */
+ public final void testComponentSortableDataModel() {
+ model = new ComponentSortableDataModel("item", l);
+ assertEquals(l.size(), model.getRowCount());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ComponentSortableDataModel#getWrappedData()}.
+ */
+ public final void testGetWrappedData() {
+ model.setWrappedData(l);
+ assertEquals(l.size(), ((List) model.getWrappedData()).size());
+
+ model.setWrappedData(a);
+ assertEquals(a.length, ((List) model.getWrappedData()).size());
+
+ model.setWrappedData(o);
+ assertEquals(1, ((List) model.getWrappedData()).size());
+
+ model.setWrappedData(null);
+ assertEquals(0, ((List) model.getWrappedData()).size());
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ComponentSortableDataModel#setWrappedData(java.lang.Object)}.
+ */
+ public final void testSetWrappedDataObject() {
+ model.setWrappedData(l);
+ assertEquals(l.size(), ((List) model.getWrappedData()).size());
+
+ model.setWrappedData(a);
+ assertEquals(a.length, ((List) model.getWrappedData()).size());
+
+ model.setWrappedData(o);
+ assertEquals(1, ((List) model.getWrappedData()).size());
+
+ model.setWrappedData(null);
+ assertEquals(0, ((List) model.getWrappedData()).size());
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/JavaBeanWrapperTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/JavaBeanWrapperTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/JavaBeanWrapperTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,76 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.Collections;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class JavaBeanWrapperTest extends TestCase {
+
+
+ private JavaBeanWrapper wrapper;
+ final Boolean test = Boolean.TRUE;
+ final Map props = Collections.singletonMap("true", test);
+ /**
+ * @param name
+ */
+ public JavaBeanWrapperTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ wrapper = new JavaBeanWrapper(test, props);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ wrapper = null;
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.JavaBeanWrapper#getProperty(java.lang.String)}.
+ */
+ public void testGetProperty() {
+ assertEquals(test, wrapper.getProperty("true"));
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.JavaBeanWrapper#getWrappedObject()}.
+ */
+ public void testGetWrappedObject() {
+ assertEquals(test, wrapper.getWrappedObject());
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/NullExpressionTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/NullExpressionTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/NullExpressionTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,63 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class NullExpressionTest extends TestCase {
+
+
+ private Expression expression;
+
+ /**
+ * @param name
+ */
+ public NullExpressionTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ expression = new NullExpression("_id2");
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ expression = null;
+ }
+
+ public void testEvaluate() {
+ Object o = new Object();
+ assertNull(expression.evaluate(o));
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ObjectWrapperFactoryTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ObjectWrapperFactoryTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ObjectWrapperFactoryTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,198 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Random;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortOrder;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ObjectWrapperFactoryTest extends AbstractAjax4JsfTestCase {
+
+
+ /**
+ *
+ */
+ SortField [] sortFields;
+ SortOrder sortOrder;
+ private ObjectWrapperFactory factory;
+ private String var = "abc";
+
+ public ObjectWrapperFactoryTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ sortFields = new SortField[3];
+ sortFields[0] = new SortField("_id1", 0, Boolean.TRUE);
+ sortFields[1] = new SortField("name", 1, Boolean.FALSE);
+ sortFields[2] = new SortField("#{" +var + ".name}", 2, Boolean.TRUE);
+ sortOrder = new SortOrder(sortFields);
+
+ factory = new ObjectWrapperFactory(facesContext, var, sortOrder);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ sortFields = null;
+ sortOrder = null;
+ factory = null;
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ObjectWrapperFactory#convertList(java.util.List, org.richfaces.model.internal.ObjectWrapperFactory.ObjectConvertor)}.
+ */
+ public final void testConvertList() {
+
+
+ List objects = new ArrayList();
+ objects.add(Boolean.TRUE);
+ int size = objects.size();
+ factory.convertList(objects, new ObjectWrapperFactory.ObjectConvertor() {
+ public Object convert(Object o ) {
+
+ return new Boolean(!((Boolean) o).booleanValue());
+ }
+ });
+
+ assertEquals(size, objects.size());
+ assertEquals(Boolean.FALSE, objects.get(0));
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ObjectWrapperFactory#unwrapList(java.util.List)}.
+ */
+ public final void testUnwrapList() {
+ List objects = new ArrayList(10);
+ int [] ints = new int[10];
+ Random random = new Random();
+ for(int i = 0; i < 10; i++) {
+ ints[i] = random.nextInt();
+ objects.add(new TestObj(String.valueOf(ints[i])));
+ }
+
+ List l1 = factory.wrapList(objects);
+ List l2 = factory.unwrapList(l1);
+
+ assertSame(objects, l1);
+ assertSame(objects, l2);
+ assertEquals(10, l2.size());
+
+ for(int i = 0; i < 10; i++) {
+ TestObj t = (TestObj) l2.get(i);
+ assertEquals(String.valueOf(ints[i]), t.getName());
+ }
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ObjectWrapperFactory#unwrapObject(java.lang.Object)}.
+ */
+ public final void testUnwrapObject() {
+
+ TestObj t = new TestObj("20");
+
+ JavaBeanWrapper wrapper = new JavaBeanWrapper(t, new HashMap());
+
+ Object wrapped = factory.unwrapObject(wrapper);
+
+ assertSame(t, wrapped);
+
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ObjectWrapperFactory#wrapList(java.util.List)}.
+ */
+ public final void testWrapList() {
+ List objects = new ArrayList(10);
+ int [] ints = new int[10];
+ Random random = new Random();
+ for(int i = 0; i < 10; i++) {
+ ints[i] = random.nextInt();
+ objects.add(new TestObj(String.valueOf(ints[i])));
+ }
+
+ List l1 = factory.wrapList(objects);
+
+ assertSame(objects, l1);
+ assertEquals(10, l1.size());
+
+ for(int i = 0; i < 10; i++) {
+ JavaBeanWrapper wrapper = (JavaBeanWrapper) l1.get(i);
+ TestObj t = (TestObj) wrapper.getWrappedObject();
+
+ String string = String.valueOf(ints[i]);
+
+ assertEquals(string, t.getName());
+
+ Object prop1 = wrapper.getProperty("name");
+ Object prop2 = wrapper.getProperty("#{abc.name}");
+
+ assertNotNull(prop1);
+ assertNotNull(prop2);
+ assertEquals(string, prop1);
+ assertEquals(string, prop2);
+ }
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ObjectWrapperFactory#wrapObject(java.lang.Object)}.
+ */
+ public final void testWrapObject() {
+ TestObj t = new TestObj("20");
+
+
+
+ JavaBeanWrapper wrapper = factory.wrapObject(t);
+
+ Object wrapped = wrapper.getWrappedObject();
+
+ assertSame(t, wrapped);
+
+ Object prop1 = wrapper.getProperty("name");
+ Object prop2 = wrapper.getProperty("#{abc.name}");
+
+ assertNotNull(prop1);
+ assertNotNull(prop2);
+ assertEquals("20", prop1);
+ assertEquals("20", prop2);
+
+
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/SimplePropertyExpressionTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/SimplePropertyExpressionTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/SimplePropertyExpressionTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,75 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SimplePropertyExpressionTest extends AbstractAjax4JsfTestCase {
+
+ final static String property = "name";
+ private SimplePropertyExpression expression;
+
+ /**
+ * @param name
+ */
+ public SimplePropertyExpressionTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ expression = new SimplePropertyExpression("name", application.getPropertyResolver());
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ expression = null;
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.SimplePropertyExpression#evaluate(java.lang.Object)}.
+ */
+ public final void testEvaluate() {
+ TestObj testObj = new TestObj("aaaa");
+ Object prop = expression.evaluate(testObj);
+ assertNotNull(prop);
+ assertEquals("aaaa", prop);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.Expression#getExpressionString()}.
+ */
+ public final void testGetExpressionString() {
+ assertEquals(property, expression.getExpressionString());
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+public class TestObj {
+ private String name;
+
+ public TestObj(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ValueBindingExpressionTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ValueBindingExpressionTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/ValueBindingExpressionTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ValueBindingExpressionTest extends AbstractAjax4JsfTestCase {
+
+ private ValueBindingExpression expression;
+ static final String var = "obj";
+ static final String el = "#{" + var + ".name}";
+
+ public ValueBindingExpressionTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ expression = new ValueBindingExpression(facesContext, el, var);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ expression = null;
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.ValueBindingExpression#evaluate(java.lang.Object)}.
+ */
+ public final void testEvaluate() {
+ TestObj testObj = new TestObj("aaaa");
+ Object prop = expression.evaluate(testObj);
+ assertNotNull(prop);
+ assertEquals("aaaa", prop);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.Expression#getExpressionString()}.
+ */
+ public final void testGetExpressionString() {
+ assertEquals(el, expression.getExpressionString());
+ }
+
+}
Added: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/WrappedBeanComparatorTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/WrappedBeanComparatorTest.java (rev 0)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/WrappedBeanComparatorTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -0,0 +1,100 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model.internal;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.richfaces.model.SortField;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class WrappedBeanComparatorTest extends TestCase {
+
+ private SortField[] sortFields;
+ private WrappedBeanComparator comparator;
+
+ private static final int [][] testData = {{0,0}, {0,1}, {1, 0}, {1, 1} };
+
+ private JavaBeanWrapper [] testWrapers;
+
+ public WrappedBeanComparatorTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ sortFields = new SortField[2];
+ sortFields[0] = new SortField("a", 1, Boolean.FALSE);
+ sortFields[1] = new SortField("b", 2, Boolean.TRUE);
+
+
+ comparator = new WrappedBeanComparator(sortFields);
+
+ testWrapers = new JavaBeanWrapper[testData.length];
+ for(int i = 0; i < testData.length; i++) {
+ testWrapers[i] = w(testData[i]);
+ }
+
+ }
+
+ private JavaBeanWrapper w(int [] ints) {
+ Map m = new HashMap();
+ m.put("a", new Integer(ints[0]));
+ m.put("b", new Integer(ints[1]));
+
+ return new JavaBeanWrapper(m, m);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ sortFields = null;
+ comparator = null;
+ testWrapers = null;
+ }
+
+ /**
+ * Test method for {@link org.richfaces.model.internal.WrappedBeanComparator#compare(java.lang.Object, java.lang.Object)}.
+ */
+ public final void testCompare() {
+
+ assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 1})) < 0);
+ assertTrue(comparator.compare(w(new int[] {1, 1}), w(new int [] {0, 0})) < 0);
+ assertTrue(comparator.compare(w(new int[] {0, 0}), w(new int [] {0, 1})) < 0);
+ assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 0})) == 0);
+ //assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 1})) < 0);
+ //assertTrue(comparator.compare(w(new int[] {1, 0}), w(new int [] {1, 1})) < 0);
+
+ }
+
+}
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -68,9 +68,10 @@
column.getChildren().add(outputText);
grid.getChildren().add(column);
- grid.setFirst(0);
- grid.setRows(40);
}
+
+ grid.setFirst(0);
+ grid.setRows(40);
facesContext.getViewRoot().getChildren().add(grid);
}
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/SelectionRendererContributorTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/SelectionRendererContributorTest.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/SelectionRendererContributorTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -5,16 +5,11 @@
import java.util.ArrayList;
-import javax.faces.component.UIComponent;
-import javax.faces.context.ExternalContext;
-
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.apache.shale.test.mock.MockExternalContext;
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.model.selection.ClientSelection;
import org.richfaces.model.selection.SelectionRange;
-import org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer;
-import org.richfaces.renderkit.html.SelectionRendererContributor;
/**
* @author Maksim Kaszynski
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasicTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasicTest.java 2007-08-30 12:03:14 UTC (rev 2605)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconBasicTest.java 2007-08-30 13:14:59 UTC (rev 2606)
@@ -11,7 +11,7 @@
import org.richfaces.skin.SkinFactory;
/**
- * @author Anton Belevichs
+ * @author Anton Belevich
*
*/
public class ScrollableDataTableIconBasicTest extends AbstractAjax4JsfTestCase{
16 years, 8 months
JBoss Rich Faces SVN: r2605 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: message and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-08-30 08:03:14 -0400 (Thu, 30 Aug 2007)
New Revision: 2605
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-524
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml 2007-08-30 11:54:14 UTC (rev 2604)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml 2007-08-30 12:03:14 UTC (rev 2605)
@@ -7,13 +7,13 @@
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
- <p>rich:insert component allows to insert and, optionally, format the file from the appication
- context to the page. The context relative path to the file is specified with <b>src</b>
+ <p>rich:insert component allows to insert and, optionally, format the file from the application
+ context into the page. The context relative path to the file is specified with <b>src</b>
attribute.
</p>
<p>
- <b>highlight</b> attribute defined the type of syntax highlighting. If this attribute is
- specified, the inserting text is formated and the keywords are colorized using
+ <b>highlight</b> attribute defines the type of a syntax highlighting. If this attribute is
+ specified, inserting text is formated and keywords are colorized using
<a href="https://jhighlight.dev.java.net/" target="_blank">jhighlight
open source</a> library. You need to have jhighlight.jar in the classpath to have this feature
enabled. The following example shows the groovy code snippet inserted and highlighted:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml 2007-08-30 11:54:14 UTC (rev 2604)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml 2007-08-30 12:03:14 UTC (rev 2605)
@@ -9,20 +9,20 @@
<ui:define name="sample">
- <p>rich:message is an extention for standard h:message component. In addition to what the
- standard conponent provides, rich:message:
+ <p>rich:message is an extension for a standard h:message component. In addition to what the
+ standard component provides, rich:message:
<ul>
- <li>does not required to be wraped with a4j:outputPanel to be rendered during the
+ <li>does not require to be wrapped with a4j:outputPanel in order to be rendered during the
Ajax requests</li>
<li>allows to have a "passed" or "failed" marker before the text label</li>
- <li>has a predefined css class names for different kind of message severities</li>
+ <li>has a predefined css class names for different kinds of message severities</li>
</ul>
</p>
- <p>The message marker is defined with facet. There are several facets names are available
- to designate the marker for different kind of message severities. The following example
- shows how the markers might be use to mark the "passed" and "failed" form fields.
- Fill the form and click "Validate" button to see the entered data passes the
- defined valudation rules.
+ <p>The message marker is defined with a facet. There are several facets names available
+ to design the marker for different kind of message severities. The following example
+ shows how the markers might be used to mark the "passed" and "failed" form fields.
+ Fill the form and click "Validate" button to see the entered data passing the
+ defined validation rules.
</p>
<div class="sample-container" >
16 years, 8 months
JBoss Rich Faces SVN: r2604 - trunk/ui/calendar/design/calendar.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-08-30 07:54:14 -0400 (Thu, 30 Aug 2007)
New Revision: 2604
Modified:
trunk/ui/calendar/design/calendar/calendar_div.html
Log:
added new colors to calendar
Modified: trunk/ui/calendar/design/calendar/calendar_div.html
===================================================================
--- trunk/ui/calendar/design/calendar/calendar_div.html 2007-08-30 11:45:30 UTC (rev 2603)
+++ trunk/ui/calendar/design/calendar/calendar_div.html 2007-08-30 11:54:14 UTC (rev 2604)
@@ -4,30 +4,30 @@
<head>
<title>calendar</title>
<style>
-.rich-calendar-exterior{
- border : 1px solid #c0c0c0; /*panelBorderColor*/
+.calendar_exterior{
+ border : 1px solid #C0C0C0; /*panelBorderColor*/
}
-.rich-calendar-btn{
+.calendar_btn{
cursor : pointer;
}
-.rich-calendar-header{
- border-bottom : 1px solid #c0c0c0; /*panelBorderColor*/
- background : #C7D7EC; /*additionalBackgroundColor*/
+.calendar_header{
+ border-bottom : 1px solid #C0C0C0; /*panelBorderColor*/
+ background : #E9F0F0; /*additionalBackgroundColor*/
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
padding : 7px;
height : 22px;
}
-.rich-cell-size{
+.cell_size{
width : 25px;
height : 22px;
}
-.rich-calendar-cell{
- background-color : #FFFFFF; /*generalBackgroundColor*/
- border-bottom : 1px solid #c0c0c0; /*panelBorderColor*/
- border-right : 1px solid #c0c0c0; /*panelBorderColor*/
+.calendar_cell{
+ background-color : #FFFFFF; /*NEW ATTRIBUTE - tableBackgroundColor*/
+ border-bottom : 1px solid #C0C0C0; /*panelBorderColor*/
+ border-right : 1px solid #C0C0C0; /*panelBorderColor*/
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
padding : 0px;
@@ -35,12 +35,12 @@
text-align : center;
}
-.rich-calendar-tool{
- border-bottom : 1px solid #c0c0c0; /*panelBorderColor*/
- background-color : #224986; /*headerBackgroundColor*/
+.calendar_tool{
+ border-bottom : 1px solid #C0C0C0; /*panelBorderColor*/
+ background-color : #E8BDBD; /*headerBackgroundColor*/
font-size : 11px; /*headerSizeFont*/
font-family : verdana; /*headerFamilyFont*/
- color : #ffffff; /*headerTextColor*/
+ color : #980808; /*headerTextColor*/
font-weight : bold;
vertical-align : middle;
text-align : center;
@@ -48,21 +48,21 @@
height : 22px;
}
-.rich-calendar-month{
- border-bottom : 1px solid #c0c0c0; /*panelBorderColor*/
- background-color : #224986; /*headerBackgroundColor*/
+.calendar_month{
+ border-bottom : 1px solid #C0C0C0; /*panelBorderColor*/
+ background-color : #E8BDBD; /*headerBackgroundColor*/
font-size : 11px; /*headerSizeFont*/
font-family : verdana; /*headerFamilyFont*/
- color : #ffffff; /*headerTextColor*/
+ color : #980808; /*headerTextColor*/
font-weight : bold;
vertical-align : middle;
text-align : center;
}
-.rich-calendar-days{
- border-bottom : 1px solid #c0c0c0; /*panelBorderColor*/
- border-right : 0px solid #c0c0c0; /*panelBorderColor*/
- background : #C7D7EC; /*additionalBackgroundColor*/
+.calendar_days{
+ border-bottom : 1px solid #C0C0C0; /*panelBorderColor*/
+ border-right : 0px solid #C0C0C0; /*panelBorderColor*/
+ background : #E9F0F0; /*additionalBackgroundColor*/
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
vertical-align : middle;
@@ -70,61 +70,62 @@
height : 22px;
}
-.rich-calendar-week{
- border-bottom : 1px solid #c0c0c0; /*panelBorderColor*/
- border-right : 1px solid #c0c0c0; /*panelBorderColor*/
+.calendar_week{
+ border-bottom : 1px solid #C0C0C0; /*panelBorderColor*/
+ border-right : 1px solid #C0C0C0; /*panelBorderColor*/
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
- background-color : #f5f5f5; /*unknown parameter - need to add*/
+ background-color : #f5f5f5; /*NEW ATTRIBUTE - calendarwWeekBackgroundColor*/
vertical-align : middle;
text-align : center;
width : 25px;
}
-.rich-calendar-holly{
- background-color : #ffebda; /*unknown parameter - need to add*/
- color : #ff7800; /*unknown parameter - need to add*/
+.calendar_holly{
+ background-color : #FFEBEB; /*NEW ATTRIBUTE - calendarHolidaysBackgroundColor*/
+ color : #980808; /*NEW ATTRIBUTE - calendarHolidaysTextColor*/
}
-.rich-calendar-today{
- background-color : #ff7800; /*unknown parameter - need to add*/
- color : #ffebda; /*unknown parameter - need to add*/
+.calendar_current{
+ background-color : #980808; /*NEW ATTRIBUTE - calendarCurrentBackgroundColor*/
+ color : #ffffff; /*NEW ATTRIBUTE - calendarCurrentTextColor*/
font-weight : bold;
}
-.rich-calendar-spec{
- background-color : #e4f5e2; /*unknown parameter - need to add*/
+.calendar_spec{
+ background-color : #f1f1f1; /*NEW ATTRIBUTE - calendarSpecBackgroundColor*/
+ color : #000000; /*NEW ATTRIBUTE - calendarSpecTextColor*/
}
-.rich-calendar-select{
- background-color : #224986; /*headerBackgroundColor*/
- color : #FFFFFF; /*headerTextColor*/
+.calendar_select{
+ background-color : #E8BDBD; /*headerBackgroundColor*/
+ color : #980808; /*headerTextColor*/
font-weight : bold;
}
-.rich-right-cell{
+.right_cell{
border-right : 0px;
}
-.rich-bottom-cell{
+.bottom_cell{
border-bottom : 0px;
}
-.rich-calendar-toolfooter{
- border-top : 1px solid #c0c0c0; /*panelBorderColor*/
- border-right : 0px solid #c0c0c0; /*panelBorderColor*/
- background : #C7D7EC; /*additionalBackgroundColor*/
+.calendar_toolfooter{
+ border-top : 1px solid #C0C0C0; /*panelBorderColor*/
+ border-right : 0px solid #C0C0C0; /*panelBorderColor*/
+ background : #E9F0F0; /*additionalBackgroundColor*/
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
padding : 0px 7px 0px 7px;
height : 22px;
}
-.rich-calendar-footer{
- border-top : 1px solid #c0c0c0; /*panelBorderColor*/
- border-right : 0px solid #c0c0c0; /*panelBorderColor*/
- background : #C7D7EC; /*additionalBackgroundColor*/
+.calendar_footer{
+ border-top : 1px solid #C0C0C0; /*panelBorderColor*/
+ border-right : 0px solid #C0C0C0; /*panelBorderColor*/
+ background : #E9F0F0; /*additionalBackgroundColor*/
font-size : 11px; /*generalSizeFont*/
font-family : verdana; /*generalFamilyFont*/
padding : 7px;
@@ -141,9 +142,9 @@
<div>
-<table border="0" cellpadding="0" cellspacing="0" class="rich-calendar-exterior">
+<table border="0" cellpadding="0" cellspacing="0" class="calendar_exterior">
<tr>
- <td class="rich-calendar-header" colspan="8">
+ <td class="calendar_header" colspan="8">
Optional Header
</td>
</tr>
@@ -152,19 +153,19 @@
<td colspan="8">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
- <td class="rich-calendar-tool rich-calendar-btn">
+ <td class="calendar_tool calendar_btn">
««
</td>
- <td class="rich-calendar-tool rich-calendar-btn">
+ <td class="calendar_tool calendar_btn">
«
</td>
- <td class="rich-calendar-month rich-calendar-btn">
+ <td class="calendar_month calendar_btn">
June, 2007
</td>
- <td class="rich-calendar-tool rich-calendar-btn">
+ <td class="calendar_tool calendar_btn">
»
</td>
- <td class="rich-calendar-tool rich-calendar-btn">
+ <td class="calendar_tool calendar_btn">
»»
</td>
</tr>
@@ -172,163 +173,163 @@
</td>
</tr>
<tr>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
<br>
</td>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
Sun
</td>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
Mon
</td>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
Tue
</td>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
Wed
</td>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
Thu
</td>
- <td class="rich-calendar-days">
+ <td class="calendar_days">
Fri
</td>
- <td class="rich-calendar-days rich-right-cell">
+ <td class="calendar_days right_cell">
Sat
</td>
</tr>
<tr>
- <td class="rich-calendar-week">
+ <td class="calendar_week">
1
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly">
+ <td class="cell_size calendar_cell calendar_holly">
<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-cell">
+ <td class="cell_size calendar_cell calendar_cell">
<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
1<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
2<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
3<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
4<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-right-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly right_cell calendar_btn">
5<br>
</td>
</tr>
<tr>
- <td class="rich-calendar-week">
+ <td class="calendar_week">
2
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly calendar_btn">
6<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
7<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-today rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_current calendar_btn">
8<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
9<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-spec rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_spec calendar_btn">
10<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-spec rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_spec calendar_btn">
11<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-right-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly right_cell calendar_btn">
12<br>
</td>
</tr>
<tr>
- <td class="rich-calendar-week">
+ <td class="calendar_week">
3
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly calendar_btn">
13<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
14<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
15<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-spec rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_spec calendar_btn">
16<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
17<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
18<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-right-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly right_cell calendar_btn">
19<br>
</td>
</tr>
<tr>
- <td class="rich-calendar-week">
+ <td class="calendar_week">
4
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly calendar_btn">
20<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
21<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
22<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
23<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-select rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_select calendar_btn">
24<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_btn">
25<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-right-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly right_cell calendar_btn">
26<br>
</td>
</tr>
<tr>
- <td class="rich-calendar-week rich-bottom-cell rich-calendar-btn">
+ <td class="calendar_week bottom_cell calendar_btn">
5
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-bottom-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_holly bottom_cell calendar_btn">
27<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-bottom-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell bottom_cell calendar_btn">
28<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-spec rich-bottom-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_spec bottom_cell calendar_btn">
29<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-spec rich-bottom-cell rich-calendar-btn">
+ <td class="cell_size calendar_cell calendar_spec bottom_cell calendar_btn">
30<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-bottom-cell">
+ <td class="cell_size calendar_cell bottom_cell">
<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-bottom-cell">
+ <td class="cell_size calendar_cell bottom_cell">
<br>
</td>
- <td class="rich-cell-size rich-calendar-cell rich-calendar-holly rich-right-cell rich-bottom-cell">
+ <td class="cell_size calendar_cell calendar_holly right_cell bottom_cell">
<br>
</td>
</tr>
@@ -336,13 +337,13 @@
<td colspan="8">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
- <td class="rich-calendar-toolfooter rich-calendar-btn">
+ <td class="calendar_toolfooter calendar_btn">
07/08/2007
</td>
- <td class="rich-calendar-toolfooter" width="100%">
+ <td class="calendar_toolfooter" width="100%">
<br>
</td>
- <td class="rich-calendar-toolfooter rich-calendar-btn" align="right">
+ <td class="calendar_toolfooter calendar_btn" align="right">
Today
</td>
</tr>
@@ -351,7 +352,7 @@
</tr>
<tr>
- <td class="rich-calendar-footer" colspan="8">
+ <td class="calendar_footer" colspan="8">
Optional Footer
</td>
</tr>
16 years, 8 months
JBoss Rich Faces SVN: r2603 - in trunk: samples/calendar-sample/src/main/java/org/richfaces and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-08-30 07:45:30 -0400 (Thu, 30 Aug 2007)
New Revision: 2603
Modified:
trunk/framework/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties
trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties
trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/samples/richfaces-demo/src/main/webapp/META-INF/MANIFEST.MF
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
Log:
added new colors to calendar
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/DEFAULT.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,16 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C4C0C9
tableBorderWidth=1px
+
+
+#Calendar colors
+calendarwWeekBackgroundColor=#F1EEE9
+
+calendarHolidaysBackgroundColor=#FFEBDA
+calendarHolidaysTextColor=#FF7800
+
+calendarCurrentBackgroundColor=#FF7800
+calendarCurrentTextColor=#FFEBDA
+
+calendarSpecBackgroundColor=#F1EEE9
+calendarSpecTextColor=#000000
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/blueSky.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -44,8 +44,22 @@
buttonSizeFont=11
buttonFamilyFont=Arial, Verdana, sans-serif
+
tableBackgroundColor=#FFFFFF
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
+
+
+#Calendar colors
+calendarwWeekBackgroundColor=#F5F5F5
+
+calendarHolidaysBackgroundColor=#FFEBDA
+calendarHolidaysTextColor=#FF7800
+
+calendarCurrentBackgroundColor=#FF7800
+calendarCurrentTextColor=#FFEBDA
+
+calendarSpecBackgroundColor=#E4F5E2
+calendarSpecTextColor=#000000
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/classic.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,16 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
+
+
+#Calendar colors
+calendarwWeekBackgroundColor=#F5F5F5
+
+calendarHolidaysBackgroundColor=#FFEBDA
+calendarHolidaysTextColor=#FF7800
+
+calendarCurrentBackgroundColor=#FF7800
+calendarCurrentTextColor=#FFEBDA
+
+calendarSpecBackgroundColor=#E4F5E2
+calendarSpecTextColor=#000000
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/deepMarine.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,16 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
+
+#Calendar colors
+calendarwWeekBackgroundColor=#F5F5F5
+
+calendarHolidaysBackgroundColor=#FFEBDA
+calendarHolidaysTextColor=#FF7800
+
+calendarCurrentBackgroundColor=#FF7800
+calendarCurrentTextColor=#FFEBDA
+
+calendarSpecBackgroundColor=#DFF8F8
+calendarSpecTextColor=#000000
+
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/emeraldTown.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,16 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
+
+#Calendar colors
+calendarwWeekBackgroundColor=#f5f5f5
+
+calendarHolidaysBackgroundColor=#FFEBDA
+calendarHolidaysTextColor=#FF7800
+
+calendarCurrentBackgroundColor=#FF7800
+calendarCurrentTextColor=#FFEBDA
+
+calendarSpecBackgroundColor=#E2F6E2
+calendarSpecTextColor=#000000
+
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/japanCherry.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,17 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#DFA5A5
tableBorderWidth=1px
+
+
+#Calendar colors
+calendarwWeekBackgroundColor=#f5f5f5
+
+calendarHolidaysBackgroundColor=#FFEBEB
+calendarHolidaysTextColor=#980808
+
+calendarCurrentBackgroundColor=#980808
+calendarCurrentTextColor=#ffffff
+
+calendarSpecBackgroundColor=#f1f1f1
+calendarSpecTextColor=#000000
+
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/plain.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,15 @@
tableSubfooterBackgroundColor=#{null}
tableBorderColor=#{null}
tableBorderWidth=0px
+
+#Calendar colors
+calendarwWeekBackgroundColor=#{null}
+
+calendarHolidaysBackgroundColor=#{null}
+calendarHolidaysTextColor=#{null}
+
+calendarCurrentBackgroundColor=#{null}
+calendarCurrentTextColor=#{null}
+
+calendarSpecBackgroundColor=#{null}
+calendarSpecTextColor=#{null}
\ No newline at end of file
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/ruby.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,3 +49,17 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C0C0C0
tableBorderWidth=1px
+
+
+#Calendar colors
+calendarwWeekBackgroundColor=#f5f5f5
+
+calendarHolidaysBackgroundColor=#FFF1F1
+calendarHolidaysTextColor=#980808
+
+calendarCurrentBackgroundColor=#808080
+calendarCurrentTextColor=#ffffff
+
+calendarSpecBackgroundColor=#f1f1f1
+calendarSpecTextColor=#000000
+
Modified: trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/framework/impl/src/main/resources/META-INF/skins/wine.skin.properties 2007-08-30 11:45:30 UTC (rev 2603)
@@ -50,3 +50,17 @@
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#B6AD84
tableBorderWidth=1px
+
+#Calendar colors
+calendarwWeekBackgroundColor=#f5f5f5
+
+calendarHolidaysBackgroundColor=#FFF4D8
+calendarHolidaysTextColor=#B38919
+
+calendarCurrentBackgroundColor=#B38919
+calendarCurrentTextColor=#ffffff
+
+calendarSpecBackgroundColor=#F0FCE2
+calendarSpecTextColor=#000000
+
+
Modified: trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-08-30 11:45:30 UTC (rev 2603)
@@ -27,6 +27,8 @@
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.event.CurrentDateChangeEvent;
+
/**
* 20/07/2007
*
@@ -206,5 +208,15 @@
public void setBoundary(String boundary) {
this.boundary = boundary;
}
+ public void dcl(CurrentDateChangeEvent event){
+ System.out.println(event.getCurrentDateString());
+ System.out.println("ajvhckndskncs");
+ }
+ public void ddd(ValueChangeEvent event){
+ System.out.println(event.getOldValue());
+ System.out.println(event.getNewValue());
+
+ }
+
}
\ No newline at end of file
Modified: trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-08-30 11:45:30 UTC (rev 2603)
@@ -49,7 +49,9 @@
buttonLabel="PopUp"
enableManualInput="#{calendarBean.enableManualInput}"
showInput="#{calendarBean.showInput}"
- boundaryDatesMode="#{calendarBean.boundary}">
+ boundaryDatesMode="#{calendarBean.boundary}"
+ currentDateChangeListener="#{calendarBean.dcl}"
+ valueChangeListener="#{calendarBean.ddd}">
<f:facet name="optionalHeader">
<h:outputText value="optionalHeader Facet" />
</f:facet>
Modified: trunk/samples/richfaces-demo/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/META-INF/MANIFEST.MF 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/samples/richfaces-demo/src/main/webapp/META-INF/MANIFEST.MF 2007-08-30 11:45:30 UTC (rev 2603)
@@ -1,3 +1,2 @@
Manifest-Version: 1.0
-Class-Path:
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2007-08-30 11:45:30 UTC (rev 2603)
@@ -115,11 +115,11 @@
java.util.Calendar.getInstance(getTimeZone()).getTime()
</defaultvalue>
</property>
- <!--property>
+ <property>
<name>currentDateChangeListener</name>
<classname>javax.faces.el.MethodBinding</classname>
<description>MethodBinding representing an action listener method that will be notified after date selection</description>
- </property -->
+ </property>
<property>
<name>datePattern</name>
<classname>java.lang.String</classname>
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-08-30 10:17:15 UTC (rev 2602)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-08-30 11:45:30 UTC (rev 2603)
@@ -56,27 +56,11 @@
.rich-calendar-week{
border-bottom : 1px solid;
border-right : 1px solid;
- /* background-color : #f5f5f5; /*unknown parameter - need to add*/ */
vertical-align : middle;
text-align : center;
width : 25px;
}
-/*.rich-calendar-holly{
- background-color : #ffebda; /*unknown parameter - need to add*/
- color : #ff7800; /*unknown parameter - need to add*/
-}*/
-
-/*.rich-calendar-today{
- background-color : #ff7800; /*unknown parameter - need to add*/
- color : #ffebda; /*unknown parameter - need to add*/
- font-weight : bold;
-}*/
-
-.rich-calendar-spec{
- background-color : #e4f5e2; /*unknown parameter - need to add*/
-}
-
.rich-right-cell{
border-right : 0px;
}
@@ -115,6 +99,10 @@
<u:style name="font-family" skin="generalFamilyFont"/>
</u:selector>
+ <u:selector name=".rich-calendar-spec">
+ <u:style name="background-color" skin="calendarSpecBackgroundColo"/>
+ </u:selector>
+
<u:selector name=".rich-calendar-header">
<u:style name="border-bottom-color" skin="panelBorderColor"/>
<u:style name="background-color" skin="additionalBackgroundColor"/>
@@ -154,14 +142,14 @@
<u:style name="font-family" skin="generalFamilyFont"/>
</u:selector>
- <u:selector name=".rich-calendar-weekend">
+ <u:selector name=".rich-calendar-weekends">
<u:style name="color" value="red"/>
</u:selector>
-/* background-color : #f5f5f5; unknown parameter - need to add*/
<u:selector name=".rich-calendar-week">
<u:style name="background" skin="additionalBackgroundColor"/>
<u:style name="border-bottom-color" skin="panelBorderColor"/>
+ <u:style name="background-color" skin="calendarwWeekBackgroundColor"/>
<u:style name="border-right-color" skin="panelBorderColor"/>
<u:style name="font-size" skin="generalSizeFont"/>
<u:style name="font-family" skin="generalFamilyFont"/>
@@ -169,29 +157,17 @@
<u:selector name=".rich-calendar-holly">
- <u:style name="background-color" value="#ffebda"/> /*unknown parameter - need to add*/
- <u:style name="color" value="#ff7800"/> /*unknown parameter - need to add*/
+ <u:style name="background-color" value="calendarHolidaysBackgroundColor"/>
+ <u:style name="color" value="calendarHolidaysTextColor"/>
</u:selector>
-/*
-.rich-calendar-today{
- background-color : #ff7800; /*unknown parameter - need to add
- color : #ffebda; /*unknown parameter - need to add
- font-weight : bold;
-}
-*/
-/*
-.rich-calendar-spec{
- background-color : #e4f5e2; /*unknown parameter - need to add
-}
-*/
<u:selector name=".rich-calendar-boundary-dates">
<u:style name="color" value="#a0a0a0"/> /*unknown parameter - need to add*/
</u:selector>
<u:selector name=".rich-calendar-today">
- <u:style name="background-color" value="#ff7800"/> /*unknown parameter - need to add*/
- <u:style name="color" value="#ffebda"/> /*unknown parameter - need to add*/
+ <u:style name="background-color" value="calendarCurrentBackgroundColor"/>
+ <u:style name="color" value="calendarCurrentTextColor"/>
<u:style name="font-weight" value="bold"/>
</u:selector>
@@ -206,7 +182,7 @@
</u:selector>
<u:selector name=".rich-calendar-today.rich-calendar-hover">
- <u:style name="color" value="#ff7800"/> /*unknown parameter - need to add*/
+ <u:style name="color" value="calendarCurrentBackgroundColor"/>
</u:selector>
<u:selector name=".rich-calendar-toolfooter">
16 years, 8 months
JBoss Rich Faces SVN: r2602 - trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-08-30 06:17:15 -0400 (Thu, 30 Aug 2007)
New Revision: 2602
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-762
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-08-30 09:30:17 UTC (rev 2601)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-08-30 10:17:15 UTC (rev 2602)
@@ -227,9 +227,9 @@
document.body.insertBefore(this.update, document.body.firstChild);
this.initialized = true;
}
+ this.wasBlur = false;
if (this.active) {
this.wasScroll = false;
- this.wasBlur = false;
switch (event.keyCode) {
case Event.KEY_TAB:
case Event.KEY_RETURN:
@@ -374,6 +374,7 @@
onBlur: function(event) {
if (this.isUnloaded()) return;
+ this.wasBlur = true;
if (!this.active) return;
var offsets = RichFaces.Position.calcOffsets(this.update);
if (RichFaces.navigatorType() != "MSIE") {
@@ -390,7 +391,6 @@
}
// needed to make click events working
setTimeout(this.hide.bind(this), 250);
- this.wasBlur = true;
},
onScroll: function(event) {
16 years, 8 months
JBoss Rich Faces SVN: r2601 - trunk/test-applications/facelets/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-30 05:30:17 -0400 (Thu, 30 Aug 2007)
New Revision: 2601
Modified:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
Log:
http://jira.jboss.com/jira/browse/RF-752
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2007-08-30 02:22:37 UTC (rev 2600)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2007-08-30 09:30:17 UTC (rev 2601)
@@ -33,7 +33,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-DradAbdDrop.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,/WEB-INF/!
faces-config-Div.xml</param-value>
+ <param-value>/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-DradAbdDrop.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xm!
l,/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-Div.xml</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
16 years, 8 months
JBoss Rich Faces SVN: r2600 - in trunk/samples/tooltip-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 22:22:37 -0400 (Wed, 29 Aug 2007)
New Revision: 2600
Added:
trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp
Modified:
trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java
trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp
Log:
richfaces-demo tooltip demo recreated in tooltip-sample
Modified: trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java 2007-08-30 02:15:28 UTC (rev 2599)
+++ trunk/samples/tooltip-sample/src/main/java/org/richfaces/Bean.java 2007-08-30 02:22:37 UTC (rev 2600)
@@ -21,7 +21,6 @@
package org.richfaces;
-import java.util.Date;
/**
* @author $Autor$
@@ -37,6 +36,7 @@
String text2 = "ToolTip content2";
String text3 = "ToolTip content3";
+ private int counter;
public String getText() {
return text;
@@ -84,4 +84,7 @@
this.text3 = text3;
}
+ public int getCounter() {
+ return counter++;
+ }
}
\ No newline at end of file
Added: trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp
===================================================================
--- trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp (rev 0)
+++ trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp 2007-08-30 02:22:37 UTC (rev 2600)
@@ -0,0 +1,103 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%--@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"--%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/tooltip" prefix="rich"%>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:outputLink value="pages/index.jsf">index.jsf</h:outputLink>
+ <h:panelGrid columns="2">
+ <a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ <f:verbatim>
+ <p>
+ Here you can see <b>default client-side</b> tool-tip
+ </p>
+ </f:verbatim>
+
+ <rich:toolTip>
+ <f:verbatim>
+ <span style="white-space:nowrap">
+ This tool-tip content was <strong>pre-rendered</strong> to the page.<br/>
+ The look of this tool-tip is 100% defined by skin.
+ </span>
+ </f:verbatim>
+ </rich:toolTip>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ <f:verbatim>
+ <p>
+ This tool-tip will <b>follow mouse</b>. Also this tool-tip has a <b>delay 0.5 sec</b>, so be patient!
+ </p>
+ </f:verbatim>
+
+ <rich:toolTip followMouse="true" direction="top-right" delay="500" styleClass="tooltip" style="width:250px">
+ <f:verbatim>
+ <span>
+ This tool-tip content also <strong>pre-rendered</strong> to the page.
+ However, the look of this tool-tip is customized by styleClass attribute.
+ </span>
+ </f:verbatim>
+ </rich:toolTip>
+ </a4j:outputPanel>
+ <h:form>
+ <a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ <f:verbatim>
+ <p>
+ This tool-tip rendered on server <b>in separate request</b>.
+ </p>
+ </f:verbatim>
+
+ <rich:toolTip direction="top-right" mode="ajax" styleClass="tooltip" layout="block">
+ <f:facet name="defaultContent">
+ <f:verbatim>
+ <strong>Wait...</strong>
+ </f:verbatim>
+ </f:facet>
+ <f:verbatim>
+ <span >This tool-tip content was <strong>rendered on server</strong> </span>
+ </f:verbatim>
+ <h:panelGrid columns="2">
+ <h:outputText value="tooltips requested:" />
+ <h:outputText value="#{bean.counter}" styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ </a4j:outputPanel>
+ </h:form>
+ <h:form>
+ <a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ <f:verbatim>
+ <p>
+ This tool-tip will be <b>activated on mouse click</b>. It also has a <b>bottom-left</b> position.
+ </p>
+ </f:verbatim>
+
+ <rich:toolTip event="onclick" direction="bottom-left" mode="ajax" styleClass="tooltip" layout="block">
+ <f:facet name="defaultContent">
+ <f:verbatim>
+ <strong>Wait...</strong>
+ </f:verbatim>
+ </f:facet>
+ <f:verbatim>
+ <span >This tool-tip content was <strong>rendered on server</strong> </span>
+ </f:verbatim>
+ <h:panelGrid columns="2">
+ <h:outputText value="tooltips requested:" />
+ <h:outputText value="#{bean.counter}" styleClass="tooltipData" />
+ </h:panelGrid>
+ </rich:toolTip>
+ </a4j:outputPanel>
+ </h:form>
+</h:panelGrid>
+
+
+
+ </f:view>
+ </body>
+</html>
+
Modified: trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp 2007-08-30 02:15:28 UTC (rev 2599)
+++ trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp 2007-08-30 02:22:37 UTC (rev 2600)
@@ -10,6 +10,7 @@
</head>
<body>
<f:view>
+ <h:outputLink value="pages/demo.jsf">demo.jsf</h:outputLink>
<h:form>
<h:selectOneRadio binding="#{skinBean.component}" />
<h:commandLink action="#{skinBean.change}" value="set skin" />
16 years, 8 months
JBoss Rich Faces SVN: r2599 - trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 22:15:28 -0400 (Wed, 29 Aug 2007)
New Revision: 2599
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
http://jira.jboss.com/jira/browse/RF-766
Modified: trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-08-30 02:02:12 UTC (rev 2598)
+++ trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-08-30 02:15:28 UTC (rev 2599)
@@ -190,6 +190,11 @@
if(!needToHide) return;
+ if (this.queuedToolTip) {
+ clearTimeout(this.queuedToolTip);
+ this.queuedToolTip = undefined;
+ }
+
var fakeEvent = false;
fakeEvent = this.detectAncestorNode(e.toElement,this.toolTip);
fakeEvent = fakeEvent || this.detectAncestorNode(e.relatedTarget,this.toolTip);
@@ -358,7 +363,7 @@
}
}
if(this.delay > 0){
- setTimeout('Richfaces.tooltips[\'' + this.parentId + '\'].setToolTipVisible(true)', this.delay);
+ this.queuedToolTip = setTimeout('Richfaces.tooltips[\'' + this.parentId + '\'].setToolTipVisible(true)', this.delay);
} else {
this.setToolTipVisible(true);
}
@@ -371,6 +376,7 @@
},
setToolTipVisible: function(runOnComplete){
+ this.queuedToolTip = undefined;
this.toolTip.style.display = "block";
this.toolTip.style.visibility = "visible";
if(this.iframe){
16 years, 8 months
JBoss Rich Faces SVN: r2598 - trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-29 22:02:12 -0400 (Wed, 29 Aug 2007)
New Revision: 2598
Modified:
trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-767
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-08-30 00:35:48 UTC (rev 2597)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-08-30 02:02:12 UTC (rev 2598)
@@ -8,16 +8,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-/*
-import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.ajax4jsf.framework.renderer.AjaxComponentRendererBase;
-import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
-import org.ajax4jsf.framework.resource.InternetResource;
-import org.ajax4jsf.framework.skin.Skin;
-import org.ajax4jsf.framework.util.javascript.JSFunction;
-import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
-import org.ajax4jsf.framework.util.javascript.JSReference;
-*/
+
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
@@ -27,7 +18,6 @@
import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.resource.InternetResource;
-import org.ajax4jsf.xml.serializer.utils.Utils;
import org.richfaces.component.UIToolTip;
import org.richfaces.skin.Skin;
@@ -185,7 +175,7 @@
beforeUpdate.addParameter("event");
beforeUpdate.addParameter("data");
beforeUpdate.addToBody(fireBeforeUpdateDOM);
- eventOptions.put("oncomplete", beforeUpdate);
+ eventOptions.put("beforeupdate", beforeUpdate);
}
16 years, 8 months