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.f...
+ </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 {
-
- }
-}