JBoss Rich Faces SVN: r20245 - in branches/RF-8742-1: core/api/src/main/java/org/richfaces/component and 34 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-30 14:36:09 -0500 (Tue, 30 Nov 2010)
New Revision: 20245
Added:
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java
branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/
branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/
branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/compress.png
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder.png
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_key.png
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_page.png
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/page_white_cup.png
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/treeModel.xhtml
branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/GridSeparatorImage.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/arrow.png
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/copy.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_doc.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_folder.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/cut.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/delete.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/edit.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/filter.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/find.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_group.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_item.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/open.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/paste.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/redo.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/reload.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/repeat.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_all.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_as.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/undo.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/verify.gif
branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuple.java
branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeModel.java
branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModelTuple.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelRecursiveAdaptor.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelRecursiveAdaptor.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeModelKey.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss
branches/RF-8742-1/ui/output/ui/src/main/templates/toolBar.template.xml
Removed:
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java
branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/
branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/GridSeparatorImage.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/arrow.png
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/copy.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_doc.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_folder.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/cut.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/delete.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/edit.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/filter.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/find.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_group.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_item.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/open.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/paste.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/redo.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/reload.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/repeat.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_all.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_as.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/undo.gif
branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/verify.gif
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/ExtendedTreeDataModelImpl.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java
Modified:
branches/RF-8742-1/
branches/RF-8742-1/core/api/src/main/java/org/richfaces/component/ComponentPredicates.java
branches/RF-8742-1/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java
branches/RF-8742-1/examples/input-demo/src/main/webapp/examples/calendar.xhtml
branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/LazyTreeNode.java
branches/RF-8742-1/examples/iteration-demo/src/main/webapp/index.xhtml
branches/RF-8742-1/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java
branches/RF-8742-1/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/progressbar.xhtml
branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
branches/RF-8742-1/examples/output-demo/src/main/webapp/templates/template.xhtml
branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java
branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java
branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar-utils.js
branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModel.java
branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataVisitor.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeRange.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeState.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
branches/RF-8742-1/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarState.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarStateEncoder.java
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
branches/RF-8742-1/ui/output/ui/src/main/templates/progressBar.template.xml
Log:
Merged revisions 20212-20217,20221-20222,20224,20226-20235 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r20212 | nbelaevski | 2010-11-29 12:14:12 -0800 (Mon, 29 Nov 2010) | 4 lines
Small progress bar fixes:
- Incorrect state displayed when no 'initial' or 'finish' facet was provided
- rf-pb class was not encoded
- Incorrect alignment in IE7
.......
r20213 | nbelaevski | 2010-11-29 12:28:16 -0800 (Mon, 29 Nov 2010) | 5 lines
RF-9680:
- Added children() method to TreeDataModel & tuples
- Related refactorings for UIDataAdaptor
- Redesign API for walking over model
- Renderer updated for new API
.......
r20214 | nbelaevski | 2010-11-29 12:36:39 -0800 (Mon, 29 Nov 2010) | 1 line
Added TODO to AbstractTree
.......
r20215 | nbelaevski | 2010-11-29 12:44:15 -0800 (Mon, 29 Nov 2010) | 1 line
RF-9680
.......
r20216 | nbelaevski | 2010-11-29 12:52:25 -0800 (Mon, 29 Nov 2010) | 1 line
https://jira.jboss.org/browse/RF-9680
.......
r20217 | nbelaevski | 2010-11-29 12:58:34 -0800 (Mon, 29 Nov 2010) | 1 line
https://jira.jboss.org/browse/RF-9680
.......
r20221 | abelevich | 2010-11-30 00:48:10 -0800 (Tue, 30 Nov 2010) | 1 line
fix rules
.......
r20222 | abelevich | 2010-11-30 01:11:39 -0800 (Tue, 30 Nov 2010) | 1 line
move from sandbox
.......
r20224 | abelevich | 2010-11-30 01:13:18 -0800 (Tue, 30 Nov 2010) | 1 line
.......
r20226 | abelevich | 2010-11-30 01:35:47 -0800 (Tue, 30 Nov 2010) | 1 line
add toolbar sample
.......
r20227 | abelevich | 2010-11-30 02:01:33 -0800 (Tue, 30 Nov 2010) | 1 line
fix renderer, add toolbar to the config files, remove package-info
.......
r20228 | abelevich | 2010-11-30 02:02:58 -0800 (Tue, 30 Nov 2010) | 1 line
add toolbar demo navigation case
.......
r20229 | abelevich | 2010-11-30 02:04:46 -0800 (Tue, 30 Nov 2010) | 1 line
add license headers
.......
r20230 | amarkhel | 2010-11-30 02:13:41 -0800 (Tue, 30 Nov 2010) | 1 line
RF-9871: JavaScript regular expression fixed.
.......
r20231 | amarkhel | 2010-11-30 02:30:22 -0800 (Tue, 30 Nov 2010) | 1 line
RF-9856: Check for undefined value of year, month and day added.
.......
r20232 | nbelaevski | 2010-11-30 02:32:04 -0800 (Tue, 30 Nov 2010) | 1 line
Removed DeclarativeTreeModel strangely duplicated
.......
r20233 | nbelaevski | 2010-11-30 02:34:56 -0800 (Tue, 30 Nov 2010) | 1 line
Corrected diagnostic exception message in TreeRendererBase.java
.......
r20234 | amarkhel | 2010-11-30 04:00:33 -0800 (Tue, 30 Nov 2010) | 1 line
RF-9837: Server side support for seconds pattern was added.
.......
r20235 | nbelaevski | 2010-11-30 06:37:17 -0800 (Tue, 30 Nov 2010) | 1 line
Removed DateTimeConverterTest
.......
Property changes on: branches/RF-8742-1
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-20207
+ /trunk:1-20241
Modified: branches/RF-8742-1/core/api/src/main/java/org/richfaces/component/ComponentPredicates.java
===================================================================
--- branches/RF-8742-1/core/api/src/main/java/org/richfaces/component/ComponentPredicates.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/core/api/src/main/java/org/richfaces/component/ComponentPredicates.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -31,6 +31,21 @@
*/
public final class ComponentPredicates {
+ private static final class WithIdPredicate implements Predicate<UIComponent> {
+
+ private final String id;
+
+ public WithIdPredicate(String id) {
+ super();
+ this.id = id;
+ }
+
+ public boolean apply(UIComponent input) {
+ return id.equals(input.getId());
+ }
+
+ }
+
private static final Predicate<UIComponent> IS_RENDERED = new Predicate<UIComponent>() {
public boolean apply(UIComponent input) {
return input.isRendered();
@@ -42,4 +57,12 @@
public static Predicate<UIComponent> isRendered() {
return IS_RENDERED;
}
+
+ public static Predicate<UIComponent> withId(String id) {
+ if (id == null) {
+ throw new NullPointerException("id");
+ }
+
+ return new WithIdPredicate(id);
+ }
}
Modified: branches/RF-8742-1/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java
===================================================================
--- branches/RF-8742-1/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/core/api/src/main/java/org/richfaces/log/RichfacesLogger.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -8,9 +8,9 @@
*
*/
public enum RichfacesLogger {
- RESOURCE("Resource"), RENDERKIT("Renderkit"), CONFIG("Config"), CONNECTION("Connection"),
- APPLICATION("Application"),
- CACHE("Cache"), CONTEXT("Context"), COMPONENTS("Components"), WEBAPP("Webapp"), UTIL("Util");
+ RESOURCE("Resource"), RENDERKIT("Renderkit"), CONFIG("Config"), CONNECTION("Connection"),
+ APPLICATION("Application"), CACHE("Cache"), CONTEXT("Context"), COMPONENTS("Components"),
+ WEBAPP("Webapp"), UTIL("Util"), MODEL("Model");
private static final String LOGGER_NAME_PREFIX = "org.richfaces.log.";
private String loggerName;
Modified: branches/RF-8742-1/examples/input-demo/src/main/webapp/examples/calendar.xhtml
===================================================================
--- branches/RF-8742-1/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -43,6 +43,7 @@
datePattern="#{calendarBean.pattern}"
dataModel="#{calendarDataModel}"
mode="#{calendarBean.mode}"
+ disabled="false"
showApplyButton="#{calendarBean.showApply}" cellWidth="24px"
cellHeight="22px" style="width:200px" minDaysInFirstWeek="3"
oncollapse="return onEvent.call(this, event);"
Modified: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/LazyTreeNode.java
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/LazyTreeNode.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/LazyTreeNode.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -93,11 +93,7 @@
}
public boolean isLeaf() {
- if (children == null) {
- return false;
- }
-
- return children.isEmpty();
+ return false;
}
public Enumeration children() {
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree)
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,61 +0,0 @@
-/**
- *
- */
-package org.richfaces.demo.model.tree;
-
-import javax.faces.FacesException;
-import javax.faces.bean.ApplicationScoped;
-import javax.faces.bean.ManagedBean;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.Unmarshaller.Listener;
-
-import org.richfaces.demo.model.tree.adaptors.Entry;
-import org.richfaces.demo.model.tree.adaptors.Root;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 25.07.2007
- *
- */
-@ManagedBean
-@ApplicationScoped
-public class TreeModelBean {
-
- private Root root;
-
- private void initializeRoot() {
-
- try {
- JAXBContext context = JAXBContext.newInstance(Root.class);
- Unmarshaller unmarshaller = context.createUnmarshaller();
- unmarshaller.setListener(new Listener() {
- @Override
- public void afterUnmarshal(Object target, Object parent) {
- super.afterUnmarshal(target, parent);
-
- if (parent instanceof Entry) {
- ((Entry) target).setParent((Entry) parent);
- }
-
- }
- });
-
-
- root = (Root) unmarshaller.unmarshal(TreeModelBean.class.getResource("tree-model-data.xml"));
- } catch (JAXBException e) {
- throw new FacesException(e.getMessage(), e);
- }
- }
-
- public Root getRoot() {
- if (root == null) {
- initializeRoot();
- }
-
- return root;
- }
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/TreeModelBean.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,61 @@
+/**
+ *
+ */
+package org.richfaces.demo.model.tree;
+
+import javax.faces.FacesException;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Unmarshaller.Listener;
+
+import org.richfaces.demo.model.tree.adaptors.Entry;
+import org.richfaces.demo.model.tree.adaptors.Root;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 25.07.2007
+ *
+ */
+@ManagedBean
+@ApplicationScoped
+public class TreeModelBean {
+
+ private Root root;
+
+ private void initializeRoot() {
+
+ try {
+ JAXBContext context = JAXBContext.newInstance(Root.class);
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ unmarshaller.setListener(new Listener() {
+ @Override
+ public void afterUnmarshal(Object target, Object parent) {
+ super.afterUnmarshal(target, parent);
+
+ if (parent instanceof Entry) {
+ ((Entry) target).setParent((Entry) parent);
+ }
+
+ }
+ });
+
+
+ root = (Root) unmarshaller.unmarshal(TreeModelBean.class.getResource("tree-model-data.xml"));
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ public Root getRoot() {
+ if (root == null) {
+ initializeRoot();
+ }
+
+ return root;
+ }
+
+}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors)
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 04.08.2007
- *
- */
-public class ArchiveEntry extends Entry {
-
- @XmlElement(name = "archiveEntry")
- private List<ArchiveEntry> archiveEntries;
-
- @XmlElement(name = "archiveEntryFile")
- private List<ArchiveEntry> archiveEntryFiles;
-
- public List<ArchiveEntry> getArchiveEntries() {
- return archiveEntries;
- }
-
- public List<ArchiveEntry> getArchiveEntryFiles() {
- return archiveEntryFiles;
- }
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveEntry.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 04.08.2007
+ *
+ */
+public class ArchiveEntry extends Entry {
+
+ @XmlElement(name = "archiveEntry")
+ private List<ArchiveEntry> archiveEntries;
+
+ @XmlElement(name = "archiveEntryFile")
+ private List<ArchiveEntry> archiveEntryFiles;
+
+ public List<ArchiveEntry> getArchiveEntries() {
+ return archiveEntries;
+ }
+
+ public List<ArchiveEntry> getArchiveEntryFiles() {
+ return archiveEntryFiles;
+ }
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-import com.google.common.collect.Lists;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 04.08.2007
- *
- */
-public class ArchiveFile extends File {
-
- @XmlElement(name = "archiveEntry")
- private List<ArchiveEntry> archiveEntries = Lists.newArrayList();
-
- public List<ArchiveEntry> getArchiveEntries() {
- return archiveEntries;
- }
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/ArchiveFile.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 04.08.2007
+ *
+ */
+public class ArchiveFile extends File {
+
+ @XmlElement(name = "archiveEntry")
+ private List<ArchiveEntry> archiveEntries = Lists.newArrayList();
+
+ public List<ArchiveEntry> getArchiveEntries() {
+ return archiveEntries;
+ }
+
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,29 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-
-/**
- * @author Nick Belaevski
- */
-public class Class extends Entry {
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Class.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+
+/**
+ * @author Nick Belaevski
+ */
+public class Class extends Entry {
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 24.07.2007
- *
- */
-public class Directory extends Entry {
-
- @XmlElement(name = "directory")
- private List<Directory> directories;
-
- @XmlElement(name = "file")
- private List<File> files;
-
- @XmlElement(name = "archive")
- private List<ArchiveFile> archiveFiles;
-
- public List<Directory> getDirectories() {
- return directories;
- }
-
- public List<File> getFiles() {
- return files;
- }
-
- public List<ArchiveFile> getArchiveFiles() {
- return archiveFiles;
- }
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Directory.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 24.07.2007
+ *
+ */
+public class Directory extends Entry {
+
+ @XmlElement(name = "directory")
+ private List<Directory> directories;
+
+ @XmlElement(name = "file")
+ private List<File> files;
+
+ @XmlElement(name = "archive")
+ private List<ArchiveFile> archiveFiles;
+
+ public List<Directory> getDirectories() {
+ return directories;
+ }
+
+ public List<File> getFiles() {
+ return files;
+ }
+
+ public List<ArchiveFile> getArchiveFiles() {
+ return archiveFiles;
+ }
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 29.07.2007
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-public abstract class Entry {
-
- @XmlAttribute
- private String name;
-
- private Entry parent;
-
- public String getPath() {
- List<Entry> entries = Lists.newLinkedList();
-
- Entry entry = this;
- while (entry != null) {
- entries.add(0, entry);
- entry = entry.getParent();
- }
-
- return Joiner.on(" -> ").join(entries);
- }
-
- public void processClick() {
- FacesContext context = FacesContext.getCurrentInstance();
-
- context.addMessage(null, new FacesMessage(getPath()));
- }
-
- public String toString() {
- return getClass().getSimpleName() + " [" + getName() + "]";
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void click() {
- }
-
- public Entry getParent() {
- return parent;
- }
-
- public void setParent(Entry parent) {
- this.parent = parent;
- }
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Entry.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 29.07.2007
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public abstract class Entry {
+
+ @XmlAttribute
+ private String name;
+
+ private Entry parent;
+
+ public String getPath() {
+ List<Entry> entries = Lists.newLinkedList();
+
+ Entry entry = this;
+ while (entry != null) {
+ entries.add(0, entry);
+ entry = entry.getParent();
+ }
+
+ return Joiner.on(" -> ").join(entries);
+ }
+
+ public void processClick() {
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ context.addMessage(null, new FacesMessage(getPath()));
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + " [" + getName() + "]";
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void click() {
+ }
+
+ public Entry getParent() {
+ return parent;
+ }
+
+ public void setParent(Entry parent) {
+ this.parent = parent;
+ }
+
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 25.07.2007
- *
- */
-public class File extends Entry {
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/File.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 25.07.2007
+ *
+ */
+public class File extends Entry {
+
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-/**
- * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
- *
- */
-public class Package extends Entry {
-
- @XmlElement(name = "class")
- private List<Class> classes;
-
- public List<Class> getClasses() {
- return classes;
- }
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Package.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
+ *
+ */
+public class Package extends Entry {
+
+ @XmlElement(name = "class")
+ private List<Class> classes;
+
+ public List<Class> getClasses() {
+ return classes;
+ }
+
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 24.07.2007
- *
- */
-public class Project extends Entry {
-
- @XmlElement(name = "sourceDirectory")
- private List<SourceDirectory> sourceDirectories;
-
- @XmlElement(name = "directory")
- private List<Directory> commonDirectories;
-
- public List<SourceDirectory> getSourceDirectories() {
- return sourceDirectories;
- }
-
- public List<Directory> getCommonDirectories() {
- return commonDirectories;
- }
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Project.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 24.07.2007
+ *
+ */
+public class Project extends Entry {
+
+ @XmlElement(name = "sourceDirectory")
+ private List<SourceDirectory> sourceDirectories;
+
+ @XmlElement(name = "directory")
+ private List<Directory> commonDirectories;
+
+ public List<SourceDirectory> getSourceDirectories() {
+ return sourceDirectories;
+ }
+
+ public List<Directory> getCommonDirectories() {
+ return commonDirectories;
+ }
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author Nick Belaevski
- *
- */
-@XmlRootElement(name = "root")
-public class Root {
-
- @XmlElement(name = "project")
- private List<Project> projects;
-
- public List<Project> getProjects() {
- return projects;
- }
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/Root.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@XmlRootElement(name = "root")
+public class Root {
+
+ @XmlElement(name = "project")
+ private List<Project> projects;
+
+ public List<Project> getProjects() {
+ return projects;
+ }
+
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-/**
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class SimpleRecursiveNode {
-
- private SimpleRecursiveNode parent;
-
- private List<SimpleRecursiveNode> children = Lists.newArrayList();
-
- private String text;
-
- public SimpleRecursiveNode(SimpleRecursiveNode parent, String text) {
- super();
- this.parent = parent;
- if (parent != null) {
- parent.addChild(this);
- }
- this.text = text;
- }
-
- public void addChild(SimpleRecursiveNode node) {
- children.add(node);
- }
-
- public void removeChild(SimpleRecursiveNode node) {
- children.remove(node);
- }
-
- public void remove() {
- if (parent != null) {
- parent.removeChild(this);
- }
- }
-
- public SimpleRecursiveNode getParent() {
- return parent;
- }
-
- public List<SimpleRecursiveNode> getChildren() {
- return children;
- }
-
- public String getText() {
- return text;
- }
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class SimpleRecursiveNode {
+
+ private SimpleRecursiveNode parent;
+
+ private List<SimpleRecursiveNode> children = Lists.newArrayList();
+
+ private String text;
+
+ public SimpleRecursiveNode(SimpleRecursiveNode parent, String text) {
+ super();
+ this.parent = parent;
+ if (parent != null) {
+ parent.addChild(this);
+ }
+ this.text = text;
+ }
+
+ public void addChild(SimpleRecursiveNode node) {
+ children.add(node);
+ }
+
+ public void removeChild(SimpleRecursiveNode node) {
+ children.remove(node);
+ }
+
+ public void remove() {
+ if (parent != null) {
+ parent.removeChild(this);
+ }
+ }
+
+ public SimpleRecursiveNode getParent() {
+ return parent;
+ }
+
+ public List<SimpleRecursiveNode> getChildren() {
+ return children;
+ }
+
+ public String getText() {
+ return text;
+ }
+}
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.richfaces.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 24.07.2007
- *
- */
-public class SourceDirectory extends Entry {
-
- @XmlElement(name = "package")
- private List<Package> packages;
-
- public List<Package> getPackages() {
- return packages;
- }
-
-}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java (from rev 20235, trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.demo.model.tree.adaptors;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 24.07.2007
+ *
+ */
+public class SourceDirectory extends Entry {
+
+ @XmlElement(name = "package")
+ private List<Package> packages;
+
+ public List<Package> getPackages() {
+ return packages;
+ }
+
+}
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model (from rev 20235, trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/model)
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree (from rev 20235, trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree)
Deleted: branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<root>
- <project name="ajax4jsf">
- <sourceDirectory name="src/main/java">
- <package name="org.ajax4jsf">
- <class name="FastFilter.java" />
- <class name="Filter.java" />
- </package>
- <package name="org.ajax4jsf.component">
- <class name="UIDataAdaptor.java" />
- <class name="AjaxActionComponent.java" />
- </package>
- <package name="org.ajax4jsf.renderkit">
- <class name="AjaxChildrenRenderer.java" />
- <class name="AjaxComponentRendererBase.java" />
- </package>
- </sourceDirectory>
- <sourceDirectory name="src/main/resources">
- <package name="org.ajax4jsf">
- </package>
- <package name="org.ajax4jsf.javascript">
- </package>
- </sourceDirectory>
- </project>
-
- <project name="richfaces">
- <sourceDirectory name="src/main/java">
- <package name="org.richfaces">
- </package>
- <package name="org.richfaces.component">
- </package>
- <package name="org.richfaces.model">
- </package>
- </sourceDirectory>
- <sourceDirectory name="src/main/resources">
- <package name="org.richfaces">
- </package>
- <package name="org.richfaces.renderkit">
- </package>
- </sourceDirectory>
- <sourceDirectory name="target/generated/java">
- <package name="org.richfaces">
- </package>
- <package name="org.richfaces.component">
- </package>
- <package name="org.richfaces.renderkit">
- </package>
- </sourceDirectory>
- <directory name="design">
- <directory name="funcspec">
- <file name="FunctionalSpecification-1.0.doc" />
- <file name="Requirements-1.0.doc" />
- </directory>
- </directory>
- <directory name="src">
- <directory name="main">
- <directory name="config">
- <directory name="org">
- <directory name="richfaces">
- <directory name="component">
- <file name="tree.config.xml" />
- <file name="treeNode.config.xml" />
- </directory>
- </directory>
- </directory>
- </directory>
- <directory name="templates"></directory>
- </directory>
- <directory name="test"></directory>
- </directory>
- <directory name="target">
- <directory name="generated-component">
- </directory>
- <directory name="surefire-reports">
- <file name="org.richfaces.JSFComponentTest.txt" />
- <file name="TEST-ComponentTest.xml" />
- </directory>
- <file name="richfaces-3.1.0-snapshot" />
- <file name="richfaces-3.1.0-javadoc" />
- <archive name="richfaces-3.1.0-sources">
- <archiveEntry name="org">
- <archiveEntry name="richfaces">
- <archiveEntry name="component">
- <archiveEntryFile name="UITree" />
- <archiveEntryFile name="UITreeNode" />
- <archiveEntryFile name="UICalendar" />
- <archiveEntryFile name="UIRangedNumberInput" />
- </archiveEntry>
- </archiveEntry>
- </archiveEntry>
- </archive>
- </directory>
- </project>
-</root>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml (from rev 20235, trunk/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/resources/org/richfaces/demo/model/tree/tree-model-data.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+ <project name="ajax4jsf">
+ <sourceDirectory name="src/main/java">
+ <package name="org.ajax4jsf">
+ <class name="FastFilter.java" />
+ <class name="Filter.java" />
+ </package>
+ <package name="org.ajax4jsf.component">
+ <class name="UIDataAdaptor.java" />
+ <class name="AjaxActionComponent.java" />
+ </package>
+ <package name="org.ajax4jsf.renderkit">
+ <class name="AjaxChildrenRenderer.java" />
+ <class name="AjaxComponentRendererBase.java" />
+ </package>
+ </sourceDirectory>
+ <sourceDirectory name="src/main/resources">
+ <package name="org.ajax4jsf">
+ </package>
+ <package name="org.ajax4jsf.javascript">
+ </package>
+ </sourceDirectory>
+ </project>
+
+ <project name="richfaces">
+ <sourceDirectory name="src/main/java">
+ <package name="org.richfaces">
+ </package>
+ <package name="org.richfaces.component">
+ </package>
+ <package name="org.richfaces.model">
+ </package>
+ </sourceDirectory>
+ <sourceDirectory name="src/main/resources">
+ <package name="org.richfaces">
+ </package>
+ <package name="org.richfaces.renderkit">
+ </package>
+ </sourceDirectory>
+ <sourceDirectory name="target/generated/java">
+ <package name="org.richfaces">
+ </package>
+ <package name="org.richfaces.component">
+ </package>
+ <package name="org.richfaces.renderkit">
+ </package>
+ </sourceDirectory>
+ <directory name="design">
+ <directory name="funcspec">
+ <file name="FunctionalSpecification-1.0.doc" />
+ <file name="Requirements-1.0.doc" />
+ </directory>
+ </directory>
+ <directory name="src">
+ <directory name="main">
+ <directory name="config">
+ <directory name="org">
+ <directory name="richfaces">
+ <directory name="component">
+ <file name="tree.config.xml" />
+ <file name="treeNode.config.xml" />
+ </directory>
+ </directory>
+ </directory>
+ </directory>
+ <directory name="templates"></directory>
+ </directory>
+ <directory name="test"></directory>
+ </directory>
+ <directory name="target">
+ <directory name="generated-component">
+ </directory>
+ <directory name="surefire-reports">
+ <file name="org.richfaces.JSFComponentTest.txt" />
+ <file name="TEST-ComponentTest.xml" />
+ </directory>
+ <file name="richfaces-3.1.0-snapshot" />
+ <file name="richfaces-3.1.0-javadoc" />
+ <archive name="richfaces-3.1.0-sources">
+ <archiveEntry name="org">
+ <archiveEntry name="richfaces">
+ <archiveEntry name="component">
+ <archiveEntryFile name="UITree" />
+ <archiveEntryFile name="UITreeNode" />
+ <archiveEntryFile name="UICalendar" />
+ <archiveEntryFile name="UIRangedNumberInput" />
+ </archiveEntry>
+ </archiveEntry>
+ </archiveEntry>
+ </archive>
+ </directory>
+ </project>
+</root>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/compress.png (from rev 20235, trunk/examples/iteration-demo/src/main/webapp/images/compress.png)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/compress.png (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/compress.png 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,7 @@
+�PNG
+
+
+��BQA�t#��݈��U+YH]�.��6�,��.�t�BJ7""�U�-b��̴�������I�����܇��������3`���V��T�>wGU���ca��^=v���u�������js��kO�m�T�֘�؉�cf�n�ŕ��o��S�
+�w����{�&���
\ No newline at end of file
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder.png (from rev 20235, trunk/examples/iteration-demo/src/main/webapp/images/folder.png)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder.png (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder.png 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,11 @@
+�PNG
+
+
+���ݬ����2OT�O�1W��/�`z����8%�;O;�9P#�9B�����}�^��nO������;�����Ǫo��~
+���d���~�Ed�p�ɳ_��_
+�u�I�
+��B�
+�!
+CF(N��߃J,$���k����(!���TA��F*$X����(�}�f�R�/�x�Q��
+�E�q��x!��i3,�mf?Oԓn����A�Q�
\ No newline at end of file
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_key.png (from rev 20235, trunk/examples/iteration-demo/src/main/webapp/images/folder_key.png)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_key.png (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_key.png 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,7 @@
+�PNG
+
+
+b�������l���Hɜ�#�->����J�-������
\ No newline at end of file
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_page.png (from rev 20235, trunk/examples/iteration-demo/src/main/webapp/images/folder_page.png)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_page.png (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/folder_page.png 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,9 @@
+�PNG
+
+
+�+��Z�։�����啗�9��n��@MLk�Z!�jȅ֯-\1�eS�s~�������J-��0e����U�l���ʖ����?]:���fh�BU�
+s��w��v����[���d@ʤ�����p Z�jU��睼p �L�9z��)d���k`Z6��j���B�{
+ h�E?�\�F�~0_����XŻ���{lc�^-e��@&mesm�t)��P�����ԛ�ō˯����#��H��-i�s9��@�r|�
\ No newline at end of file
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/page_white_cup.png (from rev 20235, trunk/examples/iteration-demo/src/main/webapp/images/page_white_cup.png)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/page_white_cup.png (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/images/page_white_cup.png 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,7 @@
+�PNG
+
+
+>������,i6��V�g�ш�p����>���G�.��ç�O�m�5~}�B���yt:�3��f���9'L�\�ە��i��n�h4�e����I�R��Ár���Z.�C"��q*�b(Db�/�N���~
+�/�J铠�n�l6�|6�q��@�R�ŽL&�
+�ڥHB�$�z��=*>'�5�RyW���b1�h�Z, �Bp:����Z!NO��B�KX�V�g�d���� h >���=��Yp*�%�h�2��#��k�M�\�:�����{�F`k��
\ No newline at end of file
Modified: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/index.xhtml
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/index.xhtml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/index.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -14,6 +14,7 @@
<li><h:link outcome="filteringAndSorting">filtering and sorting feature</h:link></li>
<li><h:link outcome="list">rich:list</h:link></li>
<li><h:link outcome="tree">rich:tree</h:link></li>
+ <li><h:link outcome="treeModel">rich:treeModelAdaptor and rich:treeModelRecursiveAdaptor</h:link></li>
</ul>
Copied: branches/RF-8742-1/examples/iteration-demo/src/main/webapp/treeModel.xhtml (from rev 20235, trunk/examples/iteration-demo/src/main/webapp/treeModel.xhtml)
===================================================================
--- branches/RF-8742-1/examples/iteration-demo/src/main/webapp/treeModel.xhtml (rev 0)
+++ branches/RF-8742-1/examples/iteration-demo/src/main/webapp/treeModel.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces Tree Models</title>
+</h:head>
+
+<h:body>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages id="messages" />
+ </a4j:outputPanel>
+
+ <h:form id="form">
+ <it:tree id="tree" var="node" toggleType="ajax">
+ <it:treeNode>
+ <a4j:commandLink value="#{node}" action="#{node.processClick}" />
+ </it:treeNode>
+
+ <it:treeModelAdaptor nodes="#{treeModelBean.root.projects}">
+ <it:treeNode iconExpanded="/images/folder_key.png" iconCollapsed="/images/folder_key.png">
+ <a4j:commandLink value="#{node}" action="#{node.processClick}" />
+ </it:treeNode>
+
+ <it:treeModelAdaptor nodes="#{node.sourceDirectories}">
+ <it:treeNode iconExpanded="/images/page_white_cup.png" iconCollapsed="/images/page_white_cup.png">
+ <a4j:commandLink value="#{node}" action="#{node.processClick}" />
+ </it:treeNode>
+
+ <it:treeModelAdaptor nodes="#{node.packages}">
+ <it:treeModelAdaptor nodes="#{node.classes}" />
+ </it:treeModelAdaptor>
+ </it:treeModelAdaptor>
+
+ <it:treeModelRecursiveAdaptor roots="#{node.commonDirectories}" nodes="#{node.directories}">
+ <it:treeNode iconExpanded="/images/folder_page.png" iconCollapsed="/images/folder.png">
+ <a4j:commandLink value="#{node}" action="#{node.processClick}" />
+ </it:treeNode>
+
+ <it:treeModelRecursiveAdaptor roots="#{node.archiveFiles}" nodes="#{node.archiveEntries}">
+
+ <it:treeNode rendered="#{node.class.simpleName eq 'ArchiveFile'}"
+ iconExpanded="/images/compress.png"
+ iconCollapsed="/images/compress.png">
+ <a4j:commandLink value="#{node}" action="#{node.processClick}" />
+ </it:treeNode>
+
+ <it:treeModelAdaptor rendered="#{node.class.simpleName eq 'ArchiveEntry'}"
+ nodes="#{node.archiveEntryFiles}" />
+ </it:treeModelRecursiveAdaptor>
+ <it:treeModelAdaptor nodes="#{node.files}" />
+ </it:treeModelRecursiveAdaptor>
+ </it:treeModelAdaptor>
+ </it:tree>
+ </h:form>
+
+ <h:panelGroup style="margin-top: 20px;">
+ <hr />
+ This demo uses icons taken from <a href="http://www.famfamfam.com/lab/icons/silk/">http://www.famfamfam.com/lab/icons/silk/</a>
+ </h:panelGroup>
+</h:body>
+</html>
Modified: branches/RF-8742-1/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -31,7 +31,11 @@
private boolean childrenRendered = false;
private boolean enabled = false;
-
+
+ private boolean initialFacetRendered = true;
+
+ private boolean finishFacetRendered = true;
+
public boolean isEnabled() {
return enabled;
}
@@ -80,6 +84,22 @@
this.childrenRendered = childrenRendered;
}
+ public boolean isInitialFacetRendered() {
+ return initialFacetRendered;
+ }
+
+ public void setInitialFacetRendered(boolean renderInitialFacet) {
+ this.initialFacetRendered = renderInitialFacet;
+ }
+
+ public boolean isFinishFacetRendered() {
+ return finishFacetRendered;
+ }
+
+ public void setFinishFacetRendered(boolean renderFinishFacet) {
+ this.finishFacetRendered = renderFinishFacet;
+ }
+
public void decreaseValueByFive() {
value -= 5;
}
Modified: branches/RF-8742-1/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -108,6 +108,13 @@
<navigation-case>
<from-outcome>qunit/tooltip</from-outcome>
<to-view-id>/qunit/tooltip.xhtml</to-view-id>
- </navigation-case>
+ </navigation-case>
+
+ <!-- Toolbar navigation -->
+ <navigation-case>
+ <from-outcome>toolbar</from-outcome>
+ <to-view-id>/examples/toolbar.xhtml</to-view-id>
+ </navigation-case>
+
</navigation-rule>
</faces-config>
Modified: branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/progressbar.xhtml
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/progressbar.xhtml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/progressbar.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -41,6 +41,14 @@
<br />
+ 'initial' facet rendered: <h:selectBooleanCheckbox value="#{progressBarBean.initialFacetRendered}" onclick="submit()" />
+
+ <br />
+
+ 'finish' facet rendered: <h:selectBooleanCheckbox value="#{progressBarBean.finishFacetRendered}" onclick="submit()" />
+
+ <br />
+
Enabled: <h:selectBooleanCheckbox value="#{progressBarBean.enabled}" onclick="submit()" />
</h:form>
@@ -54,11 +62,15 @@
<h:outputText value="child + " rendered="#{progressBarBean.childrenRendered}" />
<f:facet name="initial">
- <h:outputText value="In initial state" />
+ <h:panelGroup rendered="#{progressBarBean.initialFacetRendered}">
+ <h:outputText value="In initial state" />
+ </h:panelGroup>
</f:facet>
<f:facet name="finish">
- <h:outputText value="Finished progress" />
+ <h:panelGroup rendered="#{progressBarBean.finishFacetRendered}">
+ <h:outputText value="Finished progress" />
+ </h:panelGroup>
</f:facet>
</rich:progressBar>
@@ -78,11 +90,15 @@
<h:outputText value="child + " rendered="#{progressBarBean.childrenRendered}" />
<f:facet name="initial">
- <h:outputText value="initial ~ #{progressBarBean.currentTimeAsString}" />
+ <h:panelGroup rendered="#{progressBarBean.initialFacetRendered}">
+ <h:outputText value="initial ~ #{progressBarBean.currentTimeAsString}" />
+ </h:panelGroup>
</f:facet>
<f:facet name="finish">
- <h:outputText value="finish ~ #{progressBarBean.currentTimeAsString}" />
+ <h:panelGroup rendered="#{progressBarBean.finishFacetRendered}">
+ <h:outputText value="finish ~ #{progressBarBean.currentTimeAsString}" />
+ </h:panelGroup>
</f:facet>
</rich:progressBar>
Modified: branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -27,6 +27,12 @@
Click me :) it is toggle control
</h:outputLink>
+ <h:outputLink>
+ <pn:toggleControl targetPanel="my_id" targetItem="name1" event="click" />
+
+ Click me :) it another toggle control
+ </h:outputLink>
+
</h:form>
</ui:define>
</ui:composition>
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml (from rev 20235, trunk/examples/output-demo/src/main/webapp/examples/toolbar.xhtml)
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml (rev 0)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,82 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:tb="http://richfaces.org/output">
+ <h:head>
+ <title>ToolBar sample</title>
+ <style>
+ .pic {
+ margin-bottom: -4px;
+ margin-right: 2px;
+ }
+ </style>
+ </h:head>
+ <h:body>
+ <tb:toolBar height="45" itemSeparator="grid" contentStyle="color:red;">
+ <f:facet name="itemSeparator">
+ ||
+ </f:facet>
+ <tb:toolBarGroup itemSeparator="line" onitemclick="22">
+ <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic"/>
+ <a href="sdsd">link 1</a> Text
+ <a href="sdsd 2">link 2</a>
+ <h:graphicImage value="/images/icons/create_folder.gif" styleClass="pic" onclick="q1"/>
+ <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
+ <a href="sdsd">link 3</a> Text
+ <a href="sdsd 2">link 4</a>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup itemSeparator="none">
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup itemSeparator="line">
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ </tb:toolBarGroup>
+
+ <tb:toolBarGroup location="right" itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/filter.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ </tb:toolBar>
+ <br/>
+ <tb:toolBar itemSeparator="grid">
+ <tb:toolBarGroup itemSeparator="line">
+ <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/create_folder.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup itemSeparator="disc">
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/save_as.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/save_all.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup location="right" itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/filter.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ </tb:toolBar>
+
+ <br/>
+ <tb:toolBar height="26" itemSeparator="grid">
+ <tb:toolBarGroup itemSeparator="line">
+ <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/create_folder.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup itemSeparator="disc">
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/save_as.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/save_all.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup location="right" itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/filter.gif" styleClass="pic"/>
+ </tb:toolBarGroup>
+ </tb:toolBar>
+ </h:body>
+</html>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images (from rev 20235, trunk/examples/output-demo/src/main/webapp/images)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/GridSeparatorImage.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/GridSeparatorImage.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/GridSeparatorImage.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/arrow.png
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/arrow.png (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/arrow.png)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/copy.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/copy.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/copy.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_doc.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_doc.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/create_doc.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_folder.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/create_folder.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/create_folder.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/cut.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/cut.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/cut.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/delete.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/delete.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/delete.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/edit.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/edit.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/edit.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/filter.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/filter.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/filter.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/find.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/find.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/find.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_group.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_group.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/ico_new_group.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_item.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/ico_new_item.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/ico_new_item.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/open.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/open.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/open.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/paste.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/paste.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/paste.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/redo.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/redo.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/redo.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/reload.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/reload.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/reload.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/repeat.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/repeat.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/repeat.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/save.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_all.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_all.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/save_all.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_as.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/save_as.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/save_as.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/undo.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/undo.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/undo.gif)
===================================================================
(Binary files differ)
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/verify.gif
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/output-demo/src/main/webapp/images/icons/verify.gif (from rev 20235, trunk/examples/output-demo/src/main/webapp/images/icons/verify.gif)
===================================================================
(Binary files differ)
Modified: branches/RF-8742-1/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -143,6 +143,18 @@
</ul>
</li>
</ul>
+
+ <p>Toolbar</p>
+ <ul>
+ <li>
+ <p>Examples</p>
+ <ul>
+ <li>
+ <h:commandLink value="Toolbar" action="toolbar"/>
+ </li>
+ </ul>
+ </li>
+ </ul>
</h:form>
</td>
Modified: branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java
===================================================================
--- branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/RowKeyContextEventWrapper.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -23,26 +23,34 @@
package org.richfaces.component;
import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
import javax.faces.event.PhaseId;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
/**
* @author Nick Belaevski
*/
-class RowKeyContextEventWrapper extends FacesEvent {
+public class RowKeyContextEventWrapper extends FacesEvent {
- /**
- *
- */
private static final long serialVersionUID = -869970815228914529L;
+
+ private static final Logger LOGGER = RichfacesLogger.COMPONENTS.getLogger();
+
private FacesEvent event;
- private Object rowKey;
+ private Object eventRowKey;
- public RowKeyContextEventWrapper(UIComponent component, FacesEvent event, Object rowKey) {
+ private Object initialRowKey;
+
+ public RowKeyContextEventWrapper(UIDataAdaptor component, FacesEvent event, Object eventRowKey) {
super(component);
+
this.event = event;
- this.rowKey = rowKey;
+ this.eventRowKey = eventRowKey;
}
public FacesEvent getFacesEvent() {
@@ -65,10 +73,54 @@
throw new IllegalStateException();
}
- /**
- * @return the rowKey
- */
- public Object getRowKey() {
- return rowKey;
+ public UIDataAdaptor getComponent() {
+ return (UIDataAdaptor) super.getComponent();
}
+
+ public Object getEventRowKey() {
+ return eventRowKey;
+ }
+
+ protected void setupEventContext(FacesContext facesContext) {
+ getComponent().setRowKey(facesContext, getEventRowKey());
+ }
+
+ public void broadcast(FacesContext context) throws AbortProcessingException {
+ // Set up the correct context and fire our wrapped event
+ UIDataAdaptor dataAdaptor = getComponent();
+ initialRowKey = dataAdaptor.getRowKey();
+
+ UIComponent compositeParent = null;
+
+ UIComponent targetComponent = event.getComponent();
+
+ try {
+ if (!UIComponent.isCompositeComponent(targetComponent)) {
+ compositeParent = UIComponent.getCompositeComponentParent(targetComponent);
+ }
+
+ if (compositeParent != null) {
+ compositeParent.pushComponentToEL(context, null);
+ }
+
+ setupEventContext(context);
+
+ targetComponent.pushComponentToEL(context, null);
+ targetComponent.broadcast(event);
+ } finally {
+ try {
+ dataAdaptor.setRowKey(context, initialRowKey);
+ } catch (Exception e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+
+ initialRowKey = null;
+
+ targetComponent.popComponentFromEL(context);
+
+ if (compositeParent != null) {
+ compositeParent.popComponentFromEL(context);
+ }
+ }
+ }
}
Modified: branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -29,7 +29,6 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
import javax.el.ValueExpression;
import javax.faces.FacesException;
@@ -244,6 +243,7 @@
//TODO nick - PSH support?
private DataComponentState componentState = null;
private ExtendedDataModel<?> extendedDataModel = null;
+
private Object rowKey = null;
private String clientId;
@@ -348,18 +348,6 @@
}
/*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.component.AjaxChildrenEncoder#encodeAjaxChild(javax.faces.context.FacesContext,
- * java.lang.String, java.util.Set, java.util.Set)
- */
- public void encodeAjaxChild(FacesContext context, String path, Set<String> ids, Set<String> renderedAreas)
- throws IOException {
-
- // TODO Auto-generated method stub
- }
-
- /*
* (non-Javadoc)
* @see javax.faces.component.UniqueIdVendor#createUniqueId(javax.faces.context.FacesContext, java.lang.String)
*/
@@ -391,13 +379,17 @@
*/
public void setRowKey(FacesContext facesContext, Object rowKey) {
this.saveChildState(facesContext);
+
this.rowKey = rowKey;
- this.clientId = null;
+
getExtendedDataModel().setRowKey(rowKey);
+
+ this.clientId = null;
boolean rowSelected = (rowKey != null) && isRowAvailable();
setupVariable(facesContext, rowSelected);
+
this.restoreChildState(facesContext);
}
@@ -546,13 +538,13 @@
setRowKey(getFacesContext(), rowKey);
}
- /*
- * (non-Javadoc)
- * @see javax.faces.component.UIComponentBase#queueEvent(javax.faces.event.FacesEvent)
- */
+ protected FacesEvent wrapEvent(FacesEvent event) {
+ return new RowKeyContextEventWrapper(this, event, getRowKey());
+ }
+
@Override
public void queueEvent(FacesEvent event) {
- super.queueEvent(new RowKeyContextEventWrapper(this, event, getRowKey()));
+ super.queueEvent(wrapEvent(event));
}
/*
@@ -561,64 +553,16 @@
*/
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException {
- if (!(event instanceof RowKeyContextEventWrapper)) {
- if (!broadcastLocal(event)) {
- super.broadcast(event);
- }
-
- return;
+ if (event instanceof RowKeyContextEventWrapper) {
+ RowKeyContextEventWrapper eventWrapper = (RowKeyContextEventWrapper) event;
+
+ eventWrapper.broadcast(getFacesContext());
+ } else {
+ super.broadcast(event);
}
-
- FacesContext context = getFacesContext();
-
- // Set up the correct context and fire our wrapped event
- RowKeyContextEventWrapper revent = (RowKeyContextEventWrapper) event;
- Object oldRowKey = getRowKey();
-
- setRowKey(context, revent.getRowKey());
-
- FacesEvent rowEvent = revent.getFacesEvent();
- UIComponent source = rowEvent.getComponent();
- UIComponent compositeParent = null;
-
- try {
- if (!UIComponent.isCompositeComponent(source)) {
- compositeParent = UIComponent.getCompositeComponentParent(source);
- }
-
- if (compositeParent != null) {
- compositeParent.pushComponentToEL(context, null);
- }
-
- source.pushComponentToEL(context, null);
- source.broadcast(rowEvent);
- } finally {
- source.popComponentFromEL(context);
-
- if (compositeParent != null) {
- compositeParent.popComponentFromEL(context);
- }
- }
-
- setRowKey(context, oldRowKey);
}
/**
- * Process events targetted for concrete implementation. Hook method called
- * from {@link #broadcast(FacesEvent)}
- *
- * @param event -
- * processed event.
- * @return true if event processed, false if component must continue
- * processing.
- */
-
- // TODO - is it still actual?
- protected boolean broadcastLocal(FacesEvent event) {
- return false;
- }
-
- /**
* @return the extendedDataModel
*/
protected ExtendedDataModel<?> getExtendedDataModel() {
Modified: branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java
===================================================================
--- branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -72,15 +72,15 @@
return new ValueExpressionMetadata(name, type, attribute);
} else if (meta != null && meta.getWriteMethod(name) != null) {
- if (EXECUTE.equals(name) || RENDER.equals(name)) {
- return new LiteralAttributeMetadata(name, attribute.getValue());
- }
+ return new LiteralAttributeMetadata(name, attribute.getValue());
}
}
return null;
}
-
+
+
+
public static final class AjaxBehaviorListenerMapper extends Metadata {
private final TagAttribute attr;
Modified: branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
===================================================================
--- branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/core/ui/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -83,7 +83,7 @@
}
return new ValueExpressionMetadata(name, type, attribute);
- } else {
+ } else if(meta != null && meta.getWriteMethod(name) != null) {
return new LiteralAttributeMetadata(name, attribute.getValue());
}
}
Modified: branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -147,6 +147,8 @@
private static final String HOURS_VALUE = "hours";
private static final String MINUTES_VALUE = "minutes";
+
+ private static final String SECONDS_VALUE = "seconds";
protected void doDecode(FacesContext context, UIComponent component) {
if (!(component instanceof AbstractCalendar)) {
@@ -401,10 +403,12 @@
calendar.setTime(date);
int hours = calendar.get(Calendar.HOUR_OF_DAY);
int minutes = calendar.get(Calendar.MINUTE);
+ int seconds = calendar.get(Calendar.SECOND);
if (hours != 12 || minutes != 0) {
result.put(HOURS_VALUE, hours);
result.put(MINUTES_VALUE, minutes);
+ result.put(SECONDS_VALUE, seconds);
}
}
if (result.size() > 0) {
Modified: branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar-utils.js
===================================================================
--- branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar-utils.js 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar-utils.js 2010-11-30 19:36:09 UTC (rev 20245)
@@ -93,7 +93,7 @@
* dd+ - 01-31 */
parseDate: function(dateString, pattern, monthNames, monthNamesShort)
{
- var re = /([.*+?^<>=!:${}()[\]\/\\])/g;
+ var re = /([.*+?^<>=!:${}()\[\]\/\\])/g;
var monthNamesStr
var monthNamesShortStr;
if (!monthNames) {
@@ -115,7 +115,7 @@
var a,h,min,s;
var shortLabel=false;
- pattern = pattern.replace(/([.*+?^<>=!:${}()|[\]\/\\])/g, '\\$1');
+ pattern = pattern.replace(/([.*+?^<>=!:${}()|\[\]\/\\])/g, '\\$1');
pattern = pattern.replace(/(y+|M+|d+|a|H{1,2}|h{1,2}|m{2}|s{2})/g,
function($1) {
switch ($1) {
@@ -144,7 +144,7 @@
var re = new RegExp(pattern,'i');
var match = dateString.match(re);
- if (match!=null)
+ if (match!=null && y != undefined && m != undefined && d != undefined)
{
// set default century start
var correctYear = false;
Copied: branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuple.java (from rev 20235, trunk/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuple.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuple.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuple.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import javax.faces.component.UIComponent;
+
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DeclarativeTreeDataModelTuple extends TreeDataModelTuple {
+
+ private UIComponent component;
+
+ public DeclarativeTreeDataModelTuple(Object rowKey, Object data, UIComponent component) {
+ super(rowKey, data);
+ this.component = component;
+ }
+
+ public UIComponent getComponent() {
+ return component;
+ }
+
+ @Override
+ protected ToStringHelper createToStringHelper() {
+ return super.createToStringHelper().add("component", component);
+ }
+
+}
Copied: branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeModel.java (from rev 20235, trunk/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeModel.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeModel.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/DeclarativeTreeModel.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface DeclarativeTreeModel<E> extends TreeDataModel<E> {
+
+ public UIComponent getCurrentComponent();
+
+}
Modified: branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModel.java
===================================================================
--- branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModel.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModel.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -21,10 +21,8 @@
*/
package org.richfaces.model;
-import javax.faces.context.FacesContext;
+import java.util.Iterator;
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.Range;
/**
* @author Nick Belaevski
@@ -43,16 +41,16 @@
public E getData();
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument);
+ public Iterator<TreeDataModelTuple> children();
- public void enterNode(DataVisitor visitor);
-
- public void exitNode(DataVisitor visitor);
-
public Object getParentRowKey(Object rowKey);
public Object getWrappedData();
public void setWrappedData(Object data);
+
+ public TreeDataModelTuple createSnapshot();
+
+ public void restoreFromSnapshot(TreeDataModelTuple tuple);
}
Copied: branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModelTuple.java (from rev 20235, trunk/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModelTuple.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModelTuple.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataModelTuple.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TreeDataModelTuple {
+
+ private Object rowKey;
+
+ private Object data;
+
+ public TreeDataModelTuple(Object rowKey, Object data) {
+ super();
+ this.rowKey = rowKey;
+ this.data = data;
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ protected ToStringHelper createToStringHelper() {
+ ToStringHelper helper = Objects.toStringHelper(this);
+ helper.add("rowKey", rowKey);
+ helper.add("data", data);
+
+ return helper;
+ }
+
+ @Override
+ public String toString() {
+ return createToStringHelper().toString();
+ }
+}
Modified: branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataVisitor.java
===================================================================
--- branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataVisitor.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/TreeDataVisitor.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -21,16 +21,18 @@
*/
package org.richfaces.model;
-import org.ajax4jsf.model.DataVisitor;
/**
* @author Nick Belaevski
*
*/
-public interface TreeDataVisitor extends DataVisitor {
+public interface TreeDataVisitor {
public void enterNode();
public void exitNode();
-
+
+ public void beforeChildrenVisit();
+
+ public void afterChildrenVisit();
}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -45,11 +45,10 @@
import javax.faces.event.ExceptionQueuedEventContext;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import javax.swing.tree.TreeNode;
import org.ajax4jsf.model.DataComponentState;
+import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
import org.richfaces.application.MessageFactory;
import org.richfaces.application.ServiceTracker;
import org.richfaces.appplication.FacesMessages;
@@ -69,9 +68,12 @@
import org.richfaces.event.TreeToggleEvent;
import org.richfaces.event.TreeToggleListener;
import org.richfaces.event.TreeToggleSource;
-import org.richfaces.model.ExtendedTreeDataModelImpl;
+import org.richfaces.model.DeclarativeTreeDataModelImpl;
+import org.richfaces.model.DeclarativeTreeModel;
import org.richfaces.model.SwingTreeNodeDataModelImpl;
import org.richfaces.model.TreeDataModel;
+import org.richfaces.model.TreeDataModelTuple;
+import org.richfaces.model.TreeDataVisitor;
import org.richfaces.renderkit.MetaComponentRenderer;
import com.google.common.base.Predicate;
@@ -90,6 +92,7 @@
renderer = @JsfRenderer(type = "org.richfaces.TreeRenderer"),
attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml"}
)
+//TODO add rowData caching for wrapper events
public abstract class AbstractTree extends UIDataAdaptor implements MetaComponentResolver, MetaComponentEncoder, TreeSelectionChangeSource, TreeToggleSource {
public static final String COMPONENT_TYPE = "org.richfaces.Tree";
@@ -125,31 +128,33 @@
private static final Converter ROW_KEY_CONVERTER = new SequenceRowKeyConverter();
- /**
- * @author Nick Belaevski
- *
- */
- private final class TreeComponentState implements DataComponentState {
- public Range getRange() {
- return new TreeRange(getFacesContext(), AbstractTree.this);
- }
- }
-
private enum PropertyKeys {
selection
}
-
+
+ @SuppressWarnings("unused")
@Attribute(generate = false, signature = @Signature(returnType = Void.class, parameters = TreeSelectionChangeEvent.class))
private MethodExpression selectionChangeListener;
+ @SuppressWarnings("unused")
@Attribute(generate = false, signature = @Signature(returnType = Void.class, parameters = TreeToggleListener.class))
private MethodExpression toggleListener;
+ private transient TreeRange treeRange;
+
public AbstractTree() {
setKeepSaved(true);
setRendererType("org.richfaces.TreeRenderer");
}
+ protected TreeRange getTreeRange() {
+ if (treeRange == null) {
+ treeRange = new TreeRange(this);
+ }
+
+ return treeRange;
+ }
+
public abstract Object getValue();
public abstract boolean isImmediate();
@@ -217,13 +222,6 @@
}
@Override
- protected ExtendedDataModel<?> createExtendedDataModel() {
- ExtendedTreeDataModelImpl<?> model = new ExtendedTreeDataModelImpl<TreeNode>(new SwingTreeNodeDataModelImpl());
- model.setWrappedData(getValue());
- return model;
- }
-
- @Override
protected DataComponentState createComponentState() {
// TODO Auto-generated method stub
return null;
@@ -238,23 +236,40 @@
return converter;
}
+ protected Iterator<UIComponent> findMatchingTreeNodeComponent(String nodeType, UIComponent parentComponent) {
+ Iterator<UIComponent> children = parentComponent.getChildren().iterator();
+ if (parentComponent != this) {
+ children = Iterators.concat(children, this.getChildren().iterator());
+ }
+
+ return Iterators.filter(children, new MatchingTreeNodePredicate(nodeType));
+ }
+
+ protected UIComponent getCurrentComponent() {
+ ExtendedDataModel<?> dataModel = getExtendedDataModel();
+ if (dataModel instanceof DeclarativeTreeModel) {
+ return ((DeclarativeTreeModel) dataModel).getCurrentComponent();
+ }
+
+ return this;
+ }
+
public AbstractTreeNode findTreeNodeComponent() {
FacesContext facesContext = getFacesContext();
String nodeType = getNodeType();
- Iterator<UIComponent> matchingNodes = Iterators.filter(getChildren().iterator(),
- new MatchingTreeNodePredicate(nodeType));
-
- boolean hasNodes = matchingNodes.hasNext();
- if (hasNodes) {
- Iterator<UIComponent> renderedTreeNodes = Iterators.filter(matchingNodes, ComponentPredicates.isRendered());
- if (renderedTreeNodes.hasNext()) {
- return (AbstractTreeNode) renderedTreeNodes.next();
- } else {
- return null;
+
+ Iterator<UIComponent> nodesItr = findMatchingTreeNodeComponent(nodeType, getCurrentComponent());
+
+ if (nodesItr.hasNext()) {
+ Iterator<UIComponent> renderedNodesItr = Iterators.filter(nodesItr, ComponentPredicates.isRendered());
+ if (renderedNodesItr.hasNext()) {
+ return (AbstractTreeNode) renderedNodesItr.next();
}
+
+ return null;
}
-
+
if (Strings.isNullOrEmpty(nodeType)) {
if (getAttributes().put(DEFAULT_TREE_NODE_CREATED, Boolean.TRUE) != null) {
return null;
@@ -403,11 +418,6 @@
}
}
- @Override
- public DataComponentState getComponentState() {
- return new TreeComponentState();
- }
-
public void addTreeSelectionChangeListener(TreeSelectionChangeListener listener) {
addFacesListener(listener);
}
@@ -448,12 +458,115 @@
return treeNode.isExpanded();
}
+ //TODO review
+ protected TreeDataModel<?> getTreeDataModel() {
+ return (TreeDataModel<?>) getExtendedDataModel();
+ }
+
@Attribute(hidden = true)
public boolean isLeaf() {
if (getRowKey() == null) {
return false;
}
- return ((TreeDataModel<?>) getExtendedDataModel()).isLeaf();
+ return getTreeDataModel().isLeaf();
}
+
+ @Override
+ public void walk(final FacesContext faces, final DataVisitor visitor, final Object argument) {
+ walkModel(faces, new TreeDataVisitor() {
+
+ public void enterNode() {
+ visitor.process(faces, getRowKey(), argument);
+ }
+
+ public void exitNode() {
+ }
+
+ public void beforeChildrenVisit() {
+ }
+
+ public void afterChildrenVisit() {
+ }
+
+ });
+ }
+
+ @Override
+ protected ExtendedDataModel<?> createExtendedDataModel() {
+ ExtendedDataModel<?> dataModel;
+
+ Object value = getValue();
+ if (value == null) {
+ dataModel = new DeclarativeTreeDataModelImpl(this, getVar(), getVariablesMap(getFacesContext()));
+ } else {
+ dataModel = new SwingTreeNodeDataModelImpl();
+ dataModel.setWrappedData(getValue());
+ }
+
+ return dataModel;
+ }
+
+ public void walkModel(FacesContext context, TreeDataVisitor dataVisitor) {
+ TreeDataModel<?> model = getTreeDataModel();
+
+ if (!getTreeRange().shouldProcessNode()) {
+ return;
+ }
+
+ boolean isRootNode = (getRowKey() == null);
+
+ if (!isRootNode) {
+ dataVisitor.enterNode();
+ }
+
+ walkModelChildren(context, dataVisitor, model);
+
+ if (!isRootNode) {
+ dataVisitor.exitNode();
+ }
+ }
+
+ private void walkModelChildren(FacesContext context, TreeDataVisitor dataVisitor, TreeDataModel<?> model) {
+ if (!getTreeRange().shouldIterateChildren()) {
+ return;
+ }
+
+ dataVisitor.beforeChildrenVisit();
+
+ Iterator<TreeDataModelTuple> childrenTuples = model.children();
+ while (childrenTuples.hasNext()) {
+ TreeDataModelTuple tuple = childrenTuples.next();
+
+ restoreFromSnapshot(context, tuple);
+
+ if (!getTreeRange().shouldProcessNode()) {
+ continue;
+ }
+
+ dataVisitor.enterNode();
+
+ walkModelChildren(context, dataVisitor, model);
+
+ dataVisitor.exitNode();
+ }
+
+ dataVisitor.afterChildrenVisit();
+ }
+
+ @Override
+ protected void resetDataModel() {
+ super.resetDataModel();
+ treeRange = null;
+ }
+
+ public TreeDataModelTuple createSnapshot() {
+ return getTreeDataModel().createSnapshot();
+ }
+
+ public void restoreFromSnapshot(FacesContext context, TreeDataModelTuple tuple) {
+ getTreeDataModel().restoreFromSnapshot(tuple);
+ setRowKey(context, tuple.getRowKey());
+ }
+
}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java (from rev 20235, trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Tag;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@JsfComponent(type = AbstractTreeModelAdaptor.COMPONENT_TYPE,
+ tag = @Tag(name = "treeModelAdaptor"))
+public abstract class AbstractTreeModelAdaptor extends UIComponentBase implements TreeModelAdaptor {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TreeModelAdaptor";
+
+}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelRecursiveAdaptor.java (from rev 20235, trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelRecursiveAdaptor.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelRecursiveAdaptor.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelRecursiveAdaptor.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Tag;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@JsfComponent(type = AbstractTreeModelRecursiveAdaptor.COMPONENT_TYPE,
+ tag = @Tag(name = "treeModelRecursiveAdaptor"))
+public abstract class AbstractTreeModelRecursiveAdaptor extends UIComponentBase implements TreeModelRecursiveAdaptor {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TreeModelRecursiveAdaptor";
+
+ @Attribute(defaultValue = "first")
+ public abstract String getRecursionOrder();
+
+}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java (from rev 20235, trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface TreeModelAdaptor {
+
+ public Object getNodes();
+
+}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelRecursiveAdaptor.java (from rev 20235, trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelRecursiveAdaptor.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelRecursiveAdaptor.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelRecursiveAdaptor.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface TreeModelRecursiveAdaptor extends TreeModelAdaptor {
+
+ public Object getRoots();
+
+ public String getRecursionOrder();
+
+}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeRange.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeRange.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/component/TreeRange.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -21,8 +21,6 @@
*/
package org.richfaces.component;
-import javax.faces.context.FacesContext;
-
import org.ajax4jsf.model.Range;
/**
@@ -31,26 +29,27 @@
*/
public class TreeRange implements Range {
- private FacesContext facesContext;
-
private AbstractTree tree;
private boolean traverseAll;
- public TreeRange(FacesContext facesContext, AbstractTree tree) {
+ public TreeRange(AbstractTree tree) {
super();
- this.facesContext = facesContext;
this.tree = tree;
traverseAll = (SwitchType.client == tree.getToggleType());
}
- public boolean shouldIterateChildren(Object rowKey) {
- if (traverseAll) {
- return true;
+ public boolean shouldProcessNode() {
+ return tree.findTreeNodeComponent() != null;
+ }
+
+ public boolean shouldIterateChildren() {
+ if (tree.isLeaf()) {
+ return false;
}
- return !tree.isLeaf() && tree.isExpanded();
+ return traverseAll || tree.isExpanded();
}
}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeModelKey.java (from rev 20235, trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeModelKey.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeModelKey.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeModelKey.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DeclarativeModelKey implements Serializable {
+
+ private static final long serialVersionUID = 7065813074553570168L;
+
+ private String modelId;
+
+ private Object modelKey;
+
+ public DeclarativeModelKey(String modelId, Object modelKey) {
+ super();
+ this.modelId = modelId;
+ this.modelKey = modelKey;
+ }
+
+ public String getModelId() {
+ return modelId;
+ }
+
+ public Object getModelKey() {
+ return modelKey;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((modelId == null) ? 0 : modelId.hashCode());
+ result = prime * result + ((modelKey == null) ? 0 : modelKey.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;
+ }
+ DeclarativeModelKey other = (DeclarativeModelKey) obj;
+ if (modelId == null) {
+ if (other.modelId != null) {
+ return false;
+ }
+ } else if (!modelId.equals(other.modelId)) {
+ return false;
+ }
+ if (modelKey == null) {
+ if (other.modelKey != null) {
+ return false;
+ }
+ } else if (!modelKey.equals(other.modelKey)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return getModelId() + "." + getModelKey();
+ }
+}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java (from rev 20235, trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,272 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.model;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+
+import org.richfaces.component.AbstractTree;
+import org.richfaces.component.ComponentPredicates;
+import org.richfaces.component.TreeModelAdaptor;
+import org.richfaces.component.TreeModelRecursiveAdaptor;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.ForwardingIterator;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DeclarativeTreeDataModelImpl extends TreeSequenceKeyModel<DeclarativeModelKey, Object> implements DeclarativeTreeModel<Object> {
+
+ private static final Logger LOGGER = RichfacesLogger.MODEL.getLogger();
+
+ private final class DeclarativeModelIterator implements Iterator<TreeDataModelTuple> {
+
+ private UIComponent component;
+
+ private SequenceRowKey<DeclarativeModelKey> baseKey;
+
+ private int counter = 0;
+
+ private Iterator<?> nodesIterator;
+
+ public DeclarativeModelIterator(UIComponent component, SequenceRowKey<DeclarativeModelKey> baseKey, Iterator<?> nodesIterator) {
+ super();
+ this.component = component;
+ this.baseKey = baseKey;
+ this.nodesIterator = nodesIterator;
+ }
+
+ public TreeDataModelTuple next() {
+ Object nextNode = nodesIterator.next();
+ DeclarativeModelKey key = new DeclarativeModelKey(component.getId(), counter++);
+
+ SequenceRowKey<DeclarativeModelKey> newKey = baseKey.append(key);
+
+ return new DeclarativeTreeDataModelTuple(newKey, nextNode, component);
+ }
+
+ public boolean hasNext() {
+ return nodesIterator.hasNext();
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+
+ private final class DeclarativeModelCompositeIterator extends ForwardingIterator<TreeDataModelTuple> {
+
+ private UIComponent component;
+
+ private SequenceRowKey<DeclarativeModelKey> key;
+
+ private Iterator<TreeDataModelTuple> iterator;
+
+ public DeclarativeModelCompositeIterator(UIComponent component, SequenceRowKey<DeclarativeModelKey> key) {
+ super();
+ this.component = component;
+ this.key = key;
+ }
+
+ @Override
+ protected Iterator<TreeDataModelTuple> delegate() {
+ if (iterator == null) {
+ List<Iterator<TreeDataModelTuple>> list = Lists.newArrayList();
+
+ if (component instanceof TreeModelRecursiveAdaptor) {
+ TreeModelRecursiveAdaptor parentRecursiveAdaptor = (TreeModelRecursiveAdaptor) component;
+
+ Collection<?> nodes = (Collection<?>) parentRecursiveAdaptor.getNodes();
+
+ if (nodes != null) {
+ list.add(new DeclarativeModelIterator(component, key, nodes.iterator()));
+ }
+ }
+
+ if (component.getChildCount() > 0) {
+ for (UIComponent child : Iterables.filter(component.getChildren(), ComponentPredicates.isRendered())) {
+ Collection<?> nodes = null;
+
+ if (child instanceof TreeModelRecursiveAdaptor) {
+ TreeModelRecursiveAdaptor treeModelRecursiveAdaptor = (TreeModelRecursiveAdaptor) child;
+
+ nodes = (Collection<?>) treeModelRecursiveAdaptor.getRoots();
+ } else if (child instanceof TreeModelAdaptor) {
+ TreeModelAdaptor treeModelAdaptor = (TreeModelAdaptor) child;
+
+ nodes = (Collection<?>) treeModelAdaptor.getNodes();
+ }
+
+ if (nodes != null) {
+ list.add(new DeclarativeModelIterator(child, key, nodes.iterator()));
+ }
+ }
+ }
+
+ iterator = Iterators.concat(list.iterator());
+ }
+
+ return iterator;
+ }
+
+ }
+
+ private String var;
+
+ private Map<String, Object> contextMap;
+
+ private UIComponent tree;
+
+ private UIComponent currentComponent;
+
+ public DeclarativeTreeDataModelImpl(AbstractTree tree, String var, Map<String, Object> contextMap) {
+ super();
+ this.tree = tree;
+ this.currentComponent = tree;
+ this.var = var;
+ this.contextMap = contextMap;
+ }
+
+ public UIComponent getCurrentComponent() {
+ return currentComponent;
+ }
+
+ protected void setCurrentComponent(UIComponent currentComponent) {
+ this.currentComponent = currentComponent;
+ }
+
+ public boolean isLeaf() {
+ if (currentComponent instanceof TreeModelRecursiveAdaptor) {
+ return false;
+ }
+
+ if (currentComponent.getChildCount() == 0) {
+ return true;
+ }
+
+ return Iterables.contains(currentComponent.getChildren(), Predicates.instanceOf(TreeModelAdaptor.class));
+ }
+
+ public Iterator<TreeDataModelTuple> children() {
+ return new DeclarativeModelCompositeIterator(currentComponent, safeGetRowKey());
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.model.TreeDataModel#getParentRowKey(java.lang.Object)
+ */
+ public Object getParentRowKey(Object rowKey) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getWrappedData() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ protected void walkKey(SequenceRowKey<DeclarativeModelKey> key) {
+ Object initialContextValue = null;
+
+ if (var != null) {
+ initialContextValue = contextMap.remove(var);
+ }
+
+ try {
+ this.currentComponent = tree;
+
+ super.walkKey(key);
+ } finally {
+ if (var != null) {
+ try {
+ contextMap.put(var, initialContextValue);
+ } catch (Exception e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void walkNext(DeclarativeModelKey segment) {
+ String modelId = segment.getModelId();
+
+ UIComponent modelComponent;
+
+ if (currentComponent instanceof TreeModelRecursiveAdaptor && modelId.equals(currentComponent.getId())) {
+ modelComponent = currentComponent;
+ } else {
+ modelComponent = Iterables.find(currentComponent.getChildren(), ComponentPredicates.withId(modelId));
+ }
+
+ Object nodes = null;
+
+ if (modelComponent instanceof TreeModelRecursiveAdaptor) {
+ TreeModelRecursiveAdaptor recursiveAdaptor = (TreeModelRecursiveAdaptor) modelComponent;
+
+ if (currentComponent.equals(modelComponent)) {
+ nodes = recursiveAdaptor.getNodes();
+ } else {
+ nodes = recursiveAdaptor.getRoots();
+ }
+ } else {
+ nodes = ((TreeModelAdaptor) modelComponent).getNodes();
+ }
+
+ Object data = Iterables.get((Iterable<?>) nodes, (Integer) segment.getModelKey());
+ setRowKeyAndData(safeGetRowKey().append(segment), data);
+ setCurrentComponent(modelComponent);
+
+ if (var != null) {
+ contextMap.put(var, data);
+ }
+ }
+
+ public TreeDataModelTuple createSnapshot() {
+ return new DeclarativeTreeDataModelTuple(getRowKey(), getData(), getCurrentComponent());
+ }
+
+ public void restoreFromSnapshot(TreeDataModelTuple tuple) {
+ DeclarativeTreeDataModelTuple declarativeModelTuple = (DeclarativeTreeDataModelTuple) tuple;
+
+ super.restoreFromSnapshot(declarativeModelTuple);
+ setCurrentComponent(declarativeModelTuple.getComponent());
+ }
+
+}
Deleted: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/ExtendedTreeDataModelImpl.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/ExtendedTreeDataModelImpl.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/ExtendedTreeDataModelImpl.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,133 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.model;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class ExtendedTreeDataModelImpl<E> extends ExtendedDataModel<E> implements TreeDataModel<E> {
-
- private TreeDataModel<E> wrappedModel;
-
- public ExtendedTreeDataModelImpl(TreeDataModel<E> wrappedModel) {
- super();
- this.wrappedModel = wrappedModel;
- }
-
- public boolean isDataAvailable() {
- return wrappedModel.isDataAvailable();
- }
-
- public E getData() {
- return wrappedModel.getData();
- }
-
- public Object getParentRowKey(Object rowKey) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setRowKey(Object key) {
- wrappedModel.setRowKey(key);
- }
-
- @Override
- public Object getRowKey() {
- return wrappedModel.getRowKey();
- }
-
- @Override
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
- wrappedModel.enterNode(visitor);
- wrappedModel.walk(context, visitor, range, argument);
- wrappedModel.exitNode(visitor);
- }
-
- @Override
- public boolean isRowAvailable() {
- return wrappedModel.isDataAvailable();
- }
-
- @Override
- public int getRowCount() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public E getRowData() {
- return wrappedModel.getData();
- }
-
- @Override
- public int getRowIndex() {
- throw new UnsupportedOperationException();
- }
-
- public void setRowIndex(int rowIndex) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Object getWrappedData() {
- return wrappedModel.getWrappedData();
- }
-
- @Override
- public void setWrappedData(Object data) {
- wrappedModel.setWrappedData(data);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.model.TreeDataModel#isLeaf()
- */
- public boolean isLeaf() {
- // TODO Auto-generated method stub
- return wrappedModel.isLeaf();
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.model.TreeDataModel#enterNode(org.ajax4jsf.model.DataVisitor)
- */
- public void enterNode(DataVisitor visitor) {
- // TODO Auto-generated method stub
-
- wrappedModel.enterNode(visitor);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.model.TreeDataModel#exitNode(org.ajax4jsf.model.DataVisitor)
- */
- public void exitNode(DataVisitor visitor) {
- // TODO Auto-generated method stub
-
- wrappedModel.exitNode(visitor);
- }
-
-
-}
Deleted: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SequenceRowKeyIterator.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.model;
-
-import java.util.Iterator;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-
-/**
- * @author Nick Belaevski
- *
- */
-public abstract class SequenceRowKeyIterator<K, T> implements Iterator<Object> {
-
- private SequenceRowKey<K> baseKey;
-
- private Iterator<T> itr;
-
- private T element;
-
- private SequenceRowKey<K> elementKey;
-
- private T baseElement;
-
- public SequenceRowKeyIterator(SequenceRowKey<K> baseKey, T baseElement, Iterator<T> itr) {
- super();
- this.baseKey = baseKey;
- this.baseElement = baseElement;
- this.itr = itr;
- }
-
- public boolean hasNext() {
- return itr.hasNext();
- }
-
- protected abstract K nextKey();
-
- public Object next() {
- element = itr.next();
-
- if (baseKey != null) {
- elementKey = baseKey.append(nextKey());
- } else {
- elementKey = new SequenceRowKey<K>(nextKey());
- }
-
- return elementKey;
- }
-
- public T getElement() {
- return element;
- }
-
- public SequenceRowKey<K> getBaseKey() {
- return baseKey;
- }
-
- public T getBaseElement() {
- return baseElement;
- }
-
- public SequenceRowKey<K> getElementKey() {
- return elementKey;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- ToStringHelper helper = Objects.toStringHelper(this);
-
- helper.add("element", element).add("elementKey", elementKey);
-
- return helper.toString();
- }
-}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -38,35 +38,47 @@
*/
public class SwingTreeNodeDataModelImpl extends TreeSequenceKeyModel<Integer, TreeNode> {
- /**
- * @author Nick Belaevski
- *
- */
- private static final class SwingTreeNodeRowKeyIterator extends SequenceRowKeyIterator<Integer, TreeNode> {
+ private final class SwingTreeNodeRowKeyIterator implements Iterator<TreeDataModelTuple> {
+
+ private SequenceRowKey<Integer> baseKey;
+ private Iterator<TreeNode> children;
+
private int counter = 0;
- /**
- * @param baseKey
- * @param baseElement
- * @param itr
- */
- private SwingTreeNodeRowKeyIterator(SequenceRowKey<Integer> baseKey, TreeNode baseElement,
- Iterator<TreeNode> itr) {
- super(baseKey, baseElement, itr);
+ private SwingTreeNodeRowKeyIterator(SequenceRowKey<Integer> baseKey, Iterator<TreeNode> children) {
+ this.baseKey = baseKey;
+ this.children = children;
}
- @Override
- protected Integer nextKey() {
+ private int getNextCounterValue() {
return counter++;
}
+
+ public boolean hasNext() {
+ return children.hasNext();
+ }
+
+ public TreeDataModelTuple next() {
+ TreeNode node = children.next();
+
+ SequenceRowKey<Integer> key;
+
+ if (baseKey != null) {
+ key = baseKey.append(getNextCounterValue());
+ } else {
+ key = new SequenceRowKey<Integer>(getNextCounterValue());
+ }
+
+ return new TreeDataModelTuple(key, node);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
}
-
- /**
- * @author Nick Belaevski
- *
- */
private final class FakeRootNode implements TreeNode {
private Collection<TreeNode> wrappedData;
@@ -125,7 +137,9 @@
}
}
- private Iterator<TreeNode> safeGetChildren(SequenceRowKey<Integer> key, TreeNode treeNode) {
+ private boolean asksAllowsChildren = false;
+
+ private Iterator<TreeNode> safeGetChildren(TreeNode treeNode) {
if (treeNode == null) {
return Iterators.emptyIterator();
}
@@ -138,16 +152,6 @@
throw new UnsupportedOperationException();
}
- public boolean isLeaf() {
- if (!isDataAvailable()) {
- throw new IllegalStateException();
- }
-
- TreeNode treeNode = getData();
-
- return !treeNode.getAllowsChildren() || treeNode.isLeaf();
- }
-
public void setWrappedData(Object data) {
setRootNode(new FakeRootNode((Collection<TreeNode>) data));
}
@@ -160,21 +164,29 @@
return rootNode.getWrappedData();
}
- @Override
protected TreeNode findChild(TreeNode parent, Integer simpleKey) {
- int idx = simpleKey.intValue();
- if (idx >= 0 && idx < parent.getChildCount()) {
- return parent.getChildAt(idx);
- }
-
- return null;
+ return parent.getChildAt(simpleKey.intValue());
}
+ public Iterator<TreeDataModelTuple> children() {
+ return new SwingTreeNodeRowKeyIterator(getRowKey(), safeGetChildren(getData()));
+ }
+
+ public boolean isLeaf() {
+ if (!asksAllowsChildren) {
+ return getData().isLeaf();
+ } else {
+ return !getData().getAllowsChildren();
+ }
+ }
+
@Override
- protected SequenceRowKeyIterator<Integer, TreeNode> createChildrenIterator(SequenceRowKey<Integer> baseKey,
- TreeNode value) {
-
- return new SwingTreeNodeRowKeyIterator(baseKey, value, safeGetChildren(baseKey, value));
+ protected void walkNext(Integer segment) {
+ TreeNode child = findChild(getData(), segment);
+ //TODO what if node is missing?
+ //TODO - optimize - remove partial keys creation
+ setRowKeyAndData(safeGetRowKey().append(segment), child);
}
-}
+
+}
\ No newline at end of file
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -21,148 +21,130 @@
*/
package org.richfaces.model;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.ListIterator;
-
import javax.faces.context.FacesContext;
import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
-import org.richfaces.component.TreeRange;
+
/**
* @author Nick Belaevski
*
*/
-public abstract class TreeSequenceKeyModel<K, V> implements TreeDataModel<V> {
+public abstract class TreeSequenceKeyModel<K, V> extends ExtendedDataModel<V> implements TreeDataModel<V> {
+ private final SequenceRowKey<K> emptyKey = new SequenceRowKey<K>();
+
private V rootNode;
- private V currentData;
+ private V data;
- private SequenceRowKey<K> currentRowKey;
+ private SequenceRowKey<K> rowKey;
- private LinkedList<SequenceRowKeyIterator<K, V>> keysStack = new LinkedList<SequenceRowKeyIterator<K, V>>();
-
public SequenceRowKey<K> getRowKey() {
- return currentRowKey;
+ return rowKey;
}
+ protected SequenceRowKey<K> safeGetRowKey() {
+ SequenceRowKey<K> key = getRowKey();
+
+ if (key == null) {
+ key = emptyKey;
+ }
+
+ return key;
+ }
+
public void setRowKey(Object rowKey) {
- this.currentRowKey = (SequenceRowKey<K>) rowKey;
- this.currentData = findData(currentRowKey);
+ if (this.rowKey == null || !this.rowKey.equals(rowKey)) {
+ walkKey((SequenceRowKey<K>) rowKey);
+ }
}
+ protected void resetRowKeyAndData() {
+ setRowKeyAndData(null, rootNode);
+ }
+
+ protected void setRowKeyAndData(SequenceRowKey<K> key, V data) {
+ this.rowKey = key;
+ this.data = data;
+ }
+
public boolean isDataAvailable() {
- return currentRowKey == null || currentData != null;
+ return getRowKey() == null || data != null;
}
- public abstract boolean isLeaf();
-
public V getData() {
if (!isDataAvailable()) {
throw new IllegalArgumentException();
}
- return currentData;
+ return data;
}
-
- protected boolean isRootNodeKey(SequenceRowKey<K> key) {
- return key == null || key.getLastKeySegment() == null;
- }
- protected V findData(SequenceRowKey<K> key) {
- if (key == null) {
- return rootNode;
- }
-
- if (!keysStack.isEmpty()) {
- ListIterator<SequenceRowKeyIterator<K, V>> listIterator = keysStack.listIterator(keysStack.size());
-
- while (listIterator.hasPrevious()) {
- SequenceRowKeyIterator<K, V> previous = listIterator.previous();
+ protected void walkKey(SequenceRowKey<K> key) {
+ resetRowKeyAndData();
- V baseNode = null;
-
- SequenceRowKey<K> baseKey = previous.getBaseKey();
- if (isRootNodeKey(baseKey) && isRootNodeKey(key.getParent())) {
- baseNode = rootNode;
- } else if (baseKey.equals(key.getParent())) {
- baseNode = previous.getBaseElement();
- }
-
- if (baseNode == null) {
- continue;
- }
-
- return findChild(baseNode, key.getLastKeySegment());
+ if (key != null) {
+ for (K simpleKey: key.getSimpleKeys()) {
+ walkNext(simpleKey);
}
}
-
- V result = rootNode;
-
- for (K simpleKey : key.getSimpleKeys()) {
- result = findChild(result, simpleKey);
+ }
- if (result == null) {
- break;
- }
- }
-
- return result;
+ protected abstract void walkNext(K segment);
+
+ protected V getRootNode() {
+ return rootNode;
}
-
- protected abstract V findChild(V parent, K simpleKey);
- protected abstract SequenceRowKeyIterator<K, V> createChildrenIterator(SequenceRowKey<K> baseKey, V value);
+ protected void setRootNode(V rootNode) {
+ this.rootNode = rootNode;
+ }
- public void enterNode(DataVisitor visitor) {
- SequenceRowKey<K> sequenceKey = getRowKey();
- V data = findData(sequenceKey);
-
- keysStack.addLast(createChildrenIterator(sequenceKey, data));
+ //TODO ExtendedDataModel legacy
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
+ throw new UnsupportedOperationException();
+ }
- if (visitor instanceof TreeDataVisitor) {
- ((TreeDataVisitor) visitor).enterNode();
- }
+
+ @Override
+ public boolean isRowAvailable() {
+ return isDataAvailable();
}
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
- if (getRowKey() != null) {
- visitor.process(context, getRowKey(), argument);
- }
- TreeRange treeRange = (TreeRange) range;
-
- if (treeRange.shouldIterateChildren(getRowKey())) {
- enterNode(visitor);
- Iterator<Object> keysIterator = keysStack.getLast();
- while (keysIterator.hasNext()) {
- Object key = (Object) keysIterator.next();
- setRowKey(key);
- walk(context, visitor, range, argument);
- }
- exitNode(visitor);
- }
+ @Override
+ public int getRowCount() {
+ throw new UnsupportedOperationException();
}
- public void exitNode(DataVisitor visitor) {
- if (visitor instanceof TreeDataVisitor) {
- ((TreeDataVisitor) visitor).exitNode();
- }
- keysStack.removeLast();
+ @Override
+ public V getRowData() {
+ return getData();
}
- public abstract Object getParentRowKey(Object rowKey);
- protected V getRootNode() {
- return rootNode;
+ @Override
+ public int getRowIndex() {
+ throw new UnsupportedOperationException();
}
-
- protected void setRootNode(V rootNode) {
- this.rootNode = rootNode;
+
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ throw new UnsupportedOperationException();
}
+
+ public TreeDataModelTuple createSnapshot() {
+ return new TreeDataModelTuple(getRowKey(), getData());
+ }
+
+ public void restoreFromSnapshot(TreeDataModelTuple tuple) {
+ setRowKeyAndData((SequenceRowKey<K>) tuple.getRowKey(), (V) tuple.getData());
+ }
}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -30,15 +30,51 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.model.DataVisitResult;
import org.richfaces.component.AbstractTree;
import org.richfaces.component.AbstractTreeNode;
import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.model.TreeDataModelTuple;
import org.richfaces.model.TreeDataVisitor;
-import org.richfaces.renderkit.TreeRendererBase.QueuedData;
abstract class TreeEncoderBase implements TreeDataVisitor {
+ private static final class QueuedData {
+
+ private enum State {
+ initial, visited, encoded
+ }
+
+ private State state = State.initial;
+
+ private TreeDataModelTuple tuple;
+
+ public QueuedData(TreeDataModelTuple tuple) {
+ super();
+ this.tuple = tuple;
+ }
+
+ public boolean isEncoded() {
+ return state == State.encoded;
+ }
+
+ public void makeEncoded() {
+ this.state = State.encoded;
+ }
+
+ public void makeVisited() {
+ this.state = State.visited;
+ }
+
+ public boolean isVisited() {
+ return state == State.visited;
+ }
+
+ public TreeDataModelTuple getTuple() {
+ return tuple;
+ }
+
+ }
+
static final String TREE_NODE_STATE_ATTRIBUTE = "__treeNodeState";
protected final FacesContext context;
@@ -49,8 +85,6 @@
private LinkedList<QueuedData> queuedDataList = new LinkedList<QueuedData>();
- private QueuedData queuedData;
-
public TreeEncoderBase(FacesContext context, AbstractTree tree) {
super();
this.context = context;
@@ -59,30 +93,9 @@
}
protected void encodeTree() throws IOException {
- tree.walk(context, this, null);
+ tree.walkModel(context, this);
}
- protected void flushNode() throws IOException {
- if (!queuedData.isEncoded()) {
- tree.setRowKey(context, queuedData.getRowKey());
-
- TreeNodeState state;
- if (tree.isLeaf()) {
- state = TreeNodeState.leaf;
- } else {
- if (queuedData.isVisited()) {
- state = TreeNodeState.leaf;
- } else {
- state = TreeNodeState.collapsed;
- }
- }
-
- writeTreeNodeStartElement(state);
- }
-
- writeTreeNodeEndElement();
- }
-
protected void flushParentNode() throws IOException {
if (queuedDataList.isEmpty()) {
return;
@@ -90,54 +103,64 @@
QueuedData data = queuedDataList.getLast();
if (!data.isEncoded()) {
- data.setEncoded(true);
- tree.setRowKey(context, data.getRowKey());
+ data.makeEncoded();
+ tree.restoreFromSnapshot(context, data.getTuple());
- writeTreeNodeStartElement(tree.isExpanded() ? TreeNodeState.expanded : TreeNodeState.collapsed);
+ TreeNodeState nodeState = getNodeState(tree.isLeaf(), false);
+
+ writeTreeNodeStartElement(nodeState);
+ tree.findTreeNodeComponent().encodeAll(context);
}
}
-
- public void enterNode() {
- if (queuedData != null) {
- queuedData.makeVisited();
- queuedDataList.add(queuedData);
- queuedData = null;
+
+ private TreeNodeState getNodeState(boolean leaf, boolean visited) {
+ TreeNodeState nodeState;
+ if (leaf) {
+ nodeState = TreeNodeState.leaf;
+ } else if (visited) {
+ nodeState = TreeNodeState.expandedNoChildren;
+ } else if (tree.isExpanded()) {
+ nodeState = TreeNodeState.expanded;
+ } else {
+ nodeState = TreeNodeState.collapsed;
}
+ return nodeState;
}
- public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
+ public void beforeChildrenVisit() {
+ if (!queuedDataList.isEmpty()) {
+ queuedDataList.getLast().makeVisited();
+ }
+ }
+
+ public void afterChildrenVisit() {
+ }
+
+ public void enterNode() {
+ TreeDataModelTuple tuple = tree.createSnapshot();
+ QueuedData queuedData = new QueuedData(tuple);
+
try {
- if (queuedData != null) {
- flushNode();
- queuedData = null;
- } else {
- flushParentNode();
- }
+ flushParentNode();
} catch (IOException e) {
throw new FacesException(e.getMessage(), e);
}
-
- if (rowKey != null) {
- tree.setRowKey(context, rowKey);
-
- if (tree.isRowAvailable() && tree.findTreeNodeComponent() != null) {
- queuedData = new QueuedData(rowKey);
- }
- }
-
- return DataVisitResult.CONTINUE;
+
+ tree.restoreFromSnapshot(context, tuple);
+ queuedDataList.add(queuedData);
}
+
+ public void exitNode() {
+ QueuedData data = queuedDataList.removeLast();
- public void exitNode() {
+ tree.restoreFromSnapshot(context, data.getTuple());
try {
- if (queuedData != null) {
- flushNode();
- queuedData = null;
+ if (!data.isEncoded()) {
+ writeTreeNodeStartElement(getNodeState(tree.isLeaf(), data.isVisited()));
+ tree.findTreeNodeComponent().encodeAll(context);
}
-
- if (!queuedDataList.isEmpty()) {
- queuedData = queuedDataList.removeLast();
- }
+
+ writeTreeNodeEndElement();
} catch (IOException e) {
throw new FacesException(e.getMessage(), e);
}
@@ -155,7 +178,6 @@
responseWriter.writeAttribute(HtmlConstants.ID_ATTRIBUTE, treeNodeComponent.getClientId(context), null);
emitClientToggleEvent(treeNodeComponent, nodeState);
- treeNodeComponent.encodeAll(context);
}
protected void writeTreeNodeEndElement() throws IOException {
@@ -166,10 +188,9 @@
private void emitClientToggleEvent(AbstractTreeNode treeNode, TreeNodeState nodeState) {
if (treeNode.getClientId(context).equals(context.getAttributes().get(TreeNodeRendererBase.AJAX_TOGGLED_NODE_ATTRIBUTE))) {
- TreeNodeState submittedState = ((Boolean) (context.getAttributes().get(TreeNodeRendererBase.AJAX_TOGGLED_NODE_STATE_ATTRIBUTE)))
- ? TreeNodeState.expanded : TreeNodeState.collapsed;
+ TreeNodeState initialState = (TreeNodeState) context.getAttributes().get(TreeNodeRendererBase.AJAX_TOGGLED_NODE_STATE_ATTRIBUTE);
- if (submittedState == nodeState || nodeState == TreeNodeState.leaf) {
+ if (initialState.isDifferentThan(nodeState)) {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
ajaxContext.appendOncomplete(new JSFunction("RichFaces.ui.TreeNode.emitToggleEvent", treeNode.getClientId(context)));
}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -63,9 +63,10 @@
AbstractTreeNode treeNode = (AbstractTreeNode) component;
- boolean expanded = Boolean.valueOf(newToggleState);
- if (treeNode.isExpanded() ^ expanded) {
- new TreeToggleEvent(treeNode, expanded).queue();
+ boolean initialState = treeNode.isExpanded();
+ boolean newState = Boolean.valueOf(newToggleState);
+ if (initialState ^ newState) {
+ new TreeToggleEvent(treeNode, newState).queue();
}
PartialViewContext pvc = context.getPartialViewContext();
@@ -73,7 +74,7 @@
pvc.getRenderIds().add(treeNode.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + AbstractTreeNode.SUBTREE_META_COMPONENT_ID);
context.getAttributes().put(AJAX_TOGGLED_NODE_ATTRIBUTE, component.getClientId(context));
- context.getAttributes().put(AJAX_TOGGLED_NODE_STATE_ATTRIBUTE, expanded);
+ context.getAttributes().put(AJAX_TOGGLED_NODE_STATE_ATTRIBUTE, initialState ? TreeNodeState.expanded : TreeNodeState.collapsed);
}
}
}
@@ -141,8 +142,8 @@
if (toggleType == SwitchType.client || nodeState == TreeNodeState.collapsed) {
encodeIconForNodeState(context, tree, treeNode, TreeNodeState.collapsed, iconCollapsed);
}
-
- if (toggleType == SwitchType.client || nodeState == TreeNodeState.expanded) {
+
+ if (toggleType == SwitchType.client || nodeState == TreeNodeState.expanded || nodeState == TreeNodeState.expandedNoChildren) {
encodeIconForNodeState(context, tree, treeNode, TreeNodeState.expanded, iconExpanded);
}
}
@@ -162,6 +163,7 @@
protected void addClientEventHandlers(FacesContext facesContext, UIComponent component) {
AbstractTreeNode treeNode = (AbstractTreeNode) component;
+ //TODO check node state
//TODO check toggle/selection types
TreeRenderingContext renderingContext = TreeRenderingContext.get(facesContext);
renderingContext.addHandlers(treeNode);
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeState.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeState.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeState.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -29,28 +29,46 @@
public boolean isLeaf() {
return false;
}
- },
+
+ @Override
+ public boolean isDifferentThan(TreeNodeState anotherState) {
+ return anotherState != expandedNoChildren && super.isDifferentThan(anotherState);
+ }
+
+ },
+ expandedNoChildren("rf-tr-nd-exp rf-tr-nd-exp-nc", "rf-trn-hnd-lf", "rf-trn-ico-exp") {
+ @Override
+ public boolean isLeaf() {
+ return false;
+ }
+
+ @Override
+ public boolean isDifferentThan(TreeNodeState anotherState) {
+ return anotherState != expanded && super.isDifferentThan(anotherState);
+ }
+ },
collapsed("rf-tr-nd-colps", "rf-trn-hnd-colps", "rf-trn-ico-colps") {
@Override
public boolean isLeaf() {
return false;
}
- },
+ },
leaf("rf-tr-nd-lf", "rf-trn-hnd-lf", "rf-trn-ico-lf") {
@Override
public boolean isLeaf() {
return true;
}
+
};
private String nodeClass;
private String handleClass;
-
+
private String iconClass;
private String customIconClass;
-
+
private TreeNodeState(String nodeClass, String defaultHandleClass, String iconClass) {
this.nodeClass = nodeClass;
this.handleClass = HtmlUtil.concatClasses(defaultHandleClass, "rf-trn-hnd");
@@ -59,7 +77,11 @@
}
public abstract boolean isLeaf();
-
+
+ public boolean isDifferentThan(TreeNodeState anotherState) {
+ return anotherState != this;
+ }
+
public String getNodeClass() {
return nodeClass;
}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -84,39 +84,6 @@
}
}
- static final class QueuedData {
-
- private Object rowKey;
-
- private boolean encoded;
-
- private boolean visited;
-
- public QueuedData(Object rowKey) {
- this.rowKey = rowKey;
- }
-
- public void setEncoded(boolean encoded) {
- this.encoded = encoded;
- }
-
- public boolean isEncoded() {
- return encoded;
- }
-
- public Object getRowKey() {
- return rowKey;
- }
-
- public boolean isVisited() {
- return visited;
- }
-
- public void makeVisited() {
- visited = true;
- }
- }
-
public void encodeTree(FacesContext context, UIComponent component) throws IOException {
AbstractTree tree = (AbstractTree) component;
@@ -175,7 +142,7 @@
if (selectedKeys.hasNext()) {
//TODO - better message
- throw new IllegalArgumentException("Selection object should not contain more than selected keys!");
+ throw new IllegalArgumentException("Selection object should not contain more than one keys!");
}
writer.writeAttribute(HtmlConstants.VALUE_ATTRIBUTE, selectedNodeId, null);
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-30 19:36:09 UTC (rev 20245)
@@ -153,8 +153,12 @@
return this.__rootElt.hasClass("rf-tr-nd-lf");
},
+ __canBeToggled: function() {
+ return !this.isLeaf() && !this.__rootElt.hasClass("rf-tr-nd-exp-nc");
+ },
+
toggle: function() {
- if (this.isLeaf()) {
+ if (!this.__canBeToggled()) {
return;
}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.ToolBarRendererBase;
+
+@JsfComponent(family = AbstractToolBar.COMPONENT_FAMILY, type = AbstractToolBar.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = ToolBarRendererBase.RENDERER_TYPE), tag = @Tag(name="toolBar")
+)
+public abstract class AbstractToolBar extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.ToolBar";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.ToolBar";
+
+ @Attribute
+ public abstract String getHeight();
+
+ @Attribute
+ public abstract String getWidth();
+
+ @Attribute
+ public abstract String getItemSeparator();
+
+ @Attribute(events=@EventName("itemclick"))
+ public abstract String getOnitemclick();
+
+ @Attribute(events=@EventName("itemdblclick"))
+ public abstract String getOnitemdblclick();
+
+ @Attribute(events=@EventName("itemmousedown"))
+ public abstract String getOnitemmousedown();
+
+ @Attribute(events=@EventName("itemmouseup"))
+ public abstract String getOnitemmouseup();
+
+ @Attribute(events=@EventName("itemmouseover"))
+ public abstract String getOnitemmouseover();
+
+ @Attribute(events=@EventName("itemmousemove"))
+ public abstract String getOnitemmousemove();
+
+ @Attribute(events=@EventName("itemmouseout"))
+ public abstract String getOnitemmouseout();
+
+ @Attribute(events=@EventName("itemkeypress"))
+ public abstract String getOnitemkeypress();
+
+ @Attribute(events=@EventName("itemkeydown"))
+ public abstract String getOnitemkeydown();
+
+ @Attribute(events=@EventName("itemkeyup"))
+ public abstract String getOnitemkeyup();
+
+}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.ToolBarGroupRenderer;
+
+@JsfComponent(family = AbstractToolBar.COMPONENT_FAMILY, type = AbstractToolBarGroup.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = ToolBarGroupRenderer.RENDERER_TYPE), tag = @Tag(name="toolBarGroup"))
+public abstract class AbstractToolBarGroup extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.ToolBarGroup";
+
+ @Attribute
+ public abstract String getItemSeparator();
+
+ @Attribute
+ public abstract String getLocation();
+
+ @Attribute(events=@EventName("itemclick"))
+ public abstract String getOnitemclick();
+
+ @Attribute(events=@EventName("itemdblclick"))
+ public abstract String getOnitemdblclick();
+
+ @Attribute(events=@EventName("itemmousedown"))
+ public abstract String getOnitemmousedown();
+
+ @Attribute(events=@EventName("itemmouseup"))
+ public abstract String getOnitemmouseup();
+
+ @Attribute(events=@EventName("itemmouseover"))
+ public abstract String getOnitemmouseover();
+
+ @Attribute(events=@EventName("itemmousemove"))
+ public abstract String getOnitemmousemove();
+
+ @Attribute(events=@EventName("itemmouseout"))
+ public abstract String getOnitemmouseout();
+
+ @Attribute(events=@EventName("itemkeypress"))
+ public abstract String getOnitemkeypress();
+
+ @Attribute(events=@EventName("itemkeydown"))
+ public abstract String getOnitemkeydown();
+
+ @Attribute(events=@EventName("itemkeyup"))
+ public abstract String getOnitemkeyup();
+
+ public AbstractToolBar getToolBar() {
+ UIComponent component = this.getParent();
+ if (component == null) {
+ throw new FacesException("The component: " + this.getClientId(getFacesContext()) +
+ " is not nested within " + AbstractToolBar.class.getSimpleName());
+ } else if (!(component instanceof AbstractToolBar)) {
+ throw new FacesException("The component: " + this.getClientId(getFacesContext()) +
+ " is not a direct child of " + AbstractToolBar.class.getSimpleName());
+ }
+ return (AbstractToolBar) component;
+ }
+
+ public List<UIComponent> getRenderedChildren() {
+ List<UIComponent> children = this.getChildren();
+ List<UIComponent> renderedChildren = new ArrayList<UIComponent>(children.size());
+
+ for (UIComponent child : children) {
+ if (child.isRendered()) {
+ renderedChildren.add(child);
+ }
+ }
+
+ return renderedChildren;
+ }
+
+}
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -107,13 +107,24 @@
Number minValue = NumberUtils.getNumber(component.getAttributes().get("minValue"));
Number maxValue = NumberUtils.getNumber(component.getAttributes().get("maxValue"));
Number value = NumberUtils.getNumber(component.getAttributes().get("value"));
+
+ ProgressBarState result;
+
if (value.doubleValue() <= minValue.doubleValue()) {
- return ProgressBarState.initialState;
+ result = ProgressBarState.initialState;
} else if (value.doubleValue() > maxValue.doubleValue()) {
- return ProgressBarState.finishState;
+ result = ProgressBarState.finishState;
} else {
- return ProgressBarState.progressState;
+ result = ProgressBarState.progressState;
}
+
+ if (result == ProgressBarState.initialState || result == ProgressBarState.finishState) {
+ if (!result.hasContent(context, component)) {
+ result = ProgressBarState.progressState;
+ }
+ }
+
+ return result;
}
protected String getStateDisplayStyle(String currentState, String state) {
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarState.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarState.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarState.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -43,13 +43,16 @@
@Override
public void encodeContent(FacesContext context, UIComponent component) throws IOException {
- UIComponent facet = component.getFacet("initial");
- if (facet != null) {
- facet.encodeAll(context);
- }
+ component.getFacet("initial").encodeAll(context);
}
@Override
+ public boolean hasContent(FacesContext context, UIComponent component) {
+ UIComponent facet = component.getFacet("initial");
+ return facet != null && facet.isRendered();
+ }
+
+ @Override
public void encodeStateForMetaComponent(FacesContext context, UIComponent component,
ProgressBarStateEncoder encoder) throws IOException {
@@ -87,6 +90,11 @@
}
@Override
+ public boolean hasContent(FacesContext context, UIComponent component) {
+ return true;
+ }
+
+ @Override
public void encodeStateForMetaComponent(FacesContext context, UIComponent component,
ProgressBarStateEncoder encoder) throws IOException {
@@ -114,6 +122,12 @@
}
@Override
+ public boolean hasContent(FacesContext context, UIComponent component) {
+ UIComponent facet = component.getFacet("finish");
+ return facet != null && facet.isRendered();
+ }
+
+ @Override
public void encodeStateForMetaComponent(FacesContext context, UIComponent component,
ProgressBarStateEncoder encoder) throws IOException {
@@ -127,5 +141,7 @@
public abstract void encodeContent(FacesContext context, UIComponent component) throws IOException;
+ public abstract boolean hasContent(FacesContext context, UIComponent component);
+
public abstract void encodeStateForMetaComponent(FacesContext context, UIComponent component, ProgressBarStateEncoder encoder) throws IOException;
}
\ No newline at end of file
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarStateEncoder.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarStateEncoder.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarStateEncoder.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -50,6 +50,11 @@
private void encodeStateFacet(FacesContext context, UIComponent component, ProgressBarState state,
ProgressBarState currentState) throws IOException {
+
+ if (!state.hasContent(context, component)) {
+ return;
+ }
+
String clientId = state.getStateClientId(context, component);
ResponseWriter responseWriter = context.getResponseWriter();
@@ -103,6 +108,11 @@
public void encodeProgressStateContent(FacesContext context, UIComponent component, ProgressBarState currentState)
throws IOException {
+
+ if (!ProgressBarState.progressState.hasContent(context, component)) {
+ return;
+ }
+
ResponseWriter responseWriter = context.getResponseWriter();
String stateClientId = ProgressBarState.progressState.getStateClientId(context, component);
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractToolBar;
+import org.richfaces.component.AbstractToolBarGroup;
+import org.richfaces.renderkit.HtmlConstants;
+
+@JsfRenderer(type = ToolBarGroupRenderer.RENDERER_TYPE, family = AbstractToolBar.COMPONENT_FAMILY)
+public class ToolBarGroupRenderer extends ToolBarRendererBase {
+
+ public static final String RENDERER_TYPE = "org.richfaces.ToolBarGroupRenderer";
+
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractToolBarGroup.class;
+ }
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
+ AbstractToolBarGroup toolBarGroup = (AbstractToolBarGroup) component;
+ List<UIComponent> renderedChildren = toolBarGroup.getRenderedChildren();
+ if (renderedChildren.size() <= 0) {
+ return;
+ }
+
+ ResponseWriter writer = facesContext.getResponseWriter();
+ renderChild(facesContext, toolBarGroup, writer, renderedChildren.get(0));
+ for (int i = 1; i < renderedChildren.size(); i++) {
+ insertSeparatorIfNeed(facesContext, toolBarGroup, writer);
+ renderChild(facesContext, toolBarGroup, writer, renderedChildren.get(i));
+ }
+ }
+
+ private void renderChild(FacesContext facesContext, AbstractToolBarGroup toolBarGroup, ResponseWriter writer,
+ UIComponent child) throws IOException {
+ writer.startElement(HtmlConstants.TD_ELEM, toolBarGroup);
+ writeClassValue(toolBarGroup, writer);
+ writeStyleValue(toolBarGroup, writer);
+ encodeEventsAttributes(facesContext, toolBarGroup);
+ child.encodeAll(facesContext);
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+
+ private void writeStyleValue(AbstractToolBarGroup toolBarGroup, ResponseWriter writer) throws IOException {
+ String style = getStringAttribute(toolBarGroup, HtmlConstants.STYLE_ATTRIBUTE);
+ String contentStyle = getStringAttribute(getParentToolBar(toolBarGroup), "contentStyle");
+
+ String value = getCompoundStyleValue(contentStyle, style);
+
+ if (isPropertyRendered(value)) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, value, null);
+ }
+ }
+
+ private String getCompoundStyleValue(String... styles) {
+ if (styles != null) {
+ StringBuilder result = new StringBuilder();
+ for (int styleIndex = 0; styleIndex < styles.length; styleIndex++) {
+ result.append(styles[styleIndex]);
+ if (styleIndex != styles.length - 1) {
+ result.append("; ");
+ }
+ }
+ return result.toString();
+ }
+ return "";
+ }
+
+ private void writeClassValue(AbstractToolBarGroup toolBarGroup, ResponseWriter writer) throws IOException {
+ String styleClass = getStringAttribute(toolBarGroup, HtmlConstants.STYLE_CLASS_ATTR);
+ AbstractToolBar toolBar = getParentToolBar(toolBarGroup);
+ String contentClass = null;
+
+ if(toolBar != null) {
+ contentClass = getStringAttribute(toolBar, "contentClass");
+ }
+
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, concatClasses("rf-tb-itm", contentClass, styleClass), null);
+ }
+
+ private String getStringAttribute(UIComponent toolBarGroup, String attribute) {
+ String value = (String) toolBarGroup.getAttributes().get(attribute);
+ return null == value ? "" : value;
+ }
+
+ public AbstractToolBar getParentToolBar(UIComponent component) {
+ return (component instanceof AbstractToolBarGroup) ? ((AbstractToolBarGroup) component).getToolBar() : null;
+ }
+
+}
\ No newline at end of file
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,275 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.richfaces.component.AbstractToolBar;
+import org.richfaces.component.AbstractToolBarGroup;
+import org.richfaces.renderkit.ComponentAttribute;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RenderKitUtils;
+import org.richfaces.renderkit.RendererBase;
+
+
+@ResourceDependency(library = "org.richfaces", name = "toolBar.ecss")
+public abstract class ToolBarRendererBase extends RendererBase {
+
+ public static final String RENDERER_TYPE = "org.richfaces.ToolBarRenderer";
+
+ public static final Map<String, ComponentAttribute> ITEMS_HANDLER_ATTRIBUTES = Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
+ .setEventNames("itemclick")
+ .setComponentAttributeName("onitemclick"),
+ new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE)
+ .setEventNames("itemdblclick")
+ .setComponentAttributeName("onitemdblclick"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE)
+ .setEventNames("itemmousedown")
+ .setComponentAttributeName("onitemmousedown"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE)
+ .setEventNames("itemmouseup")
+ .setComponentAttributeName("onitemmouseup"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE)
+ .setEventNames("itemmouseover")
+ .setComponentAttributeName("onitemmouseover"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE)
+ .setEventNames("itemmousemove")
+ .setComponentAttributeName("onitemmousemove"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE)
+ .setEventNames("itemmouseout")
+ .setComponentAttributeName("onitemmouseout"),
+ new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE)
+ .setEventNames("itemkeypress")
+ .setComponentAttributeName("onitemkeypress"),
+ new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE)
+ .setEventNames("itemkeydown")
+ .setComponentAttributeName("onitemkeydown"),
+ new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE)
+ .setEventNames("itemkeyup")
+ .setComponentAttributeName("onitemkeyup")
+ ));
+
+ public enum ItemSeparators {
+ NONE, SQUARE, DISC, GRID, LINE
+ }
+
+ public enum Locations {
+ RIGHT, LEFT
+ }
+
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
+ AbstractToolBar toolBar = (AbstractToolBar) component;
+ String contentClass = (String) toolBar.getAttributes().get("contentClass");
+ String contentStyle = (String) toolBar.getAttributes().get("contentStyle");
+
+ List<UIComponent> children = toolBar.getChildren();
+
+ if (children != null) {
+ List<UIComponent> childrenToTheLeft = new LinkedList<UIComponent>();
+ List<UIComponent> childrenToTheRight = new LinkedList<UIComponent>();
+ for (UIComponent child : children) {
+ if (child.isRendered()) {
+ if (child instanceof AbstractToolBarGroup) {
+ AbstractToolBarGroup group = (AbstractToolBarGroup) child;
+ String location = group.getLocation();
+ if (location != null && location.equalsIgnoreCase(Locations.RIGHT.toString())) {
+ childrenToTheRight.add(child);
+ } else {
+ childrenToTheLeft.add(child);
+ }
+ } else {
+ childrenToTheLeft.add(child);
+ }
+ }
+ }
+
+ ResponseWriter writer = context.getResponseWriter();
+ for (Iterator<UIComponent> it = childrenToTheLeft.iterator(); it.hasNext();) {
+
+ UIComponent child = it.next();
+
+ if (!(child instanceof AbstractToolBarGroup)) {
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, concatClasses("rf-tb-itm", contentClass), null);
+ if (isPropertyRendered(contentStyle)) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, contentStyle, null);
+ }
+ encodeEventsAttributes(context, toolBar);
+ }
+
+ child.encodeAll(context);
+
+ if (!(child instanceof AbstractToolBarGroup)) {
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+
+
+
+ if (it.hasNext()) {
+ insertSeparatorIfNeed(context, toolBar, writer);
+ }
+ }
+
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, "width:100%", null);
+ writer.endElement(HtmlConstants.TD_ELEM);
+
+ for (Iterator<UIComponent> it = childrenToTheRight.iterator(); it.hasNext();) {
+ UIComponent child = it.next();
+ child.encodeAll(context);
+ if (it.hasNext()) {
+ insertSeparatorIfNeed(context, toolBar, writer);
+ }
+ }
+ }
+ }
+
+ public void encodeItem(FacesContext facesContext, UIComponent component, ResponseWriter writer, String contentStyle, String contentClass) throws IOException {
+ if (!(component instanceof AbstractToolBarGroup)) {
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, concatClasses("rf-tb-itm", contentClass), null);
+ if (isPropertyRendered(contentStyle)) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, contentStyle, null);
+ }
+ encodeEventsAttributes(facesContext, component);
+ }
+
+ component.encodeAll(facesContext);
+
+ if (!(component instanceof AbstractToolBarGroup)) {
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+ }
+
+ /**
+ * Inserts separator between toolbar items. Uses facet "itemSeparator" if it
+ * is set and default separator implementation if facet is not set.
+ *
+ * @param context
+ * - faces context
+ * @param component
+ * - component
+ * @param writer
+ * - response writer
+ * @throws IOException
+ * - in case of IOException during writing to the ResponseWriter
+ */
+ protected void insertSeparatorIfNeed(FacesContext context, UIComponent component, ResponseWriter writer)
+ throws IOException {
+ UIComponent separatorFacet = component.getFacet("itemSeparator");
+ boolean isSeparatorFacetRendered = (separatorFacet != null) ? separatorFacet.isRendered() : false;
+ if (isSeparatorFacetRendered) {
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-tb-sep", null);
+ separatorFacet.encodeAll(context);
+ writer.endElement(HtmlConstants.TD_ELEM);
+ } else {
+ insertDefaultSeparatorIfNeed(context, component, writer);
+ }
+ }
+
+ /**
+ * Inserts default separator. Possible values are: "square", "disc", "grid",
+ * "line" - for separators provided by component implementation; "none" -
+ * for no separators between toolbar items; URI string value - for custom
+ * images specified by the page author.
+ *
+ * @param context
+ * - faces context
+ * @param component
+ * - component
+ * @param writer
+ * - response writer
+ * @throws IOException
+ * - in case of IOException during writing to the ResponseWriter
+ */
+ protected void insertDefaultSeparatorIfNeed(FacesContext context, UIComponent component, ResponseWriter writer)
+ throws IOException {
+ String itemSeparator = (String) component.getAttributes().get("itemSeparator");
+
+ if (itemSeparator != null && itemSeparator.trim().length() != 0
+ && !itemSeparator.equalsIgnoreCase(ItemSeparators.NONE.toString())) {
+
+ ItemSeparators separator = null;
+ if (itemSeparator.equalsIgnoreCase(ItemSeparators.SQUARE.toString())) {
+ separator = ItemSeparators.SQUARE;
+ } else if (itemSeparator.equalsIgnoreCase(ItemSeparators.DISC.toString())) {
+ separator = ItemSeparators.DISC;
+ } else if (itemSeparator.equalsIgnoreCase(ItemSeparators.GRID.toString())) {
+ separator = ItemSeparators.GRID;
+ } else if (itemSeparator.equalsIgnoreCase(ItemSeparators.LINE.toString())) {
+ separator = ItemSeparators.LINE;
+ }
+
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ String separatorClass = "rf-tb-sep";
+
+ if (separator != null) {
+ String itemSeparatorClass = "rf-tb-sep-" + separator.toString().toLowerCase();
+ separatorClass = concatClasses(separatorClass, itemSeparatorClass, (String) component.getAttributes().get("separatorClass"));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, separatorClass, null);
+ } else {
+ concatClasses(separatorClass, (String) component.getAttributes().get("separatorClass"));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, separatorClass, null);
+
+ String uri = RenderKitUtils.getResourceURL(itemSeparator, context);
+ writer.startElement(HtmlConstants.IMG_ELEMENT, component);
+ writer.writeAttribute(HtmlConstants.SRC_ATTRIBUTE, uri, null);
+ writer.writeAttribute(HtmlConstants.ALT_ATTRIBUTE, "", null);
+ writer.endElement(HtmlConstants.IMG_ELEMENT);
+ }
+
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+ }
+
+ protected Class<? extends javax.faces.component.UIComponent> getComponentClass() {
+ return AbstractToolBar.class;
+ }
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ protected void encodeEventsAttributes(FacesContext facesContext, UIComponent component)
+ throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, ITEMS_HANDLER_ATTRIBUTES);
+ }
+
+ protected boolean isPropertyRendered(String property) {
+ return ((null != property && !"".equals(property)));
+ }
+}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images)
Deleted: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,71 +0,0 @@
-/**
- * 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.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.Area;
-import java.awt.geom.Ellipse2D;
-
-import org.richfaces.resource.DynamicUserResource;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-@DynamicUserResource
-public class DotSeparatorImage extends ToolBarSeparatorImage {
-
- private static final Dimension DIMENSIONS = new Dimension(9, 9);
-
- public Dimension getDimension() {
- return DIMENSIONS;
- }
-
- public void paint(Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-
- Color gradientColorStart = Color.WHITE;
- Color gradientColorEnd = new Color(this.getHeaderBackgroundColor());
- Ellipse2D inSquare = new Ellipse2D.Double(2, 2, DIMENSIONS.getWidth() - 4, DIMENSIONS.getHeight() - 4);
- GradientPaint paint = new GradientPaint((float) 3, (float) 3, gradientColorStart,
- (float) DIMENSIONS.getWidth() - 2, (float) DIMENSIONS.getHeight() - 2, gradientColorEnd);
- g2d.setPaint(paint);
- g2d.fill(inSquare);
-
- Ellipse2D outSquare = new Ellipse2D.Double(0, 0, DIMENSIONS.getWidth(), DIMENSIONS.getHeight());
- Ellipse2D midSquare = new Ellipse2D.Double(1, 1, DIMENSIONS.getWidth() - 2, DIMENSIONS.getHeight() - 2);
-
- g2d.setColor(new Color(this.getHeaderBackgroundColor()));
- Area area2 = new Area(outSquare);
- area2.subtract(new Area(midSquare));
- g2d.fill(area2);
-
- g2d.setColor(new Color(this.getHeaderGradientColor()));
- Area area = new Area(midSquare);
- area.subtract(new Area(inSquare));
- g2d.fill(area);
- }
-}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,71 @@
+/**
+ * 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.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Area;
+import java.awt.geom.Ellipse2D;
+
+import org.richfaces.resource.DynamicUserResource;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+@DynamicUserResource
+public class DotSeparatorImage extends ToolBarSeparatorImage {
+
+ private static final Dimension DIMENSIONS = new Dimension(9, 9);
+
+ public Dimension getDimension() {
+ return DIMENSIONS;
+ }
+
+ public void paint(Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+ Color gradientColorStart = Color.WHITE;
+ Color gradientColorEnd = new Color(this.getHeaderBackgroundColor());
+ Ellipse2D inSquare = new Ellipse2D.Double(2, 2, DIMENSIONS.getWidth() - 4, DIMENSIONS.getHeight() - 4);
+ GradientPaint paint = new GradientPaint((float) 3, (float) 3, gradientColorStart,
+ (float) DIMENSIONS.getWidth() - 2, (float) DIMENSIONS.getHeight() - 2, gradientColorEnd);
+ g2d.setPaint(paint);
+ g2d.fill(inSquare);
+
+ Ellipse2D outSquare = new Ellipse2D.Double(0, 0, DIMENSIONS.getWidth(), DIMENSIONS.getHeight());
+ Ellipse2D midSquare = new Ellipse2D.Double(1, 1, DIMENSIONS.getWidth() - 2, DIMENSIONS.getHeight() - 2);
+
+ g2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ Area area2 = new Area(outSquare);
+ area2.subtract(new Area(midSquare));
+ g2d.fill(area2);
+
+ g2d.setColor(new Color(this.getHeaderGradientColor()));
+ Area area = new Area(midSquare);
+ area.subtract(new Area(inSquare));
+ g2d.fill(area);
+ }
+}
Deleted: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,39 +0,0 @@
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.TexturePaint;
-import java.awt.image.BufferedImage;
-
-import org.richfaces.resource.DynamicUserResource;
-
-@DynamicUserResource
-public class GridSeparatorImage extends ToolBarSeparatorImage {
-
- public Dimension getDimension() {
- return calculateDimension();
- }
-
- public void paint(Graphics2D g2d) {
- Dimension dimensions = calculateDimension();
-
- BufferedImage texture = new BufferedImage(3, 3, BufferedImage.TYPE_INT_ARGB);
- Graphics2D txG2d = texture.createGraphics();
- txG2d.setColor(new Color(this.getHeaderBackgroundColor()));
- txG2d.fillRect(0, 0, 2, 2);
- txG2d.setColor(new Color(255, 255, 255, 150));
- txG2d.fillRect(0, 0, 1, 1);
- txG2d.dispose();
- g2d.setPaint(new TexturePaint(texture, new Rectangle(1, 1, 3, 3)));
- g2d.fillRect(0, 0, dimensions.width, dimensions.height);
- }
-
- private Dimension calculateDimension() {
- int h = (int)(this.getSeparatorHeight() * 0.8);
- h = h - h % 3;
- int w = 9;
- return new Dimension(w, h);
- }
-}
\ No newline at end of file
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,39 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.TexturePaint;
+import java.awt.image.BufferedImage;
+
+import org.richfaces.resource.DynamicUserResource;
+
+@DynamicUserResource
+public class GridSeparatorImage extends ToolBarSeparatorImage {
+
+ public Dimension getDimension() {
+ return calculateDimension();
+ }
+
+ public void paint(Graphics2D g2d) {
+ Dimension dimensions = calculateDimension();
+
+ BufferedImage texture = new BufferedImage(3, 3, BufferedImage.TYPE_INT_ARGB);
+ Graphics2D txG2d = texture.createGraphics();
+ txG2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ txG2d.fillRect(0, 0, 2, 2);
+ txG2d.setColor(new Color(255, 255, 255, 150));
+ txG2d.fillRect(0, 0, 1, 1);
+ txG2d.dispose();
+ g2d.setPaint(new TexturePaint(texture, new Rectangle(1, 1, 3, 3)));
+ g2d.fillRect(0, 0, dimensions.width, dimensions.height);
+ }
+
+ private Dimension calculateDimension() {
+ int h = (int)(this.getSeparatorHeight() * 0.8);
+ h = h - h % 3;
+ int w = 9;
+ return new Dimension(w, h);
+ }
+}
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,31 +0,0 @@
-package org.richfaces.renderkit.html.images;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-
-import org.richfaces.resource.DynamicUserResource;
-
-@DynamicUserResource
-public class LineSeparatorImage extends ToolBarSeparatorImage {
-
- public Dimension getDimension() {
- return calculateDimension();
- }
-
- public void paint(Graphics2D g2d) {
- Dimension dimensions = calculateDimension();
- g2d.setStroke(new BasicStroke(1));
- g2d.setColor(new Color(this.getHeaderBackgroundColor()));
- g2d.fillRect(-1, -1, dimensions.width + 2, dimensions.height + 2);
- g2d.setColor(new Color(255, 255, 255, 150));
- g2d.drawLine(1, -1, 1, dimensions.height + 2);
- }
-
- private Dimension calculateDimension() {
- int h = this.getSeparatorHeight();
- int w = 2;
- return new Dimension(w, h);
- }
-}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,31 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+
+import org.richfaces.resource.DynamicUserResource;
+
+@DynamicUserResource
+public class LineSeparatorImage extends ToolBarSeparatorImage {
+
+ public Dimension getDimension() {
+ return calculateDimension();
+ }
+
+ public void paint(Graphics2D g2d) {
+ Dimension dimensions = calculateDimension();
+ g2d.setStroke(new BasicStroke(1));
+ g2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ g2d.fillRect(-1, -1, dimensions.width + 2, dimensions.height + 2);
+ g2d.setColor(new Color(255, 255, 255, 150));
+ g2d.drawLine(1, -1, 1, dimensions.height + 2);
+ }
+
+ private Dimension calculateDimension() {
+ int h = this.getSeparatorHeight();
+ int w = 2;
+ return new Dimension(w, h);
+ }
+}
Deleted: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,48 +0,0 @@
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.geom.Area;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.RoundRectangle2D;
-
-import org.richfaces.resource.DynamicUserResource;
-
-@DynamicUserResource
-public class SquareSeparatorImage extends ToolBarSeparatorImage {
-
- private static final Dimension DIMENSIONS = new Dimension(9, 9);
-
- public Dimension getDimension() {
- return DIMENSIONS;
- }
-
- public void paint(Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-
- Color gradientColorStart = Color.WHITE;
- Color gradientColorEnd = new Color(this.getHeaderBackgroundColor());
- Rectangle2D inSquare = new Rectangle2D.Double(2, 2, DIMENSIONS.getWidth() - 4, DIMENSIONS.getHeight() - 4);
- GradientPaint paint = new GradientPaint((float) 2, (float) 2, gradientColorStart,
- (float) DIMENSIONS.getWidth() - 2, (float) DIMENSIONS.getHeight() - 2, gradientColorEnd);
- g2d.setPaint(paint);
- g2d.fill(inSquare);
-
- RoundRectangle2D outSquare = new RoundRectangle2D.Double(0, 0, DIMENSIONS.getWidth(), DIMENSIONS.getHeight(),
- 4, 4);
- Rectangle2D midSquare = new Rectangle2D.Double(1, 1, DIMENSIONS.getWidth() - 2, DIMENSIONS.getHeight() - 2);
-
- g2d.setColor(new Color(this.getHeaderBackgroundColor()));
- Area area2 = new Area(outSquare);
- area2.subtract(new Area(midSquare));
- g2d.fill(area2);
-
- g2d.setColor(new Color(this.getHeaderGradientColor()));
- Area area = new Area(midSquare);
- area.subtract(new Area(inSquare));
- g2d.fill(area);
- }
-}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,48 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Area;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+
+import org.richfaces.resource.DynamicUserResource;
+
+@DynamicUserResource
+public class SquareSeparatorImage extends ToolBarSeparatorImage {
+
+ private static final Dimension DIMENSIONS = new Dimension(9, 9);
+
+ public Dimension getDimension() {
+ return DIMENSIONS;
+ }
+
+ public void paint(Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+ Color gradientColorStart = Color.WHITE;
+ Color gradientColorEnd = new Color(this.getHeaderBackgroundColor());
+ Rectangle2D inSquare = new Rectangle2D.Double(2, 2, DIMENSIONS.getWidth() - 4, DIMENSIONS.getHeight() - 4);
+ GradientPaint paint = new GradientPaint((float) 2, (float) 2, gradientColorStart,
+ (float) DIMENSIONS.getWidth() - 2, (float) DIMENSIONS.getHeight() - 2, gradientColorEnd);
+ g2d.setPaint(paint);
+ g2d.fill(inSquare);
+
+ RoundRectangle2D outSquare = new RoundRectangle2D.Double(0, 0, DIMENSIONS.getWidth(), DIMENSIONS.getHeight(),
+ 4, 4);
+ Rectangle2D midSquare = new Rectangle2D.Double(1, 1, DIMENSIONS.getWidth() - 2, DIMENSIONS.getHeight() - 2);
+
+ g2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ Area area2 = new Area(outSquare);
+ area2.subtract(new Area(midSquare));
+ g2d.fill(area2);
+
+ g2d.setColor(new Color(this.getHeaderGradientColor()));
+ Area area = new Area(midSquare);
+ area.subtract(new Area(inSquare));
+ g2d.fill(area);
+ }
+}
Deleted: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,99 +0,0 @@
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.richfaces.resource.ImageType;
-import org.richfaces.resource.Java2DUserResource;
-import org.richfaces.resource.PostConstructResource;
-import org.richfaces.resource.ResourceParameter;
-import org.richfaces.resource.StateHolderResource;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
-public abstract class ToolBarSeparatorImage implements Java2DUserResource, StateHolderResource {
-
- private int headerBackgroundColor;
- private int separatorHeight;
- private int headerGradientColor;
-
- public int getHeaderBackgroundColor() {
- return headerBackgroundColor;
- }
-
- public void setHeaderBackgroundColor(int bgColor) {
- this.headerBackgroundColor = bgColor;
- }
-
- public int getSeparatorHeight() {
- return separatorHeight;
- }
-
- @ResourceParameter(defaultValue = "9")
- public void setSeparatorHeight(int separatorHeight) {
- this.separatorHeight = separatorHeight;
- }
-
- public int getHeaderGradientColor() {
- return headerGradientColor;
- }
-
- public void setHeaderGradientColor(int headerGradientColor) {
- this.headerGradientColor = headerGradientColor;
- }
-
- public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
- dataOutput.writeInt(headerBackgroundColor);
- dataOutput.writeInt(separatorHeight);
- dataOutput.writeInt(headerGradientColor);
- }
-
- public void readState(FacesContext context, DataInput dataInput) throws IOException {
- this.headerBackgroundColor = dataInput.readInt();
- this.separatorHeight = dataInput.readInt();
- this.headerGradientColor = dataInput.readInt();
- }
-
- public boolean isTransient() {
- return false;
- }
-
- public Map<String, String> getResponseHeaders() {
- return null;
- }
-
- public Date getLastModified() {
- return null;
- }
-
- public ImageType getImageType() {
- return ImageType.GIF;
- }
-
- @PostConstructResource
- public final void initialize() {
- FacesContext context = FacesContext.getCurrentInstance();
- Skin skin = SkinFactory.getInstance(context).getSkin(context);
- Skin defaultSkin = SkinFactory.getInstance(context).getDefaultSkin(context);
-
- String skinParameter = "headerBackgroundColor";
- String tmp = (String) skin.getParameter(context, skinParameter);
- if (null == tmp || "".equals(tmp)) {
- tmp = (String) defaultSkin.getParameter(context, skinParameter);
- }
- this.setHeaderBackgroundColor(Color.decode(tmp == null ? "#224986" : tmp).getRGB());
-
- skinParameter = "headerGradientColor";
- tmp = (String) skin.getParameter(context, skinParameter);
- if (null == tmp || "".equals(tmp)) {
- tmp = (String) defaultSkin.getParameter(context, skinParameter);
- }
- this.setHeaderGradientColor(Color.decode(tmp == null ? "#CCCCFF" : tmp).getRGB());
- }
-}
Copied: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java (from rev 20235, trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,99 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.PostConstructResource;
+import org.richfaces.resource.ResourceParameter;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+public abstract class ToolBarSeparatorImage implements Java2DUserResource, StateHolderResource {
+
+ private int headerBackgroundColor;
+ private int separatorHeight;
+ private int headerGradientColor;
+
+ public int getHeaderBackgroundColor() {
+ return headerBackgroundColor;
+ }
+
+ public void setHeaderBackgroundColor(int bgColor) {
+ this.headerBackgroundColor = bgColor;
+ }
+
+ public int getSeparatorHeight() {
+ return separatorHeight;
+ }
+
+ @ResourceParameter(defaultValue = "9")
+ public void setSeparatorHeight(int separatorHeight) {
+ this.separatorHeight = separatorHeight;
+ }
+
+ public int getHeaderGradientColor() {
+ return headerGradientColor;
+ }
+
+ public void setHeaderGradientColor(int headerGradientColor) {
+ this.headerGradientColor = headerGradientColor;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws IOException {
+ dataOutput.writeInt(headerBackgroundColor);
+ dataOutput.writeInt(separatorHeight);
+ dataOutput.writeInt(headerGradientColor);
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException {
+ this.headerBackgroundColor = dataInput.readInt();
+ this.separatorHeight = dataInput.readInt();
+ this.headerGradientColor = dataInput.readInt();
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ @PostConstructResource
+ public final void initialize() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance(context).getDefaultSkin(context);
+
+ String skinParameter = "headerBackgroundColor";
+ String tmp = (String) skin.getParameter(context, skinParameter);
+ if (null == tmp || "".equals(tmp)) {
+ tmp = (String) defaultSkin.getParameter(context, skinParameter);
+ }
+ this.setHeaderBackgroundColor(Color.decode(tmp == null ? "#224986" : tmp).getRGB());
+
+ skinParameter = "headerGradientColor";
+ tmp = (String) skin.getParameter(context, skinParameter);
+ if (null == tmp || "".equals(tmp)) {
+ tmp = (String) defaultSkin.getParameter(context, skinParameter);
+ }
+ this.setHeaderGradientColor(Color.decode(tmp == null ? "#CCCCFF" : tmp).getRGB());
+ }
+}
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -9,8 +9,759 @@
<behavior-id>org.richfaces.component.behavior.ToggleControl</behavior-id>
<behavior-class>org.richfaces.component.behavior.ToggleControl</behavior-class>
</behavior>
-
+
+ <component>
+ <component-type>org.richfaces.ToolBar</component-type>
+ <component-class>org.richfaces.component.UIToolBar</component-class>
+ <property>
+ <description>
+ A mutable Map of the attributes associated with
+ this component, keyed by attribute name.
+ </description>
+ <display-name>Attributes Map</display-name>
+ <icon/>
+ <property-name>attributes</property-name>
+ <property-class>java.util.Map</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>The value binding expression used to wire up this
+ component to a component property of a JavaBean class</description>
+ <display-name></display-name>
+ <icon/>
+ <property-name>binding</property-name>
+ <property-class>javax.faces.component.UIComponent</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The number of child components associated with
+ this component.
+ </description>
+ <display-name>Child Component Count</display-name>
+ <icon/>
+ <property-name>childCount</property-name>
+ <property-class>int</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ A mutable List of the child components associated with
+ this component.
+ </description>
+ <display-name>Child Component List</display-name>
+ <icon/>
+ <property-name>children</property-name>
+ <property-class>java.util.List</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ A mutable Map of the facets associated with
+ this component, keyed by facet name.
+ </description>
+ <display-name>Facets Map</display-name>
+ <icon/>
+ <property-name>facets</property-name>
+ <property-class>java.util.Map</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The component family to which this component belongs. This property
+ is used to select an appropriate Renderer.
+ </description>
+ <display-name>Component Family</display-name>
+ <icon/>
+ <property-name>family</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <property-name>id</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The parent component for this component. On the root component
+ in the component tree (which must be of type UIViewRoot), this
+ property is null.
+ </description>
+ <display-name>Parent Component</display-name>
+ <icon/>
+ <property-name>parent</property-name>
+ <property-class>javax.faces.component.UIComponent</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit. The default value for this property is true.
+ </description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <property-name>rendered</property-name>
+ <property-class>boolean</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ Identifier used (in conjunction with the "family" property) to
+ select an appropriate Renderer to encode and decode this component.
+ </description>
+ <display-name>Renderer Type</display-name>
+ <icon/>
+ <property-name>rendererType</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ Flag indicating whether or not this component takes responsibility
+ for rendering its own children. This decision is normally delegated
+ to the associated Renderer, if there is one.
+ </description>
+ <display-name>Renders Children</display-name>
+ <icon/>
+ <property-name>rendersChildren</property-name>
+ <property-class>boolean</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>width</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmouseover</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmouseover</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemkeydown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemkeydown</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmousemove</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmousemove</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmousedown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmousedown</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>height</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemdblclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemdblclick</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemclick</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmouseout</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmouseout</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemkeyup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemkeyup</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>itemSeparator</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmouseup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmouseup</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemkeypress</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemkeypress</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <component-extension>
+ <cdk:base-class>org.richfaces.component.AbstractToolBar</cdk:base-class>
+ <cdk:generate>true</cdk:generate>
+ <cdk:component-family>org.richfaces.ToolBar</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ToolBarRenderer</cdk:renderer-type>
+ <cdk:tag>
+ <cdk:generate>false</cdk:generate>
+ <cdk:tag-name>toolBar</cdk:tag-name>
+ <cdk:tag-type>Facelets</cdk:tag-type>
+ </cdk:tag>
+ </component-extension>
+ </component>
<component>
+ <component-type>org.richfaces.ToolBarGroup</component-type>
+ <component-class>org.richfaces.component.UIToolBarGroup</component-class>
+ <property>
+ <description>
+ A mutable Map of the attributes associated with
+ this component, keyed by attribute name.
+ </description>
+ <display-name>Attributes Map</display-name>
+ <icon/>
+ <property-name>attributes</property-name>
+ <property-class>java.util.Map</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>The value binding expression used to wire up this
+ component to a component property of a JavaBean class</description>
+ <display-name></display-name>
+ <icon/>
+ <property-name>binding</property-name>
+ <property-class>javax.faces.component.UIComponent</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The number of child components associated with
+ this component.
+ </description>
+ <display-name>Child Component Count</display-name>
+ <icon/>
+ <property-name>childCount</property-name>
+ <property-class>int</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ A mutable List of the child components associated with
+ this component.
+ </description>
+ <display-name>Child Component List</display-name>
+ <icon/>
+ <property-name>children</property-name>
+ <property-class>java.util.List</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ A mutable Map of the facets associated with
+ this component, keyed by facet name.
+ </description>
+ <display-name>Facets Map</display-name>
+ <icon/>
+ <property-name>facets</property-name>
+ <property-class>java.util.Map</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The component family to which this component belongs. This property
+ is used to select an appropriate Renderer.
+ </description>
+ <display-name>Component Family</display-name>
+ <icon/>
+ <property-name>family</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The component identifier for this component. This value must be
+ unique within the closest parent component that is a naming
+ container.
+ </description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <property-name>id</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ The parent component for this component. On the root component
+ in the component tree (which must be of type UIViewRoot), this
+ property is null.
+ </description>
+ <display-name>Parent Component</display-name>
+ <icon/>
+ <property-name>parent</property-name>
+ <property-class>javax.faces.component.UIComponent</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ Flag indicating whether or not this component should be rendered
+ (during Render Response Phase), or processed on any subsequent
+ form submit. The default value for this property is true.
+ </description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <property-name>rendered</property-name>
+ <property-class>boolean</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ Identifier used (in conjunction with the "family" property) to
+ select an appropriate Renderer to encode and decode this component.
+ </description>
+ <display-name>Renderer Type</display-name>
+ <icon/>
+ <property-name>rendererType</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <description>
+ Flag indicating whether or not this component takes responsibility
+ for rendering its own children. This decision is normally delegated
+ to the associated Renderer, if there is one.
+ </description>
+ <display-name>Renders Children</display-name>
+ <icon/>
+ <property-name>rendersChildren</property-name>
+ <property-class>boolean</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:literal>true</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>true</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>location</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmousedown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmousedown</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemdblclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemdblclick</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemclick</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemclick</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmouseover</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmouseover</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmouseout</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmouseout</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemkeyup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemkeyup</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>itemSeparator</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmouseup</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmouseup</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemkeydown</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemkeydown</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemmousemove</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemmousemove</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onitemkeypress</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">itemkeypress</cdk:event-name>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>false</cdk:hidden>
+ <cdk:literal>false</cdk:literal>
+ <cdk:pass-through>false</cdk:pass-through>
+ <cdk:read-only>false</cdk:read-only>
+ <cdk:required>false</cdk:required>
+ </property-extension>
+ </property>
+ <component-extension>
+ <cdk:base-class>org.richfaces.component.AbstractToolBarGroup</cdk:base-class>
+ <cdk:generate>true</cdk:generate>
+ <cdk:component-family>org.richfaces.ToolBar</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ToolBarGroupRenderer</cdk:renderer-type>
+ <cdk:tag>
+ <cdk:generate>false</cdk:generate>
+ <cdk:tag-name>toolBarGroup</cdk:tag-name>
+ <cdk:tag-type>Facelets</cdk:tag-type>
+ </cdk:tag>
+ </component-extension>
+ </component>
+
+ <component>
<component-type>org.richfaces.Tooltip</component-type>
<component-class>org.richfaces.component.html.HtmlTooltip</component-class>
<property>
@@ -951,12 +1702,28 @@
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
+
+ <renderer>
+ <component-family>org.richfaces.ToolBar</component-family>
+ <renderer-type>org.richfaces.ToolBarRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.ToolBarRenderer</renderer-class>
+ <renderer-extension>
+ <cdk:renders-children>false</cdk:renders-children>
+ </renderer-extension>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.ToolBar</component-family>
+ <renderer-type>org.richfaces.ToolBarGroupRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.ToolBarGroupRenderer</renderer-class>
+ <renderer-extension>
+ <cdk:renders-children>false</cdk:renders-children>
+ </renderer-extension>
+ </renderer>
<renderer>
<component-family>org.richfaces.Tooltip</component-family>
<renderer-type>org.richfaces.Tooltip</renderer-type>
<renderer-class>org.richfaces.renderkit.html.TooltipRenderer</renderer-class>
</renderer>
-
<renderer>
<component-family>org.richfaces.CollapsiblePanel</component-family>
<renderer-type>org.richfaces.CollapsiblePanel</renderer-type>
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -6,8 +6,163 @@
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd" version="2.0" id="output">
<namespace>http://richfaces.org/output</namespace>
-
+ <tag>
+ <tag-name>toolBar</tag-name>
+ <component>
+ <component-type>org.richfaces.ToolBar</component-type>
+ <renderer-type>org.richfaces.ToolBarRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <icon/>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>height</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>itemSeparator</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemdblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>width</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
<tag>
+ <tag-name>toolBarGroup</tag-name>
+ <component>
+ <component-type>org.richfaces.ToolBarGroup</component-type>
+ <renderer-type>org.richfaces.ToolBarGroupRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <icon/>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <display-name>Component Identifier</display-name>
+ <icon/>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>itemSeparator</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>location</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemdblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onitemmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <display-name>Rendered Flag</display-name>
+ <icon/>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ </tag>
+
+
+ <tag>
<tag-name>toggleControl</tag-name>
<behavior>
<behavior-id>org.richfaces.component.behavior.ToggleControl</behavior-id>
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss 2010-11-30 19:36:09 UTC (rev 20245)
@@ -15,7 +15,6 @@
font-size: '#{richSkin.generalSizeFont}';
font-weight: bold;
- text-align: center;
text-color: '#{richSkin.controlTextColor}';
background-color: '#{richSkin.controlBackgroundColor}';
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-11-30 19:36:09 UTC (rev 20245)
@@ -110,6 +110,11 @@
__showState: function (state) {
var stateElt = $(stateSelectors[state], this.__elt);
+
+ if (stateElt.length == 0 && (state == 'initial' || state == 'finish')) {
+ stateElt = $(stateSelectors['progress'], this.__elt)
+ }
+
stateElt.show().siblings().hide();
},
@@ -125,19 +130,24 @@
if (this.__isInitialState()) {
this.__showState("initial");
} else if (this.__isFinishState()) {
- rf.Event.callHandler(this.__elt, "finish");
this.__showState("finish");
} else {
this.__showState("progress");
-
- var p = this.__calculatePercent(this.value);
- $(".rf-pb-prgs", this.__elt).css('width', p + "%");
}
+
+ var p = this.__calculatePercent(this.value);
+ $(".rf-pb-prgs", this.__elt).css('width', p + "%");
},
setValue: function(val) {
+ var wasInFinishState = this.__isFinishState();
+
this.__setValue(val);
this.__updateVisualState();
+
+ if (!wasInFinishState && this.__isFinishState()) {
+ rf.Event.callHandler(this.__elt, "finish");
+ }
},
getMaxValue: function() {
Copied: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss (from rev 20235, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,48 @@
+.rf-tb {
+ border:1px solid;
+ border-color:'#{richSkin.panelBorderColor}';
+ color:'#{richSkin.headerTextColor}';
+ font-family:'#{richSkin.headerFamilyFont}';
+ font-size:'#{richSkin.headerSizeFont}';
+ font-weight:'#{richSkin.headerWeightFont}';
+ padding:0px;
+ background-color:'#{richSkin.headerBackgroundColor}';
+ background-position:left top;
+ background-repeat:repeat-x;
+ /*check gradient from headerGradientColor to headerBackgroundColor*/
+ background-image:url("#{resource['org.richfaces.renderkit.html.GradientA']}");
+ height:36px;
+ width:100%;
+}
+
+.rf-tb-itm {
+ padding:0 8px;
+ white-space:nowrap;
+}
+
+.rf-tb-sep {
+ padding:0 10px;
+ text-align:center;
+ background-repeat:no-repeat;
+ background-position:center center;
+}
+
+.rf-tb-cntr{
+ vertical-align:middle;
+}
+
+.rf-tb-sep-grid {
+ background-image:url("#{resource['org.richfaces.renderkit.html.images.GridSeparatorImage']}");
+}
+
+.rf-tb-sep-line {
+ background-image:url("#{resource['org.richfaces.renderkit.html.images.LineSeparatorImage']}");
+}
+
+.rf-tb-sep-disc {
+ background-image:url("#{resource['org.richfaces.renderkit.html.images.DotSeparatorImage']}");
+}
+
+.rf-tb-sep-square {
+ background-image:url("#{resource['org.richfaces.renderkit.html.images.SquareSeparatorImage']}");
+}
\ No newline at end of file
Modified: branches/RF-8742-1/ui/output/ui/src/main/templates/progressBar.template.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/templates/progressBar.template.xml 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/output/ui/src/main/templates/progressBar.template.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -16,7 +16,7 @@
<cc:implementation>
- <div id="#{clientId}" cdk:passThroughWithExclusions="">
+ <div id="#{clientId}" cdk:passThroughWithExclusions="" class="#{concatClasses('rf-pb', component.attributes['styleClass'])}">
<cdk:object name="encoder" value="#{getEncoder(facesContext, component)}" type="ProgressBarStateEncoder" />
<cdk:object name="currentState" value="#{getCurrentState(facesContext, component)}" type="ProgressBarState" />
Copied: branches/RF-8742-1/ui/output/ui/src/main/templates/toolBar.template.xml (from rev 20235, trunk/ui/output/ui/src/main/templates/toolBar.template.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/templates/toolBar.template.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/templates/toolBar.template.xml 2010-11-30 19:36:09 UTC (rev 20245)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+ xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+ xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+ xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.ToolBarRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.html.ToolBarRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.ToolBar</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ToolBarRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <table border="0" cellpadding="0" cellspacing="0" id="#{clientId}" width="#{component.attributes['width']}"
+ height="#{component.attributes['height']}" class="rf-tb #{component.attributes['styleClass']}"
+ style="#{component.attributes['style']}"
+ cdk:passThroughWithExclusions="">
+ <tr class="rf-tb-cntr">
+ <cdk:body />
+ </tr>
+ </table>
+ </cc:implementation>
+</cdk:root>
Deleted: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java 2010-11-30 18:55:37 UTC (rev 20244)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java 2010-11-30 19:36:09 UTC (rev 20245)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.convert;
-
-import javax.faces.convert.DateTimeConverter;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * @author Nick Belaevski
- *
- */
-(a)RunWith(ConverterTestRunner.class)
-@Ignore
-public class DateTimeConverterTest extends BaseTest {
-
- public DateTimeConverterTest() {
- super("org/richfaces/convert/testConverter.js");
- }
-
- @Test
- @TestDataHolder(
- successes = {
- @TestData(submittedValue = "18-10-2010")
- // ,@TestData(submittedValue = "17-10-2010")
- },
- failures = {
- // @TestData(submittedValue = "10/17/2010")
- }
- )
-
- public void testPattern() throws Exception {
- setClientFunction("org.rf.DateTimeConverter");
- setObjectId(DateTimeConverter.CONVERTER_ID);
- setAttribute("pattern", "dd-MM-yyyy");
- }
-
- @Test
- public void testNoPattern() throws Exception {
-
- }
-}
14 years
JBoss Rich Faces SVN: r20244 - in sandbox/trunk/examples/fileupload-demo/src/main: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-11-30 13:55:37 -0500 (Tue, 30 Nov 2010)
New Revision: 20244
Modified:
sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml
Log:
RF-9501
Modified: sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-11-30 18:54:31 UTC (rev 20243)
+++ sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-11-30 18:55:37 UTC (rev 20244)
@@ -35,7 +35,9 @@
@SessionScoped
public class FileUploadBean {
+ private String acceptedTypes;
private boolean enabled = true;
+ private boolean noDuplicate = false;
private UploadItem item;
public UploadItem getItem() {
@@ -47,8 +49,10 @@
// }
public void listener(UploadEvent event) throws Exception {
- item.getFile().delete();
item = event.getUploadItem();
+ if (item != null) {
+ item.getFile().delete();
+ }
}
public void setEnabled(boolean enabled) {
@@ -57,6 +61,22 @@
public boolean isEnabled() {
return enabled;
+ }
+
+ public void setNoDuplicate(boolean noDuplicate) {
+ this.noDuplicate = noDuplicate;
+ }
+
+ public boolean isNoDuplicate() {
+ return noDuplicate;
+ }
+
+ public void setAcceptedTypes(String acceptedTypes) {
+ this.acceptedTypes = acceptedTypes;
+ }
+
+ public String getAcceptedTypes() {
+ return acceptedTypes;
}
}
Modified: sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml 2010-11-30 18:54:31 UTC (rev 20243)
+++ sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml 2010-11-30 18:55:37 UTC (rev 20244)
@@ -58,15 +58,27 @@
};
//-->
</script>
- <fu:fileUpload id="fu" enabled="#{fileUploadBean.enabled}" fileUploadListener="#{fileUploadBean.listener}" onfilesubmit="onfilesubmit(event)" onuploadcomplete="onuploadcomplete(event)"/>
+ <fu:fileUpload id="fu" acceptedTypes="#{fileUploadBean.acceptedTypes}" enabled="#{fileUploadBean.enabled}"
+ fileUploadListener="#{fileUploadBean.listener}" noDuplicate="#{fileUploadBean.noDuplicate}"
+ onfilesubmit="onfilesubmit(event)" onuploadcomplete="onuploadcomplete(event)"/>
<h:outputText value="File name:" />
<a4j:outputPanel ajaxRendered="true">#{fileUploadBean.item.fileName}</a4j:outputPanel>
<br />
+ <h:outputText value="AcceptedTypes: " />
+ <h:inputText value="#{fileUploadBean.acceptedTypes}">
+ <f:ajax render="fu"/>
+ </h:inputText>
+ <br />
<h:outputText value="Enabled: " />
<h:selectBooleanCheckbox value="#{fileUploadBean.enabled}">
<f:ajax render="fu"/>
</h:selectBooleanCheckbox>
<br />
+ <h:outputText value="NoDuplicate: " />
+ <h:selectBooleanCheckbox value="#{fileUploadBean.noDuplicate}">
+ <f:ajax render="fu"/>
+ </h:selectBooleanCheckbox>
+ <br />
<input type="submit" />
<a4j:log />
</h:form>
14 years
JBoss Rich Faces SVN: r20243 - in sandbox/trunk/ui/fileupload/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-11-30 13:54:31 -0500 (Tue, 30 Nov 2010)
New Revision: 20243
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
Log:
RF-9496
Modified: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-11-30 18:51:54 UTC (rev 20242)
+++ sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-11-30 18:54:31 UTC (rev 20243)
@@ -49,6 +49,9 @@
init: function(id, options) {
this.id = id;
jQuery.extend(this, options);
+ if (this.acceptedTypes) {
+ this.acceptedTypes = jQuery.trim(this.acceptedTypes).split(/\s*,\s*/);
+ }
this.element = jQuery(this.attachToDom());
this.form = this.element.parents("form:first");
var header = this.element.children(".rf-fu-hdr:first");
@@ -59,8 +62,9 @@
this.inputContainer = this.addButton.find(".rf-fu-inp-cntr:first");
this.input = this.inputContainer.children("input");
this.list = header.next();
- this.progressBar = this.list.next();
- this.iframe = this.progressBar.next();
+ this.progressBarElement = this.list.next();
+ this.progressBar = richfaces.$(this.progressBarElement);
+ this.iframe = this.progressBarElement.next();
this.cleanInput = this.input.clone();
this.addProxy = jQuery.proxy(this.__addItem, this);
this.input.change(this.addProxy);
@@ -76,15 +80,18 @@
},
__addItem: function() {
- this.input.hide();
- this.input.unbind("change", this.addProxy);
- var item = new Item(this);
- this.list.append(item.getJQuery());
- this.items.push(item);
- this.input = this.cleanInput.clone();
- this.inputContainer.append(this.input);
- this.input.change(this.addProxy);
- this.__updateButtons();
+ var fileName = this.input.val();
+ if (this.__accept(fileName) && (!this.noDuplicate || !this.__isFileAlreadyAdded(fileName))) {
+ this.input.hide();
+ this.input.unbind("change", this.addProxy);
+ var item = new Item(this);
+ this.list.append(item.getJQuery());
+ this.items.push(item);
+ this.input = this.cleanInput.clone();
+ this.inputContainer.append(this.input);
+ this.input.change(this.addProxy);
+ this.__updateButtons();
+ }
},
__removeItem: function(item) {
@@ -126,7 +133,7 @@
var originalEncoding = this.form.attr("encoding");
var originalEnctype = this.form.attr("enctype");
try {
- this.form.attr("action", originalAction + "?" + UID + "=1");
+ this.form.attr("action", originalAction + "?" + UID + "=" + this.loadableItem.uid);
this.form.attr("encoding", "multipart/form-data");
this.form.attr("enctype", "multipart/form-data");
richfaces.submitForm(this.form, {"org.richfaces.ajax.component": this.id}, this.id);
@@ -167,6 +174,27 @@
}
}
}
+ },
+
+ __accept: function(fileName) {
+ var result = !this.acceptedTypes;
+ for (var i = 0; !result && i < this.acceptedTypes.length; i++) {
+ var extension = this.acceptedTypes[i];
+ result = fileName.indexOf(extension, fileName.length - extension.length) !== -1;
+ }
+ return result;
+ },
+
+ __isFileAlreadyAdded: function(fileName) {
+ var result = false;
+ for (var i = 0; !result && i < this.items.length; i++) {
+ result = this.items[i].model.name == fileName;
+ }
+ result = result || (this.loadableItem && this.loadableItem.model.name == fileName);
+ for (var i = 0; !result && i < this.uploadedItems.length; i++) {
+ result = this.uploadedItems[i].model.name == fileName;
+ }
+ return result;
}
});
@@ -196,16 +224,23 @@
},
startUploading: function() {
-// this.state.html(this.fileUpload.progressBar.detach());
-// richfaces.$(this.fileUpload.progressBar).poll();
this.state.css("display", "block");
this.link.html("");
this.input.attr("name", this.fileUpload.id);
this.model.state = ITEM_STATE.UPLOADING;
+ this.uid = Math.random();
this.fileUpload.__submit();
+ var params = {};
+ params[UID] = this.uid;
+ this.fileUpload.progressBar.setValue(0);
+ this.state.html(this.fileUpload.progressBarElement.detach());
+ this.fileUpload.progressBar.enable(params);
},
finishUploading: function() {
+ this.fileUpload.progressBar.disable();
+ this.fileUpload.progressBar.setValue(101);
+ this.fileUpload.element.append(this.fileUpload.progressBarElement.detach());
this.input.remove();
this.state.html("Done");
this.link.html("Clear");
Modified: sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-11-30 18:51:54 UTC (rev 20242)
+++ sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-11-30 18:54:31 UTC (rev 20243)
@@ -39,7 +39,8 @@
</cc:interface>
<cc:implementation>
<cdk:object name="enabled" value="#{component.attributes['enabled']}"/>
- <div id="#{clientId}" class="rf-fu">
+ <div id="#{clientId}" class="rf-fu #{component.attributes['styleClass']}"
+ cdk:passThroughWithExclusions="">
<div class="rf-fu-hdr">
<span class="rf-fu-btns-lft">
<span class="rf-fu-btn-add#{enabled ? '' : '-dis'}">
@@ -74,7 +75,7 @@
</c:if>
<iframe name="#{clientId}" class="rf-fu-frm"/>
<cdk:scriptObject name="options">
- <cdk:scriptOption attributes="onfilesubmit onuploadcomplete"/>
+ <cdk:scriptOption attributes="acceptedTypes noDuplicate onfilesubmit onuploadcomplete"/>
</cdk:scriptObject>
<script type="text/javascript">new RichFaces.ui.FileUpload(#{toScriptArgs(clientId, options)});</script>
</c:if>
14 years
JBoss Rich Faces SVN: r20242 - in sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces: context and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-11-30 13:51:54 -0500 (Tue, 30 Nov 2010)
New Revision: 20242
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/request/MultipartRequest.java
Log:
RF-9497
Modified: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-11-30 16:45:23 UTC (rev 20241)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-11-30 18:51:54 UTC (rev 20242)
@@ -37,6 +37,7 @@
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.context.FileUploadPartialViewContextFactory;
import org.richfaces.event.FileUploadListener;
import org.richfaces.event.UploadEvent;
import org.richfaces.request.MultipartRequest;
@@ -46,13 +47,20 @@
*
*/
@JsfComponent(tag = @Tag(handler = "org.richfaces.view.facelets.FileUploadHandler"),
- renderer = @JsfRenderer(type = "org.richfaces.FileUploadRenderer"))
+ renderer = @JsfRenderer(type = "org.richfaces.FileUploadRenderer"),
+ attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml"})
@ListenerFor(systemEventClass = PostAddToViewEvent.class)
public abstract class AbstractFileUpload extends UIComponentBase implements ComponentSystemEventListener {
+ @Attribute
+ public abstract String getAcceptedTypes();
+
@Attribute(defaultValue = "true")
public abstract boolean isEnabled();
+ @Attribute(defaultValue = "false")
+ public abstract boolean isNoDuplicate();
+
@Attribute(events = @EventName("filesubmit"))
public abstract String getOnfilesubmit();
@@ -68,21 +76,23 @@
}
}
- public boolean isListenerForSource(Object source) {
- return true;
- }
-
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
+ FacesContext context = getFacesContext();
Map<String, UIComponent> facets = getFacets();
UIComponent component = facets.get("progress");
if (component == null) {
- FacesContext context = getFacesContext();
- UIComponent pb = context.getApplication().createComponent(context, AbstractProgressBar.COMPONENT_TYPE,
+ component = context.getApplication().createComponent(context, AbstractProgressBar.COMPONENT_TYPE,
"org.richfaces.ProgressBarRenderer");
- pb.setId(getId() + "_pb");
- facets.put("progress", pb);
+ component.setId(getId() + "_pb");
+ facets.put("progress", component);
}
+ component.setValueExpression("value", context.getApplication().getExpressionFactory()
+ .createValueExpression(context.getELContext(),
+ "#{" + MultipartRequest.PERCENT_BEAN_NAME + "[param['"
+ + FileUploadPartialViewContextFactory.UID_KEY + "']]}", Integer.class));
+
}
+
/**
* <p>Add a new {@link FileUploadListener} to the set of listeners
* interested in being notified when {@link UploadEvent}s occur.</p>
@@ -95,7 +105,6 @@
addFacesListener(listener);
}
-
/**
* <p>Return the set of registered {@link FileUploadListener}s for this
* {@link AbstractFileUpload} instance. If there are no registered listeners,
@@ -105,7 +114,6 @@
return (FileUploadListener[]) getFacesListeners(FileUploadListener.class);
}
-
/**
* <p>Remove an existing {@link FileUploadListener} (if any) from the
* set of listeners interested in being notified when
Modified: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java 2010-11-30 16:45:23 UTC (rev 20241)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java 2010-11-30 18:51:54 UTC (rev 20242)
@@ -48,6 +48,8 @@
*/
public class FileUploadPartialViewContextFactory extends PartialViewContextFactory {
+ public static final String UID_KEY = "rf_fu_uid";
+
private static enum ResponseState {
size_exceeded, stopped, server_error
};
@@ -56,12 +58,10 @@
private static final Pattern AMPERSAND = Pattern.compile("&+");
- private static final String UID_KEY = "rf_fu_uid";
-
private PartialViewContextFactory parentFactory;
/** Flag indicating whether a temporary file should be used to cache the uploaded file */
- private boolean createTempFiles = false;
+ private boolean createTempFiles = true;
private String tempFilesDirectory;
@@ -74,12 +74,8 @@
String param = context.getInitParameter("createTempFiles");
if (param != null) {
this.createTempFiles = Boolean.parseBoolean(param);
- } else {
- this.createTempFiles = true;
}
-
this.tempFilesDirectory = context.getInitParameter("tempFilesDirectory");
-
param = context.getInitParameter("maxRequestSize");
if (param != null) {
this.maxRequestSize = Integer.parseInt(param);
Modified: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/request/MultipartRequest.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/request/MultipartRequest.java 2010-11-30 16:45:23 UTC (rev 20241)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/request/MultipartRequest.java 2010-11-30 18:51:54 UTC (rev 20242)
@@ -53,6 +53,9 @@
public static final String TEXT_HTML = "text/html";
+ /** Session bean name where progress bar's percent map will be stored */
+ public static final String PERCENT_BEAN_NAME = "_richfaces_upload_percents";
+
private static final BytesHandler NOOP_HANDLER = new BytesHandler() {
public void handle(byte[] bytes, int length) {
// do nothing
@@ -62,9 +65,6 @@
/** Session bean name where request size will be stored */
private static final String REQUEST_SIZE_BEAN_NAME = "_richfaces_request_size";
- /** Session bean name where progress bar's percent map will be stored */
- private static final String PERCENT_BEAN_NAME = "_richfaces_upload_percents";
-
private static final String PARAM_NAME = "name";
private static final String PARAM_FILENAME = "filename";
private static final String PARAM_CONTENT_TYPE = "Content-Type";
@@ -77,8 +77,8 @@
private static final byte CR = 0x0d;
private static final byte LF = 0x0a;
- private static final byte[] CR_LF = { CR, LF };
- private static final byte[] HYPHENS = { 0x2d, 0x2d }; // '--'
+ private static final byte[] CR_LF = {CR, LF};
+ private static final byte[] HYPHENS = {0x2d, 0x2d}; // '--'
private static final Pattern PARAM_VALUE_PATTERN = Pattern.compile("^\\s*([^\\s=]+)\\s*[=:]\\s*(.+)\\s*$");
@@ -592,7 +592,7 @@
vals.toArray(values);
return values;
} else {
- return new String[] { (String) vp.getValue() };
+ return new String[] {(String) vp.getValue()};
}
} else {
return super.getParameterValues(name);
14 years
JBoss Rich Faces SVN: r20241 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-30 11:45:23 -0500 (Tue, 30 Nov 2010)
New Revision: 20241
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
Log:
* unnecessary imports removed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2010-11-30 16:20:11 UTC (rev 20240)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2010-11-30 16:45:23 UTC (rev 20241)
@@ -29,7 +29,6 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.assertNotSame;
import java.net.URL;
@@ -37,7 +36,6 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
14 years
JBoss Rich Faces SVN: r20240 - management/design-4x/dropDownMenu-new.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-30 11:20:11 -0500 (Tue, 30 Nov 2010)
New Revision: 20240
Modified:
management/design-4x/dropDownMenu-new/dropDownMenu_new.html
Log:
Committed updated DDM markup
Modified: management/design-4x/dropDownMenu-new/dropDownMenu_new.html
===================================================================
--- management/design-4x/dropDownMenu-new/dropDownMenu_new.html 2010-11-30 16:19:06 UTC (rev 20239)
+++ management/design-4x/dropDownMenu-new/dropDownMenu_new.html 2010-11-30 16:20:11 UTC (rev 20240)
@@ -47,7 +47,8 @@
}
.rf-ddm-lst {
border:1px solid #bfbfc0; /*panelBorderColor*/
- background-color: #e7f2fb; /*additionalBackgroundColor*/
+ background-color: #e7f2fb; /*additionalBackgroundColor*/
+ min-width:250px;
position:absolute;
}
.rf-ddm-sublst {
@@ -57,7 +58,6 @@
}
.rf-ddm-lst-bg {
border: 1px solid #e7f2fb; /*additionalBackgroundColor*/
- border-bottom:0;
background: url(images/menu_list_bg.gif) repeat-y left; /*from additionalBackgroundColor (left) to tabBackgroundColor (right)*/
}
.rf-ddm-itm {
@@ -109,15 +109,8 @@
position : absolute;
}
.rf-ddm-itm-dis .rf-ddm-nd {
- background-position : bottom;
+ background-position: bottom;
}
- .rf-ddm-strut{
- font-size: 0px;
- border: 0px;
- margin: 0px;
- width: 250px;
- background: #e7f2fb; /*additionalBackgroundColor*/
- }
/*--- styleClass ---*/
.icon{
@@ -194,7 +187,6 @@
<span class="rf-ddm-itm-ic"><img width="16" height="16" src="images/spacer.gif" alt="Menu item icon"></span>
<span class="rf-ddm-itm-lbl"><a href="#">testString 3.5 testString 3.5 testString 3.5</a></span>
</div>
- <div class="rf-ddm-strut"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"/></div>
</div>
</div>
</div>
@@ -209,7 +201,6 @@
<span class="rf-ddm-itm-ic"><img width="16" height="16" src="images/spacer.gif" alt="Menu item icon"></span>
<span class="rf-ddm-itm-lbl">testString 2.5</span>
</div>
- <div class="rf-ddm-strut"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"/></div>
</div>
</div>
</div>
@@ -225,7 +216,6 @@
<span class="rf-ddm-itm-lbl">testString 1.5</span>
</div>
</div>
- <div class="rf-ddm-strut"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"/></div>
</div>
</div>
</div>
14 years
JBoss Rich Faces SVN: r20239 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-30 11:19:06 -0500 (Tue, 30 Nov 2010)
New Revision: 20239
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
Log:
* removed unnecessary imports
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2010-11-30 16:18:30 UTC (rev 20238)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2010-11-30 16:19:06 UTC (rev 20239)
@@ -37,8 +37,6 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.jboss.test.selenium.locator.Attribute;
-import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
14 years
JBoss Rich Faces SVN: r20238 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richTogglePanel and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-30 11:18:30 -0500 (Tue, 30 Nov 2010)
New Revision: 20238
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml
Log:
https://jira.jboss.org/browse/RFPL-675
* toggle panel's sample improved
* added 29 tests for toggle panel
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2010-11-30 16:18:25 UTC (rev 20237)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2010-11-30 16:18:30 UTC (rev 20238)
@@ -28,6 +28,7 @@
import javax.faces.bean.ViewScoped;
import org.richfaces.component.html.HtmlTogglePanel;
+import org.richfaces.event.ItemChangeEvent;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -70,4 +71,8 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
+
+ public void itemChangeListener(ItemChangeEvent event) {
+ RichBean.logToPage("* item changed " + event.getOldItem() + " -> " + event.getNewItem());
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml 2010-11-30 16:18:25 UTC (rev 20237)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTogglePanel/simple.xhtml 2010-11-30 16:18:30 UTC (rev 20238)
@@ -2,7 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich">
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
<!--
JBoss, Home of Professional Open Source
@@ -41,18 +41,35 @@
<ui:define name="component">
- <h:commandLink id="tcLink1" value="Toggle Panel Item 1">
+ <h:commandLink id="tcLink1" value="Item 1">
<rich:toggleControl targetPanel="richTogglePanel" targetItem="item1" />
</h:commandLink>
<h:outputText value=" | " />
- <h:commandLink id="tcLink2" value="Toggle Panel Item 2">
+ <h:commandLink id="tcLink2" value="Item 2">
<rich:toggleControl targetPanel="richTogglePanel" targetItem="item2" />
</h:commandLink>
<h:outputText value=" | " />
- <h:commandLink id="tcLink3" value="Toggle Panel Item 3">
+ <h:commandLink id="tcLink3" value="Item 3">
<rich:toggleControl targetPanel="richTogglePanel" targetItem="item3" />
</h:commandLink>
+ <br/>
+ <h:commandLink id="tcFirst" value="First Item">
+ <rich:toggleControl targetPanel="richTogglePanel" targetItem="@first" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink id="tcPrev" value="Prev Item">
+ <rich:toggleControl targetPanel="richTogglePanel" targetItem="@prev" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink id="tcNext" value="Next Item">
+ <rich:toggleControl targetPanel="richTogglePanel" targetItem="@next" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink id="tcLast" value="Last Item">
+ <rich:toggleControl targetPanel="richTogglePanel" targetItem="@last" />
+ </h:commandLink>
+
<br/><br/>
<rich:togglePanel id="richTogglePanel"
@@ -63,6 +80,7 @@
dir="#{richTogglePanelBean.attributes['dir'].value}"
execute="#{richTogglePanelBean.attributes['execute'].value}"
immediate="#{richTogglePanelBean.attributes['immediate'].value}"
+ itemChangeListener="#{richTogglePanelBean.itemChangeListener}"
lang="#{richTogglePanelBean.attributes['lang'].value}"
limitToList="#{richTogglePanelBean.attributes['limitToList'].value}"
onbeforeitemchange="#{richTogglePanelBean.attributes['onbeforeitemchange'].value}"
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2010-11-30 16:18:30 UTC (rev 20238)
@@ -0,0 +1,409 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTogglePanel;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.assertNotSame;
+
+import java.net.URL;
+
+import javax.faces.event.PhaseId;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
+import org.jboss.test.selenium.locator.ElementLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.EventFiredCondition;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richTogglePanel/simple.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichTogglePanel extends AbstractMetamerTest {
+
+ private JQueryLocator panel = pjq("div[id$=richTogglePanel]");
+ private JQueryLocator item1 = pjq("div[id$=item1]");
+ private JQueryLocator item2 = pjq("div[id$=item2]");
+ private JQueryLocator item3 = pjq("div[id$=item3]");
+ // toggle controls
+ private JQueryLocator tc1 = pjq("a[id$=tcLink1]");
+ private JQueryLocator tc2 = pjq("a[id$=tcLink2]");
+ private JQueryLocator tc3 = pjq("a[id$=tcLink3]");
+ private JQueryLocator tcFirst = pjq("a[id$=tcFirst]");
+ private JQueryLocator tcPrev = pjq("a[id$=tcPrev]");
+ private JQueryLocator tcNext = pjq("a[id$=tcNext]");
+ private JQueryLocator tcLast = pjq("a[id$=tcLast]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTogglePanel/simple.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(panel), "Toggle panel is not present on the page.");
+ assertTrue(selenium.isVisible(panel), "Toggle panel is not visible.");
+ assertTrue(selenium.isElementPresent(item1), "Item 1 is not present on the page.");
+ assertTrue(selenium.isVisible(item1), "Item 1 is not visible.");
+ assertTrue(selenium.isElementPresent(item2), "Item 2 is not present on the page.");
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertTrue(selenium.isElementPresent(item3), "Item 3 is not present on the page.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+ }
+
+ @Test
+ public void testSwitchTypeNull() {
+ guardXhr(selenium).click(tc3);
+ waitGui.failWith("Item 3 is not displayed.").until(isDisplayed.locator(item3));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+
+ guardXhr(selenium).click(tc2);
+ waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(item2));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+
+ guardXhr(selenium).click(tc1);
+ waitGui.failWith("Item 1 is not displayed.").until(isDisplayed.locator(item1));
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+ }
+
+ @Test
+ public void testSwitchTypeAjax() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=ajax]"));
+ selenium.waitForPageToLoad();
+
+ testSwitchTypeNull();
+ }
+
+ @Test
+ public void testSwitchTypeClient() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=client]"));
+ selenium.waitForPageToLoad();
+
+ guardNoRequest(selenium).click(tc3);
+ waitGui.failWith("Item 3 is not displayed.").until(isDisplayed.locator(item3));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+
+ guardNoRequest(selenium).click(tc2);
+ waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(item2));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+
+ guardNoRequest(selenium).click(tc1);
+ waitGui.failWith("Item 1 is not displayed.").until(isDisplayed.locator(item1));
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+ }
+
+ @Test
+ public void testSwitchTypeServer() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=server]"));
+ selenium.waitForPageToLoad();
+
+ guardHttp(selenium).click(tc3);
+ assertTrue(selenium.isVisible(item3), "Item 3 should be visible.");
+ assertFalse(selenium.isElementPresent(item1), "Item 1 should not be present.");
+ assertFalse(selenium.isElementPresent(item2), "Item 2 should not be present.");
+
+ guardHttp(selenium).click(tc2);
+ assertTrue(selenium.isVisible(item2), "Item 2 should be visible.");
+ assertFalse(selenium.isElementPresent(item1), "Item 1 should not be present.");
+ assertFalse(selenium.isElementPresent(item3), "Item 3 should not be present.");
+
+ guardHttp(selenium).click(tc1);
+ assertTrue(selenium.isVisible(item1), "Item 1 should be visible.");
+ assertFalse(selenium.isElementPresent(item2), "Item 2 should not be present.");
+ assertFalse(selenium.isElementPresent(item3), "Item 3 should not be present.");
+ }
+
+ @Test
+ public void testFirstLastPrevNextSwitchNull() {
+ guardXhr(selenium).click(tcNext);
+ waitGui.failWith("Next item (2) is not displayed.").until(isDisplayed.locator(item2));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+
+ guardXhr(selenium).click(tcPrev);
+ waitGui.failWith("Previous item (1) is not displayed.").until(isDisplayed.locator(item1));
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+
+ guardXhr(selenium).click(tcLast);
+ waitGui.failWith("Last item (3) is not displayed.").until(isDisplayed.locator(item3));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+
+ guardXhr(selenium).click(tcFirst);
+ waitGui.failWith("First item (1) is not displayed.").until(isDisplayed.locator(item1));
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+ }
+
+ @Test
+ public void testFirstLastPrevNextSwitchAjax() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=ajax]"));
+ selenium.waitForPageToLoad();
+
+ testFirstLastPrevNextSwitchNull();
+ }
+
+ @Test
+ public void testFirstLastPrevNextSwitchClient() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=client]"));
+ selenium.waitForPageToLoad();
+
+ guardNoRequest(selenium).click(tcNext);
+ waitGui.failWith("Next item (2) is not displayed.").until(isDisplayed.locator(item2));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+
+ guardNoRequest(selenium).click(tcPrev);
+ waitGui.failWith("Previous item (1) is not displayed.").until(isDisplayed.locator(item1));
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+
+ guardNoRequest(selenium).click(tcLast);
+ waitGui.failWith("Last item (3) is not displayed.").until(isDisplayed.locator(item3));
+ assertFalse(selenium.isVisible(item1), "Item 1 should not be visible.");
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+
+ guardNoRequest(selenium).click(tcFirst);
+ waitGui.failWith("First item (1) is not displayed.").until(isDisplayed.locator(item1));
+ assertFalse(selenium.isVisible(item2), "Item 2 should not be visible.");
+ assertFalse(selenium.isVisible(item3), "Item 3 should not be visible.");
+ }
+
+ @Test
+ public void testFirstLastPrevNextSwitchServer() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=server]"));
+ selenium.waitForPageToLoad();
+
+ guardHttp(selenium).click(tcNext);
+ assertTrue(selenium.isVisible(item2), "Next item (2) should be visible.");
+ assertFalse(selenium.isElementPresent(item1), "Item 1 should not be present.");
+ assertFalse(selenium.isElementPresent(item3), "Item 3 should not be present.");
+
+ guardHttp(selenium).click(tcPrev);
+ assertTrue(selenium.isVisible(item1), "Previous item (2) should be visible.");
+ assertFalse(selenium.isElementPresent(item2), "Item 2 should not be present.");
+ assertFalse(selenium.isElementPresent(item3), "Item 3 should not be present.");
+
+ guardHttp(selenium).click(tcLast);
+ assertTrue(selenium.isVisible(item3), "Last item (3) should be visible.");
+ assertFalse(selenium.isElementPresent(item1), "Item 1 should not be present.");
+ assertFalse(selenium.isElementPresent(item2), "Item 2 should not be present.");
+
+ guardHttp(selenium).click(tcFirst);
+ assertTrue(selenium.isVisible(item1), "First item (1) should be visible.");
+ assertFalse(selenium.isElementPresent(item2), "Item 2 should not be present.");
+ assertFalse(selenium.isElementPresent(item3), "Item 3 should not be present.");
+ }
+
+ @Test
+ public void testBypassUpdates() {
+ JQueryLocator input = pjq("input[type=radio][name$=bypassUpdatesInput][value=true]");
+ selenium.click(input);
+ selenium.waitForPageToLoad();
+
+ selenium.click(tc3);
+ waitGui.failWith("Item 3 is not displayed.").until(isDisplayed.locator(item3));
+
+ assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
+ PhaseId.RENDER_RESPONSE);
+
+ String listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(3)"));
+ assertEquals(listenerOutput, "* item changed item1 -> item3", "Item change listener's output");
+ }
+
+ @Test
+ public void testCycledSwitching() {
+ selenium.click(pjq("input[type=radio][name$=cycledSwitchingInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ guardXhr(selenium).click(tcPrev);
+ waitGui.failWith("Previous item (3) is not displayed.").until(isDisplayed.locator(item3));
+ guardXhr(selenium).click(tcNext);
+ waitGui.failWith("Next item (1) is not displayed.").until(isDisplayed.locator(item1));
+ }
+
+ @Test
+ public void testDir() {
+ super.testDir(panel);
+ }
+
+ @Test
+ public void testImmediate() {
+ JQueryLocator input = pjq("input[type=radio][name$=immediateInput][value=true]");
+ selenium.click(input);
+ selenium.waitForPageToLoad();
+
+ selenium.click(tc3);
+ waitGui.failWith("Item 3 is not displayed.").until(isDisplayed.locator(item3));
+
+ assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
+
+ String listenerOutput = selenium.getText(jq("div#phasesPanel li:eq(2)"));
+ assertEquals(listenerOutput, "* item changed item1 -> item3", "Item change listener's output");
+ }
+
+ @Test
+ public void testLang() {
+ testLang(panel);
+ }
+
+ @Test
+ @IssueTracking("https://jira.jboss.org/browse/RF-9881")
+ public void testLimitToList() {
+ JQueryLocator timeLoc = jq("span[id$=requestTime]");
+
+ selenium.type(pjq("input[type=text][id$=renderInput]"), "@this");
+ selenium.waitForPageToLoad();
+
+ selenium.click(pjq("input[type=radio][name$=limitToListInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ String time = selenium.getText(timeLoc);
+
+ guardXhr(selenium).click(tc2);
+ waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(item2));
+
+ String newTime = selenium.getText(timeLoc);
+ assertEquals(newTime, time, "Panel with ajaxRendered=true should not be rerendered.");
+ }
+
+ @Test
+ public void testOnbeforeitemchange() {
+ selenium.type(pjq("input[id$=onbeforeitemchangeInput]"), "metamerEvents += \"onbeforeitemchange \"");
+ selenium.waitForPageToLoad();
+
+ guardXhr(selenium).click(tc2);
+ waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(item2));
+
+ waitGui.failWith("onbeforeitemchange attribute does not work correctly").until(new EventFiredCondition(new Event("beforeitemchange")));
+ }
+
+ @Test
+ public void testItemchangeEvents() {
+ JQueryLocator time = jq("span[id$=requestTime]");
+
+ selenium.type(pjq("input[type=text][id$=onbeforeitemchangeInput]"), "metamerEvents += \"beforeitemchange \"");
+ selenium.waitForPageToLoad();
+ selenium.type(pjq("input[type=text][id$=onitemchangeInput]"), "metamerEvents += \"itemchange \"");
+ selenium.waitForPageToLoad();
+
+ selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
+ String time1Value = selenium.getText(time);
+
+ guardXhr(selenium).click(tc2);
+ waitGui.failWith("Page was not updated").waitForChange(time1Value, retrieveText.locator(time));
+
+ String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
+
+ assertEquals(events[0], "beforeitemchange", "Attribute onbeforeitemchange doesn't work");
+ assertEquals(events[1], "itemchange", "Attribute onbeforeitemchange doesn't work");
+ }
+
+ @Test
+ public void testOnclick() {
+ testFireEvent(Event.CLICK, panel);
+ }
+
+ @Test
+ public void testOndblclick() {
+ testFireEvent(Event.DBLCLICK, panel);
+ }
+
+ @Test
+ public void testOnitemchange() {
+ selenium.type(pjq("input[id$=onitemchangeInput]"), "metamerEvents += \"onitemchange \"");
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ guardXhr(selenium).click(tc2);
+ waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(item2));
+
+ waitGui.failWith("onitemchange attribute does not work correctly").until(new EventFiredCondition(new Event("itemchange")));
+ }
+
+ @Test
+ public void testOnmousedown() {
+ testFireEvent(Event.MOUSEDOWN, panel);
+ }
+
+ @Test
+ public void testOnmousemove() {
+ testFireEvent(Event.MOUSEMOVE, panel);
+ }
+
+ @Test
+ public void testOnmouseout() {
+ testFireEvent(Event.MOUSEOUT, panel);
+ }
+
+ @Test
+ public void testOnmouseover() {
+ testFireEvent(Event.MOUSEOVER, panel);
+ }
+
+ @Test
+ public void testOnmouseup() {
+ testFireEvent(Event.MOUSEUP, panel);
+ }
+
+ @Test
+ public void testRendered() {
+ JQueryLocator input = pjq("input[type=radio][name$=renderedInput][value=false]");
+ selenium.click(input);
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(panel), "Toggle panel should not be rendered when rendered=false.");
+ }
+
+ @Test
+ public void testStyle() {
+ testStyle(panel, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ testStyleClass(panel, "styleClass");
+ }
+
+ @Test
+ public void testTitle() {
+ testTitle(panel);
+ }
+}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
14 years
JBoss Rich Faces SVN: r20237 - modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-30 11:18:25 -0500 (Tue, 30 Nov 2010)
New Revision: 20237
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
Log:
metamer:attributes made implicitly ajaxRendered
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2010-11-30 16:18:25 UTC (rev 20237)
@@ -19,40 +19,42 @@
<a4j:jsFunction id="submitAjaxFunction" name="submitAjax" execute="#{cc.attrs.execute}" render="#{cc.attrs.render}" />
- <h:panelGrid id="#{cc.attrs.id}" columns="#{cc.attrs.columns * 2}" styleClass="attributes"
- columnClasses="attributes-first-column, attributes-second-column, attributes-first-column, attributes-second-column">
- <c:forEach items="#{cc.attrs.value}" var="entry">
- <h:panelGroup layout="block">
- <h:outputLabel id="#{entry.key}Label" value="#{entry.key}" style="margin-right: 5px;" for="#{entry.key}Input"/>
- <h:graphicImage value="/resources/images/help.png" title="#{entry.value.help}"
- rendered="#{entry.value.help != null}" height="18px;"
- style="vertical-align: middle;" styleClass="attribute-help" >
- </h:graphicImage>
- </h:panelGroup>
-
- <c:choose>
- <c:when test="#{entry.value.bool}">
- <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}">
- <f:selectItem itemValue="null" itemLabel="null"/>
- <f:selectItem itemValue="true" itemLabel="true"/>
- <f:selectItem itemValue="false" itemLabel="false"/>
- </h:selectOneRadio>
- </c:when>
-
- <c:when test="#{entry.value.selectOptions != null}">
- <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}"
- layout="pageDirection">
- <f:selectItems value="#{entry.value.selectOptions}" />
- </h:selectOneRadio>
- </c:when>
-
- <c:otherwise>
- <h:inputText id="#{entry.key}Input" value="#{entry.value.value}" style="width: 200px;" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}" />
- </c:otherwise>
- </c:choose>
-
- </c:forEach>
- </h:panelGrid>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid id="#{cc.attrs.id}" columns="#{cc.attrs.columns * 2}" styleClass="attributes"
+ columnClasses="attributes-first-column, attributes-second-column, attributes-first-column, attributes-second-column">
+ <c:forEach items="#{cc.attrs.value}" var="entry">
+ <h:panelGroup layout="block">
+ <h:outputLabel id="#{entry.key}Label" value="#{entry.key}" style="margin-right: 5px;" for="#{entry.key}Input"/>
+ <h:graphicImage value="/resources/images/help.png" title="#{entry.value.help}"
+ rendered="#{entry.value.help != null}" height="18px;"
+ style="vertical-align: middle;" styleClass="attribute-help" >
+ </h:graphicImage>
+ </h:panelGroup>
+
+ <c:choose>
+ <c:when test="#{entry.value.bool}">
+ <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}">
+ <f:selectItem itemValue="null" itemLabel="null"/>
+ <f:selectItem itemValue="true" itemLabel="true"/>
+ <f:selectItem itemValue="false" itemLabel="false"/>
+ </h:selectOneRadio>
+ </c:when>
+
+ <c:when test="#{entry.value.selectOptions != null}">
+ <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}"
+ layout="pageDirection">
+ <f:selectItems value="#{entry.value.selectOptions}" />
+ </h:selectOneRadio>
+ </c:when>
+
+ <c:otherwise>
+ <h:inputText id="#{entry.key}Input" value="#{entry.value.value}" style="width: 200px;" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}" />
+ </c:otherwise>
+ </c:choose>
+
+ </c:forEach>
+ </h:panelGrid>
+ </a4j:outputPanel>
</composite:implementation>
</h:body>
</html>
14 years
JBoss Rich Faces SVN: r20236 - in modules/tests/metamer/trunk/application: src/main/java/org/richfaces/tests/metamer and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-30 11:17:53 -0500 (Tue, 30 Nov 2010)
New Revision: 20236
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml
Modified:
modules/tests/metamer/trunk/application/pom.xml
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDataTableBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
Log:
rich:dataTable - pre-automating component preparation (RFPL-912)
Modified: modules/tests/metamer/trunk/application/pom.xml
===================================================================
--- modules/tests/metamer/trunk/application/pom.xml 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/pom.xml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -82,6 +82,12 @@
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.5</version>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java 2010-11-30 16:17:53 UTC (rev 20236)
@@ -22,6 +22,8 @@
package org.richfaces.tests.metamer;
import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collection;
import java.util.List;
import javax.faces.model.SelectItem;
@@ -29,6 +31,7 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -73,6 +76,12 @@
}
public void setValue(Object value) {
+ if (value instanceof String) {
+ if (type == Collection.class) {
+ String[] splitted = StringUtils.split((String) value, ",[]");
+ value = Arrays.asList(splitted);
+ }
+ }
this.value = value;
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2010-11-30 16:17:53 UTC (rev 20236)
@@ -22,9 +22,12 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
+import java.util.Map.Entry;
+
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -67,6 +70,8 @@
private String titleFilter;
private int kidsFilter;
private int kidsFilter2;
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
/**
* Initializes the managed bean.
@@ -80,19 +85,45 @@
attributes.setAttribute("rendered", true);
attributes.setAttribute("rows", 10);
-
+ attributes.get("sortPriority").setType(Collection.class);
+
+ // hidden attributes
+ attributes.remove("filteringListeners");
+ attributes.remove("sortingListeners");
+ attributes.remove("filterVar");
+ attributes.remove("iterationState");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("rowAvailable");
+ attributes.remove("rowCount");
+ attributes.remove("rowData");
+ attributes.remove("rowIndex");
+ attributes.remove("rowKey");
+ attributes.remove("rowKeyConverter");
+ attributes.remove("relativeRowIndex");
+
// TODO these must be tested in other way
attributes.remove("componentState");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
+ attributes.remove("selection");
attributes.remove("var");
attributes.remove("value");
+ attributes.remove("keepSaved");
// TODO can be these set as attributes or only as facets?
attributes.remove("caption");
attributes.remove("header");
attributes.remove("footer");
attributes.remove("noData");
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("caption", "Caption");
+ facets.put("header", "Header");
+ facets.put("columnStateHeader", "State Header");
+ facets.put("columnStateFooter", "State Footer");
+ facets.put("columnCapitalHeader", "Capital Header");
+ facets.put("columnCapitalFooter", "Capital Footer");
}
public Attributes getAttributes() {
@@ -212,6 +243,11 @@
setStatesOrder(SortOrder.ascending);
}
}
+
+ public void sortReset() {
+ setStatesOrder(SortOrder.ascending);
+ setCapitalsOrder(SortOrder.unsorted);
+ }
public Filter<?> getFilterSexImpl() {
return new Filter<Employee>() {
@@ -238,8 +274,8 @@
}
};
}
-
- public void sortingListener(SortingEvent event) {
- System.out.println(event.getSortOrder());
+
+ public Map<String, String> getFacets() {
+ return facets;
}
}
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDataTableBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDataTableBean.properties 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDataTableBean.properties 2010-11-30 16:17:53 UTC (rev 20236)
@@ -0,0 +1,2 @@
+attr.sortMode.single=single
+attr.sortMode.multi=multi
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml (from rev 20207, modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/facets.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software 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 software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css" name="richDataTable.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richDataTableBean.state}">
+ <a4j:ajax render="richDataTable scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
+ first="#{richDataTableBean.attributes['first'].value}"
+ keepSaved="#{richDataTableBean.attributes['keepSaved'].value}"
+ noDataLabel="#{richDataTableBean.attributes['noDataLabel'].value}"
+ rendered="#{richDataTableBean.attributes['rendered'].value}"
+ rows="#{richDataTableBean.attributes['rows'].value}"
+ sortMode="#{richDataTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richDataTableBean.attributes['sortPriority'].value}"
+ value="#{richDataTableBean.state ? model.capitals : null}"
+ var="record"
+ >
+
+ <f:facet name="noData">
+ <h:outputText id="noData" value="#{richDataTableBean.facets['noData']}" style="color: red;"
+ rendered="#{not empty richDataTableBean.facets['noData']}"/>
+ </f:facet>
+
+ <f:facet name="caption">
+ <h:outputText id="caption" value="#{richDataTableBean.facets['caption']}"
+ rendered="#{not empty richDataTableBean.facets['caption']}"/>
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText id="header" value="#{richDataTableBean.facets['header']}"
+ rendered="#{not empty richDataTableBean.facets['header']}" />
+ </f:facet>
+
+ <rich:column id="columnState" sortBy="#{record.state}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState" value="#{richDataTableBean.facets['columnStateHeader']}"
+ rendered="#{not empty richDataTableBean.facets['columnStateHeader']}"/>
+ </f:facet>
+
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState" value="#{richDataTableBean.facets['columnStateFooter']}"
+ rendered="#{not empty richDataTableBean.facets['columnStateFooter']}"/>
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="columnCapital" sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital" value="#{richDataTableBean.facets['columnCapitalHeader']}"
+ rendered="#{not empty richDataTableBean.facets['columnCapitalHeader']}"/>
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital" value="#{richDataTableBean.facets['columnCapitalFooter']}"
+ rendered="#{not empty richDataTableBean.facets['columnCapitalFooter']}"/>
+ </f:facet>
+ </rich:column>
+
+ </rich:dataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+
+ <a4j:ajax render="richDataTable">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="No Data Facet: " />
+ <h:inputText id="noDataInput" value="#{richDataTableBean.facets['noData']}" />
+
+ <h:outputLabel value="Caption Facet: " />
+ <h:inputText id="captionInput" value="#{richDataTableBean.facets['caption']}" />
+
+ <h:outputLabel value="Header Facet:" />
+ <h:inputText id="headerInput" value="#{richDataTableBean.facets['header']}" />
+
+ <h:outputLabel value="State Column Header:" />
+ <h:inputText id="columnStateHeaderInput" value="#{richDataTableBean.facets['columnStateHeader']}" />
+
+ <h:outputLabel value="State Column Footer:" />
+ <h:inputText id="columnStateFooterInput" value="#{richDataTableBean.facets['columnStateFooter']}" />
+
+ <h:outputLabel value="Capital Column Header:" />
+ <h:inputText id="columnCapitalHeaderInput" value="#{richDataTableBean.facets['columnCapitalHeader']}" />
+
+ <h:outputLabel value="Capital Column Footer:" />
+ <h:inputText id="columnCapitalFooterInput" value="#{richDataTableBean.facets['columnCapitalFooter']}" />
+ </h:panelGrid>
+ </a4j:ajax>
+
+ <br/><br/>
+
+ <metamer:attributes value="#{richDataTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/list.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -34,6 +34,10 @@
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
Simple page that contains <b>rich:dataTable</b> (with model containing capitals) and input boxes for all its attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="facets" outcome="facets" value="Facets">
+ Simple page that contains <b>rich:dataTable</b> (with model containing capitals) and input boxes for all its attributes.
+ </metamer:testPageLink>
<metamer:testPageLink id="scroller" outcome="scroller" value="Data Scroller">
Page that contains <b>rich:dataTable</b> (with model containing capitals), data scroller and input boxes for all its attributes.
@@ -57,7 +61,7 @@
<b>rich:dataTable</b> (with model containing states and capitals) custom sorting by <b>rich:column</b>'s attribute @sortBy, @sortOrder.
</metamer:testPageLink>
- <metamer:testPageLink id="filtering" outcome="filtering" value="Table filtering">
+ <metamer:testPageLink id="filtering" outcome="filtering" value="Table Filtering">
Page that contains filterable <b>rich:dataTable</b> (with model containing capitals) and input boxes for all its attributes.
</metamer:testPageLink>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -115,18 +115,7 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort state">
- <rich:componentControl event="click" target="richDataTable" operation="sort"/>
- </h:commandButton>
- <h:commandButton id="sortCapitalsButton" value="sort capital">
- <rich:componentControl event="click" target="richDataTable" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
<fieldset>
<legend>scroller1</legend>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -49,88 +49,30 @@
<ui:define name="component">
<rich:dataTable id="richDataTable"
- filterVar="#{richDataTableBean.attributes['filterVar'].value}"
- filteringListeners="#{richDataTableBean.attributes['filteringListeners'].value}"
first="#{richDataTableBean.attributes['first'].value}"
- iterationState="#{richDataTableBean.attributes['iterationState'].value}"
- iterationStatusVar="#{richDataTableBean.attributes['iterationStatusVar'].value}"
keepSaved="#{richDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richDataTableBean.attributes['noDataLabel'].value}"
- relativeRowIndex="#{richDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richDataTableBean.attributes['rendered'].value}"
- rowAvailable="#{richDataTableBean.attributes['rowAvailable'].value}"
- rowCount="#{richDataTableBean.attributes['rowCount'].value}"
- rowData="#{richDataTableBean.attributes['rowData'].value}"
- rowIndex="#{richDataTableBean.attributes['rowIndex'].value}"
- rowKey="#{richDataTableBean.attributes['rowKey'].value}"
- rowKeyConverter="#{richDataTableBean.attributes['rowKeyConverter'].value}"
rows="#{richDataTableBean.attributes['rows'].value}"
sortMode="#{richDataTableBean.attributes['sortMode'].value}"
sortPriority="#{richDataTableBean.attributes['sortPriority'].value}"
- sortingListeners="#{richDataTableBean.attributes['sortingListeners'].value}"
value="#{richDataTableBean.state ? model.capitals : null}"
var="record"
>
- <f:facet name="noData">
- <h:outputText value="There is no data." style="color: red;"/>
- </f:facet>
-
- <f:facet name="caption">
- <h:outputText id="captionFacet" value="Caption Facet" />
- </f:facet>
-
- <f:facet name="header">
- <h:outputText value="Header Facet" />
- </f:facet>
-
<rich:column id="columnState" sortBy="#{record.state}">
- <f:facet name="header">
- <h:outputText id="columnHeaderState" value="State Header" />
- </f:facet>
-
<h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState" value="State Footer" />
- </f:facet>
</rich:column>
<rich:column id="columnCapital" sortBy="#{record.name}">
- <f:facet name="header">
- <h:outputText id="columnHeaderCapital" value="Capital Header" />
- </f:facet>
-
<h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital" value="Capital Footer" />
- </f:facet>
</rich:column>
</rich:dataTable>
</ui:define>
<ui:define name="outOfTemplateAfter">
-
- <h:commandButton id="sortStatesButton" value="sort states">
- <rich:componentControl event="click" target="richDataTable" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
- <h:commandButton id="sortCapitalsButton" value="sort capitals">
- <rich:componentControl event="click" target="richDataTable" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
- <h:commandButton id="sortTableButton" value="sort table">
- <rich:componentControl event="click" target="richDataTable" operation="sort" />
- </h:commandButton>
-
- <br/><br/>
-
<metamer:attributes value="#{richDataTableBean.attributes}" id="attributes" />
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-column.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -79,7 +79,7 @@
<rich:column id="columnState" sortBy="#{record.state}" sortOrder="#{richDataTableBean.statesOrder}">
<f:facet name="header">
- <a4j:commandLink id="columnHeaderState" value="State" render="richDataTable" action="#{richDataTableBean.sortByStates}"/>
+ <a4j:commandLink id="sortStates" value="State" render="richDataTable" action="#{richDataTableBean.sortByStates}"/>
</f:facet>
<h:outputText value="#{record.state}" />
@@ -90,7 +90,7 @@
<rich:column id="columnCapital" sortBy="#{record.name}" sortOrder="#{richDataTableBean.capitalsOrder}" sortingListeners="#{richDataTableBean.sortingListener}">
<f:facet name="header">
- <a4j:commandLink id="columnHeaderCapital" value="Capital" render="richDataTable" action="#{richDataTableBean.sortByCapitals}"/>
+ <a4j:commandLink id="sortCapitals" value="Capital" render="richDataTable" action="#{richDataTableBean.sortByCapitals}"/>
</f:facet>
<h:outputText value="#{record.name}" />
@@ -104,6 +104,9 @@
</f:facet>
</rich:dataTable>
+
+ <a4j:commandButton id="sortReset" value="Reset Sorting" render="richDataTable" action="#{richDataTableBean.sortReset}"/>
+
</ui:define>
<ui:define name="outOfTemplateAfter">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml 2010-11-30 14:37:17 UTC (rev 20235)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/sorting-using-component-control.xhtml 2010-11-30 16:17:53 UTC (rev 20236)
@@ -79,7 +79,11 @@
<rich:column id="columnState" sortBy="#{record.state}" sortOrder="#{richDataTableBean.statesOrder}">
<f:facet name="header">
- State
+ <h:commandLink id="sortStates" value="State">
+ <rich:componentControl event="click" target="richDataTable" operation="sort">
+ <f:param value="columnState" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
<h:outputText value="#{record.state}" />
@@ -90,7 +94,11 @@
<rich:column id="columnCapital" sortBy="#{record.name}" sortOrder="#{richDataTableBean.capitalsOrder}">
<f:facet name="header">
- Capital
+ <h:commandLink id="sortCapitals" value="Capital">
+ <rich:componentControl event="click" target="richDataTable" operation="sort">
+ <f:param value="columnCapital" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
<h:outputText value="#{record.name}" />
@@ -104,29 +112,13 @@
</f:facet>
</rich:dataTable>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort state">
- <rich:componentControl event="click" target="richDataTable" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="sortCapitalsButton" value="sort capital">
- <rich:componentControl event="click" target="richDataTable" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
- <h:commandButton id="sortTableButton" value="sort table">
+ <h:commandButton id="sortReset" value="Reset Sorting">
<rich:componentControl event="click" target="richDataTable" operation="sort" />
</h:commandButton>
+ </ui:define>
- <br/><br/>
-
+ <ui:define name="outOfTemplateAfter">
<metamer:attributes value="#{richDataTableBean.attributes}" id="attributes" />
</ui:define>
14 years