JBoss Rich Faces SVN: r5475 - in trunk/ui: dataTable/src/main/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-01-18 14:29:23 -0500 (Fri, 18 Jan 2008)
New Revision: 5475
Modified:
trunk/ui/dataTable/src/main/config/component/column.xml
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java
Log:
RF-1741
Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml 2008-01-18 19:20:34 UTC (rev 5474)
+++ trunk/ui/dataTable/src/main/config/component/column.xml 2008-01-18 19:29:23 UTC (rev 5475)
@@ -81,7 +81,19 @@
<classname>java.lang.String</classname>
<description>Attribute defines a bean property which is used for sorting of a column</description>
</property>
+ <property>
+ <name>sortOrder</name>
+ <classname>org.richfaces.model.Ordering</classname>
+ <description>SortOrder is an enumeration of the possible sort orderings.</description>
+ <defaultvalue>Ordering.UNSORTED</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>filterExpression</name>
+ <classname>boolean</classname>
+ <description>Attribute defines a bean property which is used for filtering of a column</description>
+ </property>
+
<!--
<property>
<name>param</name>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-01-18 19:20:34 UTC (rev 5474)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-01-18 19:29:23 UTC (rev 5475)
@@ -22,27 +22,33 @@
package org.richfaces.component;
import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import org.ajax4jsf.component.AjaxSupport;
import org.ajax4jsf.component.SequenceDataAdaptor;
-import org.ajax4jsf.model.DataComponentState;
import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.FilterIterator;
import org.apache.commons.collections.iterators.IteratorChain;
-import org.richfaces.model.SortableModel;
-import org.richfaces.model.SortableRange;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.ModifiableModel;
+import org.richfaces.model.Ordering;
+import org.richfaces.model.SortField2;
/**
* JSF component class
*
*/
-public abstract class UIDataTable extends SequenceDataAdaptor implements Sortable2 {
+public abstract class UIDataTable extends SequenceDataAdaptor implements Sortable2, Filterable {
/**
* @author shura
@@ -158,16 +164,31 @@
@Override
protected ExtendedDataModel createDataModel() {
+ ExpressionFactory factory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
+ ELContext context = FacesContext.getCurrentInstance().getELContext();
+ List<FilterField> filterFields = new LinkedList<FilterField>();
+ List<SortField2> sortFields = new LinkedList<SortField2>();
+ List<UIComponent> list = getChildren();
+ for (Iterator<UIComponent> iterator = list.iterator(); iterator.hasNext();) {
+ UIComponent component = iterator.next();
+ if (component instanceof org.richfaces.component.UIColumn) {
+ Column column = (Column) component;
+ ValueExpression filterExpression = component.getValueExpression("filterExpression");
+ if (filterExpression != null) {
+ filterFields.add(new FilterField(filterExpression));
+ }
+ if (column.isSortable() && !Ordering.UNSORTED.equals(column.getSortOrder())) {
+ ValueExpression sortExpression = component.getValueExpression("sortExpression");
+ if (sortExpression != null) {
+ sortFields.add(new SortField2(factory.createValueExpression(context, sortExpression.getExpressionString(), Object.class), column.getSortOrder()));
+ }
+ }
+ }
+
+ }
+ setFilterFields(filterFields);
+ setSortFields(sortFields);
ExtendedDataModel dataModel = super.createDataModel();
- return new SortableModel(dataModel);
+ return new ModifiableModel(dataModel, getVar(), getFilterFields(), getSortFields());
}
-
- @Override
- protected DataComponentState createComponentState() {
- return new DataComponentState() {
- public Range getRange() {
- return new SortableRange(getFirst(), getRows(), getVar(), getSortOrder());
- }
- };
- }
}
\ No newline at end of file
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java 2008-01-18 19:20:34 UTC (rev 5474)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/html/MockColumns.java 2008-01-18 19:29:23 UTC (rev 5475)
@@ -26,6 +26,7 @@
import javax.faces.component.UIComponentBase;
import org.richfaces.component.Column;
+import org.richfaces.model.Ordering;
/**
* @author Maksim Kaszynski
@@ -38,6 +39,7 @@
}
private String sortExpression;
+ private Ordering sortOrder;
private boolean sortable;
private boolean breakbefore;
@@ -74,4 +76,12 @@
column.setId(id);
return column;
}
+
+ public Ordering getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(Ordering sortOrder) {
+ this.sortOrder = sortOrder;
+ }
}
16 years, 12 months
JBoss Rich Faces SVN: r5474 - in trunk/framework: api/src/main/java/org/richfaces/model and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-01-18 14:20:34 -0500 (Fri, 18 Jan 2008)
New Revision: 5474
Added:
trunk/framework/api/src/main/java/org/richfaces/component/Filterable.java
trunk/framework/api/src/main/java/org/richfaces/model/Field.java
trunk/framework/api/src/main/java/org/richfaces/model/FilterField.java
trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
Removed:
trunk/framework/api/src/main/java/org/richfaces/model/SortOrder2.java
trunk/framework/impl/src/main/java/org/richfaces/model/SortableModel.java
trunk/framework/impl/src/main/java/org/richfaces/model/SortableRange.java
trunk/framework/impl/src/main/java/org/richfaces/model/SortedModel.java
Modified:
trunk/framework/api/src/main/java/org/richfaces/component/Column.java
trunk/framework/api/src/main/java/org/richfaces/component/Sortable2.java
trunk/framework/api/src/main/java/org/richfaces/model/Ordering.java
trunk/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/SortField2.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/JavaBeanWrapper.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java
trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java
Log:
RF-1741
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Column.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Column.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Column.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -21,6 +21,8 @@
package org.richfaces.component;
+import org.richfaces.model.Ordering;
+
/**
* Marker interface for all components used as column in UIDataTable
* @author shura
@@ -59,4 +61,11 @@
public abstract void setSortExpression(String sortExpression);
public abstract String getSortExpression();
+ /**
+ * SortOrder is an enumeration of the possible sort orderings.
+ *
+ * @param sortOrder
+ */
+ public abstract void setSortOrder(Ordering sortOrder);
+ public abstract Ordering getSortOrder();
}
Added: trunk/framework/api/src/main/java/org/richfaces/component/Filterable.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Filterable.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Filterable.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -0,0 +1,20 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+import java.util.List;
+
+import org.richfaces.model.FilterField;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public interface Filterable {
+
+ public List<FilterField> getFilterFields();
+
+ public void setFilterFields(List<FilterField> filterFields);
+
+}
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Sortable2.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Sortable2.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Sortable2.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -3,16 +3,18 @@
*/
package org.richfaces.component;
-import org.richfaces.model.SortOrder2;
+import java.util.List;
+import org.richfaces.model.SortField2;
+
/**
* @author Maksim Kaszynski
*
*/
public interface Sortable2 {
- public SortOrder2 getSortOrder();
+ public List<SortField2> getSortFields();
- public void setSortOrder(SortOrder2 sortOrder);
+ public void setSortFields(List<SortField2> sortFields);
}
Added: trunk/framework/api/src/main/java/org/richfaces/model/Field.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/Field.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/Field.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -0,0 +1,57 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+import javax.el.ValueExpression;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public abstract class Field implements Serializable{
+
+ private static final long serialVersionUID = 7576046308828980778L;
+
+ private ValueExpression expression;
+
+ public Field(ValueExpression expression) {
+ this.expression = expression;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Field other = (Field) obj;
+ if (expression == null) {
+ if (other.expression != null)
+ return false;
+ } else if (!expression.getExpressionString().equals(other.expression.getExpressionString()))
+ return false;
+ return true;
+ }
+
+ public ValueExpression getExpression() {
+ return expression;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((expression == null) ? 0 : expression.hashCode());
+ return result;
+ }
+
+ public void setExpression(ValueExpression expression) {
+ this.expression = expression;
+ }
+}
Added: trunk/framework/api/src/main/java/org/richfaces/model/FilterField.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/FilterField.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/FilterField.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -0,0 +1,20 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import javax.el.ValueExpression;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class FilterField extends Field{
+
+ private static final long serialVersionUID = -5453359866996963829L;
+
+ public FilterField(ValueExpression expression) {
+ super(expression);
+ }
+
+}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/Ordering.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/Ordering.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/api/src/main/java/org/richfaces/model/Ordering.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -6,5 +6,6 @@
*/
public enum Ordering {
ASCENDING {},
- DESCENDING {}
+ DESCENDING {},
+ UNSORTED {}
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -76,7 +76,7 @@
* @see javax.faces.model.DataModel#getRowData()
*/
public Object getRowData() {
- return list != null ? list.get(key.intValue()) : null;
+ return (list != null && key != null) ? list.get(key.intValue()) : null;
}
/* (non-Javadoc)
@@ -97,7 +97,7 @@
* @see javax.faces.model.DataModel#isRowAvailable()
*/
public boolean isRowAvailable() {
- return list != null && list.size() > key.intValue();
+ return list != null && key != null && list.size() > key.intValue();
}
/* (non-Javadoc)
Modified: trunk/framework/api/src/main/java/org/richfaces/model/SortField2.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/SortField2.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/api/src/main/java/org/richfaces/model/SortField2.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -3,48 +3,45 @@
*/
package org.richfaces.model;
-import java.io.Serializable;
-
import javax.el.ValueExpression;
/**
* @author Maksim Kaszynski
*
*/
-public class SortField2 implements Serializable{
+public class SortField2 extends Field{
- private static final long serialVersionUID = 2122437301428777493L;
+ private static final long serialVersionUID = 4578290842517554179L;
private Ordering ordering;
- private ValueExpression expression;
-
public SortField2(ValueExpression expression) {
- super();
- this.expression = expression;
+ super(expression);
}
public SortField2(ValueExpression expression, Ordering ordering) {
- super();
- this.expression = expression;
+ super(expression);
this.ordering = ordering;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((ordering == null) ? 0 : ordering.hashCode());
+ return result;
+ }
-
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
- if (obj == null)
+ if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
SortField2 other = (SortField2) obj;
- if (expression == null) {
- if (other.expression != null)
- return false;
- } else if (!expression.getExpressionString().equals(other.expression.getExpressionString()))
- return false;
if (ordering == null) {
if (other.ordering != null)
return false;
@@ -52,27 +49,11 @@
return false;
return true;
}
- public ValueExpression getExpression() {
- return expression;
- }
+
public Ordering getOrdering() {
return ordering;
}
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((expression == null) ? 0 : expression.hashCode());
- result = prime * result
- + ((ordering == null) ? 0 : ordering.hashCode());
- return result;
- }
- public void setExpression(ValueExpression expression) {
- this.expression = expression;
- }
-
public void setOrdering(Ordering ordering) {
this.ordering = ordering;
}
Deleted: trunk/framework/api/src/main/java/org/richfaces/model/SortOrder2.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/SortOrder2.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/api/src/main/java/org/richfaces/model/SortOrder2.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -1,62 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.Serializable;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortOrder2 implements Serializable{
-
- private static final long serialVersionUID = -8464361988367479001L;
-
- private List<SortField2> fields = new LinkedList<SortField2>();
-
- public List<SortField2> getFields() {
- return fields;
- }
-
- public void setFields(List<SortField2> fields) {
- this.fields = fields;
- }
-
- public void addField(SortField2 field2) {
- fields.add(field2);
- }
-
- public boolean isEmpty() {
- return fields == null || fields.isEmpty();
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fields == null) ? 0 : fields.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- SortOrder2 other = (SortOrder2) obj;
- if (fields == null) {
- if (other.fields != null)
- return false;
- } else if (!fields.equals(other.fields))
- return false;
- return true;
- }
-
-
-}
Added: trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -0,0 +1,186 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModelListener;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceRange;
+import org.ajax4jsf.model.SerializableDataModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.model.impl.expressive.JavaBeanWrapper;
+import org.richfaces.model.impl.expressive.ObjectWrapperFactory;
+import org.richfaces.model.impl.expressive.WrappedBeanComparator2;
+import org.richfaces.model.impl.expressive.WrappedBeanFilter;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class ModifiableModel extends ExtendedDataModel{
+
+ private static final Log log = LogFactory.getLog(ModifiableModel.class);
+
+ private ExtendedDataModel delegate;
+
+ private ExtendedDataModel originalModel;
+
+ private ExtendedDataModel modifiedModel;
+
+ private String var;
+
+ private List<FilterField> filterFields;
+ private List<SortField2> sortFields;
+
+ public ModifiableModel(ExtendedDataModel originalModel, String var,
+ List<FilterField> filterFields, List<SortField2> sortFields) {
+ this.originalModel = originalModel;
+ delegate = originalModel;
+ this.var = var;
+ this.filterFields = filterFields;
+ this.sortFields = sortFields;
+ }
+
+ public void addDataModelListener(DataModelListener listener) {
+ originalModel.addDataModelListener(listener);
+ }
+
+ public DataModelListener[] getDataModelListeners() {
+ return originalModel.getDataModelListeners();
+ }
+
+ public int getRowCount() {
+ return delegate.getRowCount();
+ }
+
+ public Object getRowData() {
+ return delegate.getRowData();
+ }
+
+ public int getRowIndex() {
+ return delegate.getRowIndex();
+ }
+
+ public Object getRowKey() {
+ return delegate.getRowKey();
+ }
+
+ public SerializableDataModel getSerializableModel(Range range) {
+ return delegate.getSerializableModel(range);
+ }
+
+ public Object getWrappedData() {
+ return delegate.getWrappedData();
+ }
+
+ public boolean isRowAvailable() {
+ return delegate.isRowAvailable();
+ }
+
+ public void removeDataModelListener(DataModelListener listener) {
+ delegate.removeDataModelListener(listener);
+ }
+
+ public void setRowIndex(int rowIndex) {
+ delegate.setRowIndex(rowIndex);
+ }
+
+ public void setRowKey(Object key) {
+ delegate.setRowKey(key);
+ }
+
+ public void setWrappedData(Object data) {
+ delegate.setWrappedData(data);
+ }
+
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ if (shouldSort() || shouldFilter()) {
+ if (modifiedModel == null) {
+ modifiedModel = new SequenceDataModel();
+ modifiedModel.setWrappedData(prepareCollection());
+ }
+ delegate = modifiedModel;
+ } else {
+ delegate = originalModel;
+ }
+
+ delegate.walk(context, visitor, range, argument);
+ }
+
+ private boolean shouldSort() {
+ return sortFields != null && !sortFields.isEmpty();
+ }
+
+ private boolean shouldFilter() {
+ return filterFields != null && !filterFields.isEmpty();
+ }
+
+ private List<?> prepareCollection() {
+ int rowCount = originalModel.getRowCount();
+ final List<Object> collection;
+
+ if (rowCount > 0) {
+ collection = new ArrayList<Object>(rowCount);
+ } else {
+ collection = new ArrayList<Object>();
+ }
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ try {
+
+ originalModel.walk(context, new DataVisitor() {
+ public void process(FacesContext context, Object rowKey,
+ Object argument) throws IOException {
+ originalModel.setRowKey(rowKey);
+ if (originalModel.isRowAvailable()) {
+ collection.add(originalModel.getRowData());
+ }
+ }
+ }, new SequenceRange(0, -1),
+ null);
+ } catch (IOException e) {
+ log.error(e.getMessage(), e);
+ }
+
+ List<Object> modifedcollection = collection;
+
+ if (shouldFilter()) {
+ List <Object> filteredCollection = new ArrayList<Object>();
+ ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(
+ context, var, filterFields);
+ WrappedBeanFilter wrappedBeanFilter = new WrappedBeanFilter(filterFields);
+ wrapperFactory.wrapList(modifedcollection);
+ for (Object object : modifedcollection) {
+ if(wrappedBeanFilter.accept((JavaBeanWrapper)object)) {
+ filteredCollection.add(object);
+ }
+ }
+ modifedcollection = filteredCollection;
+ wrapperFactory.unwrapList(modifedcollection);
+ }
+
+ if (shouldSort()) {
+ ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(
+ context, var, sortFields);
+ WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(
+ sortFields);
+ wrapperFactory.wrapList(modifedcollection);
+ Collections.sort(modifedcollection, wrappedBeanComparator);
+ wrapperFactory.unwrapList(modifedcollection);
+ }
+ return modifedcollection;
+
+ }
+}
Deleted: trunk/framework/impl/src/main/java/org/richfaces/model/SortableModel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/SortableModel.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/SortableModel.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -1,111 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.DataModelListener;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.ajax4jsf.model.SerializableDataModel;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortableModel extends ExtendedDataModel{
-
- private ExtendedDataModel delegate;
-
- private ExtendedDataModel originalModel;
-
- private ExtendedDataModel modifiedModel;
-
- public SortableModel(ExtendedDataModel originalModel) {
- this.originalModel = originalModel;
- delegate = originalModel;
- }
-
- public void addDataModelListener(DataModelListener listener) {
- originalModel.addDataModelListener(listener);
- }
-
- public DataModelListener[] getDataModelListeners() {
- return originalModel.getDataModelListeners();
- }
-
- public int getRowCount() {
- return delegate.getRowCount();
- }
-
- public Object getRowData() {
- return delegate.getRowData();
- }
-
- public int getRowIndex() {
- return delegate.getRowIndex();
- }
-
- public Object getRowKey() {
- return delegate.getRowKey();
- }
-
- public SerializableDataModel getSerializableModel(Range range) {
- return delegate.getSerializableModel(range);
- }
-
- public Object getWrappedData() {
- return delegate.getWrappedData();
- }
-
- public boolean isRowAvailable() {
- return delegate.isRowAvailable();
- }
-
- public void removeDataModelListener(DataModelListener listener) {
- delegate.removeDataModelListener(listener);
- }
-
- public void setRowIndex(int rowIndex) {
- delegate.setRowIndex(rowIndex);
- }
-
- public void setRowKey(Object key) {
- delegate.setRowKey(key);
- }
-
- public void setWrappedData(Object data) {
- delegate.setWrappedData(data);
- }
-
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
-
- if (shouldSort(range)) {
- if (modifiedModel == null) {
- modifiedModel = new SortedModel(originalModel,(SortableRange) range);
- }
- delegate = modifiedModel;
- } else {
- delegate = originalModel;
- }
-
- delegate.walk(context, visitor, range, argument);
- }
-
- private boolean shouldSort(Range range) {
- boolean result = false;
- if (range instanceof SortableRange) {
- SortableRange sortableRange = (SortableRange) range;
- SortOrder2 sortOrder = sortableRange.getSortOrder();
- if (sortOrder != null) {
- result = !sortOrder.isEmpty();
- }
- }
- return result;
- }
-}
Deleted: trunk/framework/impl/src/main/java/org/richfaces/model/SortableRange.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/SortableRange.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/SortableRange.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -1,31 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import org.ajax4jsf.model.SequenceRange;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortableRange extends SequenceRange {
-
- private SortOrder2 sortOrder;
- private String var;
-
- public SortableRange(int firstRow, int rows, String var, SortOrder2 sortOrder) {
- super(firstRow, rows);
- this.sortOrder = sortOrder;
- this.var = var;
- }
-
- public SortOrder2 getSortOrder() {
- return sortOrder;
- }
-
- public String getVar() {
- return var;
- }
-
-}
Deleted: trunk/framework/impl/src/main/java/org/richfaces/model/SortedModel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/SortedModel.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/SortedModel.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -1,73 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.SequenceRange;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.richfaces.model.impl.expressive.ObjectWrapperFactory;
-import org.richfaces.model.impl.expressive.WrappedBeanComparator2;
-
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortedModel extends SequenceDataModel{
-
- private static final Log log = LogFactory.getLog(SortedModel.class);
-
- public SortedModel(ExtendedDataModel source, SortableRange range) {
- setWrappedData(prepareCollection(source, range));
- }
-
- private List<?> prepareCollection(final ExtendedDataModel source, final SortableRange range) {
- int rowCount = source.getRowCount();
- final List<Object> collection;
-
- if (rowCount > 0) {
- collection = new ArrayList<Object>(rowCount);
- } else {
- collection = new ArrayList<Object>();
- }
-
- FacesContext context = FacesContext.getCurrentInstance();
- try {
-
- source.walk(context, new DataVisitor() {
- public void process(FacesContext context, Object rowKey,
- Object argument) throws IOException {
- source.setRowKey(rowKey);
- if (source.isRowAvailable()) {
- collection.add(source.getRowData());
- }
- }
- }, new SequenceRange(0, -1),
- null);
- } catch (IOException e) {
- log.error(e.getMessage(), e);
- }
-
- SortOrder2 sortOrder = range.getSortOrder();
- ObjectWrapperFactory wrapperFactory = new ObjectWrapperFactory(context, range.getVar(), sortOrder);
- WrappedBeanComparator2 wrappedBeanComparator = new WrappedBeanComparator2(sortOrder);
-
- wrapperFactory.wrapList(collection);
- Collections.sort(collection, wrappedBeanComparator);
- wrapperFactory.unwrapList(collection);
-
- return collection;
-
- }
-}
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/JavaBeanWrapper.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/JavaBeanWrapper.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/JavaBeanWrapper.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -27,7 +27,7 @@
* @author Maksim Kaszynski
*
*/
-class JavaBeanWrapper {
+public class JavaBeanWrapper {
private Object wrappedObject;
private Map<String, Object> properties;
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/ObjectWrapperFactory.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -34,10 +34,9 @@
import javax.faces.context.FacesContext;
import org.ajax4jsf.util.ELUtils;
+import org.richfaces.model.Field;
import org.richfaces.model.SortField;
-import org.richfaces.model.SortField2;
import org.richfaces.model.SortOrder;
-import org.richfaces.model.SortOrder2;
/**
*
* class responsible for packaging objects with their properties evaluated using EL.
@@ -90,7 +89,7 @@
}
- public ObjectWrapperFactory(FacesContext context, final String var, SortOrder2 sortOrder) {
+ public ObjectWrapperFactory(FacesContext context, final String var, List<? extends Field> sortOrder) {
this.context = context;
@@ -99,12 +98,10 @@
ELContext elContext = context.getELContext();
this.var = var;
- List<SortField2> fields = sortOrder.getFields();
+ expressions = new Expression[sortOrder.size()];
- expressions = new Expression[fields.size()];
-
int i = 0;
- for (SortField2 field : fields) {
+ for (Field field : sortOrder) {
ValueExpression valueExpression = field.getExpression();
Expression expression;
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanComparator2.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -6,10 +6,9 @@
import javax.el.ValueExpression;
+import org.richfaces.model.Field;
import org.richfaces.model.Ordering;
-import org.richfaces.model.SortField;
import org.richfaces.model.SortField2;
-import org.richfaces.model.SortOrder2;
/**
* Comparator for {@link JavaBeanWrapper} objects.
@@ -20,11 +19,11 @@
*/
public final class WrappedBeanComparator2 implements Comparator<Object> {
- private final SortOrder2 sortOrder;
+ private final List<SortField2> sortFields;
- public WrappedBeanComparator2(SortOrder2 sortOrder) {
+ public WrappedBeanComparator2(List<SortField2> sortFields) {
super();
- this.sortOrder = sortOrder;
+ this.sortFields = sortFields;
}
public int compare(Object o1, Object o2) {
@@ -36,13 +35,11 @@
int result = 0;
- List<SortField2> fields = sortOrder.getFields();
-
- for (Iterator<SortField2> iterator = fields.iterator(); iterator.hasNext() && result == 0;) {
- SortField2 sortField2 = iterator.next();
- ValueExpression expression = sortField2.getExpression();
+ for (Iterator<SortField2> iterator = sortFields.iterator(); iterator.hasNext() && result == 0;) {
+ SortField2 field = iterator.next();
+ ValueExpression expression = field.getExpression();
String prop = expression.getExpressionString();
- Ordering ordering = sortField2.getOrdering();
+ Ordering ordering = field.getOrdering();
if (ordering != null) {
Object p1 = w1.getProperty(prop);
Object p2 = w2.getProperty(prop);
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java 2008-01-18 18:42:23 UTC (rev 5473)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/impl/expressive/WrappedBeanFilter.java 2008-01-18 19:20:34 UTC (rev 5474)
@@ -3,14 +3,30 @@
*/
package org.richfaces.model.impl.expressive;
+import java.util.List;
+
+import org.richfaces.model.FilterField;
+
/**
* @author Maksim Kaszynski
*
*/
public class WrappedBeanFilter implements org.richfaces.model.filter.Filter<JavaBeanWrapper>{
- public boolean accept(JavaBeanWrapper t) {
- // TODO Auto-generated method stub
- return false;
+ private final List<FilterField> filterFields;
+
+ public WrappedBeanFilter(List<FilterField> filterFields) {
+ this.filterFields = filterFields;
}
+
+ public boolean accept(JavaBeanWrapper wrapper) {
+ for (FilterField filterField : filterFields) {
+ Object property = wrapper.getProperty(filterField.getExpression().getExpressionString());
+ if(!((Boolean)property).booleanValue()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
}
16 years, 12 months
JBoss Rich Faces SVN: r5473 - in trunk/ui: inputnumber-slider/src/main/config/component and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-18 13:42:23 -0500 (Fri, 18 Jan 2008)
New Revision: 5473
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml
trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
trunk/ui/panelbar/src/main/config/component/panelbar.xml
trunk/ui/panelmenu/src/main/config/component/panelMenu.xml
trunk/ui/tabPanel/src/main/config/component/tabPanel.xml
trunk/ui/togglePanel/src/main/config/component/togglePanel.xml
Log:
http://jira.jboss.com/jira/browse/RF-1942
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -536,6 +536,11 @@
<property>
<name>inputSize</name>
<classname>int</classname>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
</component>
Modified: trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
===================================================================
--- trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -258,6 +258,11 @@
<property hidden="true">
<name>valid</name>
<classname>boolean</classname>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
</component>
</components>
Modified: trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/inputnumber-spinner/src/main/config/component/inputNumberSpinner.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -212,6 +212,11 @@
<property hidden="true">
<name>valid</name>
<classname>boolean</classname>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
</component>
</components>
Modified: trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
--- trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -249,6 +249,11 @@
<name>onmaskmouseout</name>
<classname>java.lang.String</classname>
<defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
</component>
</components>
Modified: trunk/ui/panelbar/src/main/config/component/panelbar.xml
===================================================================
--- trunk/ui/panelbar/src/main/config/component/panelbar.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/panelbar/src/main/config/component/panelbar.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -164,6 +164,12 @@
<property hidden="true">
<name>valid</name>
+ </property>
+
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
</component>
Modified: trunk/ui/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/ui/panelmenu/src/main/config/component/panelMenu.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/panelmenu/src/main/config/component/panelMenu.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -355,6 +355,11 @@
<property hidden="true">
<name>valid</name>
<description>valid</description>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
</component>
@@ -540,6 +545,11 @@
<name>valid</name>
<description>valid</description>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
</component>
Modified: trunk/ui/tabPanel/src/main/config/component/tabPanel.xml
===================================================================
--- trunk/ui/tabPanel/src/main/config/component/tabPanel.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/tabPanel/src/main/config/component/tabPanel.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -143,7 +143,12 @@
HTML: a script expression; a tab has been changed
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
- </property>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
&html_attributes;
&html_events;
Modified: trunk/ui/togglePanel/src/main/config/component/togglePanel.xml
===================================================================
--- trunk/ui/togglePanel/src/main/config/component/togglePanel.xml 2008-01-18 18:25:53 UTC (rev 5472)
+++ trunk/ui/togglePanel/src/main/config/component/togglePanel.xml 2008-01-18 18:42:23 UTC (rev 5473)
@@ -98,6 +98,11 @@
<property hidden="true">
<name>valid</name>
<classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
</property>
16 years, 12 months
JBoss Rich Faces SVN: r5472 - in branches/3.1.x/ui/scrollableDataTable/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-01-18 13:25:53 -0500 (Fri, 18 Jan 2008)
New Revision: 5472
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/Substrate.js
branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
Log:
RF-1641
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/Substrate.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/Substrate.js 2008-01-18 15:10:11 UTC (rev 5471)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/Substrate.js 2008-01-18 18:25:53 UTC (rev 5472)
@@ -15,7 +15,7 @@
initialize: function($super, element, parentElement, dontUpdateStyles) {
if(!element) {
var fakeElement = $(document.createElement("div"));
- fakeElement.innerHTML = '<iframe id="'+'ClientUI_Substrate' + (ClientUI_common_box_Substrate_idGenerator++) +'" src="" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:block"></iframe>';
+ fakeElement.innerHTML = '<iframe id="'+'ClientUI_Substrate' + (ClientUI_common_box_Substrate_idGenerator++) +'" src="javascript:\'\'" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:block"></iframe>';
element = $(fakeElement.getElementsByTagName("iframe")[0]);
fakeElement.removeChild(element);
}
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2008-01-18 15:10:11 UTC (rev 5471)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2008-01-18 18:25:53 UTC (rev 5472)
@@ -69,7 +69,7 @@
<div id="#{clientId}" style="width: #{component.attributes['width']};height: #{component.attributes['height']};" class="dr-sdt rich-sdt #{component.attributes['styleClass']}" >
<div id="#{clientId}:cs" class="dr-sdt-hsplit" style="display:none;"/>
<div id="#{clientId}_GridHeaderTemplate" class="dr-sdt-inlinebox" style="#{hStyle}; width: #{component.attributes['width']};">
- <iframe id="#{clientId}:hs" class="dr-sdt-substrate" src="" scrolling="no" frameborder="0" > <br/> </iframe>
+ <iframe id="#{clientId}:hs" class="dr-sdt-substrate" src="javascript:\'\'" scrolling="no" frameborder="0" > <br/> </iframe>
<div style="display: block; left: 0px; top: 0px; width: #{sumWidth}px;">
<span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:header:FrozenBox">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
@@ -164,7 +164,7 @@
</div>
<div id="#{clientId}_GridFooterTemplate" class="dr-sdt-inlinebox" style="#{fStyle}; width: #{component.attributes['width']};">
- <iframe id="#{clientId}:fs" class="dr-sdt-substrate" src="" scrolling="no" frameborder="0" > <br/></iframe>
+ <iframe id="#{clientId}:fs" class="dr-sdt-substrate" src="javascript:\'\'" scrolling="no" frameborder="0" > <br/></iframe>
<div style="display: block; width: width: #{sumWidth}px;">
<span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:footer:FrozenBox">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
16 years, 12 months
JBoss Rich Faces SVN: r5471 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-01-18 10:10:11 -0500 (Fri, 18 Jan 2008)
New Revision: 5471
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
RF-1674
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-18 15:08:40 UTC (rev 5470)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-18 15:10:11 UTC (rev 5471)
@@ -1381,7 +1381,7 @@
var xmlString = "<html xmlns='http://www.w3.org/1999/xhtml'><sc"+"ript>A4J.AJAX._scriptEvaluated=true;</scr"+"ipt></html>";
oDomDoc = (new DOMParser()).parseFromString(xmlString, "text/xml");
var _script=oDomDoc.getElementsByTagName("script")[0];
- if(_span.outerHTML){
+ if(!window.opera && _span.outerHTML){
_span.outerHTML = new XMLSerializer().serializeToString(_script);
} else {
var importednode ;
16 years, 12 months
JBoss Rich Faces SVN: r5470 - management/design/progressBar/markup.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-01-18 10:08:40 -0500 (Fri, 18 Jan 2008)
New Revision: 5470
Modified:
management/design/progressBar/markup/ProgressBar.html
Log:
Modified: management/design/progressBar/markup/ProgressBar.html
===================================================================
--- management/design/progressBar/markup/ProgressBar.html 2008-01-18 15:08:08 UTC (rev 5469)
+++ management/design/progressBar/markup/ProgressBar.html 2008-01-18 15:08:40 UTC (rev 5470)
@@ -1,3 +1,5 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html>
<head>
<title>1</title>
16 years, 12 months
JBoss Rich Faces SVN: r5469 - management/design/fileUpload/markup.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-01-18 10:08:08 -0500 (Fri, 18 Jan 2008)
New Revision: 5469
Modified:
management/design/fileUpload/markup/file_upload.html
Log:
Modified: management/design/fileUpload/markup/file_upload.html
===================================================================
--- management/design/fileUpload/markup/file_upload.html 2008-01-18 14:58:31 UTC (rev 5468)
+++ management/design/fileUpload/markup/file_upload.html 2008-01-18 15:08:08 UTC (rev 5469)
@@ -1,3 +1,5 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
<html>
<head>
<title>1</title>
@@ -14,18 +16,18 @@
.upload_list_width{ width:400px;}
.upload_list_decor{ border:1px solid #c0c0c0 /*tableBorderColor*/; background : #FFFFFF /*tableBackgroundColor*/;}
.upload_list_overflow{height : 210px; overflow : auto; overflow-x : hidden;}
-.upload_name{ width : 100%; height : 50px; padding : 2px 10px 2px 10px;}
-.upload_del{ width : 90; text-align : center; padding-top : 3; padding-bottom : 3;}
-.upload_scroll{ width : 10; text-align : center;}
+.upload_name{ width : 100%; height : 50px; padding : 2px 10px 2px 10px;}
+.upload_del{ width : 90px; text-align : center; padding-top : 3; padding-bottom : 3;}
+.upload_scroll{ width : 10px; text-align : center;}
.upload_anc{ color : ##0078D0/*generalLinkColor*/;}
.upload_toolbar_decor{ background : #EAF0F8 /*additionalBackgroundColor*/;border-bottom:1px solid #c0c0c0 /*tableBorderColor*/;border-top:1px solid #FFFFFF /*tableBackgroundColor*/;border-left:1px solid #FFFFFF /*tableBackgroundColor*/;padding : 2px}
-.upload_bar_exterior{ border : 1px solid #c0c0c0 /*panelBorderColor*/;}
-.upload_bar_uploaded{width : 70%; height : 100%; background : #FF9409 /**/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x; font-size : 0px;}
-.upload_bar_deleted{width : 40%; height : 100%; background : #FF9409 /**/; background-image : url(images/bg_RegressBar_perm.gif);background-repeat : repeat-x; font-size : 0px;}
-.upload_bar_shell{width : 100%; height : 8; background : #F1F1F1/*tableSubfooterBackgroundColor*/;}
+.upload_bar_exterior{height : 7px; border : 1px solid #c0c0c0 /*panelBorderColor*/;}
+.upload_bar_uploaded{height : 7px; width : 70%; height : 100%; background : #FF9409 /**/; background-image : url(images/bg_ProgressBar_perm.gif);background-repeat : repeat-x; font-size : 0px;}
+.upload_bar_deleted{height : 7px; width : 40%; height : 100%; background : #FF9409 /**/; background-image : url(images/bg_RegressBar_perm.gif);background-repeat : repeat-x; font-size : 0px;}
+.upload_bar_shell{height : 7px; width : 100%; height : 8; background : #F1F1F1/*tableSubfooterBackgroundColor*/;}
.upload_button_border{
16 years, 12 months
JBoss Rich Faces SVN: r5468 - branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-01-18 09:58:31 -0500 (Fri, 18 Jan 2008)
New Revision: 5468
Modified:
branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
RF-1674
Modified: branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-18 14:33:29 UTC (rev 5467)
+++ branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-18 14:58:31 UTC (rev 5468)
@@ -1381,7 +1381,7 @@
var xmlString = "<html xmlns='http://www.w3.org/1999/xhtml'><sc"+"ript>A4J.AJAX._scriptEvaluated=true;</scr"+"ipt></html>";
oDomDoc = (new DOMParser()).parseFromString(xmlString, "text/xml");
var _script=oDomDoc.getElementsByTagName("script")[0];
- if(_span.outerHTML){
+ if(!window.opera && _span.outerHTML){
_span.outerHTML = new XMLSerializer().serializeToString(_script);
} else {
var importednode ;
16 years, 12 months
JBoss Rich Faces SVN: r5467 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2008-01-18 09:33:29 -0500 (Fri, 18 Jan 2008)
New Revision: 5467
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/treeNode.xml
Log:
http://jira.jboss.com/jira/browse/RF-1137 - review description, fixed some errors.
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.desc.xml 2008-01-18 14:32:49 UTC (rev 5466)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.desc.xml 2008-01-18 14:33:29 UTC (rev 5467)
@@ -17,9 +17,9 @@
</imageobject>
</mediaobject>
</figure>
- <para>On the screenshot above, there is an example of the <property>tree</property> with an expanded node. This node
+ <!--para>On the screenshot above, there is an example of the <property>tree</property> with an expanded node. This node
contains its own node with several leaves. Besides, it's possible to choose your own
- icons for tree nodes.</para>
+ icons for tree nodes.</para-->
</section>
<section>
<title>Key Features</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/treeNode.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/treeNode.xml 2008-01-18 14:32:49 UTC (rev 5466)
+++ trunk/docs/userguide/en/src/main/docbook/included/treeNode.xml 2008-01-18 14:33:29 UTC (rev 5467)
@@ -70,45 +70,9 @@
...
]]></programlisting>
</section>
+
<section>
<title>Details of Usage</title>
- <para> The <emphasis>
- <property>"icon"</property>
- </emphasis>, <emphasis>
- <property>"iconCollapsed"</property>
- </emphasis>, <emphasis>
- <property>"iconExpanded"</property>
- </emphasis>, <emphasis>
- <property>"iconLeaf"</property>
- </emphasis> attributes define icons for the component. Also you can define icons using facets
- with the same names. If the facets are defined, the corresponding attributes are ignored and
- facets contents are used as icons. The width of a rendered facet area is 16px. </para>
-
- <programlisting role="JAVA"><![CDATA[...
- <rich:tree ...>
- ...
- <rich:treeNode ...>
- <f:facet name="icon">
- <hutputText value="A"/>
- </f:facet>
- <f:facet name="iconCollapsed">
- <hutputText value="B"/>
- </f:facet>
- <f:facet name="iconExpanded">
- <hutputText value="C"/>
- </f:facet>
- <f:facet name="iconLeaf">
- <hutputText value="D"/>
- </f:facet>
- </rich:treeNode>
- ...
- </rich:tree>
-...
-]]></programlisting>
-
- </section>
- <section>
- <title>Details of Usage</title>
<para>As it has been mentioned <link linkend="treeNode">above</link>, <property>treeNode</property> defines a template for nodes
rendering in a tree. Thus, during XML document rendering (a web.xml application) as a tree,
the following nodes output (passed via var="data" on a tree) happens:</para>
@@ -146,6 +110,39 @@
mouse, it's managed with the <emphasis>
<property>"ajaxSubmitSelection"</property>
</emphasis> attribute (true/false).</para>
+ <para> The <emphasis>
+ <property>"icon"</property>
+ </emphasis>, <emphasis>
+ <property>"iconCollapsed"</property>
+ </emphasis>, <emphasis>
+ <property>"iconExpanded"</property>
+ </emphasis>, <emphasis>
+ <property>"iconLeaf"</property>
+ </emphasis> attributes define icons for the component. Also you can define icons using facets
+ with the same names. If the facets are defined, the corresponding attributes are ignored and
+ facets contents are used as icons. By default the width of a rendered facet area is 16px. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ <rich:tree ....>
+ ...
+ <f:facet name="icon">
+ <h:graphicImage value="/images/tree/singer.png "/>
+ </f:facet>
+ <f:facet name="iconCollapsed">
+ <h:graphicImage value="/images/tree/singer.png " />
+ </f:facet>
+ <f:facet name="iconExpanded">
+ <h:graphicImage value="/images/tree/singer.png " />
+ </f:facet>
+ <f:facet name="iconLeaf">
+ <h:graphicImage value="/images/tree/song.png " />
+ </f:facet>
+ ...
+ </rich:tree>
+...]]></programlisting>
</section>
<section>
<title>Built-in Drag and Drop</title>
16 years, 12 months
JBoss Rich Faces SVN: r5466 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2008-01-18 09:32:49 -0500 (Fri, 18 Jan 2008)
New Revision: 5466
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-389 - added question.
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-01-18 13:53:55 UTC (rev 5465)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-01-18 14:32:49 UTC (rev 5466)
@@ -766,8 +766,16 @@
>RichFaces User Forum</ulink>.</para>
</section>
+ <section id="Howtoapplybuttonlable">
+ <?dbhtml filename="Howtoapplybuttonlable .html"?>
+ <title>How to apply button lable for <rich: calendar>?</title>
+ <para> Necessary information could be found on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120993#..."
+ >RichFaces User Forum</ulink>.</para>
+ </section>
+
<section id="DecidingWhatToChangeOnTheServerSide">
<?dbhtml filename="DecidingWhatToChangeOnTheServerSide.html"?>
<title>What should I change on the server side?</title>
16 years, 12 months