JBoss Rich Faces SVN: r8607 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-05-15 14:19:55 -0400 (Thu, 15 May 2008)
New Revision: 8607
Added:
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3.png
trunk/docs/userguide/en/src/main/resources/images/pickList2.png
trunk/docs/userguide/en/src/main/resources/images/pickList3.png
trunk/docs/userguide/en/src/main/resources/images/pickList_cn.png
trunk/docs/userguide/en/src/main/resources/images/pickList_cn2.png
trunk/docs/userguide/en/src/main/resources/images/pickList_init.png
trunk/docs/userguide/en/src/main/resources/images/pickList_oc.png
trunk/docs/userguide/en/src/main/resources/images/pickList_pc.png
trunk/docs/userguide/en/src/main/resources/images/progressBar2.png
trunk/docs/userguide/en/src/main/resources/images/progressBar3.png
trunk/docs/userguide/en/src/main/resources/images/progressBar4.png
trunk/docs/userguide/en/src/main/resources/images/progressBar_cn.png
trunk/docs/userguide/en/src/main/resources/images/progressBar_init.png
trunk/docs/userguide/en/src/main/resources/images/progressBar_pc.png
trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable2.png
trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable_cn.png
trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable_init.png
trunk/docs/userguide/en/src/main/resources/images/separator_oc.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_cn.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_init.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_oc.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_pc.png
trunk/docs/userguide/en/src/main/resources/images/spacer_init.png
trunk/docs/userguide/en/src/main/resources/images/suggestionbox4.png
trunk/docs/userguide/en/src/main/resources/images/suggestionbox_cn.png
trunk/docs/userguide/en/src/main/resources/images/suggestionbox_init.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel2.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel_cn.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel_init.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel_oc.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel_pc.png
Removed:
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3l.png
trunk/docs/userguide/en/src/main/resources/images/pickList1.png
trunk/docs/userguide/en/src/main/resources/images/pickList2.png
trunk/docs/userguide/en/src/main/resources/images/pickListClass.png
trunk/docs/userguide/en/src/main/resources/images/pickListClasses1.png
trunk/docs/userguide/en/src/main/resources/images/pickListClasses2.png
trunk/docs/userguide/en/src/main/resources/images/pickListStyle.png
trunk/docs/userguide/en/src/main/resources/images/picklist_no_lbls.png
trunk/docs/userguide/en/src/main/resources/images/progressBar_classes.png
trunk/docs/userguide/en/src/main/resources/images/progressbar.png
trunk/docs/userguide/en/src/main/resources/images/progressbarNoLabel.png
trunk/docs/userguide/en/src/main/resources/images/progressbarParams.png
trunk/docs/userguide/en/src/main/resources/images/progressbarRedefinedClasses.png
trunk/docs/userguide/en/src/main/resources/images/progressbar_macrosubs.png
trunk/docs/userguide/en/src/main/resources/images/scrollable-dt1.png
trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable.png
trunk/docs/userguide/en/src/main/resources/images/sdt.png
trunk/docs/userguide/en/src/main/resources/images/separatorStyle.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel3.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanelClass.png
trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanelStyle.png
trunk/docs/userguide/en/src/main/resources/images/spacer.png
trunk/docs/userguide/en/src/main/resources/images/suggestionbox1.png
trunk/docs/userguide/en/src/main/resources/images/suggestionbox4.png
trunk/docs/userguide/en/src/main/resources/images/suggestionbox5.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel1.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel4.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel_CS1.png
trunk/docs/userguide/en/src/main/resources/images/tabPanel_CS2.png
Log:
RF-2905--Screenshots names
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3.png (from rev 8599, trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3l.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3l.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/pickList1.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/pickList2.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/picklist_no_lbls.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList3.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/pickList2.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/pickListClass.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/pickListClasses1.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/pickListClasses2.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/pickListStyle.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/pickListClasses1.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList_cn2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/pickListClasses2.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/pickList1.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList_oc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/pickListStyle.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/pickList_pc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/pickListClass.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/picklist_no_lbls.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/progressBar2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/progressbarNoLabel.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/progressBar3.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/progressbar_macrosubs.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/progressBar4.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/progressbarParams.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/progressBar_classes.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/progressBar_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/progressBar_classes.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/progressBar_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/progressbar.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/progressBar_pc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/progressbarRedefinedClasses.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/progressbar.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/progressbarNoLabel.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/progressbarParams.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/progressbarRedefinedClasses.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/progressbar_macrosubs.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/scrollable-dt1.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/sdt.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/scrollableDataTable_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/scrollable-dt1.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/sdt.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/separatorStyle.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/separator_oc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/separatorStyle.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel3.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanelClass.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanelStyle.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel3.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_oc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanelStyle.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanel_pc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/simpleTogglePanelClass.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/spacer.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/spacer_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/spacer.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/suggestionbox1.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/suggestionbox4.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/suggestionbox4.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/suggestionbox5.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/suggestionbox5.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/suggestionbox_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/suggestionbox4.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/suggestionbox_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/suggestionbox1.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/tabPanel.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/tabPanel1.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/tabPanel2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/tabPanel1.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/tabPanel4.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/tabPanel_CS1.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/tabPanel_CS2.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/tabPanel_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/tabPanel4.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/tabPanel_init.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/tabPanel.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/tabPanel_oc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/tabPanel_CS2.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/tabPanel_pc.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/tabPanel_CS1.png)
===================================================================
(Binary files differ)
16 years, 8 months
JBoss Rich Faces SVN: r8606 - trunk/ui/datascroller/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-15 14:06:24 -0400 (Thu, 15 May 2008)
New Revision: 8606
Modified:
trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java
Log:
http://jira.jboss.com/jira/browse/RF-3349
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java 2008-05-15 18:06:20 UTC (rev 8605)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java 2008-05-15 18:06:24 UTC (rev 8606)
@@ -21,7 +21,6 @@
package org.richfaces.component;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -39,6 +38,7 @@
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import org.ajax4jsf.Messages;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.richfaces.component.util.MessageUtil;
@@ -57,8 +57,6 @@
*/
private static final long serialVersionUID = -3614288642745891577L;
- private static final String DIFFERENT_PAGE_EXPRS = "Datascroller components attached to component: {0} have different values of 'page' attribute : {1}!";
-
private static final Log log = LogFactory.getLog(DataScrollerViewPhaseListener.class);
private static final class ComponentConnections {
@@ -184,8 +182,11 @@
builder.append(scrollerItr.hasNext() ? ",\n" : "]");
}
- Object dataLabel = MessageUtil.getLabel(facesContext, data);
- log.error(MessageFormat.format(DIFFERENT_PAGE_EXPRS, dataLabel, builder));
+ String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGES_DIFFERENT,
+ new Object[] {MessageUtil.getLabel(facesContext, data), builder});
+
+
+ log.error(formattedMessage);
}
}
16 years, 8 months
JBoss Rich Faces SVN: r8605 - trunk/framework/api/src/main/java/org/ajax4jsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-15 14:06:20 -0400 (Thu, 15 May 2008)
New Revision: 8605
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
Log:
http://jira.jboss.com/jira/browse/RF-3349
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-05-15 18:06:14 UTC (rev 8604)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-05-15 18:06:20 UTC (rev 8605)
@@ -323,6 +323,7 @@
public static final String NOT_PARENT_AJAX_COMPONENT_ERROR = "NOT_PARENT_AJAX_COMPONENT_ERROR";
public static final String INVALID_VALUE = "INVALID_VALUE";
public static final String DATASCROLLER_PAGE_MISSING = "DATASCROLLER_PAGE_MISSING";
+ public static final String DATASCROLLER_PAGES_DIFFERENT = "DATASCROLLER_PAGES_DIFFERENT";
public static void main(String[] args) {
String m = getMessage(INVALID_ATTRIBUTE_VALUE, "A", "B");
16 years, 8 months
JBoss Rich Faces SVN: r8604 - trunk/framework/impl/src/main/resources/org/ajax4jsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-15 14:06:14 -0400 (Thu, 15 May 2008)
New Revision: 8604
Modified:
trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
Log:
http://jira.jboss.com/jira/browse/RF-3349
Modified: trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2008-05-15 17:40:50 UTC (rev 8603)
+++ trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2008-05-15 18:06:14 UTC (rev 8604)
@@ -256,4 +256,5 @@
UI_INSERT_RESOURCE_NOT_FOUND="Resource {1} not found, component {0}
HIGHLIGHT_LIBRARY_NOT_FOUND="In order to use highlight attribute of the rich:insert component, add jhighlight.jar from https://jhighlight.dev.java.net/ into application."
INVALID_VALUE="Component {0} has invalid value expression {1}"
-DATASCROLLER_PAGE_MISSING=Datascroller {0}: The requested page #{1} isn''t found in the model containing {2} pages. Datascroller is reset to page #{3}
\ No newline at end of file
+DATASCROLLER_PAGE_MISSING=Datascroller {0}: The requested page #{1} isn''t found in the model containing {2} pages. Paging is reset to page #{3}
+DATASCROLLER_PAGES_DIFFERENT=Datascroller components attached to component: {0} have different values of ''page'' attribute : {1}
\ No newline at end of file
16 years, 8 months
JBoss Rich Faces SVN: r8603 - trunk/ui/datascroller/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-15 13:40:50 -0400 (Thu, 15 May 2008)
New Revision: 8603
Modified:
trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java
trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
Log:
http://jira.jboss.com/jira/browse/RF-3349
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java 2008-05-15 17:36:59 UTC (rev 8602)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/DataScrollerViewPhaseListener.java 2008-05-15 17:40:50 UTC (rev 8603)
@@ -21,16 +21,29 @@
package org.richfaces.component;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import javax.el.Expression;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.component.util.MessageUtil;
+
/**
* Created 08.03.2008
* @author Nick Belaevski
@@ -44,28 +57,148 @@
*/
private static final long serialVersionUID = -3614288642745891577L;
+ private static final String DIFFERENT_PAGE_EXPRS = "Datascroller components attached to component: {0} have different values of 'page' attribute : {1}!";
+
+ private static final Log log = LogFactory.getLog(DataScrollerViewPhaseListener.class);
+
+ private static final class ComponentConnections {
+ private final Map<UIData, List<UIDatascroller>> map =
+ new HashMap<UIData, List<UIDatascroller>>();
+
+ public void addConnection(UIData one, UIDatascroller multi) {
+ List<UIDatascroller> list = map.get(one);
+ if (list == null) {
+ list = new ArrayList<UIDatascroller>(1);
+ map.put(one, list);
+ }
+
+ list.add(multi);
+ }
+
+ public Iterator<Entry<UIData, List<UIDatascroller>>> iterator() {
+ return map.entrySet().iterator();
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName() + ": " + map;
+ }
+ }
+
public void afterPhase(PhaseEvent event) {
}
- private void updateScrollers(UIComponent component) {
- if (component.isRendered()) {
- if (component instanceof UIDatascroller) {
- UIDatascroller datascroller = (UIDatascroller) component;
- datascroller.setupFirstRowValue();
+ private void collectConnections(UIComponent component, ComponentConnections connections) {
+ if (component.isRendered()) {
+ if (component instanceof UIDatascroller) {
+ UIDatascroller datascroller = (UIDatascroller) component;
+ UIData dataTable = datascroller.getDataTable();
+
+ connections.addConnection(dataTable, datascroller);
+ }
+
+ Iterator<UIComponent> children = component.getFacetsAndChildren();
+ while(children.hasNext()) {
+ collectConnections(children.next(), connections);
+ }
}
+ }
- Iterator<UIComponent> children = component.getFacetsAndChildren();
- while(children.hasNext()) {
- updateScrollers(children.next());
+ private static boolean same(Object o1, Object o2) {
+ if (o1 instanceof ValueExpression && o2 instanceof ValueExpression) {
+ ValueExpression ve1 = (ValueExpression) o1;
+ ValueExpression ve2 = (ValueExpression) o2;
+
+ if (same(ve1.getExpressionString(), ve2.getExpressionString()) && same(ve1.getExpectedType(), ve2.getExpectedType())) {
+ return true;
+ }
}
- }
+
+ return (o1 != null && o1.equals(o2)) || (o1 == null && o2 == null);
}
-
+
public void beforePhase(PhaseEvent event) {
FacesContext facesContext = event.getFacesContext();
UIViewRoot viewRoot = facesContext.getViewRoot();
if (viewRoot != null) {
- updateScrollers(viewRoot);
+ ComponentConnections connections = new ComponentConnections();
+ collectConnections(viewRoot, connections);
+ Iterator<Entry<UIData, List<UIDatascroller>>> entries =
+ connections.iterator();
+
+ while (entries.hasNext()) {
+ Entry<UIData, List<UIDatascroller>> entry = entries.next();
+ List<UIDatascroller> scrollers = entry.getValue();
+ if (!scrollers.isEmpty()) {
+ List<Object> values = new ArrayList<Object>(scrollers.size());
+
+ UIData data = entry.getKey();
+ UIDatascroller activeComponent = null;
+
+ Map<String, Object> attributes = data.getAttributes();
+ Object pageValue = attributes.get(UIDatascroller.SCROLLER_STATE_ATTRIBUTE);
+
+ if (pageValue == null) {
+ boolean valid = true;
+
+ for (UIDatascroller datascroller : scrollers) {
+ Object nextPageValue = null;
+
+ if (datascroller.isLocalPageSet()) {
+ nextPageValue = datascroller.getPage();
+ attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, nextPageValue);
+ datascroller.resetLocalPage();
+ } else {
+ nextPageValue = datascroller.getValueExpression("page");
+ }
+
+ if (!values.isEmpty() && !same(values.get(values.size() - 1), nextPageValue)) {
+ valid = false;
+ }
+
+ values.add(nextPageValue);
+
+ if (nextPageValue != null) {
+ activeComponent = datascroller;
+ pageValue = nextPageValue;
+ }
+ }
+
+ if (!valid) {
+ StringBuilder builder = new StringBuilder("\n[");
+ Iterator<UIDatascroller> scrollerItr = scrollers.iterator();
+ Iterator<Object> valueItr = values.iterator();
+
+ while (scrollerItr.hasNext()) {
+ UIDatascroller next = scrollerItr.next();
+ builder.append(MessageUtil.getLabel(facesContext, next));
+ builder.append(": ");
+
+ Object value = valueItr.next();
+ if (value instanceof Expression) {
+ builder.append(((Expression) value).getExpressionString());
+ } else {
+ builder.append(value);
+ }
+
+ builder.append(scrollerItr.hasNext() ? ",\n" : "]");
+ }
+
+ Object dataLabel = MessageUtil.getLabel(facesContext, data);
+ log.error(MessageFormat.format(DIFFERENT_PAGE_EXPRS, dataLabel, builder));
+ }
+
+ }
+
+ if (activeComponent == null) {
+ activeComponent = scrollers.get(scrollers.size() - 1);
+ }
+
+ if (pageValue != null) {
+ activeComponent.setupFirstRowValue();
+ }
+ }
+ }
}
}
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2008-05-15 17:36:59 UTC (rev 8602)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2008-05-15 17:40:50 UTC (rev 8603)
@@ -21,6 +21,8 @@
package org.richfaces.component;
+import java.util.Map;
+
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
@@ -38,6 +40,8 @@
import org.ajax4jsf.component.AjaxActionComponent;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.richfaces.component.util.MessageUtil;
import org.richfaces.event.DataScrollerEvent;
import org.richfaces.event.DataScrollerListener;
@@ -51,526 +55,566 @@
public abstract class UIDatascroller extends AjaxActionComponent
implements DataScrollerSource, ActionSource {
- private Integer page;
+ private static final Log log = LogFactory.getLog(UIDatascroller.class);
+
+ private Integer page;
- public static final String COMPONENT_TYPE = "org.richfaces.Datascroller";
- public static final String COMPONENT_FAMILY = "org.richfaces.Datascroller";
+ public static final String COMPONENT_TYPE = "org.richfaces.Datascroller";
+ public static final String COMPONENT_FAMILY = "org.richfaces.Datascroller";
- public static final String FIRST_FACET_NAME = "first";
+ public static final String FIRST_FACET_NAME = "first";
- public static final String LAST_FACET_NAME = "last";
+ public static final String LAST_FACET_NAME = "last";
- public static final String NEXT_FACET_NAME = "next";
+ public static final String NEXT_FACET_NAME = "next";
- public static final String PREVIOUS_FACET_NAME = "previous";
+ public static final String PREVIOUS_FACET_NAME = "previous";
- public static final String FAST_FORWARD_FACET_NAME = "fastforward";
+ public static final String FAST_FORWARD_FACET_NAME = "fastforward";
- public static final String FAST_REWIND_FACET_NAME = "fastrewind";
+ public static final String FAST_REWIND_FACET_NAME = "fastrewind";
- public static final String FIRST_DISABLED_FACET_NAME = "first_disabled";
+ public static final String FIRST_DISABLED_FACET_NAME = "first_disabled";
- public static final String LAST_DISABLED_FACET_NAME = "last_disabled";
+ public static final String LAST_DISABLED_FACET_NAME = "last_disabled";
- public static final String NEXT_DISABLED_FACET_NAME = "next_disabled";
+ public static final String NEXT_DISABLED_FACET_NAME = "next_disabled";
- public static final String PREVIOUS_DISABLED_FACET_NAME
- = "previous_disabled";
+ public static final String PREVIOUS_DISABLED_FACET_NAME
+ = "previous_disabled";
- public static final String FAST_FORWARD_DISABLED_FACET_NAME
- = "fastforward_disabled";
+ public static final String FAST_FORWARD_DISABLED_FACET_NAME
+ = "fastforward_disabled";
- public static final String FAST_REWIND_DISABLED_FACET_NAME
- = "fastrewind_disabled";
+ public static final String FAST_REWIND_DISABLED_FACET_NAME
+ = "fastrewind_disabled";
- public void addScrollerListener(DataScrollerListener listener) {
- addFacesListener(listener);
- }
+ public void addScrollerListener(DataScrollerListener listener) {
+ addFacesListener(listener);
+ }
- public DataScrollerListener[] getScrollerListeners() {
- return (DataScrollerListener[]) getFacesListeners(
- DataScrollerListener.class);
- }
+ public DataScrollerListener[] getScrollerListeners() {
+ return (DataScrollerListener[]) getFacesListeners(
+ DataScrollerListener.class);
+ }
- public void removeScrollerListener(DataScrollerListener listener) {
- removeFacesListener(listener);
- }
+ public void removeScrollerListener(DataScrollerListener listener) {
+ removeFacesListener(listener);
+ }
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- super.broadcast(event);
- if (event instanceof DataScrollerEvent) {
- DataScrollerEvent dataScrollerEvent = (DataScrollerEvent) event;
-
- updateModel(dataScrollerEvent.getPage());
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
+ if (event instanceof DataScrollerEvent) {
+ DataScrollerEvent dataScrollerEvent = (DataScrollerEvent) event;
- FacesContext context = FacesContext.getCurrentInstance();
- AjaxRendererUtils.addRegionByName(context, this, this.getId());
- AjaxRendererUtils.addRegionByName(context, this, this.getFor());
+ updateModel(dataScrollerEvent.getPage());
- setupReRender(context);
+ FacesContext context = FacesContext.getCurrentInstance();
+ AjaxRendererUtils.addRegionByName(context, this, this.getId());
+ AjaxRendererUtils.addRegionByName(context, this, this.getFor());
- MethodExpression scrollerListener = getScrollerListener();
- if (scrollerListener != null) {
- scrollerListener.invoke(context.getELContext(), new Object[]{event});
- }
- }
- }
+ setupReRender(context);
- public abstract MethodExpression getScrollerListener();
+ MethodExpression scrollerListener = getScrollerListener();
+ if (scrollerListener != null) {
+ scrollerListener.invoke(context.getELContext(), new Object[]{event});
+ }
+ }
+ }
- public abstract void setScrollerListener(MethodExpression scrollerListener);
+ public abstract MethodExpression getScrollerListener();
- public abstract void setFor(String f);
+ public abstract void setScrollerListener(MethodExpression scrollerListener);
- public abstract String getFor();
+ public abstract void setFor(String f);
- public abstract int getFastStep();
+ public abstract String getFor();
- public abstract void setFastStep(int FastStep);
+ public abstract int getFastStep();
- public abstract boolean isRenderIfSinglePage();
+ public abstract void setFastStep(int FastStep);
- public abstract void setRenderIfSinglePage(boolean renderIfSinglePage);
+ public abstract boolean isRenderIfSinglePage();
- public abstract int getMaxPages();
+ public abstract void setRenderIfSinglePage(boolean renderIfSinglePage);
- public abstract void setMaxPages(int maxPages);
+ public abstract int getMaxPages();
- public abstract String getSelectedStyleClass();
+ public abstract void setMaxPages(int maxPages);
- public abstract void setSelectedStyleClass(String selectedStyleClass);
+ public abstract String getSelectedStyleClass();
- public abstract String getSelectedStyle();
+ public abstract void setSelectedStyleClass(String selectedStyleClass);
- public abstract void setSelectedStyle(String selectedStyle);
+ public abstract String getSelectedStyle();
- public abstract String getEventsQueue();
+ public abstract void setSelectedStyle(String selectedStyle);
- public abstract void setEventsQueue(String eventsQueue);
+ public abstract String getEventsQueue();
- public abstract boolean isAjaxSingle();
+ public abstract void setEventsQueue(String eventsQueue);
- public abstract void setAjaxSingle(boolean ajaxSingle);
+ public abstract boolean isAjaxSingle();
- public abstract int getRequestDelay();
+ public abstract void setAjaxSingle(boolean ajaxSingle);
- public abstract void setRequestDelay(int requestDelay);
+ public abstract int getRequestDelay();
- public abstract String getTableStyleClass();
+ public abstract void setRequestDelay(int requestDelay);
- public abstract void setTableStyleClass(String tableStyleClass);
+ public abstract String getTableStyleClass();
- public abstract String getStyleClass();
+ public abstract void setTableStyleClass(String tableStyleClass);
- public abstract String getStyle();
+ public abstract String getStyleClass();
- public abstract void setStyleClass(String styleClass);
+ public abstract String getStyle();
- public abstract void setStyle(String styleClass);
+ public abstract void setStyleClass(String styleClass);
- public abstract String getAlign();
+ public abstract void setStyle(String styleClass);
- public abstract void setAlign(String align);
+ public abstract String getAlign();
- public abstract String getBoundaryControls();
+ public abstract void setAlign(String align);
- public abstract void setBoundaryControls(String boundaryControls);
+ public abstract String getBoundaryControls();
- public abstract String getFastControls();
+ public abstract void setBoundaryControls(String boundaryControls);
- public abstract void setFastControls(String fastControls);
+ public abstract String getFastControls();
- public abstract String getStepControls();
+ public abstract void setFastControls(String fastControls);
- public abstract void setStepControls(String stepControls);
+ public abstract String getStepControls();
- public abstract String getInactiveStyleClass();
+ public abstract void setStepControls(String stepControls);
- public abstract String getInactiveStyle();
+ public abstract String getInactiveStyleClass();
- public abstract void setInactiveStyleClass(String inactiveStyleClass);
+ public abstract String getInactiveStyle();
- public abstract void setInactiveStyle(String inactiveStyle);
- /**
- * Finds the dataTable which id is mapped to the "for" property
- *
- * @return the dataTable component
- */
- public UIData getDataTable() {
- String forAttribute = getFor();
- UIComponent forComp;
- if (forAttribute == null) {
- forComp = this;
- while ((forComp = forComp.getParent()) != null) {
- if (forComp instanceof UIData) {
- setFor(forComp.getId());
- return (UIData) forComp;
- }
- }
- throw new FacesException(
- "could not find dataTable for datascroller " + this.getId());
- } else {
- forComp = RendererUtils.getInstance().findComponentFor(this, forAttribute);
- }
- if (forComp == null) {
- throw new IllegalArgumentException("could not find dataTable with id '"
- + forAttribute + "'");
- } else if (!(forComp instanceof UIData)) {
- throw new IllegalArgumentException(
- "component with id '" + forAttribute
- + "' must be of type " + UIData.class.getName()
- + ", not type "
- + forComp.getClass().getName());
- }
- return (UIData) forComp;
- }
+ public abstract void setInactiveStyleClass(String inactiveStyleClass);
- private int getFastStepOrDefault() {
- int step = getFastStep();
- if (step <= 0) {
- return 1;
- } else {
- return step;
- }
- }
-
- /**
- * @param data
- * @return
- * @see #getPage()
- * @deprecated
- */
- public int getPageIndex(UIData data) {
- return getPageIndex();
- }
-
- /**
- * @return
- * @see #getPage()
- * @deprecated
- */
- public int getPageIndex() {
- return getPageIndex();
- }
+ public abstract void setInactiveStyle(String inactiveStyle);
+ /**
+ * Finds the dataTable which id is mapped to the "for" property
+ *
+ * @return the dataTable component
+ */
+ public UIData getDataTable() {
+ String forAttribute = getFor();
+ UIComponent forComp;
+ if (forAttribute == null) {
+ forComp = this;
+ while ((forComp = forComp.getParent()) != null) {
+ if (forComp instanceof UIData) {
+ setFor(forComp.getId());
+ return (UIData) forComp;
+ }
+ }
+ throw new FacesException(
+ "could not find dataTable for datascroller " + this.getId());
+ } else {
+ forComp = RendererUtils.getInstance().findComponentFor(this, forAttribute);
+ }
+ if (forComp == null) {
+ throw new IllegalArgumentException("could not find dataTable with id '"
+ + forAttribute + "'");
+ } else if (!(forComp instanceof UIData)) {
+ throw new IllegalArgumentException(
+ "component with id '" + forAttribute
+ + "' must be of type " + UIData.class.getName()
+ + ", not type "
+ + forComp.getClass().getName());
+ }
+ return (UIData) forComp;
+ }
- public int getPageForFacet(String facetName) {
- if (facetName == null) {
- throw new NullPointerException();
- }
-
- int newPage = 1;
- int pageCount = getPageCount();
+ private int getFastStepOrDefault() {
+ int step = getFastStep();
+ if (step <= 0) {
+ return 1;
+ } else {
+ return step;
+ }
+ }
- if (FIRST_FACET_NAME.equals(facetName)) {
- newPage = 1;
- } else if (PREVIOUS_FACET_NAME.equals(facetName)) {
- newPage = getPage() - 1;
- } else if (NEXT_FACET_NAME.equals(facetName)) {
- newPage = getPage() + 1;
- } else if (LAST_FACET_NAME.equals(facetName)) {
- newPage = pageCount > 0 ? pageCount : 1;
- } else if (FAST_FORWARD_FACET_NAME.equals(facetName)) {
- newPage = getPage() + getFastStepOrDefault();
- } else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
- newPage = getPage() - getFastStepOrDefault();
- } else {
- try {
- newPage = Integer.parseInt(facetName.toString());
- } catch (NumberFormatException e) {
- throw new FacesException(e.getLocalizedMessage(), e);
- }
- }
+ /**
+ * @param data
+ * @return
+ * @see #getPage()
+ * @deprecated
+ */
+ public int getPageIndex(UIData data) {
+ return getPageIndex();
+ }
- if (newPage >= 1 && newPage <= pageCount) {
- return newPage;
- } else {
- return 0;
- }
- }
-
- /**
- * Sets the page number according to the parameter recived from the
- * commandLink
- *
- * @param facetName - can be "first:, "last", "next", "previous",
- * "fastforward", "fastrewind"
- *
- * @see #setPage(int)
- * @see #getPageForFacet(String)
- *
- * @deprecated as of 3.2 replaced with <code>setPage(int)</page>
- */
- public void setPage(String facetName) {
- int newPage = getPageForFacet(facetName);
- if (newPage != 0) {
- setPage(newPage);
- }
- }
+ /**
+ * @return
+ * @see #getPage()
+ * @deprecated
+ */
+ public int getPageIndex() {
+ return getPageIndex();
+ }
- public int getPageCount(UIData data) {
- int rowCount = getRowCount(data);
- int rows = getRows(data);
-
- int pageCount;
- if (rows > 0) {
- pageCount = rows <= 0 ? 1 : rowCount / rows;
- if (rowCount % rows > 0) {
- pageCount++;
- }
- if (pageCount == 0) {
- pageCount = 1;
- }
- } else {
- rows = 1;
- pageCount = 1;
- }
- return pageCount;
- }
+ public int getPageForFacet(String facetName) {
+ if (facetName == null) {
+ throw new NullPointerException();
+ }
- /** @return the page count of the uidata */
- public int getPageCount() {
- return getPageCount(getDataTable());
- }
+ int newPage = 1;
+ int pageCount = getPageCount();
- public int getRowCount(UIData data) {
- int rowCount = data.getRowCount();
- if (rowCount >= 0) {
- return rowCount;
- }
+ if (FIRST_FACET_NAME.equals(facetName)) {
+ newPage = 1;
+ } else if (PREVIOUS_FACET_NAME.equals(facetName)) {
+ newPage = getPage() - 1;
+ } else if (NEXT_FACET_NAME.equals(facetName)) {
+ newPage = getPage() + 1;
+ } else if (LAST_FACET_NAME.equals(facetName)) {
+ newPage = pageCount > 0 ? pageCount : 1;
+ } else if (FAST_FORWARD_FACET_NAME.equals(facetName)) {
+ newPage = getPage() + getFastStepOrDefault();
+ } else if (FAST_REWIND_FACET_NAME.equals(facetName)) {
+ newPage = getPage() - getFastStepOrDefault();
+ } else {
+ try {
+ newPage = Integer.parseInt(facetName.toString());
+ } catch (NumberFormatException e) {
+ throw new FacesException(e.getLocalizedMessage(), e);
+ }
+ }
- return BinarySearch.search(data);
- }
+ if (newPage >= 1 && newPage <= pageCount) {
+ return newPage;
+ } else {
+ return 0;
+ }
+ }
- /** @return int */
- public int getRowCount() {
- //xxx nick -> alex - scrollable models can return -1 here
- //let's implement "dychotomic" discovery
- // setPage(1)... if isPageAvailable() setPage(2) then 4, 8, etc.
- // setPage() { setRowIndex(pageIdx * rows); }
- // isPageAvailable() { return isRowAvailable() }
- //return getUIData().getRowCount();
- return getRowCount(getDataTable());
- }
+ /**
+ * Sets the page number according to the parameter recived from the
+ * commandLink
+ *
+ * @param facetName - can be "first:, "last", "next", "previous",
+ * "fastforward", "fastrewind"
+ *
+ * @see #setPage(int)
+ * @see #getPageForFacet(String)
+ *
+ * @deprecated as of 3.2 replaced with <code>setPage(int)</page>
+ */
+ public void setPage(String facetName) {
+ int newPage = getPageForFacet(facetName);
+ if (newPage != 0) {
+ setPage(newPage);
+ }
+ }
- public int getRows(UIData data) {
- int row = 0;
- row = data.getRows();
- if (row == 0) {
- row = getRowCount(data);
- }
+ public int getPageCount(UIData data) {
+ int rowCount = getRowCount(data);
+ int rows = getRows(data);
- return row;
- }
+ int pageCount;
+ if (rows > 0) {
+ pageCount = rows <= 0 ? 1 : rowCount / rows;
+ if (rowCount % rows > 0) {
+ pageCount++;
+ }
+ if (pageCount == 0) {
+ pageCount = 1;
+ }
+ } else {
+ rows = 1;
+ pageCount = 1;
+ }
+ return pageCount;
+ }
- /**
- * @param data
- * @return
- * @see #getPage()
- * @deprecated
- */
- public int getFirstRow(UIData data) {
- return data.getFirst();
- }
+ /** @return the page count of the uidata */
+ public int getPageCount() {
+ return getPageCount(getDataTable());
+ }
- /**
- * @param rows
- * @see #setPage(int)
- * @deprecated
- */
- public void setFirstRow(int rows) {
- getDataTable().setFirst(rows);
- }
-
- // facet getter methods
- public UIComponent getFirst() {
- return getFacet(FIRST_FACET_NAME);
- }
+ public int getRowCount(UIData data) {
+ int rowCount = data.getRowCount();
+ if (rowCount >= 0) {
+ return rowCount;
+ }
- public UIComponent getLast() {
- return getFacet(LAST_FACET_NAME);
- }
+ return BinarySearch.search(data);
+ }
- public UIComponent getNext() {
- return getFacet(NEXT_FACET_NAME);
- }
+ /** @return int */
+ public int getRowCount() {
+ //xxx nick -> alex - scrollable models can return -1 here
+ //let's implement "dychotomic" discovery
+ // setPage(1)... if isPageAvailable() setPage(2) then 4, 8, etc.
+ // setPage() { setRowIndex(pageIdx * rows); }
+ // isPageAvailable() { return isRowAvailable() }
+ //return getUIData().getRowCount();
+ return getRowCount(getDataTable());
+ }
- public UIComponent getFastForward() {
- return getFacet(FAST_FORWARD_FACET_NAME);
- }
+ public int getRows(UIData data) {
+ int row = 0;
+ row = data.getRows();
+ if (row == 0) {
+ row = getRowCount(data);
+ }
- public UIComponent getFastRewind() {
- return getFacet(FAST_REWIND_FACET_NAME);
- }
+ return row;
+ }
- public UIComponent getPrevious() {
- return getFacet(PREVIOUS_FACET_NAME);
- }
+ /**
+ * @param data
+ * @return
+ * @see #getPage()
+ * @deprecated
+ */
+ public int getFirstRow(UIData data) {
+ return data.getFirst();
+ }
- public void setupFirstRowValue() {
- UIData dataTable = getDataTable();
- if (isRendered()) {
- Integer pageCount = getPageCount(dataTable);
-
- int page = getPage();
- int newPage = -1;
- if (page < 1) {
- newPage = 1;
- } else if (page > pageCount) {
- newPage = (pageCount != 0 ? pageCount : 1);
- }
+ /**
+ * @param rows
+ * @see #setPage(int)
+ * @deprecated
+ */
+ public void setFirstRow(int rows) {
+ getDataTable().setFirst(rows);
+ }
- if (newPage != -1) {
- FacesContext context = getFacesContext();
- Object label = MessageUtil.getLabel(context, this);
- String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING,
- new Object[] {label, page, pageCount, newPage});
+ // facet getter methods
+ public UIComponent getFirst() {
+ return getFacet(FIRST_FACET_NAME);
+ }
- context.addMessage(this.getClientId(context), new FacesMessage(formattedMessage));
+ public UIComponent getLast() {
+ return getFacet(LAST_FACET_NAME);
+ }
- page = newPage;
- setPage(page);
- }
+ public UIComponent getNext() {
+ return getFacet(NEXT_FACET_NAME);
+ }
- if (dataTable.isRendered()) {
- dataTable.setFirst((page - 1) * getRows(dataTable));
- }
- }
- }
-
- public void setPage(int newPage) {
- this.page = newPage;
- }
-
- public int getPage() {
- if (this.page != null) {
- return page;
- }
+ public UIComponent getFastForward() {
+ return getFacet(FAST_FORWARD_FACET_NAME);
+ }
- ValueExpression ve = getValueExpression("page");
- if (ve != null) {
- try {
- Integer pageObject = (Integer) ve.getValue(getFacesContext().getELContext());
+ public UIComponent getFastRewind() {
+ return getFacet(FAST_REWIND_FACET_NAME);
+ }
- if (pageObject != null) {
- return pageObject;
- } else {
- return 1;
- }
- } catch (ELException e) {
- throw new FacesException(e);
- }
- } else {
- return 1;
- }
- }
+ public UIComponent getPrevious() {
+ return getFacet(PREVIOUS_FACET_NAME);
+ }
- private void updateModel(int newPage) {
- this.page = newPage;
- FacesContext context = getFacesContext();
- ValueExpression ve = getValueExpression("page");
- if (ve != null) {
- try {
- ve.setValue(context.getELContext(), this.page);
- this.page = null;
- } catch (ELException e) {
- String messageStr = e.getMessage();
- Throwable result = e.getCause();
- while (null != result &&
- result.getClass().isAssignableFrom(ELException.class)) {
- messageStr = result.getMessage();
- result = result.getCause();
- }
- FacesMessage message;
- if (null == messageStr) {
- message =
- MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
- new Object[] { MessageUtil.getLabel(
- context, this) });
- } else {
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
- messageStr,
- messageStr);
- }
- context.getExternalContext().log(message.getSummary(), result);
- context.addMessage(getClientId(context), message);
- context.renderResponse();
- } catch (IllegalArgumentException e) {
- FacesMessage message =
- MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
- new Object[] { MessageUtil.getLabel(
- context, this) });
- context.getExternalContext().log(message.getSummary(), e);
- context.addMessage(getClientId(context), message);
- context.renderResponse();
- } catch (Exception e) {
- FacesMessage message =
- MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
- new Object[] { MessageUtil.getLabel(
- context, this) });
- context.getExternalContext().log(message.getSummary(), e);
- context.addMessage(getClientId(context), message);
- context.renderResponse();
- }
- }
- }
-
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
+ private static boolean isRendered(UIComponent component) {
+ UIComponent c = component;
+ while (c != null) {
+ if (!c.isRendered()) {
+ return false;
+ }
- static class BinarySearch {
+ c = c.getParent();
+ }
- public static int search(UIData data) {
- int rowIndex = data.getRowIndex();
- try {
- int n = 1;
- int k = 2;
- for (; ;) {
- data.setRowIndex(k - 1);
- if (data.isRowAvailable()) {
- n = k;
- k = k * 2;
- } else {
- break;
- }
- }
+ return true;
+ }
- while (n < k) {
- int kk = Math.round((n + k) / 2) + 1;
- data.setRowIndex(kk - 1);
- if (data.isRowAvailable()) {
- n = kk;
- } else {
- k = kk - 1;
- }
- }
- data.setRowIndex(k - 1);
- if (data.isRowAvailable()) {
- return k;
- } else {
- return 0;
- }
- } finally {
- data.setRowIndex(rowIndex);
- }
- }
- }
+ public void setupFirstRowValue() {
+ UIData dataTable = getDataTable();
+ if (isRendered()) {
+ Integer pageCount = getPageCount(dataTable);
- public Object saveState(FacesContext context) {
- return new Object[] {
- super.saveState(context),
- page
- };
+ int page = getPage();
+ int newPage = -1;
+ if (page < 1) {
+ newPage = 1;
+ } else if (page > pageCount) {
+ newPage = (pageCount != 0 ? pageCount : 1);
+ }
- }
+ if (newPage != -1) {
+ FacesContext context = getFacesContext();
+ Object label = MessageUtil.getLabel(context, this);
+ String formattedMessage = Messages.getMessage(Messages.DATASCROLLER_PAGE_MISSING,
+ new Object[] {label, page, pageCount, newPage});
- public void restoreState(FacesContext context, Object object) {
- Object[] state = (Object[]) object;
+ log.warn(formattedMessage);
+
+ page = newPage;
+ dataTable.getAttributes().put(SCROLLER_STATE_ATTRIBUTE, page);
+ }
- super.restoreState(context, state[0]);
- page = (Integer) state[1];
- }
+ if (isRendered(dataTable)) {
+ dataTable.setFirst((page - 1) * getRows(dataTable));
+ }
+ }
+ }
+ public void setPage(int newPage) {
+ this.page = newPage;
+ }
+
+ public int getPage() {
+ Map<String, Object> attributes = getDataTable().getAttributes();
+ Integer state = (Integer) attributes.get(SCROLLER_STATE_ATTRIBUTE);
+ if (state != null) {
+ return state;
+ }
+
+ if (this.page != null) {
+ return page;
+ }
+
+ ValueExpression ve = getValueExpression("page");
+ if (ve != null) {
+ try {
+ Integer pageObject = (Integer) ve.getValue(getFacesContext().getELContext());
+
+ if (pageObject != null) {
+ return pageObject;
+ } else {
+ return 1;
+ }
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ return 1;
+ }
+ }
+
+ private void updateModel(int newPage) {
+ UIData dataTable = getDataTable();
+
+ if (isRendered(dataTable)) {
+ dataTable.setFirst((newPage - 1) * getRows(dataTable));
+ }
+
+ Map<String, Object> attributes = dataTable.getAttributes();
+ attributes.put(SCROLLER_STATE_ATTRIBUTE, newPage);
+
+ FacesContext context = getFacesContext();
+ ValueExpression ve = getValueExpression("page");
+ if (ve != null) {
+ try {
+ ve.setValue(context.getELContext(), newPage);
+ attributes.remove(SCROLLER_STATE_ATTRIBUTE);
+ } catch (ELException e) {
+ String messageStr = e.getMessage();
+ Throwable result = e.getCause();
+ while (null != result &&
+ result.getClass().isAssignableFrom(ELException.class)) {
+ messageStr = result.getMessage();
+ result = result.getCause();
+ }
+ FacesMessage message;
+ if (null == messageStr) {
+ message =
+ MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
+ new Object[] { MessageUtil.getLabel(
+ context, this) });
+ } else {
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ messageStr,
+ messageStr);
+ }
+ context.getExternalContext().log(message.getSummary(), result);
+ context.addMessage(getClientId(context), message);
+ context.renderResponse();
+ } catch (IllegalArgumentException e) {
+ FacesMessage message =
+ MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
+ new Object[] { MessageUtil.getLabel(
+ context, this) });
+ context.getExternalContext().log(message.getSummary(), e);
+ context.addMessage(getClientId(context), message);
+ context.renderResponse();
+ } catch (Exception e) {
+ FacesMessage message =
+ MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
+ new Object[] { MessageUtil.getLabel(
+ context, this) });
+ context.getExternalContext().log(message.getSummary(), e);
+ context.addMessage(getClientId(context), message);
+ context.renderResponse();
+ }
+ }
+ }
+
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ static class BinarySearch {
+
+ public static int search(UIData data) {
+ int rowIndex = data.getRowIndex();
+ try {
+ int n = 1;
+ int k = 2;
+ for (; ;) {
+ data.setRowIndex(k - 1);
+ if (data.isRowAvailable()) {
+ n = k;
+ k = k * 2;
+ } else {
+ break;
+ }
+ }
+
+ while (n < k) {
+ int kk = Math.round((n + k) / 2) + 1;
+ data.setRowIndex(kk - 1);
+ if (data.isRowAvailable()) {
+ n = kk;
+ } else {
+ k = kk - 1;
+ }
+ }
+
+ data.setRowIndex(k - 1);
+ if (data.isRowAvailable()) {
+ return k;
+ } else {
+ return 0;
+ }
+ } finally {
+ data.setRowIndex(rowIndex);
+ }
+ }
+ }
+
+ public Object saveState(FacesContext context) {
+ return new Object[] {
+ super.saveState(context),
+ page
+ };
+
+ }
+
+ public void restoreState(FacesContext context, Object object) {
+ Object[] state = (Object[]) object;
+
+ super.restoreState(context, state[0]);
+ page = (Integer) state[1];
+ }
+
+ public static final String SCROLLER_STATE_ATTRIBUTE = COMPONENT_TYPE + ":page";
+
+ public boolean isLocalPageSet() {
+ return page != null;
+ }
+
+ public void resetLocalPage() {
+ page = null;
+ }
+
}
16 years, 8 months
JBoss Rich Faces SVN: r8602 - trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-05-15 13:36:59 -0400 (Thu, 15 May 2008)
New Revision: 8602
Modified:
trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js
Log:
http://jira.jboss.com/jira/browse/RF-3332
Modified: trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js 2008-05-15 17:28:44 UTC (rev 8601)
+++ trunk/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js 2008-05-15 17:36:59 UTC (rev 8602)
@@ -71,9 +71,12 @@
// return target;
} else {
//Fall back to DOM, and cross the fingers
- src = document.importNode(src, true);
- target.parentNode.replaceChild(src, target);
- return src;
+ //src = document.importNode(src, true);
+ //target.parentNode.replaceChild(src, target);
+ //return src;
+ //bug http://jira.jboss.com/jira/browse/RF-3332 is fixed
+ target.outerHTML = new XMLSerializer().serializeToString(src);
+ return target;
}
}
else {
16 years, 8 months
JBoss Rich Faces SVN: r8601 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-05-15 13:28:44 -0400 (Thu, 15 May 2008)
New Revision: 8601
Added:
trunk/docs/userguide/en/src/main/resources/images/fileUpload5.png
trunk/docs/userguide/en/src/main/resources/images/inplaceSelect_oc.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_init.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuItem2.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_init.png
Log:
RF-2905--Screenshots names
Added: trunk/docs/userguide/en/src/main/resources/images/fileUpload5.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/fileUpload5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/inplaceSelect_oc.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/inplaceSelect_oc.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_init.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_init.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/panelMenuItem2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/panelMenuItem2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_init.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_init.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 8 months
JBoss Rich Faces SVN: r8600 - in trunk/samples/scrollableDataTableDemo/src/main/webapp: pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-05-15 13:18:42 -0400 (Thu, 15 May 2008)
New Revision: 8600
Added:
trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/sg.jsp
Modified:
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml
Log:
jsp
Modified: trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml 2008-05-15 16:35:19 UTC (rev 8599)
+++ trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml 2008-05-15 17:18:42 UTC (rev 8600)
@@ -6,27 +6,31 @@
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
- <context-param>
- <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
- <param-value>false</param-value>
- </context-param>
<context-param>
+ <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<!--
- -->
+-->
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
- <context-param>
- <param-name>org.ajax4jsf.SKIN</param-name>
- <param-value>#{skinBean.skin}</param-value>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.jsp</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
</context-param>
<filter>
<display-name>Request Metrics</display-name>
@@ -36,11 +40,8 @@
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
- <init-param>
- <param-name>enable-cache</param-name>
- <param-value>false</param-value>
- </init-param>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param><param-name>enable-cache</param-name><param-value>false</param-value></init-param>
</filter>
<filter>
<display-name>Request Metrics</display-name>
Added: trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/sg.jsp
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/sg.jsp (rev 0)
+++ trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/sg.jsp 2008-05-15 17:18:42 UTC (rev 8600)
@@ -0,0 +1,208 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/scrollableDataTable" prefix="sg"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/dataTable" prefix="dt"%>
+<html>
+ <head>
+ <style type="text/css">
+ .inputStyle{
+ font-family:arial;
+ font-size:8pt;
+ font-size-adjust:none;
+ font-stretch:normal;
+ font-style:normal;
+ font-variant:normal;
+ font-weight:normal;
+ line-height:normal;
+ }
+
+ .rich-sdt-row {
+ height: 30px;
+ }
+
+ .col {
+ color: red;
+ }
+ .sdt_col {
+ font-family: Tahoma;
+ font-size: 11px;
+ color: #000000;
+ text-decoration: none;
+ text-align: center;
+ vertical-align: middle;
+ //padding-left: 4px;
+ //padding-right: 4px;
+ }
+
+
+
+ </style>
+ </head>
+
+
+ <body>
+ <f:view>
+ <h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ </h:form>
+ <h:form>
+
+ <c:set var="renderFooter" value="#{true}"/>
+
+ <sg:scrollableDataTable value="#{jiraService.channel.issues}"
+ var="issues"
+ first="0"
+ rows="30"
+ frozenColCount="3"
+ width="800px"
+ columnClasses="sdt_col"
+ height="500px" hideWhenScrolling="false">
+
+
+ <dt:column width="10px" sortable="false">
+
+ <f:facet name="header">
+ <h:outputText value="Index"></h:outputText>
+ </f:facet>
+
+ <h:outputText value="#{issues.index}"></h:outputText>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer0"></h:outputText>
+ </f:facet>
+ </c:if>
+
+ </dt:column>
+
+ <dt:column width="200px" sortExpression="#{issues.key.value}">
+
+ <f:facet name="header">
+ <h:outputText value="Key"></h:outputText>
+ </f:facet>
+
+ <h:outputText value="#{issues.key.value}"></h:outputText>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer1"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+
+
+ <dt:column width="200px" sortExpression="#{issues.summary}">
+
+ <f:facet name="header">
+ <h:outputText value="Summary"></h:outputText>
+ </f:facet>
+
+ <h:outputText value="#{issues.summary}"></h:outputText>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer2"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+
+ <dt:column width="200px">
+
+ <f:facet name="header">
+ <h:outputText value="Assignee"></h:outputText>
+ </f:facet>
+
+ <h:inputText value="#{issues.assignee}" converter="#{jiraUserConverter}" styleClass="inputStyle"></h:inputText>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer3"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+
+ <dt:column width="200px">
+
+ <f:facet name="header">
+ <h:outputText value="Status"></h:outputText>
+ </f:facet>
+
+ <h:selectOneMenu id="select_status" value="#{issues.status}" converter="#{StatusConverter}" styleClass="inputStyle">
+ <f:selectItem itemValue="#{status_open}" itemLabel="Open"/>
+ <f:selectItem itemValue="#{status_closed}" itemLabel="Closed"/>
+ <f:selectItem itemValue="#{status_resolved}" itemLabel="Resolved"/>
+ <f:selectItem itemValue="#{status_inprogress}" itemLabel="In Progress"/>
+ <f:selectItem itemValue="#{status_reopened}" itemLabel="Reopened"/>
+ </h:selectOneMenu>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer4"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+
+ <dt:column width="200px">
+
+ <f:facet name="header">
+ <h:outputText value="Reporter"></h:outputText>
+ </f:facet>
+
+ <h:outputText value="#{issues.reporter.username}"></h:outputText>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer5"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+
+ <dt:column width="200px">
+
+ <f:facet name="header">
+ <h:outputText value="Priority"></h:outputText>
+ </f:facet>
+
+ <h:selectOneMenu id="select_priority" value="#{issues.priority}" converter="#{PriorityConverter}" styleClass="inputStyle">
+ <f:selectItem itemValue="#{priority_blocker}" itemLabel="Blocker"/>
+ <f:selectItem itemValue="#{priority_critical}" itemLabel="Critical"/>
+ <f:selectItem itemValue="#{priority_major}" itemLabel="Major"/>
+ <f:selectItem itemValue="#{priority_minor}" itemLabel="Minor"/>
+ <f:selectItem itemValue="#{priority_cosmetic}" itemLabel="Cosmetic"/>
+ </h:selectOneMenu>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer6"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+
+ <dt:column width="200px">
+
+ <f:facet name="header">
+ <h:outputText value="Resolution"></h:outputText>
+ </f:facet>
+
+ <h:inputText value="#{issues.resolution}" styleClass="inputStyle"></h:inputText>
+
+ <c:if test="#{renderFooter}">
+ <f:facet name="footer">
+ <h:outputText value="footer8"></h:outputText>
+ </f:facet>
+ </c:if>
+ </dt:column>
+ </sg:scrollableDataTable>
+ <h:commandButton value="submit"></h:commandButton>
+ <h:messages showDetail="true"/>
+ </h:form>
+
+ <h:outputLink target="_blank" value="resource:///org/ajax4jsf/javascript/jsshell.html">Console</h:outputLink>
+
+
+ </f:view>
+ </body>
+</html>
16 years, 8 months
JBoss Rich Faces SVN: r8599 - in trunk/docs/userguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-05-15 12:35:19 -0400 (Thu, 15 May 2008)
New Revision: 8599
Added:
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup2.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3l.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup4.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_cn.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_cn2.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_cn.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_cn2.png
Removed:
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroupSC.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_icons.png
trunk/docs/userguide/en/src/main/resources/images/panelMenuItemSC.png
trunk/docs/userguide/en/src/main/resources/images/panelmenugroup1.png
trunk/docs/userguide/en/src/main/resources/images/panelmenugroup_col.png
trunk/docs/userguide/en/src/main/resources/images/panelmenugroup_exp.png
trunk/docs/userguide/en/src/main/resources/images/panelmenuitem.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/panel.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
Log:
RF-2905--Screenshots names
Modified: trunk/docs/userguide/en/src/main/docbook/included/panel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2008-05-15 16:29:02 UTC (rev 8598)
+++ trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2008-05-15 16:35:19 UTC (rev 8599)
@@ -109,7 +109,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panel.png"/>
+ <imagedata fileref="images/panel2.png"/>
</imageobject>
</mediaobject>
</figure>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.desc.xml 2008-05-15 16:29:02 UTC (rev 8598)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.desc.xml 2008-05-15 16:35:19 UTC (rev 8599)
@@ -14,7 +14,7 @@
<title><emphasis role="bold"><property><rich:panelMenuGroup></property></emphasis> component</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenu.png"/>
+ <imagedata fileref="images/panelMenuGroup_init.png"/>
</imageobject>
</mediaobject>
</figure>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2008-05-15 16:29:02 UTC (rev 8598)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2008-05-15 16:35:19 UTC (rev 8599)
@@ -142,7 +142,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelMenuGroup_icons.png"/>
+ <imagedata fileref="images/panelMenuGroup2.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -167,7 +167,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenugroup_col.png"/>
+ <imagedata fileref="images/panelMenuGroup3.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -177,7 +177,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenugroup_exp.png"/>
+ <imagedata fileref="images/panelMenuGroup4.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -433,7 +433,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelMenuGroupSC.png"/>
+ <imagedata fileref="images/panelMenuGroup_cn.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -443,7 +443,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenugroup1.png"/>
+ <imagedata fileref="images/panelMenuGroup_cn2.png"/>
</imageobject>
</mediaobject>
</figure>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.desc.xml 2008-05-15 16:29:02 UTC (rev 8598)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.desc.xml 2008-05-15 16:35:19 UTC (rev 8599)
@@ -16,7 +16,7 @@
</emphasis> component</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenu.png"/>
+ <imagedata fileref="images/panelMenuItem_init.png"/>
</imageobject>
</mediaobject>
</figure>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2008-05-15 16:29:02 UTC (rev 8598)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2008-05-15 16:35:19 UTC (rev 8599)
@@ -156,7 +156,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelMenuGroup_icons.png"/>
+ <imagedata fileref="images/panelMenuItem2.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -180,7 +180,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenugroup_exp.png"/>
+ <imagedata fileref="images/panelMenugItem3.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -344,7 +344,7 @@
<title>Classes names</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelMenuItemSC.png"></imagedata>
+ <imagedata fileref="images/panelMenuItem_cn.png"></imagedata>
</imageobject>
</mediaobject>
</figure>
@@ -353,7 +353,7 @@
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelmenuitem.png"/>
+ <imagedata fileref="images/panelMenuItem_cn2.png"/>
</imageobject>
</mediaobject>
</figure>
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_icons.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup3l.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelmenugroup_col.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup4.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelmenugroup_exp.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroupSC.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelMenuGroupSC.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_cn2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelmenugroup1.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelMenuGroup_icons.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelMenuItemSC.png
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_cn.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelMenuItemSC.png)
===================================================================
(Binary files differ)
Copied: trunk/docs/userguide/en/src/main/resources/images/panelMenuItem_cn2.png (from rev 8589, trunk/docs/userguide/en/src/main/resources/images/panelmenuitem.png)
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelmenugroup1.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelmenugroup_col.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelmenugroup_exp.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/panelmenuitem.png
===================================================================
(Binary files differ)
16 years, 8 months
JBoss Rich Faces SVN: r8598 - in trunk/test-applications/seleniumTest/src: main/webapp/pages and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-05-15 12:29:02 -0400 (Thu, 15 May 2008)
New Revision: 8598
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/calendar/
trunk/test-applications/seleniumTest/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
Log:
Add selenium test for Calendar control
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java 2008-05-15 16:29:02 UTC (rev 8598)
@@ -0,0 +1,170 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - 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.ajax4jsf;
+
+import java.lang.reflect.Method;
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import javax.faces.convert.DateTimeConverter;
+
+public class CalendarTestBean {
+
+ public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
+
+ public static final Locale LOCALE = new Locale("US");
+
+ public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT+2");
+
+ public static Date DEFAULT_DATE;
+
+ private static DateTimeConverter DEFAULT_CONVERTER;
+
+ public static DateFormat DATE_FORMAT;
+
+ // constructor for static fields
+ static {
+ setupDefaultConverter();
+ setupDefaultDate();
+ }
+
+ private String datePattern ;
+
+ private Locale locale;
+
+ private TimeZone timeZone;
+
+ private Date selectedDate;
+
+ private String selectedDateString;
+
+ public CalendarTestBean() {
+ selectedDate = DEFAULT_DATE;
+ resetSelectedDateString();
+
+ datePattern = DATE_PATTERN;
+ locale = LOCALE;
+ timeZone = TIME_ZONE;
+ }
+
+ public Date getSelectedDate() {
+ return selectedDate;
+ }
+
+ public void setSelectedDate(Date selectedDate) {
+ this.selectedDate = selectedDate;
+ resetSelectedDateString();
+ }
+
+ public void resetSelectedDateString() {
+ setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
+ }
+
+ public String getSelectedDateString() {
+ return selectedDateString;
+ }
+
+ public void setSelectedDateString(String selectedDateString) {
+ this.selectedDateString = selectedDateString;
+ }
+
+ public String getDatePattern() {
+ return datePattern;
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public TimeZone getTimeZone() {
+ return timeZone;
+ }
+
+ public void setDatePattern(String datePattern) {
+ this.datePattern = datePattern;
+ }
+
+ public void setLocale(Locale locale) {
+ this.locale = locale;
+ }
+
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ public static Calendar getCalendar() {
+ return Calendar.getInstance(CalendarTestBean.TIME_ZONE, CalendarTestBean.LOCALE);
+ }
+
+ /**
+ * Setup the default date
+ */
+ private static void setupDefaultDate() {
+ DEFAULT_DATE = getDayInMay(10);
+ }
+
+ public static Date getDayInMay(int dayOfMonth) {
+ Calendar calendar = getCalendar();
+ calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
+ calendar.set(Calendar.MONTH, Calendar.MAY);
+ calendar.set(Calendar.YEAR, 2008);
+ calendar.set(Calendar.HOUR_OF_DAY, 18);
+ calendar.set(Calendar.MINUTE, 25);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ return calendar.getTime();
+ }
+
+ /**
+ * Setup the default converter
+ */
+ private static void setupDefaultConverter() {
+ DEFAULT_CONVERTER = new DateTimeConverter();
+
+ DEFAULT_CONVERTER.setPattern(DATE_PATTERN);
+ DEFAULT_CONVERTER.setLocale(LOCALE);
+ DEFAULT_CONVERTER.setTimeZone(TIME_ZONE);
+
+ try {
+ Method method = null;
+ Method[] declaredMethods = DateTimeConverter.class.getDeclaredMethods();
+ for (int i = 0; i < declaredMethods.length; i++) {
+ if (declaredMethods[i].getName().equals("getDateFormat")) {
+ method = declaredMethods[i];
+ break;
+ }
+ }
+ if (method != null) {
+
+ method.setAccessible(true);
+ DATE_FORMAT = (DateFormat) method.invoke(DEFAULT_CONVERTER, DEFAULT_CONVERTER.getLocale());
+ DATE_FORMAT.setTimeZone(DEFAULT_CONVERTER.getTimeZone());
+ }
+ } catch (Exception e) {
+ // skip exception
+ }
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/CalendarTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/pages/calendar/calendarTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java 2008-05-15 16:29:02 UTC (rev 8598)
@@ -0,0 +1,147 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - 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;
+
+import java.text.ParseException;
+import java.util.Date;
+
+import org.ajax4jsf.CalendarTestBean;
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class CalendarTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ /**
+ * Default constructor
+ */
+ public CalendarTest() {
+ super("http", "localhost", "8080");
+ }
+
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testContextMenuComponent() throws Exception {
+ _testSelectDateComponent(Templates.SIMPLE);
+// _testCalendarComponent(Templates.DATATABLE);
+ }
+
+ private void _testCalendarComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar InputDate field");
+ clickById(calendarInputDate);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+ }
+
+ private void _testSelectDateComponent(Templates template) {
+ renderPage(getTestUrl(), template);
+
+ Date newSelectedDate = CalendarTestBean.getDayInMay(15);
+
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ String inputDateString = getValueById(calendarInputDate);
+ Date readDate = null;
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch(ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE, "Default date representation is wrong!");
+
+ // click on 15th of May
+ String newSelectedDateId = calendarOpenedId + "DayCell18";
+ clickById(newSelectedDateId);
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ inputDateString = getValueById(calendarInputDate);
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch(ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, newSelectedDate, "Date representation after selecting 15.May.2008 is wrong!");
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+
+
+ }
+
+ public String getTestUrl() {
+ return "/faces/pages/calendar/calendarTest.xhtml";
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/CalendarTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 8 months