JBoss Rich Faces SVN: r14845 - branches/jsf2.0/framework.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-08 05:01:03 -0400 (Wed, 08 Jul 2009)
New Revision: 14845
Removed:
branches/jsf2.0/framework/jsf-test/
Log:
framework code being moved into new build system again...
15 years, 6 months
JBoss Rich Faces SVN: r14844 - branches/jsf2.0/framework.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-08 04:57:26 -0400 (Wed, 08 Jul 2009)
New Revision: 14844
Removed:
branches/jsf2.0/framework/impl/
Log:
framework code being moved into new build system again...
15 years, 6 months
JBoss Rich Faces SVN: r14843 - branches/jsf2.0/framework.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-08 04:55:29 -0400 (Wed, 08 Jul 2009)
New Revision: 14843
Removed:
branches/jsf2.0/framework/api/
Log:
framework code being moved into new build system again...
15 years, 6 months
JBoss Rich Faces SVN: r14842 - framework/trunk/api.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-08 04:43:33 -0400 (Wed, 08 Jul 2009)
New Revision: 14842
Added:
framework/trunk/api/src/
Log:
framework code being moved into new build system again...
Copied: framework/trunk/api/src (from rev 14841, branches/jsf2.0/framework/api/src)
15 years, 6 months
JBoss Rich Faces SVN: r14841 - in branches/jsf2.0/framework/api: src and 35 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-07 22:00:15 -0400 (Tue, 07 Jul 2009)
New Revision: 14841
Added:
branches/jsf2.0/framework/api/src/
branches/jsf2.0/framework/api/src/main/
branches/jsf2.0/framework/api/src/main/java/
branches/jsf2.0/framework/api/src/main/java/META-INF/
branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF
branches/jsf2.0/framework/api/src/main/java/org/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java
branches/jsf2.0/framework/api/src/test/
branches/jsf2.0/framework/api/src/test/java/
branches/jsf2.0/framework/api/src/test/java/org/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java
branches/jsf2.0/framework/api/src/test/java/org/richfaces/
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java
Removed:
branches/jsf2.0/framework/api/src/main/
branches/jsf2.0/framework/api/src/main/java/
branches/jsf2.0/framework/api/src/main/java/META-INF/
branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF
branches/jsf2.0/framework/api/src/main/java/org/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java
branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java
branches/jsf2.0/framework/api/src/test/
branches/jsf2.0/framework/api/src/test/java/
branches/jsf2.0/framework/api/src/test/java/org/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java
branches/jsf2.0/framework/api/src/test/java/org/richfaces/
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java
branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java
Log:
framework code being moved into new build system again...
Copied: branches/jsf2.0/framework/api/src (from rev 14809, branches/jsf2.0/framework/api/src)
Copied: branches/jsf2.0/framework/api/src/main (from rev 14809, branches/jsf2.0/framework/api/src/main)
Copied: branches/jsf2.0/framework/api/src/main/java (from rev 14809, branches/jsf2.0/framework/api/src/main/java)
Copied: branches/jsf2.0/framework/api/src/main/java/META-INF (from rev 14809, branches/jsf2.0/framework/api/src/main/java/META-INF)
Deleted: branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
Copied: branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF (from rev 14809, branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/META-INF/MANIFEST.MF 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Copied: branches/jsf2.0/framework/api/src/main/java/org (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org)
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,374 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf;
-
-import java.text.MessageFormat;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class Messages {
- /**
- * @author asmirnov
- *
- */
- public static final class EmptyResourceBundle extends ResourceBundle {
-
- /* (non-Javadoc)
- * @see java.util.ResourceBundle#getKeys()
- */
- @Override
- public Enumeration<String> getKeys() {
- return Collections.enumeration(Collections.<String>emptyList());
- }
-
- /* (non-Javadoc)
- * @see java.util.ResourceBundle#handleGetObject(java.lang.String)
- */
- @Override
- protected Object handleGetObject(String key) {
- return null;
- }
-
- }
-
- private static final String BUNDLE_NAME = "org.ajax4jsf.messages";
-
- private static Map<ClassLoader, ResourceBundle> bundles = new HashMap<ClassLoader, ResourceBundle>();
-
- private static synchronized ResourceBundle getBundle() {
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- ResourceBundle bundle = (ResourceBundle) bundles.get(contextClassLoader);
- if (bundle == null) {
- try {
- bundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale
- .getDefault(), contextClassLoader);
-
- } catch (MissingResourceException e) {
- try {
- bundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale
- .getDefault(), Messages.class.getClassLoader());
-
- } catch (MissingResourceException e2) {
- bundle = new EmptyResourceBundle();
- }
- }
- bundles.put(contextClassLoader, bundle);
- }
-
- return bundle;
- }
-
- public static final String getMessage(String name) {
- String value = getBundle().getString(name);
- return value == null ? "%" + name + "%" : value;
- }
-
- public static final String getMessage(String name, Object param) {
- String pattern = getBundle().getString(name);
- if(pattern == null) return "%" + name + "%";
- return MessageFormat.format(pattern, new Object[]{param});
- }
-
- public static final String getMessage(String name, Object param1, Object param2) {
- String pattern = getBundle().getString(name);
- if(pattern == null) return "%" + name + "%";
- return MessageFormat.format(pattern, new Object[]{param1, param2});
- }
-
- public static final String getMessage(String name, Object[] params) {
- String pattern = getBundle().getString(name);
- if(pattern == null) return "%" + name + "%";
- return MessageFormat.format(pattern, params);
- }
-
- public static final String BUNDLE_MAP_NO_PUT_VALUE = "BUNDLE_MAP_NO_PUT_VALUE";
- public static final String BUNDLE_MAP_NO_REMOVE_VALUE = "BUNDLE_MAP_NO_REMOVE_VALUE";
- public static final String NO_CONVERTER_REGISTERED = "NO_CONVERTER_REGISTERED";
- public static final String FOR_TARGETS_NO_AJAX_CONTAINER = "FOR_TARGETS_NO_AJAX_CONTAINER";
- public static final String VAR_MUST_BE_LITERAL = "VAR_MUST_BE_LITERAL";
- public static final String EVENT_MUST_BE_LITERAL = "EVENT_MUST_BE_LITERAL";
- public static final String CREATE_JAVASCRIPT_EVENT = "CREATE_JAVASCRIPT_EVENT";
- public static final String CALLED_SET_PARENT = "CALLED_SET_PARENT";
- public static final String DETECT_NEW_COMPONENT = "DETECT_NEW_COMPONENT";
- public static final String SET_VALUE_BINDING_FOR_EVENT = "SET_VALUE_BINDING_FOR_EVENT";
- public static final String COULD_NOT_LOAD_RESOURCE_BUNDLE = "COULD_NOT_LOAD_RESOURCE_BUNDLE";
- public static final String FACES_CONTEXT_NOT_CREATED = "FACES_CONTEXT_NOT_CREATED";
- public static final String FACES_CONTEXT_HAS_NOT_EXTERNAL = "FACES_CONTEXT_HAS_NOT_EXTERNAL";
- public static final String FACES_CONTEXT_HAS_NOT_RESPONSE = "FACES_CONTEXT_HAS_NOT_RESPONSE";
- public static final String CREATE_ALTERNATE_HANDLER = "CREATE_ALTERNATE_HANDLER";
- public static final String ALTERNATE_HANDLER_CONSTRUCTOR_WARNING = "ALTERNATE_HANDLER_CONSTRUCTOR_WARNING";
- public static final String VIEW_HANDLER_INSTANTIATION_ERROR = "VIEW_HANDLER_INSTANTIATION_ERROR";
- public static final String ERROR_ON_PAGE = "ERROR_ON_PAGE";
- public static final String LIFECYCLE_ERROR = "LIFECYCLE_ERROR";
- public static final String LIFECYCLE_ERROR_AT_PHASE = "LIFECYCLE_ERROR_AT_PHASE";
- public static final String COMPONENT_TREE_NOT_CREATED = "COMPONENT_TREE_NOT_CREATED";
- public static final String SET_AJAX_LISTENER = "SET_AJAX_LISTENER";
- public static final String ADD_AJAX_AREA = "ADD_AJAX_AREA";
- public static final String ADD_AJAX_AREAS = "ADD_AJAX_AREAS";
- public static final String SET_AJAX_REQUEST = "SET_AJAX_REQUEST";
- public static final String SUBMITTED_AJAX_REQUEST = "SUBMITTED_AJAX_REQUEST";
- public static final String SEND_EVENT_TO_AJAX_LISTENER = "SEND_EVENT_TO_AJAX_LISTENER";
- public static final String RENDER_AJAX_REQUEST = "RENDER_AJAX_REQUEST";
- public static final String RENDERING_AJAX_REGION_ERROR = "RENDERING_AJAX_REGION_ERROR";
- public static final String RESTORE_AJAX_COMPONENT_STATE = "RESTORE_AJAX_COMPONENT_STATE";
- public static final String SAVE_AJAX_COMPONENT_STATE = "SAVE_AJAX_COMPONENT_STATE";
- public static final String CREATE_AJAX_AREAS_SET_TO_RENDER = "CREATE_AJAX_AREAS_SET_TO_RENDER";
- public static final String ARGUMENT_IS_NOT_AJAX_REGION_ERROR = "ARGUMENT_IS_NOT_AJAX_REGION_ERROR";
- public static final String NULL_EVENT_SUBMITTED_ERROR = "NULL_EVENT_SUBMITTED_ERROR";
- public static final String CONTENT_TYPE_ENCODING = "CONTENT_TYPE_ENCODING";
- public static final String CONTENT_TYPE_NO_ENCODING = "CONTENT_TYPE_NO_ENCODING";
- public static final String FILTER_START_INFO = "FILTER_START_INFO";
- public static final String FILTER_XML_OUTPUT = "FILTER_XML_OUTPUT";
- public static final String FILTER_NO_XML_CHAIN = "FILTER_NO_XML_CHAIN";
- public static final String FILTER_NO_XML_CHAIN_2 = "FILTER_NO_XML_CHAIN_2";
- public static final String FILTER_STOP_INFO = "FILTER_STOP_INFO";
- public static final String PARSER_NOT_INSTANTIATED_ERROR = "PARSER_NOT_INSTANTIATED_ERROR";
- public static final String PARSING_TIME_INFO = "PARSING_TIME_INFO";
- public static final String JTIDY_PARSING_ERROR = "JTIDY_PARSING_ERROR";
- public static final String COMPONENT_NOT_FOUND = "COMPONENT_NOT_FOUND";
- public static final String EVENT_IS_READ_ONLY = "EVENT_IS_READ_ONLY";
- public static final String FLUSH_BUFFERED_STREAM_ERROR = "FLUSH_BUFFERED_STREAM_ERROR";
- public static final String UNSUPPORTED_ENCODING_WARNING = "UNSUPPORTED_ENCODING_WARNING";
- public static final String UNSUPPORTED_ENCODING_WARNING_2 = "UNSUPPORTED_ENCODING_WARNING_2";
- public static final String NO_WRITER_CALLED_INFO = "NO_WRITER_CALLED_INFO";
- public static final String PARSE_XML_DOCUMENT_INFO = "PARSE_XML_DOCUMENT_INFO";
- public static final String NO_WRITER_POSSIBLE_ERROR = "NO_WRITER_POSSIBLE_ERROR";
- public static final String CREATE_WRITER_INFO = "CREATE_WRITER_INFO";
- public static final String NO_STREAM_POSSIBLE_ERROR = "NO_STREAM_POSSIBLE_ERROR";
- public static final String CREATE_STREAM_INFO = "CREATE_STREAM_INFO";
- public static final String OPEN_CLOSE_TAGS_DO_NOT_MATCH_ERROR = "OPEN_CLOSE_TAGS_DO_NOT_MATCH_ERROR";
- public static final String VARIABLE_SUBSTITUTION_WARNING = "VARIABLE_SUBSTITUTION_WARNING";
- public static final String START_DOCUMENT_SAX_EXCEPTION = "START_DOCUMENT_SAX_EXCEPTION";
- public static final String COMMENT_SAX_EXCEPTION = "COMMENT_SAX_EXCEPTION";
- public static final String END_ELEMENT_SAX_EXCEPTION = "END_ELEMENT_SAX_EXCEPTION";
- public static final String END_DOCUMENT_SAX_EXCEPTION = "END_DOCUMENT_SAX_EXCEPTION";
- public static final String START_ELEMENT_SAX_EXCEPTION = "START_ELEMENT_SAX_EXCEPTION";
- public static final String TEXT_SAX_EXCEPTION = "TEXT_SAX_EXCEPTION";
- public static final String MESSAGE_PARSING_INFO = "MESSAGE_PARSING_INFO";
- public static final String CREATE_JTIDY_INFO = "CREATE_JTIDY_INFO";
- public static final String READING_TIDY_PROPERTIES_ERROR = "READING_TIDY_PROPERTIES_ERROR";
- public static final String ILLEGAL_METHOD_STATE = "ILLEGAL_METHOD_STATE";
- public static final String WRAPPED_RULES_NULL_ERROR = "WRAPPED_RULES_NULL_ERROR";
- public static final String NO_NAME_ATTRIBUTE_ERROR = "NO_NAME_ATTRIBUTE_ERROR";
- public static final String ENCODE_COMPILED_TEMPLATE_INFO = "ENCODE_COMPILED_TEMPLATE_INFO";
- public static final String ENCODING_TEMPLATE_TERMINATED_INFO = "ENCODING_TEMPLATE_TERMINATED_INFO";
- public static final String ENCODE_COMPILED_TEMPLATE_INFO2 = "ENCODE_COMPILED_TEMPLATE_INFO2";
- public static final String CONVERTING_NON_VALUE_HOLDER_COMPONENT_ERROR = "CONVERTING_NON_VALUE_HOLDER_COMPONENT_ERROR";
- public static final String COMPONENT_CLASS_ERROR = "COMPONENT_CLASS_ERROR";
- public static final String CONTEXT_NULL_ERROR = "CONTEXT_NULL_ERROR";
- public static final String COMPONENT_NULL_ERROR = "COMPONENT_NULL_ERROR";
- public static final String START_DECODING_COMPONENT_INFO = "START_DECODING_COMPONENT_INFO";
- public static final String START_ENCODING_COMPONENT_INFO = "START_ENCODING_COMPONENT_INFO";
- public static final String CHILDREN_ENCODING_COMPONENT_INFO = "CHILDREN_ENCODING_COMPONENT_INFO";
- public static final String FINISH_ENCODING_COMPONENT_INFO = "FINISH_ENCODING_COMPONENT_INFO";
- public static final String NAMESPACE_NOT_RECOGNIZED_ERROR = "NAMESPACE_NOT_RECOGNIZED_ERROR";
- public static final String RENDERER_METHOD_NOT_SET_ERROR = "RENDERER_METHOD_NOT_SET_ERROR";
- public static final String METHOD_CALL_ERROR_1 = "METHOD_CALL_ERROR_1";
- public static final String METHOD_CALL_ERROR_2 = "METHOD_CALL_ERROR_2";
- public static final String METHOD_CALL_ERROR_3 = "METHOD_CALL_ERROR_3";
- public static final String METHOD_CALL_ERROR_4 = "METHOD_CALL_ERROR_4";
- public static final String METHOD_CALL_ERROR_5 = "METHOD_CALL_ERROR_5";
- public static final String METHOD_CALL_ERROR_6 = "METHOD_CALL_ERROR_6";
- public static final String METHOD_CALL_ERROR_1a = "METHOD_CALL_ERROR_1a";
- public static final String METHOD_CALL_ERROR_2a = "METHOD_CALL_ERROR_2a";
- public static final String METHOD_CALL_ERROR_3a = "METHOD_CALL_ERROR_3a";
- public static final String METHOD_CALL_ERROR_4a = "METHOD_CALL_ERROR_4a";
- public static final String METHOD_CALL_ERROR_5a = "METHOD_CALL_ERROR_5a";
- public static final String METHOD_CALL_ERROR_6a = "METHOD_CALL_ERROR_6a";
- public static final String PARSING_TEMPLATE_ERROR = "PARSING_TEMPLATE_ERROR";
- public static final String TEMPLATE_IO_ERROR = "TEMPLATE_IO_ERROR";
- public static final String PARSING_TEMPLATE_ERROR_2 = "PARSING_TEMPLATE_ERROR_2";
- public static final String START_COMPILE_TEMPLATE_INFO = "START_COMPILE_TEMPLATE_INFO";
- public static final String PARSING_TEMPLATE_ERROR_a = "PARSING_TEMPLATE_ERROR_a";
- public static final String TEMPLATE_IO_ERROR_a = "TEMPLATE_IO_ERROR_a";
- public static final String PARSING_TEMPLATE_ERROR_2a = "PARSING_TEMPLATE_ERROR_2a";
- public static final String FINISH_COMPILE_TEMPLATE_INFO = "FINISH_COMPILE_TEMPLATE_INFO";
- public static final String TEMPLATE_NOT_COMPILED_ERROR = "TEMPLATE_NOT_COMPILED_ERROR";
- public static final String NO_CHILD_ALLOWED = "NO_CHILD_ALLOWED";
- public static final String NO_FACET_NAME_ATTRIBUTE = "NO_FACET_NAME_ATTRIBUTE";
- public static final String BREAKPOINTS_UNSUPPORTED_ERROR = "BREAKPOINTS_UNSUPPORTED_ERROR";
- public static final String BREAKPOINT_NOT_REGISTERED_ERROR = "BREAKPOINT_NOT_REGISTERED_ERROR";
- public static final String CHILD_NOT_ALLOWED_ERROR = "CHILD_NOT_ALLOWED_ERROR";
- public static final String INVOKE_RENDERER_METHOD_ERROR = "INVOKE_RENDERER_METHOD_ERROR";
- public static final String METHOD_CALL_ERROR_2b = "METHOD_CALL_ERROR_2b";
- public static final String METHOD_CALL_ERROR_4b = "METHOD_CALL_ERROR_4b";
- public static final String METHOD_CALL_ERROR_6b = "METHOD_CALL_ERROR_6b";
- public static final String STYLE_ATTRIBUTE_ERROR = "STYLE_ATTRIBUTE_ERROR";
- public static final String BREAKPOINTS_UNSUPPORTED_ERROR_2 = "BREAKPOINTS_UNSUPPORTED_ERROR_2";
- public static final String BREAKPOINTS_UNSUPPORTED_ERROR_3 = "BREAKPOINTS_UNSUPPORTED_ERROR_3";
- public static final String REQUEST_CHAMELEON_RENDER_KIT_INFO = "REQUEST_CHAMELEON_RENDER_KIT_INFO";
- public static final String GET_DEFAULT_RENDER_KIT_ERROR = "GET_DEFAULT_RENDER_KIT_ERROR";
- public static final String DEFAULT_RENDER_KIT_INFO = "DEFAULT_RENDER_KIT_INFO";
- public static final String AJAX_RESPONSE_NOT_RENDERED_INFO = "AJAX_RESPONSE_NOT_RENDERED_INFO";
- public static final String ENTER_BEFORE_RENDER_VIEW_PHASE = "ENTER_BEFORE_RENDER_VIEW_PHASE";
- public static final String SET_RENDER_KIT_ID_INFO = "SET_RENDER_KIT_ID_INFO";
- public static final String PROCESS_AJAX_EVENTS_INFO = "PROCESS_AJAX_EVENTS_INFO";
- public static final String DELEGATE_AJAX_PROCESSING_INFO = "DELEGATE_AJAX_PROCESSING_INFO";
- public static final String BREAKPOINTS_UNSUPPORTED_INSIDE_ATTRIBUTE_ERROR = "BREAKPOINTS_UNSUPPORTED_INSIDE_ATTRIBUTE_ERROR";
- public static final String BUILD_ONCLICK_INFO = "BUILD_ONCLICK_INFO";
- public static final String UNNAMED_PARAMETER_ERROR = "UNNAMED_PARAMETER_ERROR";
- public static final String AJAX_STATUS_COMPONENT_NOT_FOWND_WARNING = "AJAX_STATUS_COMPONENT_NOT_FOWND_WARNING";
- public static final String COMPONENT_NULL_ERROR_2 = "COMPONENT_NULL_ERROR_2";
- public static final String CALCULATE_COMPONENT_ID_INFO = "CALCULATE_COMPONENT_ID_INFO";
- public static final String DETECTING_ENCODING_DISABLED_ERROR = "DETECTING_ENCODING_DISABLED_ERROR";
- public static final String OBTAIN_RESPONSE_SET_HEADER_ERROR = "OBTAIN_RESPONSE_SET_HEADER_ERROR";
- public static final String INVOKE_AJAX_REGION_LISTENER = "INVOKE_AJAX_REGION_LISTENER";
- public static final String APPENDING_AJAX_REGION_TO_NON_AJAX_CONTAINER_WARNING = "APPENDING_AJAX_REGION_TO_NON_AJAX_CONTAINER_WARNING";
- public static final String RENDER_CHILDREN_NON_AJAX_INFO = "RENDER_CHILDREN_NON_AJAX_INFO";
- public static final String RENDER_CHILDREN_AJAX_INFO = "RENDER_CHILDREN_AJAX_INFO";
- public static final String ENCODE_CHILD_AJAX_INFO = "ENCODE_CHILD_AJAX_INFO";
- public static final String RENDER_AJAX_AREA_INFO = "RENDER_AJAX_AREA_INFO";
- public static final String DECODE_AJAX_REQUEST_STATUS_INFO = "DECODE_AJAX_REQUEST_STATUS_INFO";
- public static final String REQUEST_PARAMETERS_MAP = "REQUEST_PARAMETERS_MAP";
- public static final String SET_MYFACES_SEQUENCE_INFO = "SET_MYFACES_SEQUENCE_INFO";
- public static final String SKIP_ENCODING_HTML_INFO = "SKIP_ENCODING_HTML_INFO";
- public static final String SKIP_ENCODE_BEGIN_HTML_INFO = "SKIP_ENCODE_BEGIN_HTML_INFO";
- public static final String SKIP_ENCODE_END_HTML_INFO = "SKIP_ENCODE_END_HTML_INFO";
- public static final String QUERY_STRING_BUILDING_ERROR = "QUERY_STRING_BUILDING_ERROR";
- public static final String BUILD_RESOURCE_URI_INFO = "BUILD_RESOURCE_URI_INFO";
- public static final String RESTORE_DATA_FROM_RESOURCE_URI_INFO = "RESTORE_DATA_FROM_RESOURCE_URI_INFO";
- public static final String STREAM_CORRUPTED_ERROR = "STREAM_CORRUPTED_ERROR";
- public static final String DESERIALIZE_DATA_INPUT_ERROR = "DESERIALIZE_DATA_INPUT_ERROR";
- public static final String DATA_CLASS_NOT_FOUND_ERROR = "DATA_CLASS_NOT_FOUND_ERROR";
- public static final String METHOD_NOT_IMPLEMENTED = "METHOD_NOT_IMPLEMENTED";
- public static final String ENCODE_HTML_INFO = "ENCODE_HTML_INFO";
- public static final String ENCODE_HTML_INFO_2 = "ENCODE_HTML_INFO_2";
- public static final String ENCODE_BEGIN_HTML_INFO = "ENCODE_BEGIN_HTML_INFO";
- public static final String ENCODE_END_HTML_INFO = "ENCODE_END_HTML_INFO";
- public static final String SEND_CONTENT_INFO = "SEND_CONTENT_INFO";
- public static final String NO_INPUT_STREAM_ERROR = "NO_INPUT_STREAM_ERROR";
- public static final String SET_RESPONSE_HEADERS_INFO = "SET_RESPONSE_HEADERS_INFO";
- public static final String BUILD_RESOURCE_INFO = "BUILD_RESOURCE_INFO";
- public static final String NO_RESOURCE_REGISTERED_ERROR = "NO_RESOURCE_REGISTERED_ERROR";
- public static final String NO_RESOURCE_REGISTERED_ERROR_2 = "NO_RESOURCE_REGISTERED_ERROR_2";
- public static final String NO_RESOURCE_EXISTS_ERROR = "NO_RESOURCE_EXISTS_ERROR";
- public static final String INSTANTIATE_RESOURCE_ERROR = "INSTANTIATE_RESOURCE_ERROR";
- public static final String INSTANTIATE_CLASS_ERROR = "INSTANTIATE_CLASS_ERROR";
- public static final String STATIC_RESOURCE_NOT_FOUND_ERROR = "STATIC_RESOURCE_NOT_FOUND_ERROR";
- public static final String PARSING_IF_MODIFIED_SINCE_WARNING = "PARSING_IF_MODIFIED_SINCE_WARNING";
- public static final String GET_CONTENT_FROM_CACHE_INFO = "GET_CONTENT_FROM_CACHE_INFO";
- public static final String CONTENT_NOT_FOUND_ERROR = "CONTENT_NOT_FOUND_ERROR";
- public static final String SEND_RESOURCE_ERROR = "SEND_RESOURCE_ERROR";
- public static final String SEND_RESOURCE_ERROR_2 = "SEND_RESOURCE_ERROR_2";
- public static final String READING_PROPERTIES_ERROR = "READING_PROPERTIES_ERROR";
- public static final String SEND_IMAGE_ERROR = "SEND_IMAGE_ERROR";
- public static final String SEND_IMAGE_ERROR_2 = "SEND_IMAGE_ERROR_2";
- public static final String SKIP_ENCODE_BEGIN_HTML_INFO_2 = "SKIP_ENCODE_BEGIN_HTML_INFO_2";
- public static final String MARK_AS_RENDERED_INFO = "MARK_AS_RENDERED_INFO";
- public static final String SKIP_ENCODE_END_HTML_INFO_2 = "SKIP_ENCODE_END_HTML_INFO_2";
- public static final String VARIABLE_SUBSTITUTION_ERROR = "VARIABLE_SUBSTITUTION_ERROR";
- public static final String SET_SKIN_FACTORY_INFO = "SET_SKIN_FACTORY_INFO";
- public static final String CREATING_SKIN_FACTORY_ERROR = "CREATING_SKIN_FACTORY_ERROR";
- public static final String NULL_SKIN_NAME_ERROR = "NULL_SKIN_NAME_ERROR";
- public static final String CREATE_SKIN_INFO = "CREATE_SKIN_INFO";
- public static final String DEFAULT_PROPERTIES_NOT_FOUND_ERROR = "DEFAULT_PROPERTIES_NOT_FOUND_ERROR";
- public static final String SKIN_PROPERTIES_IO_ERROR = "SKIN_PROPERTIES_IO_ERROR";
- public static final String SKIN_NOT_FOUND_ERROR = "SKIN_NOT_FOUND_ERROR";
- public static final String THEME_NOT_FOUND_ERROR = "THEME_NOT_FOUND_ERROR";
- public static final String ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR = "ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR";
- public static final String ACESSING_SKIN_PROPERTY_ERROR = "ACESSING_SKIN_PROPERTY_ERROR";
- public static final String SKIN_PROPERTIES_READ_ONLY_ERROR = "SKIN_PROPERTIES_READ_ONLY_ERROR";
- public static final String NO_DATA_ADAPTOR = "NO_DATA_ADAPTOR";
- public static final String NO_VALUE_HOLDER_ERROR = "NO_VALUE_HOLDER_ERROR";
- public static final String NO_EDITABLE_VALUE_HOLDER_ERROR = "NO_EDITABLE_VALUE_HOLDER_ERROR";
- public static final String INVALID_VALIDATION_EXPRESSION = "INVALID_VALIDATION_EXPRESSION";
- public static final String NO_ACTION_SOURCE_ERROR = "NO_ACTION_SOURCE_ERROR";
- public static final String NO_ACTION_SOURCE2_ERROR = "NO_ACTION_SOURCE2_ERROR";
- public static final String INVALID_ACTION_LISTENER = "INVALID_ACTION_LISTENER";
- public static final String INVALID_VALUE_CHANGE_LISTENER = "INVALID_VALUE_CHANGE_LISTENER";
- public static final String NO_VALUE_REFERENCE_ERROR = "NO_VALUE_REFERENCE_ERROR";
- public static final String NO_BYTE_ARRAY_ERROR = "NO_BYTE_ARRAY_ERROR";
- public static final String BUFFER_TYPE_ERROR = "BUFFER_TYPE_ERROR";
- public static final String IMAGE_ERROR = "IMAGE_ERROR";
- public static final String CANNOT_WRITE_RASTERS = "CANNOT_WRITE_RASTERS";
- public static final String NULL_OUTPUT_ERROR = "NULL_OUTPUT_ERROR";
- public static final String IMAGE_NOT_BUFFERED_ERROR = "IMAGE_NOT_BUFFERED_ERROR";
- public static final String NOT_DATA_OUTPUT_ERROR = "NOT_DATA_OUTPUT_ERROR";
- public static final String NULL_COLOR_PARAMETER_ERROR = "NULL_COLOR_PARAMETER_ERROR";
- public static final String DECODE_COLOR_PARAMETER_ERROR = "DECODE_COLOR_PARAMETER_ERROR";
- public static final String NULL_COLOR_PARAMETER_ERROR_2 = "NULL_COLOR_PARAMETER_ERROR_2";
- public static final String DECODE_PARAMETER_ERROR = "DECODE_PARAMETER_ERROR";
- public static final String IMAGE_GENERATOR_CLASS_NOT_FOUND = "IMAGE_GENERATOR_CLASS_NOT_FOUND";
- public static final String CREATING_IMAGE_GENERATOR_ERROR = "CREATING_IMAGE_GENERATOR_ERROR";
- public static final String INVALID_COMMENT_INDEX = "INVALID_COMMENT_INDEX";
- public static final String LOADING_IMAGE_ERROR = "LOADING_IMAGE_ERROR";
- public static final String NOT_INDEXED_IMAGE_ERROR = "NOT_INDEXED_IMAGE_ERROR";
- public static final String INVALID_RADIUS = "INVALID_RADIUS";
- public static final String INVALID_ATTRIBUTE_VALUE = "INVALID_ATTRIBUTE_VALUE";
- public static final String VALUE_BINDING_TYPE_ERROR = "VALUE_BINDING_TYPE_ERROR";
- public static final String NO_CONVERTER_FOUND_ERROR = "NO_CONVERTER_FOUND_ERROR";
- public static final String GRABBER_ERROR = "GRABBER_ERROR";
- public static final String TOOMANY_COLORS_ERROR = "TOOMANY_COLORS_ERROR";
- public static final String GET_RESOURCE_AS_STREAM_ERROR = "GET_RESOURCE_AS_STREAM_ERROR";
- public static final String PARSING_WEB_XML_IO_ERROR = "PARSING_WEB_XML_IO_ERROR";
- public static final String PARSING_WEB_XML_SAX_ERROR = "PARSING_WEB_XML_SAX_ERROR";
- public static final String NULL_FILTER_NAME_WARNING = "NULL_FILTER_NAME_WARNING";
- public static final String FILTER_NOT_FOUND_ERROR = "FILTER_NOT_FOUND_ERROR";
- public static final String FILTER_NOT_CONFIGURED_ERROR = "FILTER_NOT_CONFIGURED_ERROR";
- public static final String NO_PREFIX_OR_SUFFIX_IN_FILTER_MAPPING_ERROR = "NO_PREFIX_OR_SUFFIX_IN_FILTER_MAPPING_ERROR";
- public static final String CONFIG_INITIALIZATION_ERROR = "CONFIG_INITIALIZATION_ERROR";
- public static final String FIELD_READING_ERROR = "FIELD_READING_ERROR";
- public static final String CONFIG_INITIALIZATION_ERROR_2 = "CONFIG_INITIALIZATION_ERROR_2";
- public static final String DOM_METHOD_NOT_SUPPORTED = "DOM_METHOD_NOT_SUPPORTED";
- public static final String METHOD_NOT_SUPPORTED = "METHOD_NOT_SUPPORTED";
- public static final String NAMED_ITEM_NOT_FOUND_ERROR = "NAMED_ITEM_NOT_FOUND_ERROR";
- public static final String AJAX_SUPPORT_REQUEST_PARAMETER_INFO = "AJAX_SUPPORT_REQUEST_PARAMETER_INFO";
- public static final String COMMAND_LINK_SUBMIT_INFO = "COMMAND_LINK_SUBMIT_INFO";
- public static final String COMMAND_LINK_NOT_IN_FORM_WARNING = "COMMAND_LINK_NOT_IN_FORM_WARNING";
- public static final String MUST_BE_EXPRESSION_ERROR = "MUST_BE_EXPRESSION_ERROR";
- public static final String NOT_PARENT_AJAX_CONTAINER_ERROR = "NOT_PARENT_AJAX_CONTAINER_ERROR";
- public static final String MUST_BE_LITERAL_ERROR = "MUST_BE_LITERAL_ERROR";
- public static final String FACET_TAG_MANY_CHILDREN_ERROR = "FACET_TAG_MANY_CHILDREN_ERROR";
- public static final String NO_UI_COMPONENT_TAG_ANCESTOR_ERROR = "NO_UI_COMPONENT_TAG_ANCESTOR_ERROR";
- public static final String NO_VALUE_REFERENCE_ERROR_2 = "NO_VALUE_REFERENCE_ERROR_2";
- public static final String NULL_TYPE_ATTRIBUTE_ERROR = "NULL_TYPE_ATTRIBUTE_ERROR";
- public static final String NULL_ATTRIBUTE_ERROR = "NULL_ATTRIBUTE_ERROR";
- public static final String AJAX_VIEW_EXPIRED = "AJAX_VIEW_EXPIRED";
- public static final String SKIN_CYCLIC_REFERENCE = "SKIN_CYCLIC_REFERENCE";
- public static final String SKIN_ILLEGAL_REFERENCE = "SKIN_ILLEGAL_REFERENCE";
- public static final String NAME_MUST_BE_LITERAL = "NAME_MUST_BE_LITERAL";
- public static final String INSTANTIATE_LISTENER_ERROR = "INSTANTIATE_LISTENER_ERROR";
- public static final String NOT_AJAX_CONTAINER_ERROR = "NOT_AJAX_CONTAINER_ERROR";
- public static final String INVALID_EXPRESSION = "INVALID_EXPRESSION";
- public static final String NOT_INSTANCE_OF_ERROR = "NOT_INSTANCE_OF_ERROR";
- public static final String UNSUPPORTED_ENCODING_ERROR = "UNSUPPORTED_ENCODING_ERROR";
- public static final String UNSUPPORTED_INPUT_SOURCE_ERROR = "UNSUPPORTED_INPUT_SOURCE_ERROR";
- public static final String STRING_CONVERSION_ERROR = "STRING_CONVERSION_ERROR";
- public static final String UTF_CONVERSION_ERROR = "UTF_CONVERSION_ERROR";
- public static final String READ_ONLY_NODE_ERROR = "READ_ONLY_NODE_ERROR";
- public static final String NOT_PARENT_AJAX_COMPONENT_ERROR = "NOT_PARENT_AJAX_COMPONENT_ERROR";
- public static final String INVALID_VALUE = "INVALID_VALUE";
- public static final String DATASCROLLER_PAGE_MISSING = "DATASCROLLER_PAGE_MISSING";
- public static final String DATASCROLLER_PAGES_DIFFERENT = "DATASCROLLER_PAGES_DIFFERENT";
- public static final String COMPONENT_CONVERSION_ERROR = "COMPONENT_CONVERSION_ERROR";
-
- public static void main(String[] args) {
- String m = getMessage(INVALID_ATTRIBUTE_VALUE, "A", "B");
- System.out.println(m);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/Messages.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,374 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf;
+
+import java.text.MessageFormat;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ /**
+ * @author asmirnov
+ *
+ */
+ public static final class EmptyResourceBundle extends ResourceBundle {
+
+ /* (non-Javadoc)
+ * @see java.util.ResourceBundle#getKeys()
+ */
+ @Override
+ public Enumeration<String> getKeys() {
+ return Collections.enumeration(Collections.<String>emptyList());
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.ResourceBundle#handleGetObject(java.lang.String)
+ */
+ @Override
+ protected Object handleGetObject(String key) {
+ return null;
+ }
+
+ }
+
+ private static final String BUNDLE_NAME = "org.ajax4jsf.messages";
+
+ private static Map<ClassLoader, ResourceBundle> bundles = new HashMap<ClassLoader, ResourceBundle>();
+
+ private static synchronized ResourceBundle getBundle() {
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ResourceBundle bundle = (ResourceBundle) bundles.get(contextClassLoader);
+ if (bundle == null) {
+ try {
+ bundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale
+ .getDefault(), contextClassLoader);
+
+ } catch (MissingResourceException e) {
+ try {
+ bundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale
+ .getDefault(), Messages.class.getClassLoader());
+
+ } catch (MissingResourceException e2) {
+ bundle = new EmptyResourceBundle();
+ }
+ }
+ bundles.put(contextClassLoader, bundle);
+ }
+
+ return bundle;
+ }
+
+ public static final String getMessage(String name) {
+ String value = getBundle().getString(name);
+ return value == null ? "%" + name + "%" : value;
+ }
+
+ public static final String getMessage(String name, Object param) {
+ String pattern = getBundle().getString(name);
+ if(pattern == null) return "%" + name + "%";
+ return MessageFormat.format(pattern, new Object[]{param});
+ }
+
+ public static final String getMessage(String name, Object param1, Object param2) {
+ String pattern = getBundle().getString(name);
+ if(pattern == null) return "%" + name + "%";
+ return MessageFormat.format(pattern, new Object[]{param1, param2});
+ }
+
+ public static final String getMessage(String name, Object[] params) {
+ String pattern = getBundle().getString(name);
+ if(pattern == null) return "%" + name + "%";
+ return MessageFormat.format(pattern, params);
+ }
+
+ public static final String BUNDLE_MAP_NO_PUT_VALUE = "BUNDLE_MAP_NO_PUT_VALUE";
+ public static final String BUNDLE_MAP_NO_REMOVE_VALUE = "BUNDLE_MAP_NO_REMOVE_VALUE";
+ public static final String NO_CONVERTER_REGISTERED = "NO_CONVERTER_REGISTERED";
+ public static final String FOR_TARGETS_NO_AJAX_CONTAINER = "FOR_TARGETS_NO_AJAX_CONTAINER";
+ public static final String VAR_MUST_BE_LITERAL = "VAR_MUST_BE_LITERAL";
+ public static final String EVENT_MUST_BE_LITERAL = "EVENT_MUST_BE_LITERAL";
+ public static final String CREATE_JAVASCRIPT_EVENT = "CREATE_JAVASCRIPT_EVENT";
+ public static final String CALLED_SET_PARENT = "CALLED_SET_PARENT";
+ public static final String DETECT_NEW_COMPONENT = "DETECT_NEW_COMPONENT";
+ public static final String SET_VALUE_BINDING_FOR_EVENT = "SET_VALUE_BINDING_FOR_EVENT";
+ public static final String COULD_NOT_LOAD_RESOURCE_BUNDLE = "COULD_NOT_LOAD_RESOURCE_BUNDLE";
+ public static final String FACES_CONTEXT_NOT_CREATED = "FACES_CONTEXT_NOT_CREATED";
+ public static final String FACES_CONTEXT_HAS_NOT_EXTERNAL = "FACES_CONTEXT_HAS_NOT_EXTERNAL";
+ public static final String FACES_CONTEXT_HAS_NOT_RESPONSE = "FACES_CONTEXT_HAS_NOT_RESPONSE";
+ public static final String CREATE_ALTERNATE_HANDLER = "CREATE_ALTERNATE_HANDLER";
+ public static final String ALTERNATE_HANDLER_CONSTRUCTOR_WARNING = "ALTERNATE_HANDLER_CONSTRUCTOR_WARNING";
+ public static final String VIEW_HANDLER_INSTANTIATION_ERROR = "VIEW_HANDLER_INSTANTIATION_ERROR";
+ public static final String ERROR_ON_PAGE = "ERROR_ON_PAGE";
+ public static final String LIFECYCLE_ERROR = "LIFECYCLE_ERROR";
+ public static final String LIFECYCLE_ERROR_AT_PHASE = "LIFECYCLE_ERROR_AT_PHASE";
+ public static final String COMPONENT_TREE_NOT_CREATED = "COMPONENT_TREE_NOT_CREATED";
+ public static final String SET_AJAX_LISTENER = "SET_AJAX_LISTENER";
+ public static final String ADD_AJAX_AREA = "ADD_AJAX_AREA";
+ public static final String ADD_AJAX_AREAS = "ADD_AJAX_AREAS";
+ public static final String SET_AJAX_REQUEST = "SET_AJAX_REQUEST";
+ public static final String SUBMITTED_AJAX_REQUEST = "SUBMITTED_AJAX_REQUEST";
+ public static final String SEND_EVENT_TO_AJAX_LISTENER = "SEND_EVENT_TO_AJAX_LISTENER";
+ public static final String RENDER_AJAX_REQUEST = "RENDER_AJAX_REQUEST";
+ public static final String RENDERING_AJAX_REGION_ERROR = "RENDERING_AJAX_REGION_ERROR";
+ public static final String RESTORE_AJAX_COMPONENT_STATE = "RESTORE_AJAX_COMPONENT_STATE";
+ public static final String SAVE_AJAX_COMPONENT_STATE = "SAVE_AJAX_COMPONENT_STATE";
+ public static final String CREATE_AJAX_AREAS_SET_TO_RENDER = "CREATE_AJAX_AREAS_SET_TO_RENDER";
+ public static final String ARGUMENT_IS_NOT_AJAX_REGION_ERROR = "ARGUMENT_IS_NOT_AJAX_REGION_ERROR";
+ public static final String NULL_EVENT_SUBMITTED_ERROR = "NULL_EVENT_SUBMITTED_ERROR";
+ public static final String CONTENT_TYPE_ENCODING = "CONTENT_TYPE_ENCODING";
+ public static final String CONTENT_TYPE_NO_ENCODING = "CONTENT_TYPE_NO_ENCODING";
+ public static final String FILTER_START_INFO = "FILTER_START_INFO";
+ public static final String FILTER_XML_OUTPUT = "FILTER_XML_OUTPUT";
+ public static final String FILTER_NO_XML_CHAIN = "FILTER_NO_XML_CHAIN";
+ public static final String FILTER_NO_XML_CHAIN_2 = "FILTER_NO_XML_CHAIN_2";
+ public static final String FILTER_STOP_INFO = "FILTER_STOP_INFO";
+ public static final String PARSER_NOT_INSTANTIATED_ERROR = "PARSER_NOT_INSTANTIATED_ERROR";
+ public static final String PARSING_TIME_INFO = "PARSING_TIME_INFO";
+ public static final String JTIDY_PARSING_ERROR = "JTIDY_PARSING_ERROR";
+ public static final String COMPONENT_NOT_FOUND = "COMPONENT_NOT_FOUND";
+ public static final String EVENT_IS_READ_ONLY = "EVENT_IS_READ_ONLY";
+ public static final String FLUSH_BUFFERED_STREAM_ERROR = "FLUSH_BUFFERED_STREAM_ERROR";
+ public static final String UNSUPPORTED_ENCODING_WARNING = "UNSUPPORTED_ENCODING_WARNING";
+ public static final String UNSUPPORTED_ENCODING_WARNING_2 = "UNSUPPORTED_ENCODING_WARNING_2";
+ public static final String NO_WRITER_CALLED_INFO = "NO_WRITER_CALLED_INFO";
+ public static final String PARSE_XML_DOCUMENT_INFO = "PARSE_XML_DOCUMENT_INFO";
+ public static final String NO_WRITER_POSSIBLE_ERROR = "NO_WRITER_POSSIBLE_ERROR";
+ public static final String CREATE_WRITER_INFO = "CREATE_WRITER_INFO";
+ public static final String NO_STREAM_POSSIBLE_ERROR = "NO_STREAM_POSSIBLE_ERROR";
+ public static final String CREATE_STREAM_INFO = "CREATE_STREAM_INFO";
+ public static final String OPEN_CLOSE_TAGS_DO_NOT_MATCH_ERROR = "OPEN_CLOSE_TAGS_DO_NOT_MATCH_ERROR";
+ public static final String VARIABLE_SUBSTITUTION_WARNING = "VARIABLE_SUBSTITUTION_WARNING";
+ public static final String START_DOCUMENT_SAX_EXCEPTION = "START_DOCUMENT_SAX_EXCEPTION";
+ public static final String COMMENT_SAX_EXCEPTION = "COMMENT_SAX_EXCEPTION";
+ public static final String END_ELEMENT_SAX_EXCEPTION = "END_ELEMENT_SAX_EXCEPTION";
+ public static final String END_DOCUMENT_SAX_EXCEPTION = "END_DOCUMENT_SAX_EXCEPTION";
+ public static final String START_ELEMENT_SAX_EXCEPTION = "START_ELEMENT_SAX_EXCEPTION";
+ public static final String TEXT_SAX_EXCEPTION = "TEXT_SAX_EXCEPTION";
+ public static final String MESSAGE_PARSING_INFO = "MESSAGE_PARSING_INFO";
+ public static final String CREATE_JTIDY_INFO = "CREATE_JTIDY_INFO";
+ public static final String READING_TIDY_PROPERTIES_ERROR = "READING_TIDY_PROPERTIES_ERROR";
+ public static final String ILLEGAL_METHOD_STATE = "ILLEGAL_METHOD_STATE";
+ public static final String WRAPPED_RULES_NULL_ERROR = "WRAPPED_RULES_NULL_ERROR";
+ public static final String NO_NAME_ATTRIBUTE_ERROR = "NO_NAME_ATTRIBUTE_ERROR";
+ public static final String ENCODE_COMPILED_TEMPLATE_INFO = "ENCODE_COMPILED_TEMPLATE_INFO";
+ public static final String ENCODING_TEMPLATE_TERMINATED_INFO = "ENCODING_TEMPLATE_TERMINATED_INFO";
+ public static final String ENCODE_COMPILED_TEMPLATE_INFO2 = "ENCODE_COMPILED_TEMPLATE_INFO2";
+ public static final String CONVERTING_NON_VALUE_HOLDER_COMPONENT_ERROR = "CONVERTING_NON_VALUE_HOLDER_COMPONENT_ERROR";
+ public static final String COMPONENT_CLASS_ERROR = "COMPONENT_CLASS_ERROR";
+ public static final String CONTEXT_NULL_ERROR = "CONTEXT_NULL_ERROR";
+ public static final String COMPONENT_NULL_ERROR = "COMPONENT_NULL_ERROR";
+ public static final String START_DECODING_COMPONENT_INFO = "START_DECODING_COMPONENT_INFO";
+ public static final String START_ENCODING_COMPONENT_INFO = "START_ENCODING_COMPONENT_INFO";
+ public static final String CHILDREN_ENCODING_COMPONENT_INFO = "CHILDREN_ENCODING_COMPONENT_INFO";
+ public static final String FINISH_ENCODING_COMPONENT_INFO = "FINISH_ENCODING_COMPONENT_INFO";
+ public static final String NAMESPACE_NOT_RECOGNIZED_ERROR = "NAMESPACE_NOT_RECOGNIZED_ERROR";
+ public static final String RENDERER_METHOD_NOT_SET_ERROR = "RENDERER_METHOD_NOT_SET_ERROR";
+ public static final String METHOD_CALL_ERROR_1 = "METHOD_CALL_ERROR_1";
+ public static final String METHOD_CALL_ERROR_2 = "METHOD_CALL_ERROR_2";
+ public static final String METHOD_CALL_ERROR_3 = "METHOD_CALL_ERROR_3";
+ public static final String METHOD_CALL_ERROR_4 = "METHOD_CALL_ERROR_4";
+ public static final String METHOD_CALL_ERROR_5 = "METHOD_CALL_ERROR_5";
+ public static final String METHOD_CALL_ERROR_6 = "METHOD_CALL_ERROR_6";
+ public static final String METHOD_CALL_ERROR_1a = "METHOD_CALL_ERROR_1a";
+ public static final String METHOD_CALL_ERROR_2a = "METHOD_CALL_ERROR_2a";
+ public static final String METHOD_CALL_ERROR_3a = "METHOD_CALL_ERROR_3a";
+ public static final String METHOD_CALL_ERROR_4a = "METHOD_CALL_ERROR_4a";
+ public static final String METHOD_CALL_ERROR_5a = "METHOD_CALL_ERROR_5a";
+ public static final String METHOD_CALL_ERROR_6a = "METHOD_CALL_ERROR_6a";
+ public static final String PARSING_TEMPLATE_ERROR = "PARSING_TEMPLATE_ERROR";
+ public static final String TEMPLATE_IO_ERROR = "TEMPLATE_IO_ERROR";
+ public static final String PARSING_TEMPLATE_ERROR_2 = "PARSING_TEMPLATE_ERROR_2";
+ public static final String START_COMPILE_TEMPLATE_INFO = "START_COMPILE_TEMPLATE_INFO";
+ public static final String PARSING_TEMPLATE_ERROR_a = "PARSING_TEMPLATE_ERROR_a";
+ public static final String TEMPLATE_IO_ERROR_a = "TEMPLATE_IO_ERROR_a";
+ public static final String PARSING_TEMPLATE_ERROR_2a = "PARSING_TEMPLATE_ERROR_2a";
+ public static final String FINISH_COMPILE_TEMPLATE_INFO = "FINISH_COMPILE_TEMPLATE_INFO";
+ public static final String TEMPLATE_NOT_COMPILED_ERROR = "TEMPLATE_NOT_COMPILED_ERROR";
+ public static final String NO_CHILD_ALLOWED = "NO_CHILD_ALLOWED";
+ public static final String NO_FACET_NAME_ATTRIBUTE = "NO_FACET_NAME_ATTRIBUTE";
+ public static final String BREAKPOINTS_UNSUPPORTED_ERROR = "BREAKPOINTS_UNSUPPORTED_ERROR";
+ public static final String BREAKPOINT_NOT_REGISTERED_ERROR = "BREAKPOINT_NOT_REGISTERED_ERROR";
+ public static final String CHILD_NOT_ALLOWED_ERROR = "CHILD_NOT_ALLOWED_ERROR";
+ public static final String INVOKE_RENDERER_METHOD_ERROR = "INVOKE_RENDERER_METHOD_ERROR";
+ public static final String METHOD_CALL_ERROR_2b = "METHOD_CALL_ERROR_2b";
+ public static final String METHOD_CALL_ERROR_4b = "METHOD_CALL_ERROR_4b";
+ public static final String METHOD_CALL_ERROR_6b = "METHOD_CALL_ERROR_6b";
+ public static final String STYLE_ATTRIBUTE_ERROR = "STYLE_ATTRIBUTE_ERROR";
+ public static final String BREAKPOINTS_UNSUPPORTED_ERROR_2 = "BREAKPOINTS_UNSUPPORTED_ERROR_2";
+ public static final String BREAKPOINTS_UNSUPPORTED_ERROR_3 = "BREAKPOINTS_UNSUPPORTED_ERROR_3";
+ public static final String REQUEST_CHAMELEON_RENDER_KIT_INFO = "REQUEST_CHAMELEON_RENDER_KIT_INFO";
+ public static final String GET_DEFAULT_RENDER_KIT_ERROR = "GET_DEFAULT_RENDER_KIT_ERROR";
+ public static final String DEFAULT_RENDER_KIT_INFO = "DEFAULT_RENDER_KIT_INFO";
+ public static final String AJAX_RESPONSE_NOT_RENDERED_INFO = "AJAX_RESPONSE_NOT_RENDERED_INFO";
+ public static final String ENTER_BEFORE_RENDER_VIEW_PHASE = "ENTER_BEFORE_RENDER_VIEW_PHASE";
+ public static final String SET_RENDER_KIT_ID_INFO = "SET_RENDER_KIT_ID_INFO";
+ public static final String PROCESS_AJAX_EVENTS_INFO = "PROCESS_AJAX_EVENTS_INFO";
+ public static final String DELEGATE_AJAX_PROCESSING_INFO = "DELEGATE_AJAX_PROCESSING_INFO";
+ public static final String BREAKPOINTS_UNSUPPORTED_INSIDE_ATTRIBUTE_ERROR = "BREAKPOINTS_UNSUPPORTED_INSIDE_ATTRIBUTE_ERROR";
+ public static final String BUILD_ONCLICK_INFO = "BUILD_ONCLICK_INFO";
+ public static final String UNNAMED_PARAMETER_ERROR = "UNNAMED_PARAMETER_ERROR";
+ public static final String AJAX_STATUS_COMPONENT_NOT_FOWND_WARNING = "AJAX_STATUS_COMPONENT_NOT_FOWND_WARNING";
+ public static final String COMPONENT_NULL_ERROR_2 = "COMPONENT_NULL_ERROR_2";
+ public static final String CALCULATE_COMPONENT_ID_INFO = "CALCULATE_COMPONENT_ID_INFO";
+ public static final String DETECTING_ENCODING_DISABLED_ERROR = "DETECTING_ENCODING_DISABLED_ERROR";
+ public static final String OBTAIN_RESPONSE_SET_HEADER_ERROR = "OBTAIN_RESPONSE_SET_HEADER_ERROR";
+ public static final String INVOKE_AJAX_REGION_LISTENER = "INVOKE_AJAX_REGION_LISTENER";
+ public static final String APPENDING_AJAX_REGION_TO_NON_AJAX_CONTAINER_WARNING = "APPENDING_AJAX_REGION_TO_NON_AJAX_CONTAINER_WARNING";
+ public static final String RENDER_CHILDREN_NON_AJAX_INFO = "RENDER_CHILDREN_NON_AJAX_INFO";
+ public static final String RENDER_CHILDREN_AJAX_INFO = "RENDER_CHILDREN_AJAX_INFO";
+ public static final String ENCODE_CHILD_AJAX_INFO = "ENCODE_CHILD_AJAX_INFO";
+ public static final String RENDER_AJAX_AREA_INFO = "RENDER_AJAX_AREA_INFO";
+ public static final String DECODE_AJAX_REQUEST_STATUS_INFO = "DECODE_AJAX_REQUEST_STATUS_INFO";
+ public static final String REQUEST_PARAMETERS_MAP = "REQUEST_PARAMETERS_MAP";
+ public static final String SET_MYFACES_SEQUENCE_INFO = "SET_MYFACES_SEQUENCE_INFO";
+ public static final String SKIP_ENCODING_HTML_INFO = "SKIP_ENCODING_HTML_INFO";
+ public static final String SKIP_ENCODE_BEGIN_HTML_INFO = "SKIP_ENCODE_BEGIN_HTML_INFO";
+ public static final String SKIP_ENCODE_END_HTML_INFO = "SKIP_ENCODE_END_HTML_INFO";
+ public static final String QUERY_STRING_BUILDING_ERROR = "QUERY_STRING_BUILDING_ERROR";
+ public static final String BUILD_RESOURCE_URI_INFO = "BUILD_RESOURCE_URI_INFO";
+ public static final String RESTORE_DATA_FROM_RESOURCE_URI_INFO = "RESTORE_DATA_FROM_RESOURCE_URI_INFO";
+ public static final String STREAM_CORRUPTED_ERROR = "STREAM_CORRUPTED_ERROR";
+ public static final String DESERIALIZE_DATA_INPUT_ERROR = "DESERIALIZE_DATA_INPUT_ERROR";
+ public static final String DATA_CLASS_NOT_FOUND_ERROR = "DATA_CLASS_NOT_FOUND_ERROR";
+ public static final String METHOD_NOT_IMPLEMENTED = "METHOD_NOT_IMPLEMENTED";
+ public static final String ENCODE_HTML_INFO = "ENCODE_HTML_INFO";
+ public static final String ENCODE_HTML_INFO_2 = "ENCODE_HTML_INFO_2";
+ public static final String ENCODE_BEGIN_HTML_INFO = "ENCODE_BEGIN_HTML_INFO";
+ public static final String ENCODE_END_HTML_INFO = "ENCODE_END_HTML_INFO";
+ public static final String SEND_CONTENT_INFO = "SEND_CONTENT_INFO";
+ public static final String NO_INPUT_STREAM_ERROR = "NO_INPUT_STREAM_ERROR";
+ public static final String SET_RESPONSE_HEADERS_INFO = "SET_RESPONSE_HEADERS_INFO";
+ public static final String BUILD_RESOURCE_INFO = "BUILD_RESOURCE_INFO";
+ public static final String NO_RESOURCE_REGISTERED_ERROR = "NO_RESOURCE_REGISTERED_ERROR";
+ public static final String NO_RESOURCE_REGISTERED_ERROR_2 = "NO_RESOURCE_REGISTERED_ERROR_2";
+ public static final String NO_RESOURCE_EXISTS_ERROR = "NO_RESOURCE_EXISTS_ERROR";
+ public static final String INSTANTIATE_RESOURCE_ERROR = "INSTANTIATE_RESOURCE_ERROR";
+ public static final String INSTANTIATE_CLASS_ERROR = "INSTANTIATE_CLASS_ERROR";
+ public static final String STATIC_RESOURCE_NOT_FOUND_ERROR = "STATIC_RESOURCE_NOT_FOUND_ERROR";
+ public static final String PARSING_IF_MODIFIED_SINCE_WARNING = "PARSING_IF_MODIFIED_SINCE_WARNING";
+ public static final String GET_CONTENT_FROM_CACHE_INFO = "GET_CONTENT_FROM_CACHE_INFO";
+ public static final String CONTENT_NOT_FOUND_ERROR = "CONTENT_NOT_FOUND_ERROR";
+ public static final String SEND_RESOURCE_ERROR = "SEND_RESOURCE_ERROR";
+ public static final String SEND_RESOURCE_ERROR_2 = "SEND_RESOURCE_ERROR_2";
+ public static final String READING_PROPERTIES_ERROR = "READING_PROPERTIES_ERROR";
+ public static final String SEND_IMAGE_ERROR = "SEND_IMAGE_ERROR";
+ public static final String SEND_IMAGE_ERROR_2 = "SEND_IMAGE_ERROR_2";
+ public static final String SKIP_ENCODE_BEGIN_HTML_INFO_2 = "SKIP_ENCODE_BEGIN_HTML_INFO_2";
+ public static final String MARK_AS_RENDERED_INFO = "MARK_AS_RENDERED_INFO";
+ public static final String SKIP_ENCODE_END_HTML_INFO_2 = "SKIP_ENCODE_END_HTML_INFO_2";
+ public static final String VARIABLE_SUBSTITUTION_ERROR = "VARIABLE_SUBSTITUTION_ERROR";
+ public static final String SET_SKIN_FACTORY_INFO = "SET_SKIN_FACTORY_INFO";
+ public static final String CREATING_SKIN_FACTORY_ERROR = "CREATING_SKIN_FACTORY_ERROR";
+ public static final String NULL_SKIN_NAME_ERROR = "NULL_SKIN_NAME_ERROR";
+ public static final String CREATE_SKIN_INFO = "CREATE_SKIN_INFO";
+ public static final String DEFAULT_PROPERTIES_NOT_FOUND_ERROR = "DEFAULT_PROPERTIES_NOT_FOUND_ERROR";
+ public static final String SKIN_PROPERTIES_IO_ERROR = "SKIN_PROPERTIES_IO_ERROR";
+ public static final String SKIN_NOT_FOUND_ERROR = "SKIN_NOT_FOUND_ERROR";
+ public static final String THEME_NOT_FOUND_ERROR = "THEME_NOT_FOUND_ERROR";
+ public static final String ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR = "ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR";
+ public static final String ACESSING_SKIN_PROPERTY_ERROR = "ACESSING_SKIN_PROPERTY_ERROR";
+ public static final String SKIN_PROPERTIES_READ_ONLY_ERROR = "SKIN_PROPERTIES_READ_ONLY_ERROR";
+ public static final String NO_DATA_ADAPTOR = "NO_DATA_ADAPTOR";
+ public static final String NO_VALUE_HOLDER_ERROR = "NO_VALUE_HOLDER_ERROR";
+ public static final String NO_EDITABLE_VALUE_HOLDER_ERROR = "NO_EDITABLE_VALUE_HOLDER_ERROR";
+ public static final String INVALID_VALIDATION_EXPRESSION = "INVALID_VALIDATION_EXPRESSION";
+ public static final String NO_ACTION_SOURCE_ERROR = "NO_ACTION_SOURCE_ERROR";
+ public static final String NO_ACTION_SOURCE2_ERROR = "NO_ACTION_SOURCE2_ERROR";
+ public static final String INVALID_ACTION_LISTENER = "INVALID_ACTION_LISTENER";
+ public static final String INVALID_VALUE_CHANGE_LISTENER = "INVALID_VALUE_CHANGE_LISTENER";
+ public static final String NO_VALUE_REFERENCE_ERROR = "NO_VALUE_REFERENCE_ERROR";
+ public static final String NO_BYTE_ARRAY_ERROR = "NO_BYTE_ARRAY_ERROR";
+ public static final String BUFFER_TYPE_ERROR = "BUFFER_TYPE_ERROR";
+ public static final String IMAGE_ERROR = "IMAGE_ERROR";
+ public static final String CANNOT_WRITE_RASTERS = "CANNOT_WRITE_RASTERS";
+ public static final String NULL_OUTPUT_ERROR = "NULL_OUTPUT_ERROR";
+ public static final String IMAGE_NOT_BUFFERED_ERROR = "IMAGE_NOT_BUFFERED_ERROR";
+ public static final String NOT_DATA_OUTPUT_ERROR = "NOT_DATA_OUTPUT_ERROR";
+ public static final String NULL_COLOR_PARAMETER_ERROR = "NULL_COLOR_PARAMETER_ERROR";
+ public static final String DECODE_COLOR_PARAMETER_ERROR = "DECODE_COLOR_PARAMETER_ERROR";
+ public static final String NULL_COLOR_PARAMETER_ERROR_2 = "NULL_COLOR_PARAMETER_ERROR_2";
+ public static final String DECODE_PARAMETER_ERROR = "DECODE_PARAMETER_ERROR";
+ public static final String IMAGE_GENERATOR_CLASS_NOT_FOUND = "IMAGE_GENERATOR_CLASS_NOT_FOUND";
+ public static final String CREATING_IMAGE_GENERATOR_ERROR = "CREATING_IMAGE_GENERATOR_ERROR";
+ public static final String INVALID_COMMENT_INDEX = "INVALID_COMMENT_INDEX";
+ public static final String LOADING_IMAGE_ERROR = "LOADING_IMAGE_ERROR";
+ public static final String NOT_INDEXED_IMAGE_ERROR = "NOT_INDEXED_IMAGE_ERROR";
+ public static final String INVALID_RADIUS = "INVALID_RADIUS";
+ public static final String INVALID_ATTRIBUTE_VALUE = "INVALID_ATTRIBUTE_VALUE";
+ public static final String VALUE_BINDING_TYPE_ERROR = "VALUE_BINDING_TYPE_ERROR";
+ public static final String NO_CONVERTER_FOUND_ERROR = "NO_CONVERTER_FOUND_ERROR";
+ public static final String GRABBER_ERROR = "GRABBER_ERROR";
+ public static final String TOOMANY_COLORS_ERROR = "TOOMANY_COLORS_ERROR";
+ public static final String GET_RESOURCE_AS_STREAM_ERROR = "GET_RESOURCE_AS_STREAM_ERROR";
+ public static final String PARSING_WEB_XML_IO_ERROR = "PARSING_WEB_XML_IO_ERROR";
+ public static final String PARSING_WEB_XML_SAX_ERROR = "PARSING_WEB_XML_SAX_ERROR";
+ public static final String NULL_FILTER_NAME_WARNING = "NULL_FILTER_NAME_WARNING";
+ public static final String FILTER_NOT_FOUND_ERROR = "FILTER_NOT_FOUND_ERROR";
+ public static final String FILTER_NOT_CONFIGURED_ERROR = "FILTER_NOT_CONFIGURED_ERROR";
+ public static final String NO_PREFIX_OR_SUFFIX_IN_FILTER_MAPPING_ERROR = "NO_PREFIX_OR_SUFFIX_IN_FILTER_MAPPING_ERROR";
+ public static final String CONFIG_INITIALIZATION_ERROR = "CONFIG_INITIALIZATION_ERROR";
+ public static final String FIELD_READING_ERROR = "FIELD_READING_ERROR";
+ public static final String CONFIG_INITIALIZATION_ERROR_2 = "CONFIG_INITIALIZATION_ERROR_2";
+ public static final String DOM_METHOD_NOT_SUPPORTED = "DOM_METHOD_NOT_SUPPORTED";
+ public static final String METHOD_NOT_SUPPORTED = "METHOD_NOT_SUPPORTED";
+ public static final String NAMED_ITEM_NOT_FOUND_ERROR = "NAMED_ITEM_NOT_FOUND_ERROR";
+ public static final String AJAX_SUPPORT_REQUEST_PARAMETER_INFO = "AJAX_SUPPORT_REQUEST_PARAMETER_INFO";
+ public static final String COMMAND_LINK_SUBMIT_INFO = "COMMAND_LINK_SUBMIT_INFO";
+ public static final String COMMAND_LINK_NOT_IN_FORM_WARNING = "COMMAND_LINK_NOT_IN_FORM_WARNING";
+ public static final String MUST_BE_EXPRESSION_ERROR = "MUST_BE_EXPRESSION_ERROR";
+ public static final String NOT_PARENT_AJAX_CONTAINER_ERROR = "NOT_PARENT_AJAX_CONTAINER_ERROR";
+ public static final String MUST_BE_LITERAL_ERROR = "MUST_BE_LITERAL_ERROR";
+ public static final String FACET_TAG_MANY_CHILDREN_ERROR = "FACET_TAG_MANY_CHILDREN_ERROR";
+ public static final String NO_UI_COMPONENT_TAG_ANCESTOR_ERROR = "NO_UI_COMPONENT_TAG_ANCESTOR_ERROR";
+ public static final String NO_VALUE_REFERENCE_ERROR_2 = "NO_VALUE_REFERENCE_ERROR_2";
+ public static final String NULL_TYPE_ATTRIBUTE_ERROR = "NULL_TYPE_ATTRIBUTE_ERROR";
+ public static final String NULL_ATTRIBUTE_ERROR = "NULL_ATTRIBUTE_ERROR";
+ public static final String AJAX_VIEW_EXPIRED = "AJAX_VIEW_EXPIRED";
+ public static final String SKIN_CYCLIC_REFERENCE = "SKIN_CYCLIC_REFERENCE";
+ public static final String SKIN_ILLEGAL_REFERENCE = "SKIN_ILLEGAL_REFERENCE";
+ public static final String NAME_MUST_BE_LITERAL = "NAME_MUST_BE_LITERAL";
+ public static final String INSTANTIATE_LISTENER_ERROR = "INSTANTIATE_LISTENER_ERROR";
+ public static final String NOT_AJAX_CONTAINER_ERROR = "NOT_AJAX_CONTAINER_ERROR";
+ public static final String INVALID_EXPRESSION = "INVALID_EXPRESSION";
+ public static final String NOT_INSTANCE_OF_ERROR = "NOT_INSTANCE_OF_ERROR";
+ public static final String UNSUPPORTED_ENCODING_ERROR = "UNSUPPORTED_ENCODING_ERROR";
+ public static final String UNSUPPORTED_INPUT_SOURCE_ERROR = "UNSUPPORTED_INPUT_SOURCE_ERROR";
+ public static final String STRING_CONVERSION_ERROR = "STRING_CONVERSION_ERROR";
+ public static final String UTF_CONVERSION_ERROR = "UTF_CONVERSION_ERROR";
+ public static final String READ_ONLY_NODE_ERROR = "READ_ONLY_NODE_ERROR";
+ public static final String NOT_PARENT_AJAX_COMPONENT_ERROR = "NOT_PARENT_AJAX_COMPONENT_ERROR";
+ public static final String INVALID_VALUE = "INVALID_VALUE";
+ public static final String DATASCROLLER_PAGE_MISSING = "DATASCROLLER_PAGE_MISSING";
+ public static final String DATASCROLLER_PAGES_DIFFERENT = "DATASCROLLER_PAGES_DIFFERENT";
+ public static final String COMPONENT_CONVERSION_ERROR = "COMPONENT_CONVERSION_ERROR";
+
+ public static void main(String[] args) {
+ String m = getMessage(INVALID_ATTRIBUTE_VALUE, "A", "B");
+ System.out.println(m);
+ }
+
+}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,31 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.application;
-
-import javax.faces.context.FacesContext;
-
-public interface StateHolder {
-
- public Object[] getState(FacesContext context, String viewId, String sequence);
-
- public void saveState(FacesContext context, String viewId, String sequence, Object state[]);
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/StateHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,31 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.application;
+
+import javax.faces.context.FacesContext;
+
+public interface StateHolder {
+
+ public Object[] getState(FacesContext context, String viewId, String sequence);
+
+ public void saveState(FacesContext context, String viewId, String sequence, Object state[]);
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,172 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.application;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.Locale;
-
-import javax.faces.FacesException;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.Messages;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Base wrapper for {@link javax.faces.application.ViewHandler} . By default, delegate all
- * method calls to wrapped handler.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:12 $
- *
- */
-public class ViewHandlerWrapper extends ViewHandler {
- private static final String HANDLERS = "org.ajax4jsf.VIEW_HANDLERS";
-
- private static final Log _log = LogFactory.getLog(ViewHandlerWrapper.class);
-
- /**
- * Wrapped ViewHandler
- */
- protected ViewHandler _handler;
-
- /**
- * @param handler - to wrap.
- */
- public ViewHandlerWrapper(ViewHandler handler) {
- _handler = handler;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#calculateLocale(javax.faces.context.FacesContext)
- */
- public Locale calculateLocale(FacesContext context) {
- return _handler.calculateLocale(context);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#calculateRenderKitId(javax.faces.context.FacesContext)
- */
- public String calculateRenderKitId(FacesContext context) {
- return _handler.calculateRenderKitId(context);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#createView(javax.faces.context.FacesContext, java.lang.String)
- */
- public UIViewRoot createView(FacesContext context, String viewId) {
- return _handler.createView(context, viewId);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#getActionURL(javax.faces.context.FacesContext, java.lang.String)
- */
- public String getActionURL(FacesContext context, String url) {
- return _handler.getActionURL(context, url);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#getResourceURL(javax.faces.context.FacesContext, java.lang.String)
- */
- public String getResourceURL(FacesContext context, String url) {
- return _handler.getResourceURL(context, url);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
- */
- public void renderView(FacesContext context, UIViewRoot root) throws IOException, FacesException {
- _handler.renderView(context, root);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#restoreView(javax.faces.context.FacesContext, java.lang.String)
- */
- public UIViewRoot restoreView(FacesContext context, String viewId) {
- return _handler.restoreView(context, viewId);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#writeState(javax.faces.context.FacesContext)
- */
- public void writeState(FacesContext context) throws IOException {
- _handler.writeState(context);
- }
-
- /**
- * @return Returns the handler.
- */
- protected ViewHandler getHandler() {
- return _handler;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ViewHandler#initView(javax.faces.context.FacesContext)
- */
- public void initView(FacesContext context) throws FacesException {
- _handler.initView(context);
- }
-
- public String calculateCharacterEncoding(FacesContext context) {
- // TODO Auto-generated method stub
- return _handler.calculateCharacterEncoding(context);
- }
- /**
- * <p>Fill view-handlers chain for alternate handlers.</p>
- * <p><em>NOTE:</em> Calls to this method should be synchronized externally since 3.3.0 version</p>
- *
- * @param context
- */
- public void fillChain( FacesContext context){
- String handlers = context.getExternalContext().getInitParameter(HANDLERS);
- if(null != handlers){
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- String[] classes = handlers.split(",");
- for (int i = 0; i < classes.length; i++) {
- String handlerClass = classes[i];
- if (_log.isDebugEnabled()) {
- _log.debug(Messages.getMessage(Messages.CREATE_ALTERNATE_HANDLER, handlerClass));
- }
- try {
- Class<?> clazz = classLoader.loadClass(handlerClass);
- try {
- Constructor<?> constructor = clazz
- .getConstructor(new Class[] { ViewHandler.class });
- _handler = (ViewHandler) constructor
- .newInstance(new Object[] { _handler });
- } catch (NoSuchMethodException e) {
- // No constructor with parent class - create simple instance
- if (_log.isWarnEnabled()) {
- _log.warn(Messages.getMessage(Messages.ALTERNATE_HANDLER_CONSTRUCTOR_WARNING));
- }
- _handler = (ViewHandler) clazz.newInstance();
- }
- } catch (Exception e) {
- _log.error(Messages.getMessage(Messages.VIEW_HANDLER_INSTANTIATION_ERROR), e);
- }
- }
- }
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,172 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.application;
+
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.Locale;
+
+import javax.faces.FacesException;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.Messages;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Base wrapper for {@link javax.faces.application.ViewHandler} . By default, delegate all
+ * method calls to wrapped handler.
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:12 $
+ *
+ */
+public class ViewHandlerWrapper extends ViewHandler {
+ private static final String HANDLERS = "org.ajax4jsf.VIEW_HANDLERS";
+
+ private static final Log _log = LogFactory.getLog(ViewHandlerWrapper.class);
+
+ /**
+ * Wrapped ViewHandler
+ */
+ protected ViewHandler _handler;
+
+ /**
+ * @param handler - to wrap.
+ */
+ public ViewHandlerWrapper(ViewHandler handler) {
+ _handler = handler;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#calculateLocale(javax.faces.context.FacesContext)
+ */
+ public Locale calculateLocale(FacesContext context) {
+ return _handler.calculateLocale(context);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#calculateRenderKitId(javax.faces.context.FacesContext)
+ */
+ public String calculateRenderKitId(FacesContext context) {
+ return _handler.calculateRenderKitId(context);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#createView(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public UIViewRoot createView(FacesContext context, String viewId) {
+ return _handler.createView(context, viewId);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#getActionURL(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public String getActionURL(FacesContext context, String url) {
+ return _handler.getActionURL(context, url);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#getResourceURL(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public String getResourceURL(FacesContext context, String url) {
+ return _handler.getResourceURL(context, url);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
+ */
+ public void renderView(FacesContext context, UIViewRoot root) throws IOException, FacesException {
+ _handler.renderView(context, root);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#restoreView(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public UIViewRoot restoreView(FacesContext context, String viewId) {
+ return _handler.restoreView(context, viewId);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#writeState(javax.faces.context.FacesContext)
+ */
+ public void writeState(FacesContext context) throws IOException {
+ _handler.writeState(context);
+ }
+
+ /**
+ * @return Returns the handler.
+ */
+ protected ViewHandler getHandler() {
+ return _handler;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ViewHandler#initView(javax.faces.context.FacesContext)
+ */
+ public void initView(FacesContext context) throws FacesException {
+ _handler.initView(context);
+ }
+
+ public String calculateCharacterEncoding(FacesContext context) {
+ // TODO Auto-generated method stub
+ return _handler.calculateCharacterEncoding(context);
+ }
+ /**
+ * <p>Fill view-handlers chain for alternate handlers.</p>
+ * <p><em>NOTE:</em> Calls to this method should be synchronized externally since 3.3.0 version</p>
+ *
+ * @param context
+ */
+ public void fillChain( FacesContext context){
+ String handlers = context.getExternalContext().getInitParameter(HANDLERS);
+ if(null != handlers){
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ String[] classes = handlers.split(",");
+ for (int i = 0; i < classes.length; i++) {
+ String handlerClass = classes[i];
+ if (_log.isDebugEnabled()) {
+ _log.debug(Messages.getMessage(Messages.CREATE_ALTERNATE_HANDLER, handlerClass));
+ }
+ try {
+ Class<?> clazz = classLoader.loadClass(handlerClass);
+ try {
+ Constructor<?> constructor = clazz
+ .getConstructor(new Class[] { ViewHandler.class });
+ _handler = (ViewHandler) constructor
+ .newInstance(new Object[] { _handler });
+ } catch (NoSuchMethodException e) {
+ // No constructor with parent class - create simple instance
+ if (_log.isWarnEnabled()) {
+ _log.warn(Messages.getMessage(Messages.ALTERNATE_HANDLER_CONSTRUCTOR_WARNING));
+ }
+ _handler = (ViewHandler) clazz.newInstance();
+ }
+ } catch (Exception e) {
+ _log.error(Messages.getMessage(Messages.VIEW_HANDLER_INSTANTIATION_ERROR), e);
+ }
+ }
+ }
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Classes required to support application-level logic
- */
-package org.ajax4jsf.application;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/application/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Classes required to support application-level logic
+ */
+package org.ajax4jsf.application;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,197 +0,0 @@
-/*
- * Copyright [yyyy] [name of copyright owner].
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.ajax4jsf.cache;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-/**
- * <p>
- * A cache, being a mechanism for efficient temporary storage of objects
- * for the purpose of improving the overall performance of an application
- * system, should not be necessary for the application to function correctly,
- * it only improves the performance.
- * <p>
- * A cache could be scoped, for examples to a JVM, all JVMs on a node, all
- * nodes in a cluster, etc. Operations that are scoped to a cache such as put
- * or load would affect all JVMs in the cache. So the object loaded in 1 JVM
- * would be equally available to all other JVMs in the cache.
- * <p>
- * Objects are identified in the cache by a key. A key can be any Java
- * object that implements the equals and hashcode methods. If the object is
- * to be distributed or persisted (if supported) it must implement
- * serializable.
- * <p/>
- * Each object in the cache will have a <code>CacheEntry<code> object associated with
- * it. This object will encapsulate the metadata associated with the cached
- * object. Mainly it represents the object statistics.
- * <p/>
- * "CacheStatistics" represents the read-only statistics of the cache,
- * while "CacheAttributes" represents the user settable attributes of the
- * cache.
- */
-public interface Cache
-{
- /**
- * Returns true if the cache contains the specified key. The search is
- * scoped to the cache. Other caches in the system will not be searched
- * and a CacheLoader will not be called.
- * @return true, if the cache contains the specified key.
- */
- public boolean containsKey(Object key);
-
- /**
- * @return true if the cache contains one or more keys to the specified value.
- */
- public boolean containsValue(Object value);
-
- /**
- * Returns a set view of the objects currently contained in the cache.
- * A CacheLoader will not be called. The behavior is unspecified for the
- * case when an object is remove from the cache while the return set is
- * being traversed.
- */
- public Set<Entry<Object, Object>> entrySet();
-
- /**
- * Equality is based on the Set returned by entrySet. Equal will return
- * true if the two objects are referencing the same object or
- * entrySet.equals(((Map)o).entrySet()) returns true.
- */
- public boolean equals(Object o);
-
- /**
- * @param ht a hashtable which holds a pointer pointing to the
- * declarative cache description.
- * @throws CacheException if any error occurs.
- */
-
- /**
- * @return the hash code value for this the cache.
- */
- public int hashCode();
-
- /**
- * @return true if entrySet().isEmpty() returns true.
- */
- public boolean isEmpty();
-
- /**
- * Returns a set view of the keys currently contained in the cache. A
- * CacheLoader will not be called. The behavior is unspecified for the
- * case when an object is remove from the cache while the return set is
- * being traversed.
- */
- public Set<Object> keySet();
-
- /**
- * Copies all of the mappings from the specified map to the cache. This
- * would be equivalent to t.entrySet() then iterating through the Set and
- * calling put with each key value pair.
- */
- public void putAll(Map<? extends Object, ? extends Object> t);
-
- /**
- * @return the number of objects in the cache. This should be the same
- * value as entrySet().size();
- */
- public int size();
-
- /**
- * @return a collection view of the values contained in the cache.
- */
- public Collection<Object> values();
-
- /**
- * The get method will return, from the cache, the object associated with
- * the argument "key". If the object is not in the cache, the associated
- * cache loader will be called. If no loader is associated with the object,
- * a null is returned. If a problem is encountered during the retrieving
- * or loading of the object, an exception (to be defined) will be thrown.
- * If the "arg" argument is set, the arg object will be passed to the
- * CacheLoader.load method. The cache will not dereference the object.
- * If no "arg" value is provided a null will be passed to the load method.
- * The storing of null values in the cache is permitted, however, the get
- * method will not distinguish returning a null stored in the cache and
- * not finding the object in the cache. In both cases a null is returned.
- * @throws CacheException
- */
- public Object get(Object key, Object context) throws CacheException;
-
- /**
- * The load method provides a means to "pre load" the cache. This method
- * will, asynchronously, load the specified object into the cache using
- * the associated cacheloader. If the object already exists in the cache,
- * no action is taken. If no loader is associated with the object, no object
- * will be loaded into the cache. If a problem is encountered during the
- * retrieving or loading of the object, an exception should
- * be logged.
- * If the "arg" argument is set, the arg object will be passed to the
- * CacheLoader.load method. The cache will not dereference the object. If
- * no "arg" value is provided a null will be passed to the load method.
- * The storing of null values in the cache is permitted, however, the get
- * method will not distinguish returning a null stored in the cache and not
- * finding the object in the cache. In both cases a null is returned.
- */
- public void load(Object key, Object context) throws CacheException;
-
- /**
- * The peek method will return the object associated with "key" if it
- * currently exists (and is valid) in the cache. If not, a null is
- * returned. With "peek" the CacheLoader will not be invoked and other
- * caches in the system will not be searched.
- */
- public Object peek(Object key);
-
- /**
- * The put method adds the object "value" to the cache identified by the
- * object "key".
- */
- public Object put(Object key, Object value);
-
- /**
- * Returns the CacheEntry object associated with the object identified by
- * "key". If the object is not in the cache a null is returned.
- */
- public CacheEntry getCacheEntry(Object key);
-
- /**
- * The remove method will delete the object from the cache including the
- * key, the associated value and the associated CacheStatistics object.
- */
- public Object remove(Object key);
-
- /**
- * The clear method will remove all objects from the cache including the
- * key, the associated value and the associated CacheStatistics object.
- */
- public void clear();
-
- /**
- * The evict method will remove objects from the cache that are no longer
- * valid. Objects where the specified expiration time has been reached.
- */
- public void evict();
-
- /** Add a listener to the list of cache listeners */
- public void addListener(CacheListener listener);
-
- /** Remove a listener from the list of cache listeners */
- public void removeListener(CacheListener listener);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/Cache.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,197 @@
+/*
+ * Copyright [yyyy] [name of copyright owner].
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ajax4jsf.cache;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+/**
+ * <p>
+ * A cache, being a mechanism for efficient temporary storage of objects
+ * for the purpose of improving the overall performance of an application
+ * system, should not be necessary for the application to function correctly,
+ * it only improves the performance.
+ * <p>
+ * A cache could be scoped, for examples to a JVM, all JVMs on a node, all
+ * nodes in a cluster, etc. Operations that are scoped to a cache such as put
+ * or load would affect all JVMs in the cache. So the object loaded in 1 JVM
+ * would be equally available to all other JVMs in the cache.
+ * <p>
+ * Objects are identified in the cache by a key. A key can be any Java
+ * object that implements the equals and hashcode methods. If the object is
+ * to be distributed or persisted (if supported) it must implement
+ * serializable.
+ * <p/>
+ * Each object in the cache will have a <code>CacheEntry<code> object associated with
+ * it. This object will encapsulate the metadata associated with the cached
+ * object. Mainly it represents the object statistics.
+ * <p/>
+ * "CacheStatistics" represents the read-only statistics of the cache,
+ * while "CacheAttributes" represents the user settable attributes of the
+ * cache.
+ */
+public interface Cache
+{
+ /**
+ * Returns true if the cache contains the specified key. The search is
+ * scoped to the cache. Other caches in the system will not be searched
+ * and a CacheLoader will not be called.
+ * @return true, if the cache contains the specified key.
+ */
+ public boolean containsKey(Object key);
+
+ /**
+ * @return true if the cache contains one or more keys to the specified value.
+ */
+ public boolean containsValue(Object value);
+
+ /**
+ * Returns a set view of the objects currently contained in the cache.
+ * A CacheLoader will not be called. The behavior is unspecified for the
+ * case when an object is remove from the cache while the return set is
+ * being traversed.
+ */
+ public Set<Entry<Object, Object>> entrySet();
+
+ /**
+ * Equality is based on the Set returned by entrySet. Equal will return
+ * true if the two objects are referencing the same object or
+ * entrySet.equals(((Map)o).entrySet()) returns true.
+ */
+ public boolean equals(Object o);
+
+ /**
+ * @param ht a hashtable which holds a pointer pointing to the
+ * declarative cache description.
+ * @throws CacheException if any error occurs.
+ */
+
+ /**
+ * @return the hash code value for this the cache.
+ */
+ public int hashCode();
+
+ /**
+ * @return true if entrySet().isEmpty() returns true.
+ */
+ public boolean isEmpty();
+
+ /**
+ * Returns a set view of the keys currently contained in the cache. A
+ * CacheLoader will not be called. The behavior is unspecified for the
+ * case when an object is remove from the cache while the return set is
+ * being traversed.
+ */
+ public Set<Object> keySet();
+
+ /**
+ * Copies all of the mappings from the specified map to the cache. This
+ * would be equivalent to t.entrySet() then iterating through the Set and
+ * calling put with each key value pair.
+ */
+ public void putAll(Map<? extends Object, ? extends Object> t);
+
+ /**
+ * @return the number of objects in the cache. This should be the same
+ * value as entrySet().size();
+ */
+ public int size();
+
+ /**
+ * @return a collection view of the values contained in the cache.
+ */
+ public Collection<Object> values();
+
+ /**
+ * The get method will return, from the cache, the object associated with
+ * the argument "key". If the object is not in the cache, the associated
+ * cache loader will be called. If no loader is associated with the object,
+ * a null is returned. If a problem is encountered during the retrieving
+ * or loading of the object, an exception (to be defined) will be thrown.
+ * If the "arg" argument is set, the arg object will be passed to the
+ * CacheLoader.load method. The cache will not dereference the object.
+ * If no "arg" value is provided a null will be passed to the load method.
+ * The storing of null values in the cache is permitted, however, the get
+ * method will not distinguish returning a null stored in the cache and
+ * not finding the object in the cache. In both cases a null is returned.
+ * @throws CacheException
+ */
+ public Object get(Object key, Object context) throws CacheException;
+
+ /**
+ * The load method provides a means to "pre load" the cache. This method
+ * will, asynchronously, load the specified object into the cache using
+ * the associated cacheloader. If the object already exists in the cache,
+ * no action is taken. If no loader is associated with the object, no object
+ * will be loaded into the cache. If a problem is encountered during the
+ * retrieving or loading of the object, an exception should
+ * be logged.
+ * If the "arg" argument is set, the arg object will be passed to the
+ * CacheLoader.load method. The cache will not dereference the object. If
+ * no "arg" value is provided a null will be passed to the load method.
+ * The storing of null values in the cache is permitted, however, the get
+ * method will not distinguish returning a null stored in the cache and not
+ * finding the object in the cache. In both cases a null is returned.
+ */
+ public void load(Object key, Object context) throws CacheException;
+
+ /**
+ * The peek method will return the object associated with "key" if it
+ * currently exists (and is valid) in the cache. If not, a null is
+ * returned. With "peek" the CacheLoader will not be invoked and other
+ * caches in the system will not be searched.
+ */
+ public Object peek(Object key);
+
+ /**
+ * The put method adds the object "value" to the cache identified by the
+ * object "key".
+ */
+ public Object put(Object key, Object value);
+
+ /**
+ * Returns the CacheEntry object associated with the object identified by
+ * "key". If the object is not in the cache a null is returned.
+ */
+ public CacheEntry getCacheEntry(Object key);
+
+ /**
+ * The remove method will delete the object from the cache including the
+ * key, the associated value and the associated CacheStatistics object.
+ */
+ public Object remove(Object key);
+
+ /**
+ * The clear method will remove all objects from the cache including the
+ * key, the associated value and the associated CacheStatistics object.
+ */
+ public void clear();
+
+ /**
+ * The evict method will remove objects from the cache that are no longer
+ * valid. Objects where the specified expiration time has been reached.
+ */
+ public void evict();
+
+ /** Add a listener to the list of cache listeners */
+ public void addListener(CacheListener listener);
+
+ /** Remove a listener from the list of cache listeners */
+ public void removeListener(CacheListener listener);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.cache;
-
-import java.util.Properties;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 02.05.2007
- *
- */
-public interface CacheConfigurationLoader {
- public Properties loadProperties(String name);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheConfigurationLoader.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.cache;
+
+import java.util.Properties;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 02.05.2007
+ *
+ */
+public interface CacheConfigurationLoader {
+ public Properties loadProperties(String name);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,45 +0,0 @@
-/*
- * Copyright [yyyy] [name of copyright owner].
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.ajax4jsf.cache;
-
-import java.util.Map;
-
-/**
- * CacheEntry
- *
- * @author Brian Goetz
- */
-public interface CacheEntry extends Map.Entry {
-
- int getHits();
-
- long getLastAccessTime();
- long getLastUpdateTime();
- long getCreationTime();
- long getExpirationTime();
-
- /**
- * Returns a version counter.
- * An implementation may use timestamps for this or an incrementing
- * number. Timestamps usually have issues with granularity and are harder
- * to use across clusteres or threads, so an incrementing counter is often safer.
- */
- long getVersion();
-
- boolean isValid();
- long getCost();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheEntry.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,45 @@
+/*
+ * Copyright [yyyy] [name of copyright owner].
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ajax4jsf.cache;
+
+import java.util.Map;
+
+/**
+ * CacheEntry
+ *
+ * @author Brian Goetz
+ */
+public interface CacheEntry extends Map.Entry {
+
+ int getHits();
+
+ long getLastAccessTime();
+ long getLastUpdateTime();
+ long getCreationTime();
+ long getExpirationTime();
+
+ /**
+ * Returns a version counter.
+ * An implementation may use timestamps for this or an incrementing
+ * number. Timestamps usually have issues with granularity and are harder
+ * to use across clusteres or threads, so an incrementing counter is often safer.
+ */
+ long getVersion();
+
+ boolean isValid();
+ long getCost();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,59 +0,0 @@
-/*
- * Copyright [yyyy] [name of copyright owner].
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.ajax4jsf.cache;
-
-
-/**
- * CacheException is a generic exception, which indicates
- * a cache error has occurred. All the other cache exceptions are the
- * subclass of this class. All the methods in the cache package only
- * throw CacheException or the sub class of it.
- * <P>
- *
- */
-public class CacheException extends Exception
-{
- /**
- *
- */
- private static final long serialVersionUID = 6712594794189413065L;
-
- /**
- * Constructs a new CacheException.
- */
- public CacheException()
- {
- super();
- }
-
- /**
- * Constructs a new CacheException with a message string.
- */
- public CacheException(String s)
- {
- super(s);
- }
-
- /**
- * Constructs a CacheException with a message string, and
- * a base exception
- */
- public CacheException(String s, Throwable ex)
- {
- super(s, ex);
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,59 @@
+/*
+ * Copyright [yyyy] [name of copyright owner].
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ajax4jsf.cache;
+
+
+/**
+ * CacheException is a generic exception, which indicates
+ * a cache error has occurred. All the other cache exceptions are the
+ * subclass of this class. All the methods in the cache package only
+ * throw CacheException or the sub class of it.
+ * <P>
+ *
+ */
+public class CacheException extends Exception
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6712594794189413065L;
+
+ /**
+ * Constructs a new CacheException.
+ */
+ public CacheException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new CacheException with a message string.
+ */
+ public CacheException(String s)
+ {
+ super(s);
+ }
+
+ /**
+ * Constructs a CacheException with a message string, and
+ * a base exception
+ */
+ public CacheException(String s, Throwable ex)
+ {
+ super(s, ex);
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,38 +0,0 @@
-/*
- * Copyright [yyyy] [name of copyright owner].
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.ajax4jsf.cache;
-
-import java.util.Map;
-
-/**
- * CacheFactory is a service provider specific interface.
- * Service provider should implement CacheFactory to provide
- * the functionality to create a new implementation specific Cache object.
- */
-public interface CacheFactory
-{
- /**
- * creates a new implementation specific Cache object using the env parameters.
- * @param env implementation specific environment parameters passed to the
- * CacheFactory.
- * @param cacheLoader implementation of the {@link CacheLoader} to use
- * @param cacheConfigurationloader TODO
- * @return an implementation specific Cache object.
- * @throws CacheException if any error occurs.
- */
- public Cache createCache(Map env, CacheLoader cacheLoader, CacheConfigurationLoader cacheConfigurationloader) throws CacheException;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheFactory.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,38 @@
+/*
+ * Copyright [yyyy] [name of copyright owner].
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ajax4jsf.cache;
+
+import java.util.Map;
+
+/**
+ * CacheFactory is a service provider specific interface.
+ * Service provider should implement CacheFactory to provide
+ * the functionality to create a new implementation specific Cache object.
+ */
+public interface CacheFactory
+{
+ /**
+ * creates a new implementation specific Cache object using the env parameters.
+ * @param env implementation specific environment parameters passed to the
+ * CacheFactory.
+ * @param cacheLoader implementation of the {@link CacheLoader} to use
+ * @param cacheConfigurationloader TODO
+ * @return an implementation specific Cache object.
+ * @throws CacheException if any error occurs.
+ */
+ public Cache createCache(Map env, CacheLoader cacheLoader, CacheConfigurationLoader cacheConfigurationloader) throws CacheException;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,36 +0,0 @@
-/*
- * Copyright [yyyy] [name of copyright owner].
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.ajax4jsf.cache;
-
-/** Interface describing various events that can happen as elements are added to
- * or removed from a cache
- */
-public interface CacheListener {
- /** Triggered when a cache mapping is created due to the cache loader being consulted */
- public void onLoad(Object key);
-
- /** Triggered when a cache mapping is created due to calling Cache.put() */
- public void onPut(Object key);
-
- /** Triggered when a cache mapping is removed due to eviction */
- public void onEvict(Object key);
-
- /** Triggered when a cache mapping is removed due to calling Cache.remove() */
- public void onRemove(Object key);
-
- public void onClear();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,36 @@
+/*
+ * Copyright [yyyy] [name of copyright owner].
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ajax4jsf.cache;
+
+/** Interface describing various events that can happen as elements are added to
+ * or removed from a cache
+ */
+public interface CacheListener {
+ /** Triggered when a cache mapping is created due to the cache loader being consulted */
+ public void onLoad(Object key);
+
+ /** Triggered when a cache mapping is created due to calling Cache.put() */
+ public void onPut(Object key);
+
+ /** Triggered when a cache mapping is removed due to eviction */
+ public void onEvict(Object key);
+
+ /** Triggered when a cache mapping is removed due to calling Cache.remove() */
+ public void onRemove(Object key);
+
+ public void onClear();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,40 +0,0 @@
-/*
- * Copyright [yyyy] [name of copyright owner].
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.ajax4jsf.cache;
-
-
-/**
- * User should implement this CacheLoader interface to
- * provide a loader object to load the objects into cache.
- */
-public interface CacheLoader
-{
- /**
- * loads an object. Application writers should implement this
- * method to customize the loading of cache object. This method is called
- * by the caching service when the requested object is not in the cache.
- * <P>
- *
- * @param key the key identifying the object being loaded
- *
- * @return The object that is to be stored in the cache.
- * @throws CacheException
- *
- */
- public Object load(Object key, Object context) throws CacheException;
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/CacheLoader.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,40 @@
+/*
+ * Copyright [yyyy] [name of copyright owner].
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.ajax4jsf.cache;
+
+
+/**
+ * User should implement this CacheLoader interface to
+ * provide a loader object to load the objects into cache.
+ */
+public interface CacheLoader
+{
+ /**
+ * loads an object. Application writers should implement this
+ * method to customize the loading of cache object. This method is called
+ * by the caching service when the requested object is not in the cache.
+ * <P>
+ *
+ * @param key the key identifying the object being loaded
+ *
+ * @return The object that is to be stored in the cache.
+ * @throws CacheException
+ *
+ */
+ public Object load(Object key, Object context) throws CacheException;
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Cache APIs
- */
-package org.ajax4jsf.cache;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/cache/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Cache APIs
+ */
+package org.ajax4jsf.cache;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,55 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import java.io.IOException;
-import java.util.Set;
-
-import javax.faces.context.FacesContext;
-
-/**
- * Marker interface for components, have ability to manipulate rendering in case of Ajax responses.
- * Such as ajax-enabled iterator, menus etc
- * @author shura
- *
- */
-public interface AjaxChildrenEncoder {
-
- /**
- * Iterate over all childs of components. If component id contains in list ,
- * or, if list is empty, compotents is submitted form - render it.
- * TODO - Instead of calculate full path for every component, build current Path
- * for componet and send as parameter.
- *
- * @param context -
- * current context
- * @param component -
- * curent faces component.
- * @param ids -
- * list of Id to render.
- * @throws IOException
- */
- public void encodeAjaxChild(FacesContext context,
- String path,Set<String> ids,Set<String> renderedAreas) throws IOException ;
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,55 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Marker interface for components, have ability to manipulate rendering in case of Ajax responses.
+ * Such as ajax-enabled iterator, menus etc
+ * @author shura
+ *
+ */
+public interface AjaxChildrenEncoder {
+
+ /**
+ * Iterate over all childs of components. If component id contains in list ,
+ * or, if list is empty, compotents is submitted form - render it.
+ * TODO - Instead of calculate full path for every component, build current Path
+ * for componet and send as parameter.
+ *
+ * @param context -
+ * current context
+ * @param component -
+ * curent faces component.
+ * @param ids -
+ * list of Id to render.
+ * @throws IOException
+ */
+ public void encodeAjaxChild(FacesContext context,
+ String path,Set<String> ids,Set<String> renderedAreas) throws IOException ;
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,229 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-
-/**
- * Base Interface for Ajax-enabled acting components.
- * TODO - extend <code>ActionSource</code>???
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/01/23 20:01:01 $
- *
- */
-public interface AjaxComponent
-{
-
- public static final String AJAX_COMPONETT_PARAMETER = AjaxComponent.class.getName()+".parameter";
-
- /**
- * setter method for property
- * @param new value of String, <code>Collection</code> or array of component's Id , updated in case of Ajax request by parent component. to set
- */
- public abstract void setReRender(Object targetId);
-
- /**
- * @return value or result of valueBinding of String, <code>Collection</code> or array of component's Id , updated in case of Ajax request by parent component.
- */
- public abstract Object getReRender();
-
- /**
- * setter method for property
- * @param new value of String, <code>Collection</code> or array of component's Id , processed at the phases 2-5
- * in the case of Ajax request by parent component. to set
- */
- public abstract void setProcess(Object targetId);
-
- /**
- * @return value or result of valueBinding of String, <code>Collection</code> or array of component's Id , processed at the phases 2-5 in case of Ajax request by parent component.
- */
- public abstract Object getProcess();
-
- /**
- * setter method for property
- * @param new value of ajaxType of control component - link or input to set
- */
-// public abstract void setAjaxType(String ajaxType);
-
- /**
- * @return value or result of valueBinding of ajaxType of control component - link or input
- */
-// public abstract String getAjaxType();
-
- /**
- * setter method for property
- * @param new value of Id ( in format of UIComponent.findComponent() call ) of request status indicator to set
- */
- public abstract void setStatus(String status);
-
- /**
- * @return value or result of valueBinding of Id ( in format of UIComponent.findComponent() call ) of request status indicator
- */
- public abstract String getStatus();
-
- /**
- * setter method for property
- * @param new value of Name of JavaScript function, called on complete Ajax request to set
- */
- public abstract void setOncomplete(String oncomplete);
-
- /**
- * @return value or result of valueBinding of Name of JavaScript function, called on complete Ajax request
- */
- public abstract String getOncomplete();
-
-
-
- /**
- * @return value or result of valueBinding of Name of JavaScript function, called before updating DOM
- */
- public abstract String getOnbeforedomupdate();
-
- /**
- * setter method for property
- * @param new value of Name of JavaScript function, called before updating DOM to set
- */
- public abstract void setOnbeforedomupdate(String beforeUpdate);
-
- /**
- * setter method for property
- * @param new value of custom data translated to oncomplete function by AJAX
- */
- public abstract void setData(Object data);
-
- /**
- * @return value of custom data for translate to oncomplete function by AJAX
- */
- public abstract Object getData();
-
- /**
- * setter method for property
- * @param new value of Submit ( or not ) full form on Ajax action. to set
- */
- public abstract void setLimitToList(boolean submitForm);
-
- /**
- * @return value or result of valueBinding of Submit ( or not ) full form on Ajax action.
- */
- public abstract boolean isLimitToList();
-
- /**
- * setter method for property
- * @param new value of Submit ( or not ) full form on Ajax action. to set
- */
- public abstract void setAjaxSingle(boolean single);
-
- /**
- * @return value or result of valueBinding of Submit ( or not ) full form on Ajax action.
- */
- public abstract boolean isAjaxSingle();
-
- /**
- * Getter for bypassUpdates bean property. Indicate that component must invoke listeners after Process Validators phase
- * and force render response after it - since no values of components will be updated. Can be used to perform validation of client input
- * using server-side validators.
- * @return true if component must force render after validation phase.
- */
- public abstract boolean isBypassUpdates();
-
- /**
- * Setter for bypassUpdates bean property.
- * @param bypass true if component must force render after validation phase.
- */
- public abstract void setBypassUpdates(boolean bypass);
-
- /**
- * Getter for property name of events queue on client side - for avoid to send requests too frequnly ( on key events, for example ), implementation will be generated by
- * componnents-generator
- * @return property value
- */
- public abstract String getEventsQueue();
-
- /**
- * Setter for flag indicated aborting unfinished ajax requests in queue.
- * @param newvalue - new property value. If true, unfinished request in queue will be aborted on new events.
- */
- public abstract void setIgnoreDupResponses(boolean newvalue);
-
-
- /**
- * Getter for property flag indicated aborting unfinished ajax requests in queue.
- * componnents-generator
- * @return property value
- */
- public abstract boolean isIgnoreDupResponses();
-
- /**
- * Setter for property name of events queue on client side - for avoid to send requests too frequnly ( on key events, for example ), implementation will be generated by
- * componnents-generator
- * @param newvalue - new property value
- */
- public abstract void setEventsQueue(String newvalue);
-
- /**
- * Getter for property Delay ( in ms. ) for send ajax request on JavaScript event. In conjunction with events queue can reduce number of requests on keyboard or mouse move events., implementation will be generated by
- * componnents-generator
- * @return property value
- */
- public abstract int getRequestDelay();
-
- /**
- * Setter for property Delay ( in ms. ) for send ajax request on JavaScript event. In conjunction with events queue can reduce number of requests on keyboard or mouse move events., implementation will be generated by
- * componnents-generator
- * @param newvalue - new property value
- */
- public abstract void setRequestDelay(int newvalue);
-
- /**
- * Getter for request timeout
- * @return timeout in ms.
- */
- public abstract int getTimeout();
-
- /**
- * Setter for request timeout
- * @param timeout new value in ms.
- */
- public abstract void setTimeout(int timeout);
-
-
- /**
- * Setter for a 'focus' bean property - id of component( or of DOM element ), to set focus after AJAX request.
- * @param focus
- */
- public abstract void setFocus(String focus);
-
- /**
- * @return
- */
- public abstract String getFocus();
-
- /**
- *
- */
- public abstract void setSimilarityGroupingId(String similarityGroupingId);
-
- /**
- *
- */
- public abstract String getSimilarityGroupingId();
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxComponent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,229 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+
+/**
+ * Base Interface for Ajax-enabled acting components.
+ * TODO - extend <code>ActionSource</code>???
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/01/23 20:01:01 $
+ *
+ */
+public interface AjaxComponent
+{
+
+ public static final String AJAX_COMPONETT_PARAMETER = AjaxComponent.class.getName()+".parameter";
+
+ /**
+ * setter method for property
+ * @param new value of String, <code>Collection</code> or array of component's Id , updated in case of Ajax request by parent component. to set
+ */
+ public abstract void setReRender(Object targetId);
+
+ /**
+ * @return value or result of valueBinding of String, <code>Collection</code> or array of component's Id , updated in case of Ajax request by parent component.
+ */
+ public abstract Object getReRender();
+
+ /**
+ * setter method for property
+ * @param new value of String, <code>Collection</code> or array of component's Id , processed at the phases 2-5
+ * in the case of Ajax request by parent component. to set
+ */
+ public abstract void setProcess(Object targetId);
+
+ /**
+ * @return value or result of valueBinding of String, <code>Collection</code> or array of component's Id , processed at the phases 2-5 in case of Ajax request by parent component.
+ */
+ public abstract Object getProcess();
+
+ /**
+ * setter method for property
+ * @param new value of ajaxType of control component - link or input to set
+ */
+// public abstract void setAjaxType(String ajaxType);
+
+ /**
+ * @return value or result of valueBinding of ajaxType of control component - link or input
+ */
+// public abstract String getAjaxType();
+
+ /**
+ * setter method for property
+ * @param new value of Id ( in format of UIComponent.findComponent() call ) of request status indicator to set
+ */
+ public abstract void setStatus(String status);
+
+ /**
+ * @return value or result of valueBinding of Id ( in format of UIComponent.findComponent() call ) of request status indicator
+ */
+ public abstract String getStatus();
+
+ /**
+ * setter method for property
+ * @param new value of Name of JavaScript function, called on complete Ajax request to set
+ */
+ public abstract void setOncomplete(String oncomplete);
+
+ /**
+ * @return value or result of valueBinding of Name of JavaScript function, called on complete Ajax request
+ */
+ public abstract String getOncomplete();
+
+
+
+ /**
+ * @return value or result of valueBinding of Name of JavaScript function, called before updating DOM
+ */
+ public abstract String getOnbeforedomupdate();
+
+ /**
+ * setter method for property
+ * @param new value of Name of JavaScript function, called before updating DOM to set
+ */
+ public abstract void setOnbeforedomupdate(String beforeUpdate);
+
+ /**
+ * setter method for property
+ * @param new value of custom data translated to oncomplete function by AJAX
+ */
+ public abstract void setData(Object data);
+
+ /**
+ * @return value of custom data for translate to oncomplete function by AJAX
+ */
+ public abstract Object getData();
+
+ /**
+ * setter method for property
+ * @param new value of Submit ( or not ) full form on Ajax action. to set
+ */
+ public abstract void setLimitToList(boolean submitForm);
+
+ /**
+ * @return value or result of valueBinding of Submit ( or not ) full form on Ajax action.
+ */
+ public abstract boolean isLimitToList();
+
+ /**
+ * setter method for property
+ * @param new value of Submit ( or not ) full form on Ajax action. to set
+ */
+ public abstract void setAjaxSingle(boolean single);
+
+ /**
+ * @return value or result of valueBinding of Submit ( or not ) full form on Ajax action.
+ */
+ public abstract boolean isAjaxSingle();
+
+ /**
+ * Getter for bypassUpdates bean property. Indicate that component must invoke listeners after Process Validators phase
+ * and force render response after it - since no values of components will be updated. Can be used to perform validation of client input
+ * using server-side validators.
+ * @return true if component must force render after validation phase.
+ */
+ public abstract boolean isBypassUpdates();
+
+ /**
+ * Setter for bypassUpdates bean property.
+ * @param bypass true if component must force render after validation phase.
+ */
+ public abstract void setBypassUpdates(boolean bypass);
+
+ /**
+ * Getter for property name of events queue on client side - for avoid to send requests too frequnly ( on key events, for example ), implementation will be generated by
+ * componnents-generator
+ * @return property value
+ */
+ public abstract String getEventsQueue();
+
+ /**
+ * Setter for flag indicated aborting unfinished ajax requests in queue.
+ * @param newvalue - new property value. If true, unfinished request in queue will be aborted on new events.
+ */
+ public abstract void setIgnoreDupResponses(boolean newvalue);
+
+
+ /**
+ * Getter for property flag indicated aborting unfinished ajax requests in queue.
+ * componnents-generator
+ * @return property value
+ */
+ public abstract boolean isIgnoreDupResponses();
+
+ /**
+ * Setter for property name of events queue on client side - for avoid to send requests too frequnly ( on key events, for example ), implementation will be generated by
+ * componnents-generator
+ * @param newvalue - new property value
+ */
+ public abstract void setEventsQueue(String newvalue);
+
+ /**
+ * Getter for property Delay ( in ms. ) for send ajax request on JavaScript event. In conjunction with events queue can reduce number of requests on keyboard or mouse move events., implementation will be generated by
+ * componnents-generator
+ * @return property value
+ */
+ public abstract int getRequestDelay();
+
+ /**
+ * Setter for property Delay ( in ms. ) for send ajax request on JavaScript event. In conjunction with events queue can reduce number of requests on keyboard or mouse move events., implementation will be generated by
+ * componnents-generator
+ * @param newvalue - new property value
+ */
+ public abstract void setRequestDelay(int newvalue);
+
+ /**
+ * Getter for request timeout
+ * @return timeout in ms.
+ */
+ public abstract int getTimeout();
+
+ /**
+ * Setter for request timeout
+ * @param timeout new value in ms.
+ */
+ public abstract void setTimeout(int timeout);
+
+
+ /**
+ * Setter for a 'focus' bean property - id of component( or of DOM element ), to set focus after AJAX request.
+ * @param focus
+ */
+ public abstract void setFocus(String focus);
+
+ /**
+ * @return
+ */
+ public abstract String getFocus();
+
+ /**
+ *
+ */
+ public abstract void setSimilarityGroupingId(String similarityGroupingId);
+
+ /**
+ *
+ */
+ public abstract String getSimilarityGroupingId();
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,56 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.event.AjaxSource;
-
-
-/**
- * Extend Ajax-enabled region to support event listeners on Ajax requests.
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:39 $
- *
- */
-public interface AjaxContainer extends AjaxContainerBase, AjaxSource
-{
-
- /**
- * Is ajax container must re-render all output from page or only it's children ?
- * @return true if all ajax-enabled to re-render araes on page must be checked for output.
- */
- public abstract boolean isRenderRegionOnly();
-
- public abstract void setRenderRegionOnly(boolean reRenderPage);
-
- /**
- * Encode AJAX response from this container ( call encode methods for selected components only )
- * @param context
- * @throws IOException
- */
- public void encodeAjax(FacesContext context) throws IOException ;
-
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,56 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.event.AjaxSource;
+
+
+/**
+ * Extend Ajax-enabled region to support event listeners on Ajax requests.
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:39 $
+ *
+ */
+public interface AjaxContainer extends AjaxContainerBase, AjaxSource
+{
+
+ /**
+ * Is ajax container must re-render all output from page or only it's children ?
+ * @return true if all ajax-enabled to re-render araes on page must be checked for output.
+ */
+ public abstract boolean isRenderRegionOnly();
+
+ public abstract void setRenderRegionOnly(boolean reRenderPage);
+
+ /**
+ * Encode AJAX response from this container ( call encode methods for selected components only )
+ * @param context
+ * @throws IOException
+ */
+ public void encodeAjax(FacesContext context) throws IOException ;
+
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,85 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import javax.el.MethodExpression;
-
-/**
- * Base interface for controller component, managed AJAX Requests.
- * Component, implemented this interface, must always return <code>true</code> for
- * <code>javax.faces.component.UIComponent#getRendersChildren()</code> method.
- * in common, set of components, rendered of current request, maintain by it.
- * TODO - add capabilites for components, rendered in <code>PhaseListener</code>
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/02/06 16:23:20 $
- *
- */
-public interface AjaxContainerBase {
- /**
- * getter for AjaxListener method. Same as for <code>ActionSource</code>
- *
- * @see javax.faces.component.ActionSource#getActionListener()
- */
- public MethodExpression getAjaxListener();
-
- /**
- * setter for AjaxListener <code>MethodBinding</code>
- * in case on AjaxRequest, component must call this method in
- * <code>PhaseId.APPLY_REQUEST_VALUES</code> or
- * <code>PhaseId.INVOKE_APPLICATION</code> phases, depend on immediate flag.
- *
- * @see javax.faces.component.ActionSource#setActionListener(javax.faces.el.MethodBinding)
- */
- public void setAjaxListener(MethodExpression AjaxListener);
-
- /**
- * getter for flag immediate call Listener's on PhaseId.APPLY_REQUEST_VALUES phase.
- *
- * @see javax.faces.component.ActionSource#isImmediate()
- */
- public boolean isImmediate();
-
- /**
- * getter for render method flag of subview. If true, on AJAX-request component render it children
- * after {@link com.sun.faces.lifecycle.Phase.INVOKE_APPLICATION }
- * @return value of selfRendered flag
- */
- public boolean isSelfRendered();
-
- /**
- * setter for self-render flag.
- * @param selfRendered
- */
- public void setSelfRendered(boolean selfRendered);
- /**
- * setter for immediate flag.
- *
- * @see javax.faces.component.ActionSource#setImmediate(boolean)
- */
- public void setImmediate(boolean immediate);
-
- public boolean isSubmitted();
-
- public void setSubmitted(boolean submitted);
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,85 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import javax.el.MethodExpression;
+
+/**
+ * Base interface for controller component, managed AJAX Requests.
+ * Component, implemented this interface, must always return <code>true</code> for
+ * <code>javax.faces.component.UIComponent#getRendersChildren()</code> method.
+ * in common, set of components, rendered of current request, maintain by it.
+ * TODO - add capabilites for components, rendered in <code>PhaseListener</code>
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/02/06 16:23:20 $
+ *
+ */
+public interface AjaxContainerBase {
+ /**
+ * getter for AjaxListener method. Same as for <code>ActionSource</code>
+ *
+ * @see javax.faces.component.ActionSource#getActionListener()
+ */
+ public MethodExpression getAjaxListener();
+
+ /**
+ * setter for AjaxListener <code>MethodBinding</code>
+ * in case on AjaxRequest, component must call this method in
+ * <code>PhaseId.APPLY_REQUEST_VALUES</code> or
+ * <code>PhaseId.INVOKE_APPLICATION</code> phases, depend on immediate flag.
+ *
+ * @see javax.faces.component.ActionSource#setActionListener(javax.faces.el.MethodBinding)
+ */
+ public void setAjaxListener(MethodExpression AjaxListener);
+
+ /**
+ * getter for flag immediate call Listener's on PhaseId.APPLY_REQUEST_VALUES phase.
+ *
+ * @see javax.faces.component.ActionSource#isImmediate()
+ */
+ public boolean isImmediate();
+
+ /**
+ * getter for render method flag of subview. If true, on AJAX-request component render it children
+ * after {@link com.sun.faces.lifecycle.Phase.INVOKE_APPLICATION }
+ * @return value of selfRendered flag
+ */
+ public boolean isSelfRendered();
+
+ /**
+ * setter for self-render flag.
+ * @param selfRendered
+ */
+ public void setSelfRendered(boolean selfRendered);
+ /**
+ * setter for immediate flag.
+ *
+ * @see javax.faces.component.ActionSource#setImmediate(boolean)
+ */
+ public void setImmediate(boolean immediate);
+
+ public boolean isSubmitted();
+
+ public void setSubmitted(boolean submitted);
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,43 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import java.util.Set;
-
-import org.ajax4jsf.model.ExtendedDataModel;
-
-/**
- * Interface for iterable component, allowed for render given set of rows in ajax response.
- * @author shura
- *
- */
-public interface AjaxDataEncoder extends AjaxChildrenEncoder {
-
- /**
- * @return Set for values of {@link ExtendedDataModel} keys, encoded in ajax response by this component.
- */
- public Set<Object> getAjaxKeys();
-
- public void setAjaxKeys(Set<Object> ajaxKeys);
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,43 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.util.Set;
+
+import org.ajax4jsf.model.ExtendedDataModel;
+
+/**
+ * Interface for iterable component, allowed for render given set of rows in ajax response.
+ * @author shura
+ *
+ */
+public interface AjaxDataEncoder extends AjaxChildrenEncoder {
+
+ /**
+ * @return Set for values of {@link ExtendedDataModel} keys, encoded in ajax response by this component.
+ */
+ public Set<Object> getAjaxKeys();
+
+ public void setAjaxKeys(Set<Object> ajaxKeys);
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,55 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-/**
- * Marker interface for all JSF components, encoded ( or not ) on rendering
- * Ajax request , depend on it self properties ( such as messages, help or like components )
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:39 $
- *
- */
-public interface AjaxOutput {
- /**
- * getter for ajax-rendered flag property.
- * @return
- */
- public boolean isAjaxRendered();
- /**
- * Setter for ajax rendered property.
- * @param ajaxRendered
- */
- public void setAjaxRendered(boolean ajaxRendered);
-
- /**
- * getter for ajax-rendered flag property.
- * @return
- */
- public boolean isKeepTransient();
- /**
- * Setter for ajax rendered property.
- * @param ajaxRendered
- */
- public void setKeepTransient(boolean ajaxRendered);
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxOutput.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,55 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+/**
+ * Marker interface for all JSF components, encoded ( or not ) on rendering
+ * Ajax request , depend on it self properties ( such as messages, help or like components )
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:39 $
+ *
+ */
+public interface AjaxOutput {
+ /**
+ * getter for ajax-rendered flag property.
+ * @return
+ */
+ public boolean isAjaxRendered();
+ /**
+ * Setter for ajax rendered property.
+ * @param ajaxRendered
+ */
+ public void setAjaxRendered(boolean ajaxRendered);
+
+ /**
+ * getter for ajax-rendered flag property.
+ * @return
+ */
+ public boolean isKeepTransient();
+ /**
+ * Setter for ajax rendered property.
+ * @param ajaxRendered
+ */
+ public void setKeepTransient(boolean ajaxRendered);
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,87 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import javax.faces.component.UIComponent;
-
-/**
- * Version of {@link org.ajax4jsf.component.AjaxComponent} for append
- * Ajax functions for non-ajax components
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:34 $
- *
- */
-public interface AjaxSupport {
-
- /**
- * @return JavaScript eventString. Rebuild on every call, since
- * can be in loop ( as in dataTable ) with different parameters.
- */
- public String getEventString();
- /**
- * setter method for property
- * @param new value of Name of event property of parent component for build JavaScript AJAX.Submit call to set
- */
- public abstract void setEvent(String event);
-
- /**
- * @return value or result of valueBinding of Name of event property of parent component for build JavaScript AJAX.Submit call
- */
- public abstract String getEvent();
-
-
- /**
- * Name of JavaScript function, called before submit Ajax request
- * description
- *
- * @parameter
- * @return the acceptClass
- */
- public abstract String getOnsubmit();
-
- /**
- * @param newOnsubmit
- * the value to set
- */
- public abstract void setOnsubmit(String newOnsubmit);
-
-
- /**
- * Getter for property If true, disable default action for target event ( encode 'return false' to JavaScript ), implementation will be generated by
- * componnents-generator
- * @return property value
- */
- public abstract boolean isDisableDefault();
-
- /**
- * Setter for property If true, disable default action for target event ( encode 'return false' to JavaScript ), implementation will be generated by
- * componnents-generator
- * @param newvalue - new property value
- */
- public abstract void setDisableDefault(boolean newvalue);
-
- /**
- * Set property for JavaScrept event generated by this component.
- * @param parent
- */
- public void setParentProperties(UIComponent parent);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/AjaxSupport.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,87 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Version of {@link org.ajax4jsf.component.AjaxComponent} for append
+ * Ajax functions for non-ajax components
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:34 $
+ *
+ */
+public interface AjaxSupport {
+
+ /**
+ * @return JavaScript eventString. Rebuild on every call, since
+ * can be in loop ( as in dataTable ) with different parameters.
+ */
+ public String getEventString();
+ /**
+ * setter method for property
+ * @param new value of Name of event property of parent component for build JavaScript AJAX.Submit call to set
+ */
+ public abstract void setEvent(String event);
+
+ /**
+ * @return value or result of valueBinding of Name of event property of parent component for build JavaScript AJAX.Submit call
+ */
+ public abstract String getEvent();
+
+
+ /**
+ * Name of JavaScript function, called before submit Ajax request
+ * description
+ *
+ * @parameter
+ * @return the acceptClass
+ */
+ public abstract String getOnsubmit();
+
+ /**
+ * @param newOnsubmit
+ * the value to set
+ */
+ public abstract void setOnsubmit(String newOnsubmit);
+
+
+ /**
+ * Getter for property If true, disable default action for target event ( encode 'return false' to JavaScript ), implementation will be generated by
+ * componnents-generator
+ * @return property value
+ */
+ public abstract boolean isDisableDefault();
+
+ /**
+ * Setter for property If true, disable default action for target event ( encode 'return false' to JavaScript ), implementation will be generated by
+ * componnents-generator
+ * @param newvalue - new property value
+ */
+ public abstract void setDisableDefault(boolean newvalue);
+
+ /**
+ * Set property for JavaScrept event generated by this component.
+ * @param parent
+ */
+ public void setParentProperties(UIComponent parent);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,48 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.component;
-
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIData;
-
-/**
- * In the original {@link UIData} component, only state for a {@link EditableValueHolder} component saved for an iteration.
- * In the Richfaces, we also save state for a components implemented this interface.
- * @author asmirnov
- *
- */
-public interface IterationStateHolder {
-
- /**
- * Get component state for a current iteration.
- * @return request-scope component state. Details are subject for a component implementation
- */
- public Object getIterationState();
-
- /**
- * Set component state for the next iteration. State can be either previously saved iteration state
- * or <code>null</code> value. In the second case component should reset its state to the initial.
- * @param state request-scope component state or <code>null</code>. Details are subject for a component
- * implementation
- */
- public void setIterationState( Object state);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/IterationStateHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,48 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.component;
+
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIData;
+
+/**
+ * In the original {@link UIData} component, only state for a {@link EditableValueHolder} component saved for an iteration.
+ * In the Richfaces, we also save state for a components implemented this interface.
+ * @author asmirnov
+ *
+ */
+public interface IterationStateHolder {
+
+ /**
+ * Get component state for a current iteration.
+ * @return request-scope component state. Details are subject for a component implementation
+ */
+ public Object getIterationState();
+
+ /**
+ * Set component state for the next iteration. State can be either previously saved iteration state
+ * or <code>null</code> value. In the second case component should reset its state to the initial.
+ * @param state request-scope component state or <code>null</code>. Details are subject for a component
+ * implementation
+ */
+ public void setIterationState( Object state);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-/**
- * Interface for extend {@link javax.faces.component.UIParameter} component by
- * handling isertion parameters into JavaScript code as references, not string literals.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:40 $
- *
- */
-public interface JavaScriptParameter {
-
- public void setNoEscape(boolean noEscape);
-
- public boolean isNoEscape();
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/JavaScriptParameter.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+/**
+ * Interface for extend {@link javax.faces.component.UIParameter} component by
+ * handling isertion parameters into JavaScript code as references, not string literals.
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:40 $
+ *
+ */
+public interface JavaScriptParameter {
+
+ public void setNoEscape(boolean noEscape);
+
+ public boolean isNoEscape();
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Base APIs of AJAX-enabled components
- */
-package org.ajax4jsf.component;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/component/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Base APIs of AJAX-enabled components
+ */
+package org.ajax4jsf.component;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,226 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.context;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.util.URLToStreamHelper;
-
-public abstract class AjaxContext {
-
- private boolean limitToList;
-
- public static final String RESPONSE_DATA_KEY = "_ajax:data";
- static final String SERVICE_RESOURCE = "META-INF/services/"
- + AjaxContext.class.getName();
- private static final String DEFAULT_CONTEXT_CLASS = "org.ajax4jsf.context.AjaxContextImpl";
-
- public static final String HEAD_EVENTS_PARAMETER = "org.ajax4jsf.framework.HEAD_EVENTS_LIST";
-
- /**
- * Key for keep request state information in request-scope attributes.
- */
- public static final String AJAX_CONTEXT_KEY = "ajaxContext";
-
- public abstract Map<String, Object> getCommonAjaxParameters();
-
- public abstract String getAjaxActionURL(FacesContext context);
-
- public abstract void setResponseData(Object responseData);
-
- public abstract Object getResponseData();
-
- public abstract void setOncomplete(Object oncompleteFunction);
-
- public abstract Object getOncomplete();
-
- public abstract void setViewIdHolder(ViewIdHolder viewIdHolder);
-
- public abstract ViewIdHolder getViewIdHolder();
-
- public abstract boolean removeRenderedArea(String id);
-
- public abstract void addRenderedArea(String id);
-
- public abstract Set<String> getAjaxRenderedAreas();
-
- public abstract void addComponentToAjaxRender(UIComponent base, String id);
-
- public abstract void addComponentToAjaxRender(UIComponent component);
-
- public abstract void addRegionsFromComponent(UIComponent component);
-
- /**
- * @param component
- * @since 3.3.0
- */
- public abstract void addAreasToProcessFromComponent(FacesContext context, UIComponent component);
-
- public abstract Set<String> getAjaxAreasToRender();
-
- public abstract Set<String> getAjaxAreasToProcess();
-
- public boolean isAjaxRequest(FacesContext facesContext) {
- return isAjaxRequest();
- }
-
- public abstract boolean isAjaxRequest();
-
- public abstract void encodeAjaxEnd(FacesContext context) throws IOException;
-
- public abstract void encodeAjaxBegin(FacesContext context) throws IOException;
-
- public abstract void renderAjax(FacesContext context);
-
- public abstract void decode(FacesContext context);
-
- public abstract void release();
-
- public abstract Map<String, Object> getResponseDataMap();
-
- public abstract void setAjaxRequest(boolean b);
-
- public abstract boolean isSelfRender();
-
- public abstract void setSelfRender(boolean b);
-
- public abstract String getSubmittedRegionClientId();
-
- public abstract void saveViewState(FacesContext context) throws IOException;
-
- public abstract void setAjaxSingleClientId(String ajaxSingleClientId);
-
- public abstract String getAjaxSingleClientId();
-
- public abstract void setAjaxAreasToProcess(Set<String> ajaxAreasToProcess);
-
- public abstract void setSubmittedRegionClientId(String submittedClientId);
-
-
- public boolean isLimitToList() {
- return limitToList;
- }
-
- public void setLimitToList(boolean limitToList) {
- this.limitToList = limitToList;
- }
-
- /**
- * Get instance of current AJAX Context. Instance get by
- * variable {@link AjaxContext#AJAX_CONTEXT_KEY}
- *
- * @return memento instance for current request
- */
- public static AjaxContext getCurrentInstance() {
- FacesContext context = FacesContext.getCurrentInstance();
- return getCurrentInstance(context);
- }
-
- private static Map<ClassLoader, Class<? extends AjaxContext>> ajaxContextClasses = new HashMap<ClassLoader, Class<? extends AjaxContext>>();
-
- /**
- * Get instance of current AJAX Context. Instance get by
- * variable {@link AjaxContext#AJAX_CONTEXT_KEY}
- *
- * @param context
- * current FacesContext
- * @return instance of AjaxContext.
- */
- public static AjaxContext getCurrentInstance(FacesContext context) {
- if (null == context) {
- throw new NullPointerException("FacesContext is null");
- }
- Map<String, Object> requestMap = context.getExternalContext()
- .getRequestMap();
- AjaxContext ajaxContext = (AjaxContext) requestMap
- .get(AJAX_CONTEXT_KEY);
- if (null == ajaxContext) {
- ClassLoader contextClassLoader = Thread.currentThread()
- .getContextClassLoader();
- if(null == contextClassLoader) {
- contextClassLoader = AjaxContext.class.getClassLoader();
- }
- Class<? extends AjaxContext> clazz;
- synchronized (ajaxContextClasses) {
- clazz = ajaxContextClasses.get(contextClassLoader);
- if (null == clazz) {
- String factoryClassName = DEFAULT_CONTEXT_CLASS;
- // Pluggable factories.
- InputStream input = null; // loader.getResourceAsStream(SERVICE_RESOURCE);
- input = URLToStreamHelper.urlToStreamSafe(contextClassLoader
- .getResource(SERVICE_RESOURCE));
- // have services file.
- if (input != null) {
- try {
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(input));
- factoryClassName = reader.readLine();
-
- } catch (Exception e) {
- throw new FacesException(
- "Error to create AjaxContext Instance", e);
- } finally {
- try {
- input.close();
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- try {
- clazz = Class.forName(factoryClassName, false, contextClassLoader).asSubclass(AjaxContext.class);
- } catch (ClassNotFoundException e) {
- throw new FacesException(
- "AjaxContext implementation class "
- + factoryClassName + " not found ", e);
- }
- ajaxContextClasses.put(contextClassLoader, clazz);
- }
- }
- try {
- ajaxContext = clazz.newInstance();
- ajaxContext.decode(context);
- } catch (InstantiationException e) {
- throw new FacesException(
- "Error to create AjaxContext Instance", e);
- } catch (IllegalAccessException e) {
- throw new FacesException(
- "No access to AjaxContext constructor", e);
- }
- requestMap.put(AJAX_CONTEXT_KEY, ajaxContext);
- }
- return ajaxContext;
- }
-
- public AjaxContext() {
- }
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,226 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.context;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+
+public abstract class AjaxContext {
+
+ private boolean limitToList;
+
+ public static final String RESPONSE_DATA_KEY = "_ajax:data";
+ static final String SERVICE_RESOURCE = "META-INF/services/"
+ + AjaxContext.class.getName();
+ private static final String DEFAULT_CONTEXT_CLASS = "org.ajax4jsf.context.AjaxContextImpl";
+
+ public static final String HEAD_EVENTS_PARAMETER = "org.ajax4jsf.framework.HEAD_EVENTS_LIST";
+
+ /**
+ * Key for keep request state information in request-scope attributes.
+ */
+ public static final String AJAX_CONTEXT_KEY = "ajaxContext";
+
+ public abstract Map<String, Object> getCommonAjaxParameters();
+
+ public abstract String getAjaxActionURL(FacesContext context);
+
+ public abstract void setResponseData(Object responseData);
+
+ public abstract Object getResponseData();
+
+ public abstract void setOncomplete(Object oncompleteFunction);
+
+ public abstract Object getOncomplete();
+
+ public abstract void setViewIdHolder(ViewIdHolder viewIdHolder);
+
+ public abstract ViewIdHolder getViewIdHolder();
+
+ public abstract boolean removeRenderedArea(String id);
+
+ public abstract void addRenderedArea(String id);
+
+ public abstract Set<String> getAjaxRenderedAreas();
+
+ public abstract void addComponentToAjaxRender(UIComponent base, String id);
+
+ public abstract void addComponentToAjaxRender(UIComponent component);
+
+ public abstract void addRegionsFromComponent(UIComponent component);
+
+ /**
+ * @param component
+ * @since 3.3.0
+ */
+ public abstract void addAreasToProcessFromComponent(FacesContext context, UIComponent component);
+
+ public abstract Set<String> getAjaxAreasToRender();
+
+ public abstract Set<String> getAjaxAreasToProcess();
+
+ public boolean isAjaxRequest(FacesContext facesContext) {
+ return isAjaxRequest();
+ }
+
+ public abstract boolean isAjaxRequest();
+
+ public abstract void encodeAjaxEnd(FacesContext context) throws IOException;
+
+ public abstract void encodeAjaxBegin(FacesContext context) throws IOException;
+
+ public abstract void renderAjax(FacesContext context);
+
+ public abstract void decode(FacesContext context);
+
+ public abstract void release();
+
+ public abstract Map<String, Object> getResponseDataMap();
+
+ public abstract void setAjaxRequest(boolean b);
+
+ public abstract boolean isSelfRender();
+
+ public abstract void setSelfRender(boolean b);
+
+ public abstract String getSubmittedRegionClientId();
+
+ public abstract void saveViewState(FacesContext context) throws IOException;
+
+ public abstract void setAjaxSingleClientId(String ajaxSingleClientId);
+
+ public abstract String getAjaxSingleClientId();
+
+ public abstract void setAjaxAreasToProcess(Set<String> ajaxAreasToProcess);
+
+ public abstract void setSubmittedRegionClientId(String submittedClientId);
+
+
+ public boolean isLimitToList() {
+ return limitToList;
+ }
+
+ public void setLimitToList(boolean limitToList) {
+ this.limitToList = limitToList;
+ }
+
+ /**
+ * Get instance of current AJAX Context. Instance get by
+ * variable {@link AjaxContext#AJAX_CONTEXT_KEY}
+ *
+ * @return memento instance for current request
+ */
+ public static AjaxContext getCurrentInstance() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return getCurrentInstance(context);
+ }
+
+ private static Map<ClassLoader, Class<? extends AjaxContext>> ajaxContextClasses = new HashMap<ClassLoader, Class<? extends AjaxContext>>();
+
+ /**
+ * Get instance of current AJAX Context. Instance get by
+ * variable {@link AjaxContext#AJAX_CONTEXT_KEY}
+ *
+ * @param context
+ * current FacesContext
+ * @return instance of AjaxContext.
+ */
+ public static AjaxContext getCurrentInstance(FacesContext context) {
+ if (null == context) {
+ throw new NullPointerException("FacesContext is null");
+ }
+ Map<String, Object> requestMap = context.getExternalContext()
+ .getRequestMap();
+ AjaxContext ajaxContext = (AjaxContext) requestMap
+ .get(AJAX_CONTEXT_KEY);
+ if (null == ajaxContext) {
+ ClassLoader contextClassLoader = Thread.currentThread()
+ .getContextClassLoader();
+ if(null == contextClassLoader) {
+ contextClassLoader = AjaxContext.class.getClassLoader();
+ }
+ Class<? extends AjaxContext> clazz;
+ synchronized (ajaxContextClasses) {
+ clazz = ajaxContextClasses.get(contextClassLoader);
+ if (null == clazz) {
+ String factoryClassName = DEFAULT_CONTEXT_CLASS;
+ // Pluggable factories.
+ InputStream input = null; // loader.getResourceAsStream(SERVICE_RESOURCE);
+ input = URLToStreamHelper.urlToStreamSafe(contextClassLoader
+ .getResource(SERVICE_RESOURCE));
+ // have services file.
+ if (input != null) {
+ try {
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(input));
+ factoryClassName = reader.readLine();
+
+ } catch (Exception e) {
+ throw new FacesException(
+ "Error to create AjaxContext Instance", e);
+ } finally {
+ try {
+ input.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
+ try {
+ clazz = Class.forName(factoryClassName, false, contextClassLoader).asSubclass(AjaxContext.class);
+ } catch (ClassNotFoundException e) {
+ throw new FacesException(
+ "AjaxContext implementation class "
+ + factoryClassName + " not found ", e);
+ }
+ ajaxContextClasses.put(contextClassLoader, clazz);
+ }
+ }
+ try {
+ ajaxContext = clazz.newInstance();
+ ajaxContext.decode(context);
+ } catch (InstantiationException e) {
+ throw new FacesException(
+ "Error to create AjaxContext Instance", e);
+ } catch (IllegalAccessException e) {
+ throw new FacesException(
+ "No access to AjaxContext constructor", e);
+ }
+ requestMap.put(AJAX_CONTEXT_KEY, ajaxContext);
+ }
+ return ajaxContext;
+ }
+
+ public AjaxContext() {
+ }
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.context;
-
-/**
- * Interface to skip navigation cases in ViewHandler and , instead, store new ViewId.
- * @author shura
- *
- */
-public interface ViewIdHolder {
-
- public boolean skipNavigation(String ViewId);
-
- public String getViewId();
-
- public void setViewId(String newViewId);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/ViewIdHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.context;
+
+/**
+ * Interface to skip navigation cases in ViewHandler and , instead, store new ViewId.
+ * @author shura
+ *
+ */
+public interface ViewIdHolder {
+
+ public boolean skipNavigation(String ViewId);
+
+ public String getViewId();
+
+ public void setViewId(String newViewId);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Classes and interfaces that defines contextual request information
- */
-package org.ajax4jsf.context;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/context/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Classes and interfaces that defines contextual request information
+ */
+package org.ajax4jsf.context;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,48 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.ActionEvent;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:34 $
- *
- */
-public class AjaxActionEvent extends ActionEvent {
-
-
- /**
- *
- */
- private static final long serialVersionUID = -5406101936114574903L;
-
- /**
- * @param component
- */
- public AjaxActionEvent(UIComponent component) {
- super(component);
- // TODO Auto-generated constructor stub
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxActionEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,48 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.ActionEvent;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:34 $
+ *
+ */
+public class AjaxActionEvent extends ActionEvent {
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5406101936114574903L;
+
+ /**
+ * @param component
+ */
+ public AjaxActionEvent(UIComponent component) {
+ super(component);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,69 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-import javax.faces.event.PhaseId;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:33 $
- *
- * Event for send by <code>AjaxContainer</code> in case of Ajax Request.
- * Used for build set of id's to render at current request, perform special render etc.
- */
-public class AjaxEvent extends FacesEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = -5624716710738446159L;
-
- /**
- * @param component
- */
- public AjaxEvent(UIComponent component) {
- super(component);
- setPhaseId(PhaseId.RENDER_RESPONSE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof AjaxListener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((AjaxListener) listener).processAjax(this);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,69 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseId;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:33 $
+ *
+ * Event for send by <code>AjaxContainer</code> in case of Ajax Request.
+ * Used for build set of id's to render at current request, perform special render etc.
+ */
+public class AjaxEvent extends FacesEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5624716710738446159L;
+
+ /**
+ * @param component
+ */
+ public AjaxEvent(UIComponent component) {
+ super(component);
+ setPhaseId(PhaseId.RENDER_RESPONSE);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof AjaxListener);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((AjaxListener) listener).processAjax(this);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,40 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * Base interface for all listeners, capable for receive <code>AjaxEvent</code>
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:36 $
- */
-public interface AjaxListener extends FacesListener {
-
- public static final Class<?>[] AJAX_LISTENER_ARGS = { AjaxEvent.class };
-
- /**
- * @param event - to process
- */
- void processAjax(AjaxEvent event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,40 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * Base interface for all listeners, capable for receive <code>AjaxEvent</code>
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:36 $
+ */
+public interface AjaxListener extends FacesListener {
+
+ public static final Class<?>[] AJAX_LISTENER_ARGS = { AjaxEvent.class };
+
+ /**
+ * @param event - to process
+ */
+ void processAjax(AjaxEvent event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,59 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:41 $
- *
- */
-public class AjaxRenderEvent extends FacesEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 5877851431032645762L;
-
- /**
- * @param component
- */
- public AjaxRenderEvent(UIComponent component) {
- super(component);
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof AjaxRenderListener;
- }
-
- public void processListener(FacesListener listener) {
- if (listener instanceof AjaxRenderListener) {
- AjaxRenderListener renderListener = (AjaxRenderListener) listener;
- renderListener.processAjaxRender(this);
- }
-
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,59 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:41 $
+ *
+ */
+public class AjaxRenderEvent extends FacesEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5877851431032645762L;
+
+ /**
+ * @param component
+ */
+ public AjaxRenderEvent(UIComponent component) {
+ super(component);
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof AjaxRenderListener;
+ }
+
+ public void processListener(FacesListener listener) {
+ if (listener instanceof AjaxRenderListener) {
+ AjaxRenderListener renderListener = (AjaxRenderListener) listener;
+ renderListener.processAjaxRender(this);
+ }
+
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,34 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author shura
- *
- */
-public interface AjaxRenderListener extends FacesListener {
-
- public void processAjaxRender(AjaxRenderEvent event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author shura
+ *
+ */
+public interface AjaxRenderListener extends FacesListener {
+
+ public void processAjaxRender(AjaxRenderEvent event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,51 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.event;
-
-/**
- * Interface for all components capable to process {@link org.ajax4jsf.event.AjaxEvent}'s
- * @author shura
- *
- */
-public interface AjaxSource {
- /**
- * same as for ActionSource, but for AjaxListener
- *
- * @see javax.faces.component.ActionSource#addActionListener(javax.faces.event.ActionListener)
- */
- public void addAjaxListener(AjaxListener listener);
-
- /**
- * same as for ActionSource, but for AjaxListener
- *
- * @see javax.faces.component.ActionSource#getActionListeners()
- */
- public AjaxListener[] getAjaxListeners();
-
- /**
- * same as for ActionSource, but for AjaxListener
- * @see javax.faces.component.ActionSource#removeActionListener(javax.faces.event.ActionListener)
- */
- public void removeAjaxListener(AjaxListener listener);
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/AjaxSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+/**
+ * Interface for all components capable to process {@link org.ajax4jsf.event.AjaxEvent}'s
+ * @author shura
+ *
+ */
+public interface AjaxSource {
+ /**
+ * same as for ActionSource, but for AjaxListener
+ *
+ * @see javax.faces.component.ActionSource#addActionListener(javax.faces.event.ActionListener)
+ */
+ public void addAjaxListener(AjaxListener listener);
+
+ /**
+ * same as for ActionSource, but for AjaxListener
+ *
+ * @see javax.faces.component.ActionSource#getActionListeners()
+ */
+ public AjaxListener[] getAjaxListeners();
+
+ /**
+ * same as for ActionSource, but for AjaxListener
+ * @see javax.faces.component.ActionSource#removeActionListener(javax.faces.event.ActionListener)
+ */
+ public void removeAjaxListener(AjaxListener listener);
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,30 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.event;
-
-import java.util.EventListener;
-import java.util.EventObject;
-
-public interface PushEventListener extends EventListener {
-
- public void onEvent(EventObject event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,30 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.event;
+
+import java.util.EventListener;
+import java.util.EventObject;
+
+public interface PushEventListener extends EventListener {
+
+ public void onEvent(EventObject event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Interfaces and classes of events and listeners of basic AJAX components
- */
-package org.ajax4jsf.event;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/event/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Interfaces and classes of events and listeners of basic AJAX components
+ */
+package org.ajax4jsf.event;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,98 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-
-/**
- * @author shura
- *
- */
-public class AjaxSubmitFunction extends JSFunction {
-
- /**
- * Name Javasript function for submit AJAX request
- */
- public static final String AJAX_FUNCTION_NAME = "A4J.AJAX.Submit";
-
- /**
- * Attribute for keep clientId of status component
- */
- public static final String STATUS_ATTR_NAME = "status";
-
- /**
- * Attribute for keep JavaScript funtion name for call after complete
- * request.
- */
- public static final String ONCOMPLETE_ATTR_NAME = "oncomplete";
-
- /**
- * Attribute to keep
- */
- public static final String LIMITTOLIST_ATTR_NAME = "limitToList";
-
- //private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
-
- public static final String AJAX_REGIONS_ATTRIBUTE = "reRender";
-
- //private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
-
- private UIComponent component;
-
- private Map<String, Object> options = new HashMap<String, Object>();
-
- private Map<String, String> requestParameters = new HashMap<String, String>();
-
- /**
- *
- */
- public AjaxSubmitFunction(UIComponent component) {
- this(component,AJAX_FUNCTION_NAME);
- }
- /**
- * @param name
- */
- public AjaxSubmitFunction(UIComponent component,String name) {
- super(name);
- this.component = component;
- // Fill parameters and options values.
- }
- /**
- * @return the options
- */
- public Map<String, Object> getOptions() {
- return this.options;
- }
- /**
- * @return the requestParameters
- */
- public Map<String, String> getRequestParameters() {
- return this.requestParameters;
- }
-
- public UIComponent getComponent() {
- return component;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,98 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author shura
+ *
+ */
+public class AjaxSubmitFunction extends JSFunction {
+
+ /**
+ * Name Javasript function for submit AJAX request
+ */
+ public static final String AJAX_FUNCTION_NAME = "A4J.AJAX.Submit";
+
+ /**
+ * Attribute for keep clientId of status component
+ */
+ public static final String STATUS_ATTR_NAME = "status";
+
+ /**
+ * Attribute for keep JavaScript funtion name for call after complete
+ * request.
+ */
+ public static final String ONCOMPLETE_ATTR_NAME = "oncomplete";
+
+ /**
+ * Attribute to keep
+ */
+ public static final String LIMITTOLIST_ATTR_NAME = "limitToList";
+
+ //private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
+
+ public static final String AJAX_REGIONS_ATTRIBUTE = "reRender";
+
+ //private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
+
+ private UIComponent component;
+
+ private Map<String, Object> options = new HashMap<String, Object>();
+
+ private Map<String, String> requestParameters = new HashMap<String, String>();
+
+ /**
+ *
+ */
+ public AjaxSubmitFunction(UIComponent component) {
+ this(component,AJAX_FUNCTION_NAME);
+ }
+ /**
+ * @param name
+ */
+ public AjaxSubmitFunction(UIComponent component,String name) {
+ super(name);
+ this.component = component;
+ // Fill parameters and options values.
+ }
+ /**
+ * @return the options
+ */
+ public Map<String, Object> getOptions() {
+ return this.options;
+ }
+ /**
+ * @return the requestParameters
+ */
+ public Map<String, String> getRequestParameters() {
+ return this.requestParameters;
+ }
+
+ public UIComponent getComponent() {
+ return component;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,66 +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.ajax4jsf.javascript;
-
-/**
- * Created 04.08.2008
- * @author Nick Belaevski
- * @since 3.2.2
- */
-
-public class JSBind extends ScriptStringBase {
-
- private JSFunction function;
-
- private String[] vars;
-
- public JSBind(JSFunction function, String... vars) {
- super();
- this.function = function;
- this.vars = vars;
- }
-
- public void appendScript(StringBuffer functionString) {
- functionString.append("function () {");
- functionString.append("var vars = {");
- boolean isFirst = true;
- for (String var : vars) {
- if (isFirst) {
- isFirst = false;
- } else {
- functionString.append(',');
- }
-
- functionString.append(var);
- functionString.append(':');
- functionString.append(var);
- }
-
- functionString.append("};");
-
- functionString.append("return function() { with (vars) {");
- functionString.append(function.toScript());
- functionString.append("}}}()");
-
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSBind.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,66 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+/**
+ * Created 04.08.2008
+ * @author Nick Belaevski
+ * @since 3.2.2
+ */
+
+public class JSBind extends ScriptStringBase {
+
+ private JSFunction function;
+
+ private String[] vars;
+
+ public JSBind(JSFunction function, String... vars) {
+ super();
+ this.function = function;
+ this.vars = vars;
+ }
+
+ public void appendScript(StringBuffer functionString) {
+ functionString.append("function () {");
+ functionString.append("var vars = {");
+ boolean isFirst = true;
+ for (String var : vars) {
+ if (isFirst) {
+ isFirst = false;
+ } else {
+ functionString.append(',');
+ }
+
+ functionString.append(var);
+ functionString.append(':');
+ functionString.append(var);
+ }
+
+ functionString.append("};");
+
+ functionString.append("return function() { with (vars) {");
+ functionString.append(function.toScript());
+ functionString.append("}}}()");
+
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,123 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-/**
- * @author shura
- * Encode chars as JavaScript sequences
- */
-public class JSEncoder {
- //private char APOSTROPHE[] = { '\\', '\'' };
-
- private static final char ENCODE_HEX[] = "0123456789ABCDEF".toCharArray();
-
- private static final char ENCODE_APOS[] = "\\'".toCharArray();
-
- private static final char ENCODE_QUOT[] = "\\\"".toCharArray();
-
- private static final char ENCODE_CR[] = "\\r".toCharArray();
-
- private static final char ENCODE_LF[] = "\\n".toCharArray();
-
- private static final char ENCODE_FF[] = "\\f".toCharArray();
-
- private static final char ENCODE_TAB[] = "\\t".toCharArray();
-
- private static final char ENCODE_BS[] = "\\\\".toCharArray();
-
- //private static final char ENCODE_ESC[] = "\\e".toCharArray();
-
- /**
- * Create a new instance of this <code>XMLEncoder</code>.
- */
- public JSEncoder() {
- }
-
- /**
- * Return true or false wether this encoding can encode the specified
- * character or not.
- * <p>
- * This method will return true for the following character range: <br />
- * <code>
- * <nobr>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
- * </code>
- * </p>
- *
- * @see <a href="http://www.w3.org/TR/REC-xml#charsets">W3C XML 1.0 </a>
- */
- public boolean compile(char c) {
-
- if ((c == 0x09) || // [\t]
- (c == 0x0a) || // [\n]
- (c == 0x0d) || // [\r](c == 0x22) || // ["]
- (c == 0x22) || // ["]
- (c == 0x27) || // [']
- (c == 0x5c) || // [\]
- (c == 0x03) || // [esc]
- (c == ']') || // ] - to avoid conflicts in CDATA
- (c == '<') || // - escape HTML markup characters
- (c == '>') || // - HTML
- (c == '&') || // - HTML
- (c == '-') || // - HTML comments
- (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
- ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd)|| (c > 0xff)) {
- return (false);
- }
-
- return (true);
- }
-
- /**
- * Return an array of characters representing the encoding for the specified
- * character.
- */
- public char[] encode(char c) {
- switch (c) {
- case 0x03:
- return (ENCODE_FF); // (>) [>]
- case 0x09:
- return (ENCODE_TAB); // (>) [>]
- case 0x0a:
- return (ENCODE_LF); // (>) [>]
- case 0x0d:
- return (ENCODE_CR); // (>) [>]
- case 0x22:
- return (ENCODE_QUOT); // (") ["]
- case 0x27:
- return (ENCODE_APOS); // (') [']
- case 0x5c:
- return (ENCODE_BS); // (<) [<]
- default: {
- if (c > 0xff) {
- char ret[] = { '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf],
- ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
- ENCODE_HEX[c & 0xf] };
- return (ret);
- }
- char ret[] = { '\\', 'x', ENCODE_HEX[c >> 0x4 & 0xf],
- ENCODE_HEX[c & 0xf] };
- return (ret);
- }
- }
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,123 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+/**
+ * @author shura
+ * Encode chars as JavaScript sequences
+ */
+public class JSEncoder {
+ //private char APOSTROPHE[] = { '\\', '\'' };
+
+ private static final char ENCODE_HEX[] = "0123456789ABCDEF".toCharArray();
+
+ private static final char ENCODE_APOS[] = "\\'".toCharArray();
+
+ private static final char ENCODE_QUOT[] = "\\\"".toCharArray();
+
+ private static final char ENCODE_CR[] = "\\r".toCharArray();
+
+ private static final char ENCODE_LF[] = "\\n".toCharArray();
+
+ private static final char ENCODE_FF[] = "\\f".toCharArray();
+
+ private static final char ENCODE_TAB[] = "\\t".toCharArray();
+
+ private static final char ENCODE_BS[] = "\\\\".toCharArray();
+
+ //private static final char ENCODE_ESC[] = "\\e".toCharArray();
+
+ /**
+ * Create a new instance of this <code>XMLEncoder</code>.
+ */
+ public JSEncoder() {
+ }
+
+ /**
+ * Return true or false wether this encoding can encode the specified
+ * character or not.
+ * <p>
+ * This method will return true for the following character range: <br />
+ * <code>
+ * <nobr>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]</nobr>
+ * </code>
+ * </p>
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml#charsets">W3C XML 1.0 </a>
+ */
+ public boolean compile(char c) {
+
+ if ((c == 0x09) || // [\t]
+ (c == 0x0a) || // [\n]
+ (c == 0x0d) || // [\r](c == 0x22) || // ["]
+ (c == 0x22) || // ["]
+ (c == 0x27) || // [']
+ (c == 0x5c) || // [\]
+ (c == 0x03) || // [esc]
+ (c == ']') || // ] - to avoid conflicts in CDATA
+ (c == '<') || // - escape HTML markup characters
+ (c == '>') || // - HTML
+ (c == '&') || // - HTML
+ (c == '-') || // - HTML comments
+ (c < 0x20) || // See <http://www.w3.org/TR/REC-xml#charsets>
+ ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd)|| (c > 0xff)) {
+ return (false);
+ }
+
+ return (true);
+ }
+
+ /**
+ * Return an array of characters representing the encoding for the specified
+ * character.
+ */
+ public char[] encode(char c) {
+ switch (c) {
+ case 0x03:
+ return (ENCODE_FF); // (>) [>]
+ case 0x09:
+ return (ENCODE_TAB); // (>) [>]
+ case 0x0a:
+ return (ENCODE_LF); // (>) [>]
+ case 0x0d:
+ return (ENCODE_CR); // (>) [>]
+ case 0x22:
+ return (ENCODE_QUOT); // (") ["]
+ case 0x27:
+ return (ENCODE_APOS); // (') [']
+ case 0x5c:
+ return (ENCODE_BS); // (<) [<]
+ default: {
+ if (c > 0xff) {
+ char ret[] = { '\\', 'u', ENCODE_HEX[c >> 0xc & 0xf],
+ ENCODE_HEX[c >> 0x8 & 0xf], ENCODE_HEX[c >> 0x4 & 0xf],
+ ENCODE_HEX[c & 0xf] };
+ return (ret);
+ }
+ char ret[] = { '\\', 'x', ENCODE_HEX[c >> 0x4 & 0xf],
+ ENCODE_HEX[c & 0xf] };
+ return (ret);
+ }
+ }
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.3 $ $Date: 2007/02/06 16:23:26 $
- *
- */
-public class JSFunction extends ScriptStringBase implements ScriptString {
-
- private String name;
-
- private List<Object> parameters = new ArrayList<Object>();
-
- /**
- * @param name
- * @param parameters
- */
- public JSFunction(String name, Object ... parameters) {
- this.name = name;
- this.parameters.addAll(Arrays.asList(parameters));
- }
-
-
- public JSFunction addParameter(Object parameter) {
- getParameters().add(parameter);
- return this;
- }
-
- public void appendScript(StringBuffer functionString) {
- functionString.append(name).append('(');
- boolean first = true;
- List<?> parameters = getParameters();
- if (null != parameters) {
- for (Iterator<?> param = parameters.iterator(); param.hasNext();) {
- Object element = param.next();
- if (!first) {
- functionString.append(',');
- }
- if (null != element) {
- functionString.append(ScriptUtils.toScript(element));
- } else {
- functionString.append("null");
- }
- first = false;
- }
-
- }
- functionString.append(")");
- }
-
- /**
- * @return the parameters
- */
- public List<Object> getParameters() {
- return this.parameters;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.3 $ $Date: 2007/02/06 16:23:26 $
+ *
+ */
+public class JSFunction extends ScriptStringBase implements ScriptString {
+
+ private String name;
+
+ private List<Object> parameters = new ArrayList<Object>();
+
+ /**
+ * @param name
+ * @param parameters
+ */
+ public JSFunction(String name, Object ... parameters) {
+ this.name = name;
+ this.parameters.addAll(Arrays.asList(parameters));
+ }
+
+
+ public JSFunction addParameter(Object parameter) {
+ getParameters().add(parameter);
+ return this;
+ }
+
+ public void appendScript(StringBuffer functionString) {
+ functionString.append(name).append('(');
+ boolean first = true;
+ List<?> parameters = getParameters();
+ if (null != parameters) {
+ for (Iterator<?> param = parameters.iterator(); param.hasNext();) {
+ Object element = param.next();
+ if (!first) {
+ functionString.append(',');
+ }
+ if (null != element) {
+ functionString.append(ScriptUtils.toScript(element));
+ } else {
+ functionString.append("null");
+ }
+ first = false;
+ }
+
+ }
+ functionString.append(")");
+ }
+
+ /**
+ * @return the parameters
+ */
+ public List<Object> getParameters() {
+ return this.parameters;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,99 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/01/24 13:22:31 $
- *
- */
-public class JSFunctionDefinition extends ScriptStringBase implements ScriptString
-{
-
-
-
- private List<Object> parameters = new ArrayList<Object>();
-
- private StringBuffer body = new StringBuffer();
-
- private String name ;
-
- /**
- * Construct {@link JSFunctionDefinition} with arbitrary list of params
- * @param params
- */
- public JSFunctionDefinition(Object ... params) {
- parameters.addAll(Arrays.asList(params));
- }
-
- public void addParameter(Object param) {
- parameters.add(param);
- }
-
- public JSFunctionDefinition addToBody(Object body)
- {
- this.body.append(body);
- return this;
- }
- /* (non-Javadoc)
- * @see org.ajax4jsf.components.renderkit.scriptutils.ScriptString#appendScript(java.lang.StringBuffer)
- */
- public void appendScript(StringBuffer functionString)
- {
- functionString.append("function");
- if(null != name){
- functionString.append(" ").append(name);
- }
- functionString.append("(");
- boolean first = true;
- for (Iterator<Object> param = parameters.iterator(); param.hasNext();)
- {
- Object element = param.next();
- if(!first){
- functionString.append(',');
- }
- functionString.append(element.toString());
- first = false;
- }
- functionString.append("){").append(body).append("}");
- }
-
- /**
- * @return the name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,99 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/01/24 13:22:31 $
+ *
+ */
+public class JSFunctionDefinition extends ScriptStringBase implements ScriptString
+{
+
+
+
+ private List<Object> parameters = new ArrayList<Object>();
+
+ private StringBuffer body = new StringBuffer();
+
+ private String name ;
+
+ /**
+ * Construct {@link JSFunctionDefinition} with arbitrary list of params
+ * @param params
+ */
+ public JSFunctionDefinition(Object ... params) {
+ parameters.addAll(Arrays.asList(params));
+ }
+
+ public void addParameter(Object param) {
+ parameters.add(param);
+ }
+
+ public JSFunctionDefinition addToBody(Object body)
+ {
+ this.body.append(body);
+ return this;
+ }
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.components.renderkit.scriptutils.ScriptString#appendScript(java.lang.StringBuffer)
+ */
+ public void appendScript(StringBuffer functionString)
+ {
+ functionString.append("function");
+ if(null != name){
+ functionString.append(" ").append(name);
+ }
+ functionString.append("(");
+ boolean first = true;
+ for (Iterator<Object> param = parameters.iterator(); param.hasNext();)
+ {
+ Object element = param.next();
+ if(!first){
+ functionString.append(',');
+ }
+ functionString.append(element.toString());
+ first = false;
+ }
+ functionString.append("){").append(body).append("}");
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,73 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-/**
- * Class provides creation of simple literal javascript to be set in ajax response data
- * @author Andrey Markavtsov
- *
- */
-public class JSLiteral extends ScriptStringBase {
-
- /** Javascript literal text */
- private String literal;
-
-
- /**
- * Default constructor
- */
- public JSLiteral() {
- super();
- }
-
- /**
- * Constructor using literal parameter
- * @param literal
- */
- public JSLiteral(String literal) {
- super();
- this.literal = literal;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.javascript.ScriptString#appendScript(java.lang.StringBuffer)
- */
- public void appendScript(StringBuffer jsString) {
- jsString.append(literal);
-
- }
-
- /**
- * @return the literal
- */
- public String getLiteral() {
- return literal;
- }
-
- /**
- * @param literal the literal to set
- */
- public void setLiteral(String literal) {
- this.literal = literal;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+/**
+ * Class provides creation of simple literal javascript to be set in ajax response data
+ * @author Andrey Markavtsov
+ *
+ */
+public class JSLiteral extends ScriptStringBase {
+
+ /** Javascript literal text */
+ private String literal;
+
+
+ /**
+ * Default constructor
+ */
+ public JSLiteral() {
+ super();
+ }
+
+ /**
+ * Constructor using literal parameter
+ * @param literal
+ */
+ public JSLiteral(String literal) {
+ super();
+ this.literal = literal;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.javascript.ScriptString#appendScript(java.lang.StringBuffer)
+ */
+ public void appendScript(StringBuffer jsString) {
+ jsString.append(literal);
+
+ }
+
+ /**
+ * @return the literal
+ */
+ public String getLiteral() {
+ return literal;
+ }
+
+ /**
+ * @param literal the literal to set
+ */
+ public void setLiteral(String literal) {
+ this.literal = literal;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,49 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:30 $
- *
- */
-public class JSObject extends JSFunction
-{
-
- /**
- * @param name
- * @param parameter
- */
- public JSObject(String name, Object ... parameters)
- {
- super(name, parameters);
- // TODO Auto-generated constructor stub
- }
-
- public void appendScript(StringBuffer functionString)
- {
- functionString.append("new ");
- super.appendScript(functionString);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,49 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:30 $
+ *
+ */
+public class JSObject extends JSFunction
+{
+
+ /**
+ * @param name
+ * @param parameter
+ */
+ public JSObject(String name, Object ... parameters)
+ {
+ super(name, parameters);
+ // TODO Auto-generated constructor stub
+ }
+
+ public void appendScript(StringBuffer functionString)
+ {
+ functionString.append("new ");
+ super.appendScript(functionString);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,70 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-/**
- * Create reference to JavaScript variable with optional index.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:30 $
- *
- */
-public class JSReference extends ScriptStringBase {
-
- public static final JSReference THIS = new JSReference("this");
-
- public static final JSReference TRUE = new JSReference("true");
- public static final JSReference FALSE = new JSReference("false");
- public static final JSReference NULL = new JSReference("null");
-
- private String name;
- private Object index=null;
-
- /**
- * @param name
- */
- public JSReference(String name) {
- // TODO Auto-generated constructor stub
- this.name = name;
- }
-
- /**
- * @param name
- * @param index
- */
- public JSReference(String name, Object index) {
- // TODO Auto-generated constructor stub
- this.name = name;
- this.index = index;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.javascript.ScriptString#appendScript(java.lang.StringBuffer)
- */
- public void appendScript(StringBuffer functionString) {
- functionString.append(name);
- if (null != index) {
- functionString.append("[").append(ScriptUtils.toScript(index)).append("]");
- }
-
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/JSReference.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+/**
+ * Create reference to JavaScript variable with optional index.
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:30 $
+ *
+ */
+public class JSReference extends ScriptStringBase {
+
+ public static final JSReference THIS = new JSReference("this");
+
+ public static final JSReference TRUE = new JSReference("true");
+ public static final JSReference FALSE = new JSReference("false");
+ public static final JSReference NULL = new JSReference("null");
+
+ private String name;
+ private Object index=null;
+
+ /**
+ * @param name
+ */
+ public JSReference(String name) {
+ // TODO Auto-generated constructor stub
+ this.name = name;
+ }
+
+ /**
+ * @param name
+ * @param index
+ */
+ public JSReference(String name, Object index) {
+ // TODO Auto-generated constructor stub
+ this.name = name;
+ this.index = index;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.javascript.ScriptString#appendScript(java.lang.StringBuffer)
+ */
+ public void appendScript(StringBuffer functionString) {
+ functionString.append(name);
+ if (null != index) {
+ functionString.append("[").append(ScriptUtils.toScript(index)).append("]");
+ }
+
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,88 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import javax.faces.context.ResponseWriter;
-
-final class ResponseWriterWrapper extends Writer {
-
- private static final int BUFFER_SIZE = 1024;
-
- private final ResponseWriter responseWriter;
-
- private char[] writeBuffer;
-
- ResponseWriterWrapper(ResponseWriter responseWriter) {
- this.responseWriter = responseWriter;
- }
-
- @Override
- public void close() throws IOException {
- responseWriter.close();
- }
-
- @Override
- public void flush() throws IOException {
- responseWriter.flush();
- }
-
- @Override
- public void write(char[] cbuf, int off, int len) throws IOException {
- responseWriter.writeText(cbuf, off, len);
- }
-
- @Override
- public void write(String str) throws IOException {
- responseWriter.writeText(str, null);
- }
-
- @Override
- public void write(String str, int off, int len) throws IOException {
- char cbuf[];
- if (len <= BUFFER_SIZE) {
- if (writeBuffer == null) {
- writeBuffer = new char[BUFFER_SIZE];
- }
-
- cbuf = writeBuffer;
- } else {
- cbuf = new char[len];
- }
-
- str.getChars(off, off + len, cbuf, 0);
-
- responseWriter.writeText(cbuf, 0, len);
- }
-
- @Override
- public void write(int c) throws IOException {
- if (writeBuffer == null){
- writeBuffer = new char[BUFFER_SIZE];
- }
- writeBuffer[0] = (char) c;
-
- responseWriter.writeText(writeBuffer, 0, 1);
- }
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ResponseWriterWrapper.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,88 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.faces.context.ResponseWriter;
+
+final class ResponseWriterWrapper extends Writer {
+
+ private static final int BUFFER_SIZE = 1024;
+
+ private final ResponseWriter responseWriter;
+
+ private char[] writeBuffer;
+
+ ResponseWriterWrapper(ResponseWriter responseWriter) {
+ this.responseWriter = responseWriter;
+ }
+
+ @Override
+ public void close() throws IOException {
+ responseWriter.close();
+ }
+
+ @Override
+ public void flush() throws IOException {
+ responseWriter.flush();
+ }
+
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ responseWriter.writeText(cbuf, off, len);
+ }
+
+ @Override
+ public void write(String str) throws IOException {
+ responseWriter.writeText(str, null);
+ }
+
+ @Override
+ public void write(String str, int off, int len) throws IOException {
+ char cbuf[];
+ if (len <= BUFFER_SIZE) {
+ if (writeBuffer == null) {
+ writeBuffer = new char[BUFFER_SIZE];
+ }
+
+ cbuf = writeBuffer;
+ } else {
+ cbuf = new char[len];
+ }
+
+ str.getChars(off, off + len, cbuf, 0);
+
+ responseWriter.writeText(cbuf, 0, len);
+ }
+
+ @Override
+ public void write(int c) throws IOException {
+ if (writeBuffer == null){
+ writeBuffer = new char[BUFFER_SIZE];
+ }
+ writeBuffer[0] = (char) c;
+
+ responseWriter.writeText(writeBuffer, 0, 1);
+ }
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,44 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:32 $
- *
- */
-public interface ScriptString
-{
-
- /**
- * Return object content as JavaScript String.
- * @return
- */
- public abstract String toScript();
-
- /**
- * Append JavaScript code to @link StringBuffer
- * @param functionString
- */
- public void appendScript(StringBuffer functionString);
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptString.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,44 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:32 $
+ *
+ */
+public interface ScriptString
+{
+
+ /**
+ * Return object content as JavaScript String.
+ * @return
+ */
+ public abstract String toScript();
+
+ /**
+ * Append JavaScript code to @link StringBuffer
+ * @param functionString
+ */
+ public void appendScript(StringBuffer functionString);
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,50 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/01/26 10:38:52 $
- *
- */
-public abstract class ScriptStringBase implements ScriptString
-{
-
-
-
-
-
- public String toScript()
- {
- StringBuffer functionString = new StringBuffer();
- appendScript(functionString);
- return functionString.toString();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return toScript();
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptStringBase.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,50 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/01/26 10:38:52 $
+ *
+ */
+public abstract class ScriptStringBase implements ScriptString
+{
+
+
+
+
+
+ public String toScript()
+ {
+ StringBuffer functionString = new StringBuffer();
+ appendScript(functionString);
+ return functionString.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return toScript();
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,295 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import java.beans.PropertyDescriptor;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.lang.reflect.Array;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.faces.context.ResponseWriter;
-
-import org.apache.commons.beanutils.PropertyUtils;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.3 $ $Date: 2007/01/24 13:22:31 $
- *
- */
-public class ScriptUtils {
-
- /**
- * This is utility class, don't instantiate.
- */
- private ScriptUtils() {
-
- }
-
- private static void writeScriptToStream(Writer writer, Object obj) throws IOException {
- if (null == obj) {
- writer.write("null");
- } else if (obj instanceof ScriptString) {
- writer.write(((ScriptString) obj).toScript());
- } else if (obj.getClass().isArray()) {
- writer.write("[");
- boolean first = true;
- for (int i = 0; i < Array.getLength(obj); i++) {
- Object element = Array.get(obj, i);
- if (!first) {
- writer.write(',');
- }
- writeScriptToStream(writer, element);
- first = false;
- }
-
- writer.write("] ");
- } else if (obj instanceof Collection) {
- // Collections put as JavaScript array.
-
- @SuppressWarnings("unchecked")
- Collection<Object> collection = (Collection<Object>) obj;
-
- writer.write("[");
- boolean first = true;
- for (Iterator<Object> iter = collection.iterator(); iter.hasNext();) {
- Object element = iter.next();
- if (!first) {
- writer.write(',');
- }
- writeScriptToStream(writer, element);
- first = false;
- }
- writer.write("] ");
- } else if (obj instanceof Map) {
-
- // Maps put as JavaScript hash.
- @SuppressWarnings("unchecked")
- Map<Object, Object> map = (Map<Object, Object>) obj;
-
- writer.write("{");
- boolean first = true;
- for (Map.Entry<Object, Object> entry : map.entrySet()) {
- if (!first) {
- writer.write(',');
- }
-
- writeEncodedString(writer, entry.getKey());
- writer.write(":");
- writeScriptToStream(writer, entry.getValue());
- first = false;
- }
- writer.write("} ");
- } else if (obj instanceof Number || obj instanceof Boolean) {
- // numbers and boolean put as-is, without conversion
- writer.write(obj.toString());
- } else if (obj instanceof String) {
- // all other put as encoded strings.
- writeEncodedString(writer, obj);
- } else if (obj instanceof Enum) {
- // all other put as encoded strings.
- writeEncodedString(writer, obj);
- } else if (obj.getClass().getName().startsWith("java.sql.")) {
- writer.write("{");
- boolean first = true;
- for (PropertyDescriptor propertyDescriptor :
- PropertyUtils.getPropertyDescriptors(obj)) {
- String key = propertyDescriptor.getName();
- if ("class".equals(key)) {
- continue;
- }
- Object value = null;
- try {
- value = PropertyUtils.getProperty(obj, key);
- } catch (Exception e) {
- continue;
- }
-
- if (!first) {
- writer.write(',');
- }
-
- writeEncodedString(writer, key);
- writer.write(":");
- writeScriptToStream(writer, value);
-
- first = false;
- }
- writer.write("} ");
- } else {
- // All other objects threaded as Java Beans.
- writer.write("{");
-
- PropertyDescriptor[] propertyDescriptors;
- try {
- propertyDescriptors = PropertyUtils.getPropertyDescriptors(obj);
- } catch (Exception e) {
- throw new FacesException(
- "Error in conversion Java Object to JavaScript", e);
- }
-
- boolean first = true;
- for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
- String key = propertyDescriptor.getName();
- if ("class".equals(key)) {
- continue;
- }
- if (!first) {
- writer.write(',');
- }
- writeEncodedString(writer, key);
- writer.write(":");
-
- Object propertyValue;
- try{
- propertyValue = PropertyUtils.getProperty(obj, key);
- } catch (Exception e) {
- throw new FacesException(
- "Error in conversion Java Object to JavaScript", e);
- }
-
- writeScriptToStream(writer, propertyValue);
- first = false;
- }
-
- writer.write("} ");
- }
- }
-
- /**
- * Convert any Java Object to JavaScript representation ( as possible ) and write it to
- * writer immediately
- *
- * @param responseWriter
- * @param obj
- * @throws IOException
- */
- public static void writeToStream(final ResponseWriter responseWriter, Object obj) throws IOException {
- writeScriptToStream(new ResponseWriterWrapper(responseWriter), obj);
- }
-
- /**
- * Convert any Java Object to JavaScript representation ( as possible ).
- * @param obj
- * @return
- */
- public static String toScript(Object obj) {
- StringBuilder sb = new StringBuilder();
- try {
- writeScriptToStream(new StringBuilderWriter(sb), obj);
- } catch (IOException e) {
- //ignore
- }
- return sb.toString();
- }
-
- public static void writeEncodedString(Writer w, Object obj) throws IOException {
- w.write("'");
- writeEncoded(w, obj);
- w.write("'");
- }
-
- public static void addEncodedString(StringBuilder buff, Object obj) {
- try {
- writeEncodedString(new StringBuilderWriter(buff), obj);
- } catch (IOException e) {
- //ignore
- }
- }
-
- public static void writeEncoded(Writer w, Object obj) throws IOException {
- JSEncoder encoder = new JSEncoder();
- char chars[] = obj.toString().toCharArray();
- for (int i = 0; i < chars.length; i++) {
- char c = chars[i];
- if (!encoder.compile(c)) {
- w.write(encoder.encode(c));
- } else {
- w.write(c);
- }
- }
- }
-
- public static void addEncoded(StringBuilder buff, Object obj) {
- try {
- writeEncoded(new StringBuilderWriter(buff), obj);
- } catch (IOException e) {
- //ignore
- }
- }
-
- public static String getValidJavascriptName(String s) {
-
- StringBuffer buf = null;
- for (int i = 0, len = s.length(); i < len; i++) {
- char c = s.charAt(i);
-
- if (Character.isLetterOrDigit(c)||c=='_' ) {
- // allowed char
- if (buf != null)
- buf.append(c);
- } else {
- if (buf == null) {
- buf = new StringBuffer(s.length() + 10);
- buf.append(s.substring(0, i));
- }
-
- buf.append('_');
- if (c < 16) {
- // pad single hex digit values with '0' on the left
- buf.append('0');
- }
-
- if (c < 128) {
- // first 128 chars match their byte representation in UTF-8
- buf.append(Integer.toHexString(c).toUpperCase());
- } else {
- byte[] bytes;
- try {
- bytes = Character.toString(c).getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
-
- for (int j = 0; j < bytes.length; j++) {
- int intVal = bytes[j];
- if (intVal < 0) {
- // intVal will be >= 128
- intVal = 256 + intVal;
- } else if (intVal < 16) {
- // pad single hex digit values with '0' on the left
- buf.append('0');
- }
- buf.append(Integer.toHexString(intVal).toUpperCase());
- }
- }
- }
-
- }
-
- return buf == null ? s : buf.toString();
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,295 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import java.beans.PropertyDescriptor;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.lang.reflect.Array;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.FacesException;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.3 $ $Date: 2007/01/24 13:22:31 $
+ *
+ */
+public class ScriptUtils {
+
+ /**
+ * This is utility class, don't instantiate.
+ */
+ private ScriptUtils() {
+
+ }
+
+ private static void writeScriptToStream(Writer writer, Object obj) throws IOException {
+ if (null == obj) {
+ writer.write("null");
+ } else if (obj instanceof ScriptString) {
+ writer.write(((ScriptString) obj).toScript());
+ } else if (obj.getClass().isArray()) {
+ writer.write("[");
+ boolean first = true;
+ for (int i = 0; i < Array.getLength(obj); i++) {
+ Object element = Array.get(obj, i);
+ if (!first) {
+ writer.write(',');
+ }
+ writeScriptToStream(writer, element);
+ first = false;
+ }
+
+ writer.write("] ");
+ } else if (obj instanceof Collection) {
+ // Collections put as JavaScript array.
+
+ @SuppressWarnings("unchecked")
+ Collection<Object> collection = (Collection<Object>) obj;
+
+ writer.write("[");
+ boolean first = true;
+ for (Iterator<Object> iter = collection.iterator(); iter.hasNext();) {
+ Object element = iter.next();
+ if (!first) {
+ writer.write(',');
+ }
+ writeScriptToStream(writer, element);
+ first = false;
+ }
+ writer.write("] ");
+ } else if (obj instanceof Map) {
+
+ // Maps put as JavaScript hash.
+ @SuppressWarnings("unchecked")
+ Map<Object, Object> map = (Map<Object, Object>) obj;
+
+ writer.write("{");
+ boolean first = true;
+ for (Map.Entry<Object, Object> entry : map.entrySet()) {
+ if (!first) {
+ writer.write(',');
+ }
+
+ writeEncodedString(writer, entry.getKey());
+ writer.write(":");
+ writeScriptToStream(writer, entry.getValue());
+ first = false;
+ }
+ writer.write("} ");
+ } else if (obj instanceof Number || obj instanceof Boolean) {
+ // numbers and boolean put as-is, without conversion
+ writer.write(obj.toString());
+ } else if (obj instanceof String) {
+ // all other put as encoded strings.
+ writeEncodedString(writer, obj);
+ } else if (obj instanceof Enum) {
+ // all other put as encoded strings.
+ writeEncodedString(writer, obj);
+ } else if (obj.getClass().getName().startsWith("java.sql.")) {
+ writer.write("{");
+ boolean first = true;
+ for (PropertyDescriptor propertyDescriptor :
+ PropertyUtils.getPropertyDescriptors(obj)) {
+ String key = propertyDescriptor.getName();
+ if ("class".equals(key)) {
+ continue;
+ }
+ Object value = null;
+ try {
+ value = PropertyUtils.getProperty(obj, key);
+ } catch (Exception e) {
+ continue;
+ }
+
+ if (!first) {
+ writer.write(',');
+ }
+
+ writeEncodedString(writer, key);
+ writer.write(":");
+ writeScriptToStream(writer, value);
+
+ first = false;
+ }
+ writer.write("} ");
+ } else {
+ // All other objects threaded as Java Beans.
+ writer.write("{");
+
+ PropertyDescriptor[] propertyDescriptors;
+ try {
+ propertyDescriptors = PropertyUtils.getPropertyDescriptors(obj);
+ } catch (Exception e) {
+ throw new FacesException(
+ "Error in conversion Java Object to JavaScript", e);
+ }
+
+ boolean first = true;
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ String key = propertyDescriptor.getName();
+ if ("class".equals(key)) {
+ continue;
+ }
+ if (!first) {
+ writer.write(',');
+ }
+ writeEncodedString(writer, key);
+ writer.write(":");
+
+ Object propertyValue;
+ try{
+ propertyValue = PropertyUtils.getProperty(obj, key);
+ } catch (Exception e) {
+ throw new FacesException(
+ "Error in conversion Java Object to JavaScript", e);
+ }
+
+ writeScriptToStream(writer, propertyValue);
+ first = false;
+ }
+
+ writer.write("} ");
+ }
+ }
+
+ /**
+ * Convert any Java Object to JavaScript representation ( as possible ) and write it to
+ * writer immediately
+ *
+ * @param responseWriter
+ * @param obj
+ * @throws IOException
+ */
+ public static void writeToStream(final ResponseWriter responseWriter, Object obj) throws IOException {
+ writeScriptToStream(new ResponseWriterWrapper(responseWriter), obj);
+ }
+
+ /**
+ * Convert any Java Object to JavaScript representation ( as possible ).
+ * @param obj
+ * @return
+ */
+ public static String toScript(Object obj) {
+ StringBuilder sb = new StringBuilder();
+ try {
+ writeScriptToStream(new StringBuilderWriter(sb), obj);
+ } catch (IOException e) {
+ //ignore
+ }
+ return sb.toString();
+ }
+
+ public static void writeEncodedString(Writer w, Object obj) throws IOException {
+ w.write("'");
+ writeEncoded(w, obj);
+ w.write("'");
+ }
+
+ public static void addEncodedString(StringBuilder buff, Object obj) {
+ try {
+ writeEncodedString(new StringBuilderWriter(buff), obj);
+ } catch (IOException e) {
+ //ignore
+ }
+ }
+
+ public static void writeEncoded(Writer w, Object obj) throws IOException {
+ JSEncoder encoder = new JSEncoder();
+ char chars[] = obj.toString().toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ char c = chars[i];
+ if (!encoder.compile(c)) {
+ w.write(encoder.encode(c));
+ } else {
+ w.write(c);
+ }
+ }
+ }
+
+ public static void addEncoded(StringBuilder buff, Object obj) {
+ try {
+ writeEncoded(new StringBuilderWriter(buff), obj);
+ } catch (IOException e) {
+ //ignore
+ }
+ }
+
+ public static String getValidJavascriptName(String s) {
+
+ StringBuffer buf = null;
+ for (int i = 0, len = s.length(); i < len; i++) {
+ char c = s.charAt(i);
+
+ if (Character.isLetterOrDigit(c)||c=='_' ) {
+ // allowed char
+ if (buf != null)
+ buf.append(c);
+ } else {
+ if (buf == null) {
+ buf = new StringBuffer(s.length() + 10);
+ buf.append(s.substring(0, i));
+ }
+
+ buf.append('_');
+ if (c < 16) {
+ // pad single hex digit values with '0' on the left
+ buf.append('0');
+ }
+
+ if (c < 128) {
+ // first 128 chars match their byte representation in UTF-8
+ buf.append(Integer.toHexString(c).toUpperCase());
+ } else {
+ byte[] bytes;
+ try {
+ bytes = Character.toString(c).getBytes("UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+
+ for (int j = 0; j < bytes.length; j++) {
+ int intVal = bytes[j];
+ if (intVal < 0) {
+ // intVal will be >= 128
+ intVal = 256 + intVal;
+ } else if (intVal < 16) {
+ // pad single hex digit values with '0' on the left
+ buf.append('0');
+ }
+ buf.append(Integer.toHexString(intVal).toUpperCase());
+ }
+ }
+ }
+
+ }
+
+ return buf == null ? s : buf.toString();
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,84 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.2
- */
-final class StringBuilderWriter extends Writer {
-
- private StringBuilder builder;
-
- public StringBuilderWriter(StringBuilder builder) {
- super();
- this.builder = builder;
- }
-
- /**
- * Closing this writer doesn't have any effect
- */
- @Override
- public void close() throws IOException {
- //do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.Writer#flush()
- */
- @Override
- public void flush() throws IOException {
- //do nothing
- }
-
- /* (non-Javadoc)
- * @see java.io.Writer#write(char[], int, int)
- */
- @Override
- public void write(char[] cbuf, int off, int len) throws IOException {
- builder.append(cbuf, off, len);
- }
-
- @Override
- public void write(char[] cbuf) throws IOException {
- builder.append(cbuf);
- }
-
- @Override
- public void write(String str) throws IOException {
- builder.append(str);
- }
-
- @Override
- public void write(String str, int off, int len) throws IOException {
- builder.append(str, off, off + len);
- }
-
- @Override
- public void write(int c) throws IOException {
- builder.append((char) c);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/StringBuilderWriter.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,84 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.2
+ */
+final class StringBuilderWriter extends Writer {
+
+ private StringBuilder builder;
+
+ public StringBuilderWriter(StringBuilder builder) {
+ super();
+ this.builder = builder;
+ }
+
+ /**
+ * Closing this writer doesn't have any effect
+ */
+ @Override
+ public void close() throws IOException {
+ //do nothing
+ }
+
+ /* (non-Javadoc)
+ * @see java.io.Writer#flush()
+ */
+ @Override
+ public void flush() throws IOException {
+ //do nothing
+ }
+
+ /* (non-Javadoc)
+ * @see java.io.Writer#write(char[], int, int)
+ */
+ @Override
+ public void write(char[] cbuf, int off, int len) throws IOException {
+ builder.append(cbuf, off, len);
+ }
+
+ @Override
+ public void write(char[] cbuf) throws IOException {
+ builder.append(cbuf);
+ }
+
+ @Override
+ public void write(String str) throws IOException {
+ builder.append(str);
+ }
+
+ @Override
+ public void write(String str, int off, int len) throws IOException {
+ builder.append(str, off, off + len);
+ }
+
+ @Override
+ public void write(int c) throws IOException {
+ builder.append((char) c);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Classes and interfaces that ease creation of client-side Javascript code
- */
-package org.ajax4jsf.javascript;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/javascript/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Classes and interfaces that ease creation of client-side Javascript code
+ */
+package org.ajax4jsf.javascript;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,41 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-
-/**
- * Interface for classes keeped current iterable component state, as :
- * active data objects range
- * sorting order
- * tree nodes expanded state
- *
- * @author shura
- *
- */
-public interface DataComponentState {
-
- /**
- * Build used data objects range for iteration.
- * @return
- */
- public abstract Range getRange();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,41 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+
+/**
+ * Interface for classes keeped current iterable component state, as :
+ * active data objects range
+ * sorting order
+ * tree nodes expanded state
+ *
+ * @author shura
+ *
+ */
+public interface DataComponentState {
+
+ /**
+ * Build used data objects range for iteration.
+ * @return
+ */
+ public abstract Range getRange();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,45 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-
-/**
- * Interface for classes, able to receive visitor processing calls from ExtendedDataModel
- * @author shura
- *
- */
-public interface DataVisitor {
-
- /**
- * This method called back ( as visitor ) from {@link ExtendedDataModel#walk(FacesContext, DataVisitor, Range)} for
- * each row.
- * @param context current JSF context.
- * @param rowKey current row key of DataModel
- * @param argument Implementation-specific argument
- * @throws IOException
- */
- public void process(FacesContext context,Object rowKey, Object argument) throws IOException;
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,45 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Interface for classes, able to receive visitor processing calls from ExtendedDataModel
+ * @author shura
+ *
+ */
+public interface DataVisitor {
+
+ /**
+ * This method called back ( as visitor ) from {@link ExtendedDataModel#walk(FacesContext, DataVisitor, Range)} for
+ * each row.
+ * @param context current JSF context.
+ * @param rowKey current row key of DataModel
+ * @param argument Implementation-specific argument
+ * @throws IOException
+ */
+ public void process(FacesContext context,Object rowKey, Object argument) throws IOException;
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.DataModel;
-
-/**
- * Extesion for {@link DataModel} , for support complex data structure, like tree, spreadsheet etc
- * in iterable components.
- * @author shura
- *
- */
-public abstract class ExtendedDataModel extends DataModel {
-
- /**
- * <p>Instead of simple <code>int</code> for current state selection, this model can use any object for
- * select current data. Implementation depend on model, with any restrictions :</p>
- * <ol>
- * <li> key must be {@link Serializable}.</li>
- * <li>{@link Object#toString()} method must return representation compatible with {@link javax.faces.component.UIComponent#getClientId(javax.faces.context.FacesContext)},
- * as far as this string will be appended to clientId of iterator component.</li>
- * </ol>
- * @param key key for select current data, or null for clear selection.
- */
- public abstract void setRowKey(Object key);
-
- /**
- * @return key for selected data or <code>null</code>
- */
- public abstract Object getRowKey();
-
- /**
- * Iteration component can support save data for use at decoding/validation/update phases to avoid unnessesary calls to original models,
- * for example - to avoid requests to database until all data is validated.
- * @return
- */
- public SerializableDataModel getSerializableModel(Range range){
- // By default, model not serializable.
- return null;
- }
-
-
- /**
- * Iterate over model by "visitor" pattern, for given range
- * @param context current JSF context.
- * @param visitor instance of {@link DataVisitor}, for process each row.
- * @param range Implementation-specific range of data keys.
- * @param argument Implementation-specific argument
- * @throws IOException
- */
- public abstract void walk(FacesContext context,DataVisitor visitor,Range range, Object argument) throws IOException;
-
- /**
- * Create Iterator on all row keys for given range.
- * @param range - Implementation-specific range of data keys.
- * @return
- */
-// public abstract Iterator dataIterator(Range range);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+
+/**
+ * Extesion for {@link DataModel} , for support complex data structure, like tree, spreadsheet etc
+ * in iterable components.
+ * @author shura
+ *
+ */
+public abstract class ExtendedDataModel extends DataModel {
+
+ /**
+ * <p>Instead of simple <code>int</code> for current state selection, this model can use any object for
+ * select current data. Implementation depend on model, with any restrictions :</p>
+ * <ol>
+ * <li> key must be {@link Serializable}.</li>
+ * <li>{@link Object#toString()} method must return representation compatible with {@link javax.faces.component.UIComponent#getClientId(javax.faces.context.FacesContext)},
+ * as far as this string will be appended to clientId of iterator component.</li>
+ * </ol>
+ * @param key key for select current data, or null for clear selection.
+ */
+ public abstract void setRowKey(Object key);
+
+ /**
+ * @return key for selected data or <code>null</code>
+ */
+ public abstract Object getRowKey();
+
+ /**
+ * Iteration component can support save data for use at decoding/validation/update phases to avoid unnessesary calls to original models,
+ * for example - to avoid requests to database until all data is validated.
+ * @return
+ */
+ public SerializableDataModel getSerializableModel(Range range){
+ // By default, model not serializable.
+ return null;
+ }
+
+
+ /**
+ * Iterate over model by "visitor" pattern, for given range
+ * @param context current JSF context.
+ * @param visitor instance of {@link DataVisitor}, for process each row.
+ * @param range Implementation-specific range of data keys.
+ * @param argument Implementation-specific argument
+ * @throws IOException
+ */
+ public abstract void walk(FacesContext context,DataVisitor visitor,Range range, Object argument) throws IOException;
+
+ /**
+ * Create Iterator on all row keys for given range.
+ * @param range - Implementation-specific range of data keys.
+ * @return
+ */
+// public abstract Iterator dataIterator(Range range);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,46 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.model;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Marker annotation, to keep request-scope beans between requests in the view state.
- * @author asmirnov
- *
- */
-(a)Target(ElementType.TYPE)
-(a)Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface KeepAlive {
-
- /**
- * Boolean attribute indicating whether kept beans are accessible for all requests or AJAX-only.
- *
- * @return
- * @since 3.2.2
- */
- boolean ajaxOnly() default false;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.model;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Marker annotation, to keep request-scope beans between requests in the view state.
+ * @author asmirnov
+ *
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface KeepAlive {
+
+ /**
+ * Boolean attribute indicating whether kept beans are accessible for all requests or AJAX-only.
+ *
+ * @return
+ * @since 3.2.2
+ */
+ boolean ajaxOnly() default false;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-/**
- * Marker interface for building iterator over dataModel values. over {@link ExtendedDataModel} elements.
- * It can be simple min/max values for data table, but also can provide set of expanded/collapsed nodes in tree,
- * can provide sorting order,
- * @author shura
- *
- */
-public interface Range {
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/Range.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+/**
+ * Marker interface for building iterator over dataModel values. over {@link ExtendedDataModel} elements.
+ * It can be simple min/max values for data table, but also can provide set of expanded/collapsed nodes in tree,
+ * can provide sorting order,
+ * @author shura
+ *
+ */
+public interface Range {
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,79 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-import java.io.Serializable;
-
-/**
- * @author shura
- *
- */
-public class RepeatState implements DataComponentState,Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -5552520123654180445L;
-
- private int _rows = -1;
-
- private int _first = 0;
-
-
- /**
- * @return the first
- */
- public int getFirst() {
- return _first;
- }
-
- /**
- * @param first the first to set
- */
- public void setFirst(int first) {
- this._first = first;
- }
-
- /**
- * @return the rows
- */
- public int getRows() {
- return _rows;
- }
-
- /**
- * @param rows the rows to set
- */
- public void setRows(int rows) {
- this._rows = rows;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.ajax.repeat.DataComponentState#getRange()
- */
- public Range getRange() {
- // TODO Auto-generated method stub
- return new SequenceRange(getFirst(),getRows());
- }
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,79 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+import java.io.Serializable;
+
+/**
+ * @author shura
+ *
+ */
+public class RepeatState implements DataComponentState,Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5552520123654180445L;
+
+ private int _rows = -1;
+
+ private int _first = 0;
+
+
+ /**
+ * @return the first
+ */
+ public int getFirst() {
+ return _first;
+ }
+
+ /**
+ * @param first the first to set
+ */
+ public void setFirst(int first) {
+ this._first = first;
+ }
+
+ /**
+ * @return the rows
+ */
+ public int getRows() {
+ return _rows;
+ }
+
+ /**
+ * @param rows the rows to set
+ */
+ public void setRows(int rows) {
+ this._rows = rows;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.ajax.repeat.DataComponentState#getRange()
+ */
+ public Range getRange() {
+ // TODO Auto-generated method stub
+ return new SequenceRange(getFirst(),getRows());
+ }
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,202 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-import java.io.IOException;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.DataModel;
-
-/**
- * @author shura
- *
- */
-public class SequenceDataModel extends ExtendedDataModel {
-
- private DataModel wrappedModel;
-
- /**
- * @param wrapped
- */
- public SequenceDataModel(DataModel wrapped) {
- super();
- this.wrappedModel = wrapped;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#dataIterator(org.ajax4jsf.ajax.repeat.Range)
- */
-/* public Iterator dataIterator(Range range) {
- final SequenceRange seqRange = (SequenceRange) range;
- int rows = seqRange.getRows();
- int rowCount = wrapped.getRowCount();
- final int firstRow = seqRange.getFirstRow();
- if(rows > 0){
- rows += firstRow;
- if(rowCount >=0){
- rows = Math.min(rows, rowCount);
- }
- } else if(rowCount >=0 ){
- rows = rowCount;
- }
- final int maxRow = rows;
- return new Iterator(){
-
- int rowIndex = firstRow;
-
- public boolean hasNext() {
- // TODO Auto-generated method stub
- return maxRow < 0 || rowIndex < maxRow;
- }
-
- public Object next() {
- // TODO Auto-generated method stub
- return new Integer(rowIndex++);
- }
-
- public void remove() {
- throw new IllegalStateException();
- }
-
- };
- }
-*/
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
- final SequenceRange seqRange = (SequenceRange) range;
- int rows = seqRange.getRows();
- int rowCount = wrappedModel.getRowCount();
- int currentRow = seqRange.getFirstRow();
- if(rows > 0){
- rows += currentRow;
- if(rowCount >=0){
- rows = Math.min(rows, rowCount);
- }
- } else if(rowCount >=0 ){
- rows = rowCount;
- } else {
- rows = -1;
- }
- while (rows < 0 || currentRow < rows) {
- wrappedModel.setRowIndex(currentRow);
- if(wrappedModel.isRowAvailable()){
- visitor.process(context, new Integer(currentRow), argument);
- } else {
- break;
- }
- currentRow++;
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#getRowKey()
- */
- public Object getRowKey() {
- int index = wrappedModel.getRowIndex();
- if(index<0){
- return null;
- }
- return new Integer(index);
- }
-
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#setRowKey(java.lang.Object)
- */
- public void setRowKey(Object key) {
- if(null == key){
- wrappedModel.setRowIndex(-1);
- } else {
- Integer index = (Integer) key;
- wrappedModel.setRowIndex(index.intValue());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getRowCount()
- */
- public int getRowCount() {
- // TODO Auto-generated method stub
- return wrappedModel.getRowCount();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getRowData()
- */
- public Object getRowData() {
- // TODO Auto-generated method stub
- return wrappedModel.getRowData();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getRowIndex()
- */
- public int getRowIndex() {
- // TODO Auto-generated method stub
- return wrappedModel.getRowIndex();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getWrappedData()
- */
- public Object getWrappedData() {
- // TODO Auto-generated method stub
- return wrappedModel.getWrappedData();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#isRowAvailable()
- */
- public boolean isRowAvailable() {
- // TODO Auto-generated method stub
- return wrappedModel.isRowAvailable();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#setRowIndex(int)
- */
- public void setRowIndex(int rowIndex) {
- wrappedModel.setRowIndex(rowIndex);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
- */
- public void setWrappedData(Object data) {
- wrappedModel.setWrappedData(data);
- }
-
- /**
- * @return the wrappedModel
- */
- protected DataModel getWrappedModel() {
- return this.wrappedModel;
- }
-
- /**
- * @param wrappedModel the wrappedModel to set
- */
- protected void setWrappedModel(DataModel wrappedModel) {
- this.wrappedModel = wrappedModel;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,202 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+
+/**
+ * @author shura
+ *
+ */
+public class SequenceDataModel extends ExtendedDataModel {
+
+ private DataModel wrappedModel;
+
+ /**
+ * @param wrapped
+ */
+ public SequenceDataModel(DataModel wrapped) {
+ super();
+ this.wrappedModel = wrapped;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#dataIterator(org.ajax4jsf.ajax.repeat.Range)
+ */
+/* public Iterator dataIterator(Range range) {
+ final SequenceRange seqRange = (SequenceRange) range;
+ int rows = seqRange.getRows();
+ int rowCount = wrapped.getRowCount();
+ final int firstRow = seqRange.getFirstRow();
+ if(rows > 0){
+ rows += firstRow;
+ if(rowCount >=0){
+ rows = Math.min(rows, rowCount);
+ }
+ } else if(rowCount >=0 ){
+ rows = rowCount;
+ }
+ final int maxRow = rows;
+ return new Iterator(){
+
+ int rowIndex = firstRow;
+
+ public boolean hasNext() {
+ // TODO Auto-generated method stub
+ return maxRow < 0 || rowIndex < maxRow;
+ }
+
+ public Object next() {
+ // TODO Auto-generated method stub
+ return new Integer(rowIndex++);
+ }
+
+ public void remove() {
+ throw new IllegalStateException();
+ }
+
+ };
+ }
+*/
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
+ final SequenceRange seqRange = (SequenceRange) range;
+ int rows = seqRange.getRows();
+ int rowCount = wrappedModel.getRowCount();
+ int currentRow = seqRange.getFirstRow();
+ if(rows > 0){
+ rows += currentRow;
+ if(rowCount >=0){
+ rows = Math.min(rows, rowCount);
+ }
+ } else if(rowCount >=0 ){
+ rows = rowCount;
+ } else {
+ rows = -1;
+ }
+ while (rows < 0 || currentRow < rows) {
+ wrappedModel.setRowIndex(currentRow);
+ if(wrappedModel.isRowAvailable()){
+ visitor.process(context, new Integer(currentRow), argument);
+ } else {
+ break;
+ }
+ currentRow++;
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#getRowKey()
+ */
+ public Object getRowKey() {
+ int index = wrappedModel.getRowIndex();
+ if(index<0){
+ return null;
+ }
+ return new Integer(index);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#setRowKey(java.lang.Object)
+ */
+ public void setRowKey(Object key) {
+ if(null == key){
+ wrappedModel.setRowIndex(-1);
+ } else {
+ Integer index = (Integer) key;
+ wrappedModel.setRowIndex(index.intValue());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ public int getRowCount() {
+ // TODO Auto-generated method stub
+ return wrappedModel.getRowCount();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowData()
+ */
+ public Object getRowData() {
+ // TODO Auto-generated method stub
+ return wrappedModel.getRowData();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowIndex()
+ */
+ public int getRowIndex() {
+ // TODO Auto-generated method stub
+ return wrappedModel.getRowIndex();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getWrappedData()
+ */
+ public Object getWrappedData() {
+ // TODO Auto-generated method stub
+ return wrappedModel.getWrappedData();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ // TODO Auto-generated method stub
+ return wrappedModel.isRowAvailable();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#setRowIndex(int)
+ */
+ public void setRowIndex(int rowIndex) {
+ wrappedModel.setRowIndex(rowIndex);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object data) {
+ wrappedModel.setWrappedData(data);
+ }
+
+ /**
+ * @return the wrappedModel
+ */
+ protected DataModel getWrappedModel() {
+ return this.wrappedModel;
+ }
+
+ /**
+ * @param wrappedModel the wrappedModel to set
+ */
+ protected void setWrappedModel(DataModel wrappedModel) {
+ this.wrappedModel = wrappedModel;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,73 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-/**
- * @author shura
- *
- */
-public class SequenceRange implements Range {
-
- private int firstRow = 0;
-
- private int rows = -1;
-
- /**
- * @return the firstRow
- */
- public int getFirstRow() {
- return firstRow;
- }
-
- /**
- * @return the rows
- */
- public int getRows() {
- return rows;
- }
-
- /**
- *
- */
- protected SequenceRange() {
- super();
- }
-
- /**
- * @param firstRow
- * @param rows
- */
- public SequenceRange(int firstRow, int rows) {
- super();
- this.firstRow = firstRow;
- this.rows = rows;
- }
-
- protected void setFirstRow(int firstRow) {
- this.firstRow = firstRow;
- }
-
- protected void setRows(int rows) {
- this.rows = rows;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+/**
+ * @author shura
+ *
+ */
+public class SequenceRange implements Range {
+
+ private int firstRow = 0;
+
+ private int rows = -1;
+
+ /**
+ * @return the firstRow
+ */
+ public int getFirstRow() {
+ return firstRow;
+ }
+
+ /**
+ * @return the rows
+ */
+ public int getRows() {
+ return rows;
+ }
+
+ /**
+ *
+ */
+ protected SequenceRange() {
+ super();
+ }
+
+ /**
+ * @param firstRow
+ * @param rows
+ */
+ public SequenceRange(int firstRow, int rows) {
+ super();
+ this.firstRow = firstRow;
+ this.rows = rows;
+ }
+
+ protected void setFirstRow(int firstRow) {
+ this.firstRow = firstRow;
+ }
+
+ protected void setRows(int rows) {
+ this.rows = rows;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,40 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.model;
-
-import java.io.Serializable;
-
-/**
- * Serializable version of {@link ExtendedDataModel}, for save lightweight version of data
- *
- * @author shura
- *
- */
-@SuppressWarnings("serial")
-public abstract class SerializableDataModel extends ExtendedDataModel implements Serializable {
-
- /**
- * Method called after update all model values. For example, developer can update
- * database with new values of modified rows.
- */
- public abstract void update();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,40 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.model;
+
+import java.io.Serializable;
+
+/**
+ * Serializable version of {@link ExtendedDataModel}, for save lightweight version of data
+ *
+ * @author shura
+ *
+ */
+@SuppressWarnings("serial")
+public abstract class SerializableDataModel extends ExtendedDataModel implements Serializable {
+
+ /**
+ * Method called after update all model values. For example, developer can update
+ * database with new values of modified rows.
+ */
+ public abstract void update();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Various model objects APIs. Contains a set of extended data models classes
- */
-package org.ajax4jsf.model;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/model/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Various model objects APIs. Contains a set of extended data models classes
+ */
+package org.ajax4jsf.model;
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Base package for AJAX classes
- */
-package org.ajax4jsf;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Base package for AJAX classes
+ */
+package org.ajax4jsf;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,60 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.renderkit;
-
-import java.io.IOException;
-import java.util.Set;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-public interface AjaxRenderer {
-
- /**
- * Iterate over all childs of components. If component id contains in list ,
- * or, if list is empty, compotents is submitted form - render it. TODO -
- * Instead of calculate full path for every component, build current Path
- * for componet and send as parameter.
- *
- * @param context -
- * current context
- * @param component -
- * curent faces component.
- * @param ids -
- * list of Id to render.
- * @throws IOException
- */
- public void encodeAjaxChildren(FacesContext context, UIComponent component,
- String path, Set<String> ids, Set<String> renderedAreas) throws IOException;
-
- /**
- * @param context
- * @param component
- * @param currentPath
- * @param ids
- * @param renderedAreas
- * @throws IOException
- */
- public void encodeAjaxComponent(FacesContext context,
- UIComponent component, String currentPath, Set<String> ids,
- Set<String> renderedAreas) throws IOException;
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,60 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.renderkit;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+public interface AjaxRenderer {
+
+ /**
+ * Iterate over all childs of components. If component id contains in list ,
+ * or, if list is empty, compotents is submitted form - render it. TODO -
+ * Instead of calculate full path for every component, build current Path
+ * for componet and send as parameter.
+ *
+ * @param context -
+ * current context
+ * @param component -
+ * curent faces component.
+ * @param ids -
+ * list of Id to render.
+ * @throws IOException
+ */
+ public void encodeAjaxChildren(FacesContext context, UIComponent component,
+ String path, Set<String> ids, Set<String> renderedAreas) throws IOException;
+
+ /**
+ * @param context
+ * @param component
+ * @param currentPath
+ * @param ids
+ * @param renderedAreas
+ * @throws IOException
+ */
+ public void encodeAjaxComponent(FacesContext context,
+ UIComponent component, String currentPath, Set<String> ids,
+ Set<String> renderedAreas) throws IOException;
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,55 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit;
-
-import java.util.LinkedHashSet;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * Interface for renderers, for wich nessesary insert script or style resource in header.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:50 $
- *
- */
-public interface HeaderResourceProducer {
-
- /**
- * Return set of strings with URI's of nessesary scripts.
- * Use linked set to preserve insertion order
- * @param context - current faces context.
- * @param component TODO
- * @return - set of URI's or null
- */
- public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent component);
-
- /**
- * Return set of strings with URI's of nessesary CSS styles.
- * Use linked set to preserve insertion order.
- * @param context - current faces context.
- * @param component TODO
- * @return - set of URI's or null
- */
- public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent component);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,55 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit;
+
+import java.util.LinkedHashSet;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * Interface for renderers, for wich nessesary insert script or style resource in header.
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:50 $
+ *
+ */
+public interface HeaderResourceProducer {
+
+ /**
+ * Return set of strings with URI's of nessesary scripts.
+ * Use linked set to preserve insertion order
+ * @param context - current faces context.
+ * @param component TODO
+ * @return - set of URI's or null
+ */
+ public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent component);
+
+ /**
+ * Return set of strings with URI's of nessesary CSS styles.
+ * Use linked set to preserve insertion order.
+ * @param context - current faces context.
+ * @param component TODO
+ * @return - set of URI's or null
+ */
+ public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent component);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,42 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit;
-
-import java.io.IOException;
-import java.util.Set;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.InternetResource;
-
-/**
- * Interface for renderers, for wich nessesary insert script or style resource in header.
- * This is the second revision of {@link HeaderResourceProducer} interface that returns
- * arrays of {@link InternetResource} instead of {@link Set}
- * @author nbelaevski(a)exadel.com
- *
- */
-public interface HeaderResourceProducer2 {
-
- public void encodeToHead(FacesContext context, UIComponent component, ProducerContext pc) throws IOException;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,42 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.InternetResource;
+
+/**
+ * Interface for renderers, for wich nessesary insert script or style resource in header.
+ * This is the second revision of {@link HeaderResourceProducer} interface that returns
+ * arrays of {@link InternetResource} instead of {@link Set}
+ * @author nbelaevski(a)exadel.com
+ *
+ */
+public interface HeaderResourceProducer2 {
+
+ public void encodeToHead(FacesContext context, UIComponent component, ProducerContext pc) throws IOException;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,35 +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.ajax4jsf.renderkit;
-
-
-/**
- * @author Nick Belaevski
- * @since 3.2.2
- */
-
-public interface ProducerContext {
-
- public boolean isProcessStyles();
-
- public boolean isProcessScripts();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/ProducerContext.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,35 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit;
+
+
+/**
+ * @author Nick Belaevski
+ * @since 3.2.2
+ */
+
+public interface ProducerContext {
+
+ public boolean isProcessStyles();
+
+ public boolean isProcessScripts();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,54 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.renderkit;
-
-import java.util.LinkedHashSet;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * Marker interface for a user-defined resources for a HTML HEAD tag.
- * There resourses must be loaded AFTER all other components.
- * @author asmirnov
- *
- */
-public interface UserResourceRenderer {
-
- /**
- * Return set of strings with URI's of nessesary scripts.
- * Use linked set to preserve insertion order
- * @param context - current faces context.
- * @param component TODO
- * @return - set of URI's or null
- */
- public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent component);
-
- /**
- * Return set of strings with URI's of nessesary CSS styles.
- * Use linked set to preserve insertion order.
- * @param context - current faces context.
- * @param component TODO
- * @return - set of URI's or null
- */
- public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent component);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,54 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.renderkit;
+
+import java.util.LinkedHashSet;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * Marker interface for a user-defined resources for a HTML HEAD tag.
+ * There resourses must be loaded AFTER all other components.
+ * @author asmirnov
+ *
+ */
+public interface UserResourceRenderer {
+
+ /**
+ * Return set of strings with URI's of nessesary scripts.
+ * Use linked set to preserve insertion order
+ * @param context - current faces context.
+ * @param component TODO
+ * @return - set of URI's or null
+ */
+ public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent component);
+
+ /**
+ * Return set of strings with URI's of nessesary CSS styles.
+ * Use linked set to preserve insertion order.
+ * @param context - current faces context.
+ * @param component TODO
+ * @return - set of URI's or null
+ */
+ public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent component);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,42 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.renderkit;
-
-import java.io.IOException;
-import java.util.Set;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.InternetResource;
-
-/**
- * Marker interface for a user-defined resources for a HTML HEAD tag.
- * There resourses must be loaded AFTER all other components.
- * This is the second revision of {@link UserResourceRenderer} interface that returns
- * arrays of {@link InternetResource} instead of {@link Set}
- * @author nbelaevski(a)exadel.com
- *
- */
-public interface UserResourceRenderer2 {
-
- public void encodeToHead(FacesContext context, UIComponent component) throws IOException;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,42 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.renderkit;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.InternetResource;
+
+/**
+ * Marker interface for a user-defined resources for a HTML HEAD tag.
+ * There resourses must be loaded AFTER all other components.
+ * This is the second revision of {@link UserResourceRenderer} interface that returns
+ * arrays of {@link InternetResource} instead of {@link Set}
+ * @author nbelaevski(a)exadel.com
+ *
+ */
+public interface UserResourceRenderer2 {
+
+ public void encodeToHead(FacesContext context, UIComponent component) throws IOException;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Classes and interface participating in component rendering process
- */
-package org.ajax4jsf.renderkit;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/renderkit/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Classes and interface participating in component rendering process
+ */
+package org.ajax4jsf.renderkit;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,192 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Date;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-/**
- * Interface for work with off-page internet resources ( images, scripts, styles etc. )
- * All instances must work in two phases - render page ( application set HTML code and attributes to reference resource )
- * and in concrete request to resource body.
- * For best performance, preffer to realise it as "lightweght" pattern.
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: nick_belaevski $)
- * @version $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:15 $
- *
- */
-public interface InternetResource {
-
- public static final String ENCODE_URI_PARAMETER = "org.ajax4jsf.ENCRYPT_RESOURCE_DATA";
- public static final String ENCODE_PASS_PARAMETER = "org.ajax4jsf.ENCRYPT_PASSWORD";
- public static final String CODEC_ATTR = "org.ajax4jsf.resource.CODEC";
-
- public static final String RESOURCE_PROTOCOL = "resource";
- public static final String RESOURCE_URI_PREFIX = "resource://";
- public static final int RESOURCE_URI_PREFIX_LENGTH = RESOURCE_URI_PREFIX.length();
- public static final String DATA_SEPARATOR = "/DATA/";
- static public final long DEFAULT_EXPIRE = 1000L * 60L * 60L * 24L;// 1 day
- public static final String DEFAULT_EXPITE_PARAMETER = "org.ajax4jsf.DEFAULT_EXPIRE";
- /**
- * @param resourceContext current {@link ResourceContext}
- * @return Returns the contentLength.
- */
- public int getContentLength(ResourceContext resourceContext);
-
- /**
- * @param resourceContext current {@link ResourceContext}
- * @return Returns the expired.
- */
- public long getExpired(ResourceContext resourceContext);
-
- /**
- * @param resourceContext current {@link ResourceContext}
- * @return Returns the lastModified.
- */
- public Date getLastModified(ResourceContext resourceContext);
-
- /**
- * @param resourceContext current {@link ResourceContext}
- * @return Returns the cacheable.
- */
- public boolean isCacheable(ResourceContext resourceContext);
-
- /**
- * @param resourceContext current {@link ResourceContext}
- * @return Returns the mimeType.
- */
- public String getContentType(ResourceContext resourceContext);
-
- /**
- * @param context TODO
- * @return input stream with resource
- */
- public InputStream getResourceAsStream(ResourceContext context);
-
- /**
- * @return string with URI for get resource from page.
- */
- public String getUri(FacesContext context, Object data);
-
-
-
- /**
- * Encode resource as Markup .
- * @param context
- * @param data
- * @throws IOException
- */
- public void encode(FacesContext context, Object data) throws IOException;
-
- /**
- * Encode resource as Markup with custom attributes .
- * @param context
- * @param data
- * @param attributes
- * @throws IOException
- */
- public void encode(FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
-
- /**
- * Encode start tag, attributes and body ( for inline script or style )
- * @param context
- * @param component
- * @param attrs
- * @throws IOException
- */
- public void encodeBegin(FacesContext context, Object component, Map<String, Object> attrs) throws IOException;
-
- /**
- * Encode closed tag.
- * @param context
- * @param component
- * @throws IOException
- */
- public void encodeEnd(FacesContext context, Object component) throws IOException;
-
- /**
- * Send incapsulated resource to client by {@link ResourceContext} .
- * @param context
- */
- public void send(ResourceContext context) throws IOException;
-
- /**
- * Set response headers based on resource properties ( mime type etc )
- * TODO - send via {@link FacesContext } ???
- * @param response
- */
- public void sendHeaders(ResourceContext response);
-
- /**
- * Custom properties for resource ( image size etc. )
- * @param key
- * @return property value, or null if not set.
- */
- public Object getProperty(Object key);
-
- /**
- * Set new value for custom property.
- * @param key
- * @param value
- */
- void setProperty(Object key,Object value);
-
-
- /**
- * Set concrete renderer ( for brige pattern ). In renderer, incapsulate encoding functions,
- * content type, resource encoding.
- * @param renderer
- */
- public void setRenderer(ResourceRenderer renderer);
-
- /**
- * @return true, if resource must be rendered in faces request cicle.
- */
- public boolean requireFacesContext();
-
- /**
- * Flag for check session-dependencies for resource. In application-wide case,
- * resource URL not prepared by context.getExternalContext().encodeResourceURL(resourceURL)
- * and used application-wide cache for store.
- * @return
- */
- public boolean isSessionAware();
-
- void setKey(String key);
-
- String getKey();
-
- public abstract ResourceRenderer getRenderer(ResourceContext resourceContext);
-
- public abstract void setSessionAware(boolean sessionAware);
-
- public abstract void setCacheable(boolean cacheable);
-
- public abstract void setLastModified(Date lastModified);
-
- public abstract void setExpired(long expired);
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,192 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Interface for work with off-page internet resources ( images, scripts, styles etc. )
+ * All instances must work in two phases - render page ( application set HTML code and attributes to reference resource )
+ * and in concrete request to resource body.
+ * For best performance, preffer to realise it as "lightweght" pattern.
+ *
+ * @author asmirnov(a)exadel.com (latest modification by $Author: nick_belaevski $)
+ * @version $Revision: 1.1.2.2 $ $Date: 2007/01/11 16:52:15 $
+ *
+ */
+public interface InternetResource {
+
+ public static final String ENCODE_URI_PARAMETER = "org.ajax4jsf.ENCRYPT_RESOURCE_DATA";
+ public static final String ENCODE_PASS_PARAMETER = "org.ajax4jsf.ENCRYPT_PASSWORD";
+ public static final String CODEC_ATTR = "org.ajax4jsf.resource.CODEC";
+
+ public static final String RESOURCE_PROTOCOL = "resource";
+ public static final String RESOURCE_URI_PREFIX = "resource://";
+ public static final int RESOURCE_URI_PREFIX_LENGTH = RESOURCE_URI_PREFIX.length();
+ public static final String DATA_SEPARATOR = "/DATA/";
+ static public final long DEFAULT_EXPIRE = 1000L * 60L * 60L * 24L;// 1 day
+ public static final String DEFAULT_EXPITE_PARAMETER = "org.ajax4jsf.DEFAULT_EXPIRE";
+ /**
+ * @param resourceContext current {@link ResourceContext}
+ * @return Returns the contentLength.
+ */
+ public int getContentLength(ResourceContext resourceContext);
+
+ /**
+ * @param resourceContext current {@link ResourceContext}
+ * @return Returns the expired.
+ */
+ public long getExpired(ResourceContext resourceContext);
+
+ /**
+ * @param resourceContext current {@link ResourceContext}
+ * @return Returns the lastModified.
+ */
+ public Date getLastModified(ResourceContext resourceContext);
+
+ /**
+ * @param resourceContext current {@link ResourceContext}
+ * @return Returns the cacheable.
+ */
+ public boolean isCacheable(ResourceContext resourceContext);
+
+ /**
+ * @param resourceContext current {@link ResourceContext}
+ * @return Returns the mimeType.
+ */
+ public String getContentType(ResourceContext resourceContext);
+
+ /**
+ * @param context TODO
+ * @return input stream with resource
+ */
+ public InputStream getResourceAsStream(ResourceContext context);
+
+ /**
+ * @return string with URI for get resource from page.
+ */
+ public String getUri(FacesContext context, Object data);
+
+
+
+ /**
+ * Encode resource as Markup .
+ * @param context
+ * @param data
+ * @throws IOException
+ */
+ public void encode(FacesContext context, Object data) throws IOException;
+
+ /**
+ * Encode resource as Markup with custom attributes .
+ * @param context
+ * @param data
+ * @param attributes
+ * @throws IOException
+ */
+ public void encode(FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
+
+ /**
+ * Encode start tag, attributes and body ( for inline script or style )
+ * @param context
+ * @param component
+ * @param attrs
+ * @throws IOException
+ */
+ public void encodeBegin(FacesContext context, Object component, Map<String, Object> attrs) throws IOException;
+
+ /**
+ * Encode closed tag.
+ * @param context
+ * @param component
+ * @throws IOException
+ */
+ public void encodeEnd(FacesContext context, Object component) throws IOException;
+
+ /**
+ * Send incapsulated resource to client by {@link ResourceContext} .
+ * @param context
+ */
+ public void send(ResourceContext context) throws IOException;
+
+ /**
+ * Set response headers based on resource properties ( mime type etc )
+ * TODO - send via {@link FacesContext } ???
+ * @param response
+ */
+ public void sendHeaders(ResourceContext response);
+
+ /**
+ * Custom properties for resource ( image size etc. )
+ * @param key
+ * @return property value, or null if not set.
+ */
+ public Object getProperty(Object key);
+
+ /**
+ * Set new value for custom property.
+ * @param key
+ * @param value
+ */
+ void setProperty(Object key,Object value);
+
+
+ /**
+ * Set concrete renderer ( for brige pattern ). In renderer, incapsulate encoding functions,
+ * content type, resource encoding.
+ * @param renderer
+ */
+ public void setRenderer(ResourceRenderer renderer);
+
+ /**
+ * @return true, if resource must be rendered in faces request cicle.
+ */
+ public boolean requireFacesContext();
+
+ /**
+ * Flag for check session-dependencies for resource. In application-wide case,
+ * resource URL not prepared by context.getExternalContext().encodeResourceURL(resourceURL)
+ * and used application-wide cache for store.
+ * @return
+ */
+ public boolean isSessionAware();
+
+ void setKey(String key);
+
+ String getKey();
+
+ public abstract ResourceRenderer getRenderer(ResourceContext resourceContext);
+
+ public abstract void setSessionAware(boolean sessionAware);
+
+ public abstract void setCacheable(boolean cacheable);
+
+ public abstract void setLastModified(Date lastModified);
+
+ public abstract void setExpired(long expired);
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,210 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-import javax.servlet.ServletException;
-
-import org.ajax4jsf.resource.util.URLToStreamHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public abstract class InternetResourceBuilder {
-
- private static final Log log = LogFactory.getLog(InternetResourceBuilder.class);
- public static final String LOAD_NONE = "NONE";
- public static final String LOAD_ALL = "ALL";
-
- public static final String SKINNING_SCRIPT = "/org/richfaces/renderkit/html/scripts/skinning.js";
-
- public static final String COMMON_FRAMEWORK_SCRIPT = "/org/ajax4jsf/framework.pack.js";
- public static final String COMMON_UI_SCRIPT = "/org/richfaces/ui.pack.js";
- public static final String COMMON_STYLE_PREFIX = "/org/richfaces/skin";
- public static final String COMMON_STYLE_EXTENSION = ".xcss";
- public static final String COMMON_STYLE = COMMON_STYLE_PREFIX + COMMON_STYLE_EXTENSION;
- public static final String LOAD_STYLE_STRATEGY_PARAM = "org.richfaces.LoadStyleStrategy";
- public static final String LOAD_SCRIPT_STRATEGY_PARAM = "org.richfaces.LoadScriptStrategy";
-
- public static final String STD_CONTROLS_SKINNING_PARAM = "org.richfaces.CONTROL_SKINNING";
- public static final String STD_CONTROLS_SKINNING_CLASSES_PARAM = "org.richfaces.CONTROL_SKINNING_CLASSES";
- public static final String ENABLE = "enable";
-
- public static final String CONTROL_SKINNING_LEVEL = "org.richfaces.CONTROL_SKINNING_LEVEL";
- public static final String BASIC = "basic";
- public static final String EXTENDED = "extended";
-
- /**
- * Get application start time for check resources modification time.
- *
- * @return application start time in msec's
- */
- public abstract long getStartTime();
-
- /**
- * @param cacheable
- * @param session
- * @param mime
- * @return
- * @throws FacesException
- */
- public abstract InternetResource createUserResource(boolean cacheable,
- boolean session, String mime) throws FacesException;
-
- /**
- * @param key
- * @param resource
- */
- public abstract void addResource(String key, InternetResource resource);
-
- /**
- * @param path
- * @return
- * @throws ResourceNotFoundException
- */
- public abstract InternetResource getResource(String path)
- throws ResourceNotFoundException;
-
- /**
- * @param key
- * @return
- */
- public abstract Object getResourceDataForKey(String key);
-
- /**
- * @param key
- * @return
- * @throws ResourceNotFoundException
- */
- public abstract InternetResource getResourceForKey(String key)
- throws ResourceNotFoundException;
-
- /**
- * @param resource
- * @param context
- * @param storeData
- * @return
- */
- public abstract String getUri(InternetResource resource,
- FacesContext context, Object storeData);
-
- /**
- * @param base
- * @param path
- * @return
- * @throws FacesException
- */
- public abstract InternetResource createResource(Object base, String path)
- throws FacesException;
-
- /**
- * @throws ServletException
- */
- public abstract void init()
- throws FacesException;
-
- /**
- * static instance variable.
- */
- private static Map<ClassLoader, InternetResourceBuilder> instances =
- Collections.synchronizedMap(new HashMap<ClassLoader, InternetResourceBuilder> ());
-
- /**
- * Get ( or create if nessesary ) instance of builder for current
- * loader. check content of file
- * META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder
- * for name of class to instantiate, othrthise create
- * {@link ResourceBuilderImpl} instance.
- *
- * @return current builder instance.
- */
- public static InternetResourceBuilder getInstance() {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- InternetResourceBuilder instance = (InternetResourceBuilder) instances
- .get(loader);
- if (null == instance) {
- try {
- // Default service implementation
- String serviceClassName = "org.ajax4jsf.resource.ResourceBuilderImpl";
- String resource = "META-INF/services/"
- + InternetResourceBuilder.class.getName();
- InputStream in = URLToStreamHelper.urlToStreamSafe(
- loader.getResource(resource));
- if (null != in) {
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(in));
- serviceClassName = reader.readLine();
- reader.close();
- in.close();
- }
- Class<?> builderClass = loader.loadClass(serviceClassName);
- instance = (InternetResourceBuilder) builderClass.newInstance();
- if (log.isDebugEnabled()) {
- log.debug("Create instance of InternetBuilder from class "
- + serviceClassName);
- }
- } catch (Exception e) {
- if (log.isDebugEnabled()) {
- log.error(
- "Can't create instance of InternetBuilder service",
- e);
- throw new FacesException(
- "Error on create instance of InternetBuilder service",
- e);
- }
- // TODO - detect default instance.
- // instance = new ResourceBuilderImpl();
- }
- instances.put(loader, instance);
- }
- if (log.isDebugEnabled()) {
- log.debug("Return instance of internet resource builder "
- + instance.toString());
- }
- return instance;
- }
-
- /**
- * Package-wide method for reset instance in Junit tests.
- *
- * @param instance
- */
- public static void setInstance(InternetResourceBuilder instance) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- instances.put(loader, instance);
- }
-
- public InternetResourceBuilder() {
- super();
- }
-
- public abstract ResourceRenderer getStyleRenderer();
-
- public abstract ResourceRenderer getScriptRenderer();
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,210 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletException;
+
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public abstract class InternetResourceBuilder {
+
+ private static final Log log = LogFactory.getLog(InternetResourceBuilder.class);
+ public static final String LOAD_NONE = "NONE";
+ public static final String LOAD_ALL = "ALL";
+
+ public static final String SKINNING_SCRIPT = "/org/richfaces/renderkit/html/scripts/skinning.js";
+
+ public static final String COMMON_FRAMEWORK_SCRIPT = "/org/ajax4jsf/framework.pack.js";
+ public static final String COMMON_UI_SCRIPT = "/org/richfaces/ui.pack.js";
+ public static final String COMMON_STYLE_PREFIX = "/org/richfaces/skin";
+ public static final String COMMON_STYLE_EXTENSION = ".xcss";
+ public static final String COMMON_STYLE = COMMON_STYLE_PREFIX + COMMON_STYLE_EXTENSION;
+ public static final String LOAD_STYLE_STRATEGY_PARAM = "org.richfaces.LoadStyleStrategy";
+ public static final String LOAD_SCRIPT_STRATEGY_PARAM = "org.richfaces.LoadScriptStrategy";
+
+ public static final String STD_CONTROLS_SKINNING_PARAM = "org.richfaces.CONTROL_SKINNING";
+ public static final String STD_CONTROLS_SKINNING_CLASSES_PARAM = "org.richfaces.CONTROL_SKINNING_CLASSES";
+ public static final String ENABLE = "enable";
+
+ public static final String CONTROL_SKINNING_LEVEL = "org.richfaces.CONTROL_SKINNING_LEVEL";
+ public static final String BASIC = "basic";
+ public static final String EXTENDED = "extended";
+
+ /**
+ * Get application start time for check resources modification time.
+ *
+ * @return application start time in msec's
+ */
+ public abstract long getStartTime();
+
+ /**
+ * @param cacheable
+ * @param session
+ * @param mime
+ * @return
+ * @throws FacesException
+ */
+ public abstract InternetResource createUserResource(boolean cacheable,
+ boolean session, String mime) throws FacesException;
+
+ /**
+ * @param key
+ * @param resource
+ */
+ public abstract void addResource(String key, InternetResource resource);
+
+ /**
+ * @param path
+ * @return
+ * @throws ResourceNotFoundException
+ */
+ public abstract InternetResource getResource(String path)
+ throws ResourceNotFoundException;
+
+ /**
+ * @param key
+ * @return
+ */
+ public abstract Object getResourceDataForKey(String key);
+
+ /**
+ * @param key
+ * @return
+ * @throws ResourceNotFoundException
+ */
+ public abstract InternetResource getResourceForKey(String key)
+ throws ResourceNotFoundException;
+
+ /**
+ * @param resource
+ * @param context
+ * @param storeData
+ * @return
+ */
+ public abstract String getUri(InternetResource resource,
+ FacesContext context, Object storeData);
+
+ /**
+ * @param base
+ * @param path
+ * @return
+ * @throws FacesException
+ */
+ public abstract InternetResource createResource(Object base, String path)
+ throws FacesException;
+
+ /**
+ * @throws ServletException
+ */
+ public abstract void init()
+ throws FacesException;
+
+ /**
+ * static instance variable.
+ */
+ private static Map<ClassLoader, InternetResourceBuilder> instances =
+ Collections.synchronizedMap(new HashMap<ClassLoader, InternetResourceBuilder> ());
+
+ /**
+ * Get ( or create if nessesary ) instance of builder for current
+ * loader. check content of file
+ * META-INF/services/org.ajax4jsf.resource.InternetResourceBuilder
+ * for name of class to instantiate, othrthise create
+ * {@link ResourceBuilderImpl} instance.
+ *
+ * @return current builder instance.
+ */
+ public static InternetResourceBuilder getInstance() {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ InternetResourceBuilder instance = (InternetResourceBuilder) instances
+ .get(loader);
+ if (null == instance) {
+ try {
+ // Default service implementation
+ String serviceClassName = "org.ajax4jsf.resource.ResourceBuilderImpl";
+ String resource = "META-INF/services/"
+ + InternetResourceBuilder.class.getName();
+ InputStream in = URLToStreamHelper.urlToStreamSafe(
+ loader.getResource(resource));
+ if (null != in) {
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(in));
+ serviceClassName = reader.readLine();
+ reader.close();
+ in.close();
+ }
+ Class<?> builderClass = loader.loadClass(serviceClassName);
+ instance = (InternetResourceBuilder) builderClass.newInstance();
+ if (log.isDebugEnabled()) {
+ log.debug("Create instance of InternetBuilder from class "
+ + serviceClassName);
+ }
+ } catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.error(
+ "Can't create instance of InternetBuilder service",
+ e);
+ throw new FacesException(
+ "Error on create instance of InternetBuilder service",
+ e);
+ }
+ // TODO - detect default instance.
+ // instance = new ResourceBuilderImpl();
+ }
+ instances.put(loader, instance);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Return instance of internet resource builder "
+ + instance.toString());
+ }
+ return instance;
+ }
+
+ /**
+ * Package-wide method for reset instance in Junit tests.
+ *
+ * @param instance
+ */
+ public static void setInstance(InternetResourceBuilder instance) {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ instances.put(loader, instance);
+ }
+
+ public InternetResourceBuilder() {
+ super();
+ }
+
+ public abstract ResourceRenderer getStyleRenderer();
+
+ public abstract ResourceRenderer getScriptRenderer();
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,121 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import java.util.Date;
-
-import javax.faces.el.MethodBinding;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:13 $
- *
- */
-public interface ResourceComponent {
-
- /**
- * Get Mime-type for target .
- * @return
- */
- public abstract String getMimeType();
-
- /**
- * Set Mime-type for target .
- * @param newvalue
- */
- public abstract void setMimeType(String newvalue);
-
-
- /**
- * Get Last modified date for target .
- * @return
- */
- public abstract Date getLastModified();
-
- /**
- * Set Last modified for target .
- * @param newvalue
- */
- public abstract void setLastModified(Date newvalue);
-
-
- /**
- * Get Expiration time for target .
- * @return
- */
- public abstract Date getExpires();
-
- /**
- * Set Expiration time for target .
- * @param newvalue
- */
- public abstract void setExpires(Date newvalue);
-
-
- /**
- * Get caching flag for resource.
- * @return
- */
- public abstract boolean isCacheable();
-
- /**
- * Set caching flag for resource.
- * @param newvalue
- */
- public abstract void setCacheable(boolean newvalue);
-
- /**
- * Get session-avare flag for resource.
- * @return true if resource depend of client session. If false, no JSESSIONID encoded in URI
- */
- public abstract boolean isSession();
-
- /**
- * Set session-avare flag for resource.
- * @param newvalue
- */
- public abstract void setSession(boolean newvalue);
-
- /**
- * Get Data object, encoded in uri and passed to "send" method for generate resource content.
- * @return
- */
- public abstract Object getValue();
-
- /**
- * Set Data object, encoded in uri and passed to "send" method for generate resource content.
- * @param newvalue
- */
- public abstract void setValue(Object newvalue);
-
- /**
- * Get El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
- * @return
- */
- public abstract MethodBinding getCreateContent();
-
- /**
- * Set El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
- * @param newvalue
- */
- public abstract void setCreateContent(MethodBinding newvalue);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,121 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import java.util.Date;
+
+import javax.faces.el.MethodBinding;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:13 $
+ *
+ */
+public interface ResourceComponent {
+
+ /**
+ * Get Mime-type for target .
+ * @return
+ */
+ public abstract String getMimeType();
+
+ /**
+ * Set Mime-type for target .
+ * @param newvalue
+ */
+ public abstract void setMimeType(String newvalue);
+
+
+ /**
+ * Get Last modified date for target .
+ * @return
+ */
+ public abstract Date getLastModified();
+
+ /**
+ * Set Last modified for target .
+ * @param newvalue
+ */
+ public abstract void setLastModified(Date newvalue);
+
+
+ /**
+ * Get Expiration time for target .
+ * @return
+ */
+ public abstract Date getExpires();
+
+ /**
+ * Set Expiration time for target .
+ * @param newvalue
+ */
+ public abstract void setExpires(Date newvalue);
+
+
+ /**
+ * Get caching flag for resource.
+ * @return
+ */
+ public abstract boolean isCacheable();
+
+ /**
+ * Set caching flag for resource.
+ * @param newvalue
+ */
+ public abstract void setCacheable(boolean newvalue);
+
+ /**
+ * Get session-avare flag for resource.
+ * @return true if resource depend of client session. If false, no JSESSIONID encoded in URI
+ */
+ public abstract boolean isSession();
+
+ /**
+ * Set session-avare flag for resource.
+ * @param newvalue
+ */
+ public abstract void setSession(boolean newvalue);
+
+ /**
+ * Get Data object, encoded in uri and passed to "send" method for generate resource content.
+ * @return
+ */
+ public abstract Object getValue();
+
+ /**
+ * Set Data object, encoded in uri and passed to "send" method for generate resource content.
+ * @param newvalue
+ */
+ public abstract void setValue(Object newvalue);
+
+ /**
+ * Get El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
+ * @return
+ */
+ public abstract MethodBinding getCreateContent();
+
+ /**
+ * Set El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
+ * @param newvalue
+ */
+ public abstract void setCreateContent(MethodBinding newvalue);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import javax.el.MethodExpression;
-
-/**
- * Interface for the ResourceComponent introduced after refactoring
- * to support MethodExpression. Old interface is left for the
- * compatibility.
- *
- * @author Vladislav Baranov
- */
-public interface ResourceComponent2 extends ResourceComponent {
-
- /**
- * Get MethodExpression to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @return MethodExpression
- */
- public abstract MethodExpression getCreateContentExpression();
-
- /**
- * Set MethodExpression to method in user bean to send resource. Method will
- * called with two parameters - restored data object and servlet output
- * stream.
- *
- * @param newvalue - new MethodExpression value
- */
- public abstract void setCreateContentExpression(MethodExpression newvalue);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import javax.el.MethodExpression;
+
+/**
+ * Interface for the ResourceComponent introduced after refactoring
+ * to support MethodExpression. Old interface is left for the
+ * compatibility.
+ *
+ * @author Vladislav Baranov
+ */
+public interface ResourceComponent2 extends ResourceComponent {
+
+ /**
+ * Get MethodExpression to method in user bean to send resource. Method will
+ * called with two parameters - restored data object and servlet output
+ * stream.
+ *
+ * @return MethodExpression
+ */
+ public abstract MethodExpression getCreateContentExpression();
+
+ /**
+ * Set MethodExpression to method in user bean to send resource. Method will
+ * called with two parameters - restored data object and servlet output
+ * stream.
+ *
+ * @param newvalue - new MethodExpression value
+ */
+ public abstract void setCreateContentExpression(MethodExpression newvalue);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,228 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Set;
-
-/**
- * Abstraction context class for rendering resource ( image, script, style )
- * can be work in 2 variants - for simple ServletRequest and as JSF context encapsulation.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:57 $
- *
- */
-public abstract class ResourceContext {
-
- private boolean cacheEnabled = false;
- private Object resourceData;
- // response headers
- /**
- * Delegate to {@link javax.servlet.ServletResponse} setHeader
- * @param name name of header
- * @param value new value
- */
- public abstract void setHeader(String name, String value);
-
- /**
- * Delegate to {@link javax.servlet.ServletResponse} setHeader
- * @param name name of header
- * @param value new value
- */
- public abstract void setIntHeader(String name, int value);
-
- /**
- * Delegate to {@link javax.servlet.ServletResponse} setHeader
- * @param name name of header
- * @param value new value
- */
- public abstract void setDateHeader(String name, long value);
-
- /**
- * @return
- * @throws IOException
- */
- public abstract OutputStream getOutputStream() throws IOException;
-
- /**
- * @return
- */
- @Deprecated
- public abstract String getQueryString();
-
- /**
- * @return
- */
- @Deprecated
- public abstract String getPathInfo();
-
- /**
- * @return
- */
- @Deprecated
- public abstract String getServletPath();
-
- /**
- * Get session attribute for given name. session not created
- * @param name attribute name
- * @return value for attribute, or null.
- */
- public abstract Object getSessionAttribute(String name);
-
- /**
- * Get ServletContext attribute by name.
- * @param name
- * @return value for attribute, or null.
- */
- public abstract Object getContextAttribute(String name);
-
- /**
- * <p>Return a <code>URL</code> for the application resource mapped to the
- * specified path, if it exists; otherwise, return <code>null</code>.</p>
- *
- * <p><em>Servlet:</em> This must be the value returned by the
- * <code>javax.servlet.ServletContext</code> method
- * <code>getResource(path)</code>.</p>
- *
- * <p><em>Portlet:</em> This must be the value returned by the
- * <code>javax.portlet.PortletContext</code> method
- * <code>getResource(path)</code>.</p>
- *
- * @param path The path to the requested resource, which must
- * start with a slash ("/" character
- *
- * @throws MalformedURLException if the specified path
- * is not in the correct form
- * @throws NullPointerException if <code>path</code>
- * is <code>null</code>
- */
- public abstract URL getResource(String path) throws MalformedURLException;
-
-
- /**
- * <p>Return an <code>InputStream</code> for an application resource
- * mapped to the specified path, if it exists; otherwise, return
- * <code>null</code>.</p>
- *
- * <p><em>Servlet:</em> This must be the value returned by the
- * <code>javax.servlet.ServletContext</code> method
- * <code>getResourceAsStream(path)</code>.</p>
- *
- * <p><em>Portlet:</em> This must be the value returned by the
- * <code>javax.portlet.PortletContext</code> method
- * <code>getResourceAsStream(path)</code>.</p>
- *
- * @param path The path to the requested resource, which must
- * start with a slash ("/" character
- *
- * @throws NullPointerException if <code>path</code>
- * is <code>null</code>
- */
- public abstract InputStream getResourceAsStream(String path);
-
-
- /**
- * <p>Return the <code>Set</code> of resource paths for all application
- * resources whose resource path starts with the specified argument.</p>
- *
- * <p><em>Servlet:</em> This must be the value returned by the
- * <code>javax.servlet.ServletContext</code> method
- * <code>getResourcePaths(path).</code></p>
- *
- * <p><em>Portlet:</em> This must be the value returned by the
- * <code>javax.portlet.PortletContext</code> method
- * <code>getResourcePaths(path).</code></p>
- *
- * @param path Partial path used to match resources, which must
- * start with a slash ("/") character
- *
- * @throws NullPointerException if <code>path</code>
- * is <code>null</code>
- */
- public abstract Set<String> getResourcePaths(String path);
-
- /**
- * Get request parameter for given name.
- * @param data_parameter
- * @return
- */
- public abstract String getRequestParameter(String data_parameter);
-
- /**
- * @return Returns the cacheEnabled.
- */
- public boolean isCacheEnabled() {
- return this.cacheEnabled;
- }
-
- /**
- * @param cacheEnabled The cacheEnabled to set.
- */
- public void setCacheEnabled(boolean cacheEnabled) {
- this.cacheEnabled = cacheEnabled;
- }
-
- /**
- * get output writer for send response.
- * @return
- */
- //TODO method signature changed
- public abstract Writer getWriter() throws IOException;
-
- /**
- * Setup response content type as {@see javax.servlet.ServletResponse#setContentType(java.lang.String)}
- * @param contentType
- */
- public abstract void setContentType(String contentType);
-
- /**
- * Setup response content length as {@see javax.servlet.ServletResponse#setContentLength(int)}
- * @param contentLength
- */
- public abstract void setContentLength(int contentLength);
-
- public abstract String getInitParameter(String name);
-
- public Object getResourceData() {
- // TODO Auto-generated method stub
- return resourceData;
- }
-
- public void setResourceData(Object data) {
- resourceData = data;
-
- }
-
- /**
- * Release any data used by this context.
- * Close buffers used by cached context, release FacesContext, if exist.
- */
- public void release() {
-
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceContext.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,228 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Set;
+
+/**
+ * Abstraction context class for rendering resource ( image, script, style )
+ * can be work in 2 variants - for simple ServletRequest and as JSF context encapsulation.
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:57 $
+ *
+ */
+public abstract class ResourceContext {
+
+ private boolean cacheEnabled = false;
+ private Object resourceData;
+ // response headers
+ /**
+ * Delegate to {@link javax.servlet.ServletResponse} setHeader
+ * @param name name of header
+ * @param value new value
+ */
+ public abstract void setHeader(String name, String value);
+
+ /**
+ * Delegate to {@link javax.servlet.ServletResponse} setHeader
+ * @param name name of header
+ * @param value new value
+ */
+ public abstract void setIntHeader(String name, int value);
+
+ /**
+ * Delegate to {@link javax.servlet.ServletResponse} setHeader
+ * @param name name of header
+ * @param value new value
+ */
+ public abstract void setDateHeader(String name, long value);
+
+ /**
+ * @return
+ * @throws IOException
+ */
+ public abstract OutputStream getOutputStream() throws IOException;
+
+ /**
+ * @return
+ */
+ @Deprecated
+ public abstract String getQueryString();
+
+ /**
+ * @return
+ */
+ @Deprecated
+ public abstract String getPathInfo();
+
+ /**
+ * @return
+ */
+ @Deprecated
+ public abstract String getServletPath();
+
+ /**
+ * Get session attribute for given name. session not created
+ * @param name attribute name
+ * @return value for attribute, or null.
+ */
+ public abstract Object getSessionAttribute(String name);
+
+ /**
+ * Get ServletContext attribute by name.
+ * @param name
+ * @return value for attribute, or null.
+ */
+ public abstract Object getContextAttribute(String name);
+
+ /**
+ * <p>Return a <code>URL</code> for the application resource mapped to the
+ * specified path, if it exists; otherwise, return <code>null</code>.</p>
+ *
+ * <p><em>Servlet:</em> This must be the value returned by the
+ * <code>javax.servlet.ServletContext</code> method
+ * <code>getResource(path)</code>.</p>
+ *
+ * <p><em>Portlet:</em> This must be the value returned by the
+ * <code>javax.portlet.PortletContext</code> method
+ * <code>getResource(path)</code>.</p>
+ *
+ * @param path The path to the requested resource, which must
+ * start with a slash ("/" character
+ *
+ * @throws MalformedURLException if the specified path
+ * is not in the correct form
+ * @throws NullPointerException if <code>path</code>
+ * is <code>null</code>
+ */
+ public abstract URL getResource(String path) throws MalformedURLException;
+
+
+ /**
+ * <p>Return an <code>InputStream</code> for an application resource
+ * mapped to the specified path, if it exists; otherwise, return
+ * <code>null</code>.</p>
+ *
+ * <p><em>Servlet:</em> This must be the value returned by the
+ * <code>javax.servlet.ServletContext</code> method
+ * <code>getResourceAsStream(path)</code>.</p>
+ *
+ * <p><em>Portlet:</em> This must be the value returned by the
+ * <code>javax.portlet.PortletContext</code> method
+ * <code>getResourceAsStream(path)</code>.</p>
+ *
+ * @param path The path to the requested resource, which must
+ * start with a slash ("/" character
+ *
+ * @throws NullPointerException if <code>path</code>
+ * is <code>null</code>
+ */
+ public abstract InputStream getResourceAsStream(String path);
+
+
+ /**
+ * <p>Return the <code>Set</code> of resource paths for all application
+ * resources whose resource path starts with the specified argument.</p>
+ *
+ * <p><em>Servlet:</em> This must be the value returned by the
+ * <code>javax.servlet.ServletContext</code> method
+ * <code>getResourcePaths(path).</code></p>
+ *
+ * <p><em>Portlet:</em> This must be the value returned by the
+ * <code>javax.portlet.PortletContext</code> method
+ * <code>getResourcePaths(path).</code></p>
+ *
+ * @param path Partial path used to match resources, which must
+ * start with a slash ("/") character
+ *
+ * @throws NullPointerException if <code>path</code>
+ * is <code>null</code>
+ */
+ public abstract Set<String> getResourcePaths(String path);
+
+ /**
+ * Get request parameter for given name.
+ * @param data_parameter
+ * @return
+ */
+ public abstract String getRequestParameter(String data_parameter);
+
+ /**
+ * @return Returns the cacheEnabled.
+ */
+ public boolean isCacheEnabled() {
+ return this.cacheEnabled;
+ }
+
+ /**
+ * @param cacheEnabled The cacheEnabled to set.
+ */
+ public void setCacheEnabled(boolean cacheEnabled) {
+ this.cacheEnabled = cacheEnabled;
+ }
+
+ /**
+ * get output writer for send response.
+ * @return
+ */
+ //TODO method signature changed
+ public abstract Writer getWriter() throws IOException;
+
+ /**
+ * Setup response content type as {@see javax.servlet.ServletResponse#setContentType(java.lang.String)}
+ * @param contentType
+ */
+ public abstract void setContentType(String contentType);
+
+ /**
+ * Setup response content length as {@see javax.servlet.ServletResponse#setContentLength(int)}
+ * @param contentLength
+ */
+ public abstract void setContentLength(int contentLength);
+
+ public abstract String getInitParameter(String name);
+
+ public Object getResourceData() {
+ // TODO Auto-generated method stub
+ return resourceData;
+ }
+
+ public void setResourceData(Object data) {
+ resourceData = data;
+
+ }
+
+ /**
+ * Release any data used by this context.
+ * Close buffers used by cached context, release FacesContext, if exist.
+ */
+ public void release() {
+
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,72 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import javax.faces.FacesException;
-
-/**
- * Exception for throw in case of illegal creation of resource ( not existed file etc. )
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:08 $
- *
- */
-public class ResourceNotFoundException extends FacesException {
-
- /**
- *
- */
- private static final long serialVersionUID = -3263301605684963184L;
-
- /**
- *
- */
- public ResourceNotFoundException() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param arg0
- */
- public ResourceNotFoundException(String arg0) {
- super(arg0);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param arg0
- */
- public ResourceNotFoundException(Throwable arg0) {
- super(arg0);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param arg0
- * @param arg1
- */
- public ResourceNotFoundException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- // TODO Auto-generated constructor stub
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,72 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import javax.faces.FacesException;
+
+/**
+ * Exception for throw in case of illegal creation of resource ( not existed file etc. )
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:08 $
+ *
+ */
+public class ResourceNotFoundException extends FacesException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3263301605684963184L;
+
+ /**
+ *
+ */
+ public ResourceNotFoundException() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param arg0
+ */
+ public ResourceNotFoundException(String arg0) {
+ super(arg0);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param arg0
+ */
+ public ResourceNotFoundException(Throwable arg0) {
+ super(arg0);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param arg0
+ * @param arg1
+ */
+ public ResourceNotFoundException(String arg0, Throwable arg1) {
+ super(arg0, arg1);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,38 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-
-/**
- * Interface for all Renderers ( or other classes ? ) for
- * generate internet resources.
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:56 $
- *
- */
-public interface ResourceProduser {
- /**
- * @param path - local path to internet resource.
- * @return resource instance
- */
- public InternetResource getResource( String path) throws ResourceNotFoundException;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceProduser.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,38 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+
+/**
+ * Interface for all Renderers ( or other classes ? ) for
+ * generate internet resources.
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:56:56 $
+ *
+ */
+public interface ResourceProduser {
+ /**
+ * @param path - local path to internet resource.
+ * @return resource instance
+ */
+ public InternetResource getResource( String path) throws ResourceNotFoundException;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,82 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.resource;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-/**
- * "Brige" for concrete resource types - images, scripts, styles.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:07 $
- *
- */
-public interface ResourceRenderer {
-
- /**
- * @return content type ( image/jpeg , text/javascript etc. ) for given type.
- */
- String getContentType();
-
- /**
- * Encode concrete HTML element for resource.
- * @param context
- * @param data
- * @throws IOException
- */
- void encode(InternetResource resource, FacesContext context, Object data) throws IOException;
-
- /**
- * Encode concrete HTML element for resource.
- * @param context
- * @param data
- * @throws IOException
- */
- void encode(InternetResource resource, FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
-
- void encodeBegin(InternetResource base, FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
-
- void encodeEnd(InternetResource base, FacesContext context, Object data) throws IOException;
-
- /**
- * @return true, if resource must be rendered in faces request cicle.
- */
- public boolean requireFacesContext();
-
- /**
- * Send incapsulated resource to client by {@link ResourceContext} .
- * Perform any conversions, nessesary for this resources ( template interpretations, JavaScript conversions etc )
- * @param context
- * @return TODO
- */
- public int send(InternetResource base,ResourceContext context) throws IOException;
-
- /**
- * Get data to build URI for given resource. Can be any Serialisable object,
- * @param base TODO
- * @return data for Store in URI/ Cache key.
- */
- public Object getData(InternetResource base, FacesContext context, Object data);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,82 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * "Brige" for concrete resource types - images, scripts, styles.
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:07 $
+ *
+ */
+public interface ResourceRenderer {
+
+ /**
+ * @return content type ( image/jpeg , text/javascript etc. ) for given type.
+ */
+ String getContentType();
+
+ /**
+ * Encode concrete HTML element for resource.
+ * @param context
+ * @param data
+ * @throws IOException
+ */
+ void encode(InternetResource resource, FacesContext context, Object data) throws IOException;
+
+ /**
+ * Encode concrete HTML element for resource.
+ * @param context
+ * @param data
+ * @throws IOException
+ */
+ void encode(InternetResource resource, FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
+
+ void encodeBegin(InternetResource base, FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
+
+ void encodeEnd(InternetResource base, FacesContext context, Object data) throws IOException;
+
+ /**
+ * @return true, if resource must be rendered in faces request cicle.
+ */
+ public boolean requireFacesContext();
+
+ /**
+ * Send incapsulated resource to client by {@link ResourceContext} .
+ * Perform any conversions, nessesary for this resources ( template interpretations, JavaScript conversions etc )
+ * @param context
+ * @return TODO
+ */
+ public int send(InternetResource base,ResourceContext context) throws IOException;
+
+ /**
+ * Get data to build URI for given resource. Can be any Serialisable object,
+ * @param base TODO
+ * @return data for Store in URI/ Cache key.
+ */
+ public Object getData(InternetResource base, FacesContext context, Object data);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Resources-handling functionality
- */
-package org.ajax4jsf.resource;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Resources-handling functionality
+ */
+package org.ajax4jsf.resource;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,88 +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.ajax4jsf.resource.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Utility class to solve JAR locking issue using {@link URLConnection#setUseCaches(boolean)} method.
- * Contains one utility method that gets {@link InputStream} from {@link URL} with caching disabled.
- *
- * Created 07.02.2008
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public final class URLToStreamHelper {
-
- private static final Log log = LogFactory.getLog(URLToStreamHelper.class);
-
- private URLToStreamHelper() {
- super();
- }
-
- /**
- * Returns {@link InputStream} corresponding to argument {@link URL}
- * but with caching disabled
- *
- * @param url {@link URL} of the resource
- * @return {@link InputStream} instance or <code>null</code>
- * @throws IOException
- */
- public static final InputStream urlToStream(URL url) throws IOException {
- if (url != null) {
- URLConnection connection = url.openConnection();
- try {
- connection.setUseCaches(false);
- } catch (IllegalArgumentException e) {
- log.error(e.getLocalizedMessage(), e);
- }
-
- return connection.getInputStream();
- } else {
- return null;
- }
- }
-
- /**
- * Variant of {@link #urlToStream(URL)} method that doesn't throw IOException, but silently ignores them
- *
- * @param url
- * @return
- */
- public static final InputStream urlToStreamSafe(URL url) {
- try {
- return urlToStream(url);
- } catch (IOException e) {
- // do nothing
- }
-
- return null;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,88 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.resource.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Utility class to solve JAR locking issue using {@link URLConnection#setUseCaches(boolean)} method.
+ * Contains one utility method that gets {@link InputStream} from {@link URL} with caching disabled.
+ *
+ * Created 07.02.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public final class URLToStreamHelper {
+
+ private static final Log log = LogFactory.getLog(URLToStreamHelper.class);
+
+ private URLToStreamHelper() {
+ super();
+ }
+
+ /**
+ * Returns {@link InputStream} corresponding to argument {@link URL}
+ * but with caching disabled
+ *
+ * @param url {@link URL} of the resource
+ * @return {@link InputStream} instance or <code>null</code>
+ * @throws IOException
+ */
+ public static final InputStream urlToStream(URL url) throws IOException {
+ if (url != null) {
+ URLConnection connection = url.openConnection();
+ try {
+ connection.setUseCaches(false);
+ } catch (IllegalArgumentException e) {
+ log.error(e.getLocalizedMessage(), e);
+ }
+
+ return connection.getInputStream();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Variant of {@link #urlToStream(URL)} method that doesn't throw IOException, but silently ignores them
+ *
+ * @param url
+ * @return
+ */
+ public static final InputStream urlToStreamSafe(URL url) {
+ try {
+ return urlToStream(url);
+ } catch (IOException e) {
+ // do nothing
+ }
+
+ return null;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Helper classes for various purposes of resources handling
- */
-package org.ajax4jsf.resource.util;
Copied: branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/ajax4jsf/resource/util/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Helper classes for various purposes of resources handling
+ */
+package org.ajax4jsf.resource.util;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces)
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,82 +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.component;
-
-import javax.el.MethodExpression;
-
-import org.richfaces.model.Ordering;
-
-/**
- * Marker interface for all components used as column in UIDataTable
- * @author shura
- *
- */
-public interface Column {
-
-
- /**
- * Out this column on new row
- * @parameter
- * @return the acceptClass
- */
- public abstract boolean isBreakBefore();
-
- /**
- * @param newBreakBefore the value to set
- */
- public abstract void setBreakBefore(boolean newBreakBefore);
-
-
- /**
- * The column allows data sorting
- * @return
- */
- public abstract boolean isSortable();
-
- public abstract void setSortable(boolean sortable);
-
- /**
- * expression used for column sorting.
- * literal value is treated as property of data object
- * EL-expression is evaluated on every data row
- * @param sortExpression
- */
- public abstract void setSortExpression(String sortExpression);
- public abstract String getSortExpression();
-
- /**
- * SortOrder is an enumeration of the possible sort orderings.
- *
- * @param sortOrder
- */
- public abstract void setSortOrder(Ordering sortOrder);
- public abstract Ordering getSortOrder();
-
- public abstract void setFilterMethod(MethodExpression methodExpression);
- public abstract MethodExpression getFilterMethod();
-
- public abstract void setFilterValue(String filterValue);
- public abstract String getFilterValue();
-
- public abstract boolean isSelfSorted();
- public abstract void setSelfSorted(boolean selfSorted);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Column.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,82 @@
+/**
+ * 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.component;
+
+import javax.el.MethodExpression;
+
+import org.richfaces.model.Ordering;
+
+/**
+ * Marker interface for all components used as column in UIDataTable
+ * @author shura
+ *
+ */
+public interface Column {
+
+
+ /**
+ * Out this column on new row
+ * @parameter
+ * @return the acceptClass
+ */
+ public abstract boolean isBreakBefore();
+
+ /**
+ * @param newBreakBefore the value to set
+ */
+ public abstract void setBreakBefore(boolean newBreakBefore);
+
+
+ /**
+ * The column allows data sorting
+ * @return
+ */
+ public abstract boolean isSortable();
+
+ public abstract void setSortable(boolean sortable);
+
+ /**
+ * expression used for column sorting.
+ * literal value is treated as property of data object
+ * EL-expression is evaluated on every data row
+ * @param sortExpression
+ */
+ public abstract void setSortExpression(String sortExpression);
+ public abstract String getSortExpression();
+
+ /**
+ * SortOrder is an enumeration of the possible sort orderings.
+ *
+ * @param sortOrder
+ */
+ public abstract void setSortOrder(Ordering sortOrder);
+ public abstract Ordering getSortOrder();
+
+ public abstract void setFilterMethod(MethodExpression methodExpression);
+ public abstract MethodExpression getFilterMethod();
+
+ public abstract void setFilterValue(String filterValue);
+ public abstract String getFilterValue();
+
+ public abstract boolean isSelfSorted();
+ public abstract void setSelfSorted(boolean selfSorted);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,135 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
-
-import org.richfaces.event.DragListener;
-
-
-/**
- * Interface for all draggable components. Describe bean properties, implemented by component.
- * @author shura
- *
- */
-public interface Draggable {
-
- /**
- * Getter for value parameter, used as key for draggable component.
- * @return
- */
- public Object getDragValue();
-
- public void setDragValue(Object value);
-
- /**
- * Getter for id of component ( instance of {@link UIDragIndicator} ) used for create drag cursor.
- * @return
- */
- public String getDragIndicator();
-
- /**
- * @param dragIndicator - id of cursor component
- */
- public void setDragIndicator(String dragIndicator);
-
- /**
- * Draggable implementation may wish to resolve drag indicator id to clientId itself
- * @param facesContext {@link FacesContext} instance
- * @return resolved indicator client id or null
- * @since 3.1
- */
- public String getResolvedDragIndicator(FacesContext facesContext);
-
- /**
- * Getter for type of this draggable ( file, mail etc ).
- * @return
- */
- public String getDragType();
-
- /**
- * @param dragType
- */
- public void setDragType(String dragType);
-
- /**
- * Getter for JavaScript event handler, called before start drag operation.
- * If this handler return false, drag operation is cancelled.
- * @return javaScript code of event handler.
- */
- public String getOndragstart();
-
- /**
- * @param dragType
- */
- public void setOndragstart(String ondrag);
-
- /**
- * Getter for JavaScript event handler; Called when drag operation end.
- * @return javaScript code of event handler.
- */
- public String getOndragend();
- public void setOndragend(String ondrag);
-
- /**
- * Getter for JavaScript event handler; Called when dragged element over the dropzone.
- * @return javaScript code of event handler.
- */
- public String getOndropover();
- public void setOndropover(String ondropover);
-
- /**
- * Getter for JavaScript event handler; Called when dragged element out the dropzone.
- * @return javaScript code of event handler.
- */
- public String getOndropout();
- public void setOndropout(String ondropout);
-
- /**
- * Append drag listener to component listeners collection
- * @param listener
- */
- public void addDragListener(DragListener listener);
-
- /**
- * Get array of all Drop Listeners
- * @return
- */
- public DragListener[] getDragListeners();
-
- /**
- * Remove drop listener from component listeners array.
- * @param listener
- */
- public void removeDragListener(DragListener listener);
-
- public void setDragListener(MethodBinding binding);
- public MethodBinding getDragListener();
-
- public String getGrabCursors();
- public void setGrabCursors(String grabCursors);
-
- public String getGrabbingCursors();
- public void setGrabbingCursors(String grabbingCursors);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Draggable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,135 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+
+import org.richfaces.event.DragListener;
+
+
+/**
+ * Interface for all draggable components. Describe bean properties, implemented by component.
+ * @author shura
+ *
+ */
+public interface Draggable {
+
+ /**
+ * Getter for value parameter, used as key for draggable component.
+ * @return
+ */
+ public Object getDragValue();
+
+ public void setDragValue(Object value);
+
+ /**
+ * Getter for id of component ( instance of {@link UIDragIndicator} ) used for create drag cursor.
+ * @return
+ */
+ public String getDragIndicator();
+
+ /**
+ * @param dragIndicator - id of cursor component
+ */
+ public void setDragIndicator(String dragIndicator);
+
+ /**
+ * Draggable implementation may wish to resolve drag indicator id to clientId itself
+ * @param facesContext {@link FacesContext} instance
+ * @return resolved indicator client id or null
+ * @since 3.1
+ */
+ public String getResolvedDragIndicator(FacesContext facesContext);
+
+ /**
+ * Getter for type of this draggable ( file, mail etc ).
+ * @return
+ */
+ public String getDragType();
+
+ /**
+ * @param dragType
+ */
+ public void setDragType(String dragType);
+
+ /**
+ * Getter for JavaScript event handler, called before start drag operation.
+ * If this handler return false, drag operation is cancelled.
+ * @return javaScript code of event handler.
+ */
+ public String getOndragstart();
+
+ /**
+ * @param dragType
+ */
+ public void setOndragstart(String ondrag);
+
+ /**
+ * Getter for JavaScript event handler; Called when drag operation end.
+ * @return javaScript code of event handler.
+ */
+ public String getOndragend();
+ public void setOndragend(String ondrag);
+
+ /**
+ * Getter for JavaScript event handler; Called when dragged element over the dropzone.
+ * @return javaScript code of event handler.
+ */
+ public String getOndropover();
+ public void setOndropover(String ondropover);
+
+ /**
+ * Getter for JavaScript event handler; Called when dragged element out the dropzone.
+ * @return javaScript code of event handler.
+ */
+ public String getOndropout();
+ public void setOndropout(String ondropout);
+
+ /**
+ * Append drag listener to component listeners collection
+ * @param listener
+ */
+ public void addDragListener(DragListener listener);
+
+ /**
+ * Get array of all Drop Listeners
+ * @return
+ */
+ public DragListener[] getDragListeners();
+
+ /**
+ * Remove drop listener from component listeners array.
+ * @param listener
+ */
+ public void removeDragListener(DragListener listener);
+
+ public void setDragListener(MethodBinding binding);
+ public MethodBinding getDragListener();
+
+ public String getGrabCursors();
+ public void setGrabCursors(String grabCursors);
+
+ public String getGrabbingCursors();
+ public void setGrabbingCursors(String grabbingCursors);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,122 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-import org.richfaces.event.DropSource;
-
-/**
- * Base interface for all components, accesible as drop zone.
- * @author shura
- *
- */
-public interface Dropzone extends DropSource {
-
- /**
- * Getter for dropType's , accepted by this zone.
- * @return
- */
- public Object getAcceptedTypes();
-
- public void setAcceptedTypes(Object types);
-
- /**
- * Getter for mapping between drop types and indicator states.
- * @return
- */
- public Object getTypeMapping();
-
- public void setTypeMapping(Object types);
-
-
- /**
- * Getter for mapping between drop types and acceptable cursors
- * @return
- */
- public Object getCursorTypeMapping();
- public void setCursorTypeMapping(Object types);
-
- /**
- * Getter for JavaScript event handler, called then drag curcor enter in component area.
- * If this handler return false, or "declined", drop operation on this component not allowed.
- * If handler return true or "allowed" , or any other supported indicator states, drop operation
- * is allowed and corresponding indicator state will be displayed.
- * @return javaScript code of event handler.
- */
- public String getOndragenter();
-
- /**
- * @param dragType
- */
- public void setOndragenter(String ondrag);
-
- /**
- * Getter for JavaScript event handler, called before drag cursor leave component area.
- * @return javaScript code of event handler.
- */
- public String getOndragexit();
-
- /**
- * @param dragType
- */
- public void setOndragexit(String ondrag);
-
- public Object getDropValue();
-
- public void setDropValue(Object o);
-
- /**
- * Javascript code called before drop event.
- * @parameter
- * @return the acceptClass
- */
- public abstract String getOndrop();
-
- /**
- * @param newOndrop the value to set
- */
- public abstract void setOndrop(String newOndrop);
-
- /**
- * Javascript handler for event fired on drop even the drop for given type is not available
- * @parameter
- * @return the acceptClass
- */
- public abstract String getOndropend();
-
- /**
- * @param newname the value to set
- */
- public abstract void setOndropend(String ondropend);
-
- /**
- * Getter for the list of comma separated cursors that indicates when acceptable draggable over dropzone
- */
- public String getAcceptCursors();
- public void setAcceptCursors(String acceptCursors);
-
- /**
- * Getter for the list of comma separated cursors that indicates when rejectable draggable over dropzone
- */
- public String getRejectCursors();
- public void setRejectCursors(String rejectCursors);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Dropzone.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,122 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+import org.richfaces.event.DropSource;
+
+/**
+ * Base interface for all components, accesible as drop zone.
+ * @author shura
+ *
+ */
+public interface Dropzone extends DropSource {
+
+ /**
+ * Getter for dropType's , accepted by this zone.
+ * @return
+ */
+ public Object getAcceptedTypes();
+
+ public void setAcceptedTypes(Object types);
+
+ /**
+ * Getter for mapping between drop types and indicator states.
+ * @return
+ */
+ public Object getTypeMapping();
+
+ public void setTypeMapping(Object types);
+
+
+ /**
+ * Getter for mapping between drop types and acceptable cursors
+ * @return
+ */
+ public Object getCursorTypeMapping();
+ public void setCursorTypeMapping(Object types);
+
+ /**
+ * Getter for JavaScript event handler, called then drag curcor enter in component area.
+ * If this handler return false, or "declined", drop operation on this component not allowed.
+ * If handler return true or "allowed" , or any other supported indicator states, drop operation
+ * is allowed and corresponding indicator state will be displayed.
+ * @return javaScript code of event handler.
+ */
+ public String getOndragenter();
+
+ /**
+ * @param dragType
+ */
+ public void setOndragenter(String ondrag);
+
+ /**
+ * Getter for JavaScript event handler, called before drag cursor leave component area.
+ * @return javaScript code of event handler.
+ */
+ public String getOndragexit();
+
+ /**
+ * @param dragType
+ */
+ public void setOndragexit(String ondrag);
+
+ public Object getDropValue();
+
+ public void setDropValue(Object o);
+
+ /**
+ * Javascript code called before drop event.
+ * @parameter
+ * @return the acceptClass
+ */
+ public abstract String getOndrop();
+
+ /**
+ * @param newOndrop the value to set
+ */
+ public abstract void setOndrop(String newOndrop);
+
+ /**
+ * Javascript handler for event fired on drop even the drop for given type is not available
+ * @parameter
+ * @return the acceptClass
+ */
+ public abstract String getOndropend();
+
+ /**
+ * @param newname the value to set
+ */
+ public abstract void setOndropend(String ondropend);
+
+ /**
+ * Getter for the list of comma separated cursors that indicates when acceptable draggable over dropzone
+ */
+ public String getAcceptCursors();
+ public void setAcceptCursors(String acceptCursors);
+
+ /**
+ * Getter for the list of comma separated cursors that indicates when rejectable draggable over dropzone
+ */
+ public String getRejectCursors();
+ public void setRejectCursors(String rejectCursors);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-import java.util.List;
-
-import org.richfaces.model.FilterField;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public interface Filterable {
-
- public List<FilterField> getFilterFields();
-
- public void setFilterFields(List<FilterField> filterFields);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Filterable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+import java.util.List;
+
+import org.richfaces.model.FilterField;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public interface Filterable {
+
+ public List<FilterField> getFilterFields();
+
+ public void setFilterFields(List<FilterField> filterFields);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,41 +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.component;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-
-/**
- * Marker interface for table columns, rendered as entire row.
- * @author shura
- *
- */
-public interface Row extends Column {
-
- /**
- * Get iterator for all columns contained in this row.
- * @return
- */
- public Iterator<UIComponent> columns();
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Row.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,41 @@
+/**
+ * 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.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Marker interface for table columns, rendered as entire row.
+ * @author shura
+ *
+ */
+public interface Row extends Column {
+
+ /**
+ * Get iterator for all columns contained in this row.
+ * @return
+ */
+ public Iterator<UIComponent> columns();
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,30 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface ScriptExportable {
- public String getScriptVar();
- public void setScriptVar(String s);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/ScriptExportable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,30 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ScriptExportable {
+ public String getScriptVar();
+ public void setScriptVar(String s);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,32 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-import org.richfaces.model.selection.Selection;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Selectable {
- public Selection getSelection();
- public void setSelection (Selection selection);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Selectable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,32 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+import org.richfaces.model.selection.Selection;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface Selectable {
+ public Selection getSelection();
+ public void setSelection (Selection selection);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,23 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/component/Sortable.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.component;
-
-import org.richfaces.model.SortOrder;
-
-
-/**
- * @author Maksim Kaszynski
- * Base interface for sort capable components
- */
-public interface Sortable {
- public SortOrder getSortOrder();
- public void setSortOrder(SortOrder sortOrder);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,23 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/component/Sortable.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.component;
+
+import org.richfaces.model.SortOrder;
+
+
+/**
+ * @author Maksim Kaszynski
+ * Base interface for sort capable components
+ */
+public interface Sortable {
+ public SortOrder getSortOrder();
+ public void setSortOrder(SortOrder sortOrder);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-import java.util.List;
-
-import org.richfaces.model.SortField2;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Sortable2 {
-
- public List<SortField2> getSortFields();
-
- public void setSortFields(List<SortField2> sortFields);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/Sortable2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+import java.util.List;
+
+import org.richfaces.model.SortField2;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface Sortable2 {
+
+ public List<SortField2> getSortFields();
+
+ public void setSortFields(List<SortField2> sortFields);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,35 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.component;
-
-/**
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 10.08.2007
- *
- */
-public interface TemplateComponent {
- public static final String TEMPLATE_CLIENT_ID = "{componentId}";
-
- public void startTemplateEncode();
-
- public void endTemplateEncode();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/TemplateComponent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,35 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.component;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 10.08.2007
+ *
+ */
+public interface TemplateComponent {
+ public static final String TEMPLATE_CLIENT_ID = "{componentId}";
+
+ public void startTemplateEncode();
+
+ public void endTemplateEncode();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Base RichFaces components interfaces and classes
- */
-package org.richfaces.component;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Base RichFaces components interfaces and classes
+ */
+package org.richfaces.component;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,82 +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.component.xml;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 16.11.2006
- *
- */
-public class XmlNodeData implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 8320619478974873168L;
-
- private String namespace;
-
- private String name = "";
-
- private String text;
-
- private Map<String, Object> attributes = new HashMap<String, Object>();
-
- public Map<String, Object> getAttributes() {
- return attributes;
- }
-
- public void setAttribute(String key, Object value) {
- this.attributes.put(key, value);
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public String getText() {
- return text != null ? text : "";
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public String toString() {
- return getName() + "{" + attributes.toString() + " <" + getText().trim() + ">" + "}";
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,82 @@
+/**
+ * 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.component.xml;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 16.11.2006
+ *
+ */
+public class XmlNodeData implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8320619478974873168L;
+
+ private String namespace;
+
+ private String name = "";
+
+ private String text;
+
+ private Map<String, Object> attributes = new HashMap<String, Object>();
+
+ public Map<String, Object> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttribute(String key, Object value) {
+ this.attributes.put(key, value);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getText() {
+ return text != null ? text : "";
+ }
+
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public String toString() {
+ return getName() + "{" + attributes.toString() + " <" + getText().trim() + ">" + "}";
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Classes that represent XML node data
- */
-package org.richfaces.component.xml;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/component/xml/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Classes that represent XML node data
+ */
+package org.richfaces.component.xml;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,46 +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.event;
-
-import javax.faces.component.UIComponent;
-
-/**
- *
- * <br /><br />
- *
- * Created 27.08.2007
- * @author mikalaj
- * @since 3.1
- */
-
-public class AjaxExpandedEvent extends NodeExpandedEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 5191468583939051390L;
-
- public AjaxExpandedEvent(UIComponent component) {
- super(component);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,46 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+
+/**
+ *
+ * <br /><br />
+ *
+ * Created 27.08.2007
+ * @author mikalaj
+ * @since 3.1
+ */
+
+public class AjaxExpandedEvent extends NodeExpandedEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5191468583939051390L;
+
+ public AjaxExpandedEvent(UIComponent component) {
+ super(component);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,43 +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.event;
-
-import javax.faces.component.UIComponent;
-
-import org.richfaces.model.TreeRowKey;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class AjaxSelectedEvent extends NodeSelectedEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 1156974665865521208L;
-
- public AjaxSelectedEvent(UIComponent component, TreeRowKey oldSelection) {
- super(component, oldSelection);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,43 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+
+import org.richfaces.model.TreeRowKey;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class AjaxSelectedEvent extends NodeSelectedEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1156974665865521208L;
+
+ public AjaxSelectedEvent(UIComponent component, TreeRowKey oldSelection) {
+ super(component, oldSelection);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,54 +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.event;
-
-import javax.faces.component.UIComponent;
-
-/**
- * Base interface holding attributes that can lately
- * be applied on {@link UIComponent}
- * @author Maksim Kaszynski
- *
- */
-public interface AttributeHolder {
-
- /**
- *
- * @param name
- * @param value
- */
- public abstract void setAttribute(String name, Object value);
-
- /**
- *
- * @param name
- * @return
- */
- public abstract Object getAttribute(String name);
-
- /**
- * Copy attributes from event map to component
- * @param component
- */
- public abstract void applyAttributes(UIComponent component);
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,54 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Base interface holding attributes that can lately
+ * be applied on {@link UIComponent}
+ * @author Maksim Kaszynski
+ *
+ */
+public interface AttributeHolder {
+
+ /**
+ *
+ * @param name
+ * @param value
+ */
+ public abstract void setAttribute(String name, Object value);
+
+ /**
+ *
+ * @param name
+ * @return
+ */
+ public abstract Object getAttribute(String name);
+
+ /**
+ * Copy attributes from event map to component
+ * @param component
+ */
+ public abstract void applyAttributes(UIComponent component);
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,97 +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.event;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-
-/**
- * Base class for events carrying component attributes.
- * By using it, renderer-specific attributes can
- * be applied when event is broadcast
- * @author Maksim Kaszynski
- *
- */
-public abstract class AttributedEvent extends FacesEvent implements AttributeHolder{
-
- private static final long serialVersionUID = 1L;
-
- private Map<String, Object> attributes = new HashMap<String, Object>();
-
- public AttributedEvent(UIComponent component) {
- super(component);
- }
-
- public AttributedEvent(UIComponent component, Map<String, Object> attributes) {
- super(component);
- this.attributes.putAll(attributes);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.event.AttributeHolder#setAttribute(java.lang.String, java.lang.Object)
- */
- public void setAttribute(String name, Object value) {
- attributes.put(name, value);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.event.AttributeHolder#getAttribute(java.lang.String)
- */
- public Object getAttribute(String name) {
- return attributes.get(name);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.event.AttributeHolder#applyAttributes(javax.faces.component.UIComponent)
- */
- public void applyAttributes(UIComponent component) {
-
- Map<String, Object> attrs = component.getAttributes();
-
- for(Iterator<Map.Entry<String, Object>> iterator = attributes.entrySet().iterator();
- iterator.hasNext(); ) {
-
- Map.Entry<String, Object> entry = iterator.next();
-
- String key = entry.getKey();
- Object value = entry.getValue();
-
- if (value == null) {
- attrs.remove(key);
- } else {
- attrs.put(key, value);
- }
- }
- }
-
- /**
- * copy attributes to event source
- */
- public void applyAttributes() {
- applyAttributes(getComponent());
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,97 @@
+/**
+ * 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.event;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+
+/**
+ * Base class for events carrying component attributes.
+ * By using it, renderer-specific attributes can
+ * be applied when event is broadcast
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class AttributedEvent extends FacesEvent implements AttributeHolder{
+
+ private static final long serialVersionUID = 1L;
+
+ private Map<String, Object> attributes = new HashMap<String, Object>();
+
+ public AttributedEvent(UIComponent component) {
+ super(component);
+ }
+
+ public AttributedEvent(UIComponent component, Map<String, Object> attributes) {
+ super(component);
+ this.attributes.putAll(attributes);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.AttributeHolder#setAttribute(java.lang.String, java.lang.Object)
+ */
+ public void setAttribute(String name, Object value) {
+ attributes.put(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.AttributeHolder#getAttribute(java.lang.String)
+ */
+ public Object getAttribute(String name) {
+ return attributes.get(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.AttributeHolder#applyAttributes(javax.faces.component.UIComponent)
+ */
+ public void applyAttributes(UIComponent component) {
+
+ Map<String, Object> attrs = component.getAttributes();
+
+ for(Iterator<Map.Entry<String, Object>> iterator = attributes.entrySet().iterator();
+ iterator.hasNext(); ) {
+
+ Map.Entry<String, Object> entry = iterator.next();
+
+ String key = entry.getKey();
+ Object value = entry.getValue();
+
+ if (value == null) {
+ attrs.remove(key);
+ } else {
+ attrs.put(key, value);
+ }
+ }
+ }
+
+ /**
+ * copy attributes to event source
+ */
+ public void applyAttributes() {
+ applyAttributes(getComponent());
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,69 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import java.util.Date;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-public class CurrentDateChangeEvent extends FacesEvent {
-
-
- private static final long serialVersionUID = -8169207286087810907L;
- private Date currentDate = null;
- private String currentDateString = null;
-
- @Deprecated
- public CurrentDateChangeEvent(UIComponent component, Date curentDate) {
- super(component);
- this.currentDate = curentDate;
-
- }
-
- public CurrentDateChangeEvent(UIComponent component, String curentDateString) {
- super(component);
- this.currentDateString = curentDateString;
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return false;
- }
-
- public void processListener(FacesListener listener) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException();
- }
-
- public Date getCurrentDate() {
- return currentDate;
- }
-
- public void setCurrentDate(Date currentDate) {
- this.currentDate = currentDate;
- }
-
- public String getCurrentDateString() {
- return currentDateString;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,69 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import java.util.Date;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+public class CurrentDateChangeEvent extends FacesEvent {
+
+
+ private static final long serialVersionUID = -8169207286087810907L;
+ private Date currentDate = null;
+ private String currentDateString = null;
+
+ @Deprecated
+ public CurrentDateChangeEvent(UIComponent component, Date curentDate) {
+ super(component);
+ this.currentDate = curentDate;
+
+ }
+
+ public CurrentDateChangeEvent(UIComponent component, String curentDateString) {
+ super(component);
+ this.currentDateString = curentDateString;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return false;
+ }
+
+ public void processListener(FacesListener listener) {
+ // TODO Auto-generated method stub
+ throw new UnsupportedOperationException();
+ }
+
+ public Date getCurrentDate() {
+ return currentDate;
+ }
+
+ public void setCurrentDate(Date currentDate) {
+ this.currentDate = currentDate;
+ }
+
+ public String getCurrentDateString() {
+ return currentDateString;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,36 +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.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Alexej Kushunin - akushunin(a)exadel.com
- * created 28.08.2007
- *
- * Base calendar events interface
- */
-public interface CurrentDateChangeListener extends FacesListener {
-
- public void processCurrentDateChange(CurrentDateChangeEvent event);
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,36 @@
+/**
+ * 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.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Alexej Kushunin - akushunin(a)exadel.com
+ * created 28.08.2007
+ *
+ * Base calendar events interface
+ */
+public interface CurrentDateChangeListener extends FacesListener {
+
+ public void processCurrentDateChange(CurrentDateChangeEvent event);
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,76 +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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesListener;
-import javax.faces.event.PhaseId;
-
-import org.ajax4jsf.event.AjaxEvent;
-
-/**
- * @author Wesley Hales
- */
-public class DataFilterSliderEvent extends AjaxEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private Integer oldSliderVal;
- private Integer newSliderVal;
-
- /**
- * Creates a new SliderEvent.
- *
- * @param component the source of the event
- * @param thisOldSliderVal the previously showing item identifier
- * @param thisNewSliderVal the currently showing item identifier
- */
- public DataFilterSliderEvent(UIComponent component, Integer thisOldSliderVal, Integer thisNewSliderVal) {
- super(component);
- setPhaseId(PhaseId.INVOKE_APPLICATION);
- oldSliderVal = thisOldSliderVal;
- newSliderVal = thisNewSliderVal;
- }
-
- public Integer getOldSliderVal() {
- return oldSliderVal;
- }
-
- public Integer getNewSliderVal() {
- return newSliderVal;
- }
-
- public boolean isAppropriateListener(FacesListener listener){
- return (listener instanceof DataFilterSliderListener);
- }
-
- /**
- * Delivers this event to the SliderListener.
- *
- * @param listener the slider listener
- */
- public void processListener(FacesListener listener){
- ((DataFilterSliderListener) listener).processSlider(this);
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,76 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseId;
+
+import org.ajax4jsf.event.AjaxEvent;
+
+/**
+ * @author Wesley Hales
+ */
+public class DataFilterSliderEvent extends AjaxEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Integer oldSliderVal;
+ private Integer newSliderVal;
+
+ /**
+ * Creates a new SliderEvent.
+ *
+ * @param component the source of the event
+ * @param thisOldSliderVal the previously showing item identifier
+ * @param thisNewSliderVal the currently showing item identifier
+ */
+ public DataFilterSliderEvent(UIComponent component, Integer thisOldSliderVal, Integer thisNewSliderVal) {
+ super(component);
+ setPhaseId(PhaseId.INVOKE_APPLICATION);
+ oldSliderVal = thisOldSliderVal;
+ newSliderVal = thisNewSliderVal;
+ }
+
+ public Integer getOldSliderVal() {
+ return oldSliderVal;
+ }
+
+ public Integer getNewSliderVal() {
+ return newSliderVal;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener){
+ return (listener instanceof DataFilterSliderListener);
+ }
+
+ /**
+ * Delivers this event to the SliderListener.
+ *
+ * @param listener the slider listener
+ */
+ public void processListener(FacesListener listener){
+ ((DataFilterSliderListener) listener).processSlider(this);
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +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.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Wesley Hales
- */
-public interface DataFilterSliderListener extends FacesListener {
-
- public void processSlider(org.richfaces.event.DataFilterSliderEvent event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+ * 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.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Wesley Hales
+ */
+public interface DataFilterSliderListener extends FacesListener {
+
+ public void processSlider(org.richfaces.event.DataFilterSliderEvent event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,50 +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.event;
-
-/**
- * @author Wesley Hales
- */
-public interface DataFilterSliderSource {
-
- /**
- * Adds a DataFilterSliderListener to this DataFilterSliderSource.
- *
- * @param listener the Slider listener to be added
- */
- public void addSliderListener(org.richfaces.event.DataFilterSliderListener listener);
-
- /**
- * Removes a DataFilterSliderListener from this DataFilterSliderSource.
- *
- * @param listener the Slider listener to be removed
- */
- public void removeSliderListener(DataFilterSliderListener listener);
-
- /**
- * Returns all SliderListeners for this DataFilterSliderSource.
- *
- * @return the Slider listener array
- */
- public DataFilterSliderListener[] getSliderListeners();
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,50 @@
+/**
+ * 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.event;
+
+/**
+ * @author Wesley Hales
+ */
+public interface DataFilterSliderSource {
+
+ /**
+ * Adds a DataFilterSliderListener to this DataFilterSliderSource.
+ *
+ * @param listener the Slider listener to be added
+ */
+ public void addSliderListener(org.richfaces.event.DataFilterSliderListener listener);
+
+ /**
+ * Removes a DataFilterSliderListener from this DataFilterSliderSource.
+ *
+ * @param listener the Slider listener to be removed
+ */
+ public void removeSliderListener(DataFilterSliderListener listener);
+
+ /**
+ * Returns all SliderListeners for this DataFilterSliderSource.
+ *
+ * @return the Slider listener array
+ */
+ public DataFilterSliderListener[] getSliderListeners();
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,90 +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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Wesley Hales
- */
-public class DataScrollerEvent extends ActionEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 2657353903701932561L;
- private String oldScrolVal;
- private String newScrolVal;
- private int page;
-
- /**
- * Creates a new ScrollerEvent.
- *
- * @param component the source of the event
- * @param thisOldScrolVal the previously showing item identifier
- * @param thisNewScrolVal the currently showing item identifier
- */
- public DataScrollerEvent(UIComponent component, String thisOldScrolVal, String thisNewScrolVal, int page) {
- super(component);
- oldScrolVal = thisOldScrolVal;
- newScrolVal = thisNewScrolVal;
- this.page = page;
- }
-
- public String getOldScrolVal() {
- return oldScrolVal;
- }
-
- public String getNewScrolVal() {
- return newScrolVal;
- }
-
- /**
- * @since 3.2
- * @return new page or <code>-1</code> if not applicable
- */
- public int getPage() {
- return page;
- }
-
- public boolean isAppropriateListener(FacesListener listener){
- return super.isAppropriateListener(listener) || (listener instanceof DataScrollerListener);
- }
-
- /**
- * Delivers this event to the SliderListener.
- *
- * @param listener the slider listener
- */
- public void processListener(FacesListener listener){
- if (listener instanceof DataScrollerListener) {
- DataScrollerListener dataScrollerListener = (DataScrollerListener) listener;
- dataScrollerListener.processScroller(this);
- }
-
- if (super.isAppropriateListener(listener)) {
- super.processListener(listener);
- }
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,90 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Wesley Hales
+ */
+public class DataScrollerEvent extends ActionEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2657353903701932561L;
+ private String oldScrolVal;
+ private String newScrolVal;
+ private int page;
+
+ /**
+ * Creates a new ScrollerEvent.
+ *
+ * @param component the source of the event
+ * @param thisOldScrolVal the previously showing item identifier
+ * @param thisNewScrolVal the currently showing item identifier
+ */
+ public DataScrollerEvent(UIComponent component, String thisOldScrolVal, String thisNewScrolVal, int page) {
+ super(component);
+ oldScrolVal = thisOldScrolVal;
+ newScrolVal = thisNewScrolVal;
+ this.page = page;
+ }
+
+ public String getOldScrolVal() {
+ return oldScrolVal;
+ }
+
+ public String getNewScrolVal() {
+ return newScrolVal;
+ }
+
+ /**
+ * @since 3.2
+ * @return new page or <code>-1</code> if not applicable
+ */
+ public int getPage() {
+ return page;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener){
+ return super.isAppropriateListener(listener) || (listener instanceof DataScrollerListener);
+ }
+
+ /**
+ * Delivers this event to the SliderListener.
+ *
+ * @param listener the slider listener
+ */
+ public void processListener(FacesListener listener){
+ if (listener instanceof DataScrollerListener) {
+ DataScrollerListener dataScrollerListener = (DataScrollerListener) listener;
+ dataScrollerListener.processScroller(this);
+ }
+
+ if (super.isAppropriateListener(listener)) {
+ super.processListener(listener);
+ }
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,31 +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.event;
-
-import javax.faces.event.FacesListener;
-
-
-public interface DataScrollerListener extends FacesListener {
-
- public void processScroller(org.richfaces.event.DataScrollerEvent event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,31 @@
+/**
+ * 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.event;
+
+import javax.faces.event.FacesListener;
+
+
+public interface DataScrollerListener extends FacesListener {
+
+ public void processScroller(org.richfaces.event.DataScrollerEvent event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,47 +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.event;
-
-public interface DataScrollerSource {
-
- /**
- * Adds a DataScrollerListener to this DataScrollerSource.
- *
- * @param listener the Scroler listener to be added
- */
- public void addScrollerListener(org.richfaces.event.DataScrollerListener listener);
-
- /**
- * Removes a DataFilterSliderListener from this DataScrollerSourceSource.
- *
- * @param listener the Scroler listener to be removed
- */
- public void removeScrollerListener(DataScrollerListener listener);
-
- /**
- * Returns all ScrollerListeners for this DataScrollerSource.
- *
- * @return the Scroler listener array
- */
- public DataScrollerListener[] getScrollerListeners();
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,47 @@
+/**
+ * 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.event;
+
+public interface DataScrollerSource {
+
+ /**
+ * Adds a DataScrollerListener to this DataScrollerSource.
+ *
+ * @param listener the Scroler listener to be added
+ */
+ public void addScrollerListener(org.richfaces.event.DataScrollerListener listener);
+
+ /**
+ * Removes a DataFilterSliderListener from this DataScrollerSourceSource.
+ *
+ * @param listener the Scroler listener to be removed
+ */
+ public void removeScrollerListener(DataScrollerListener listener);
+
+ /**
+ * Returns all ScrollerListeners for this DataScrollerSource.
+ *
+ * @return the Scroler listener array
+ */
+ public DataScrollerListener[] getScrollerListeners();
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,46 +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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-
-/**
- *
- * <br /><br />
- *
- * Created 12.11.2007
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public abstract class DnDEvent extends FacesEvent {
- /**
- *
- */
- private static final long serialVersionUID = -2455016405742082110L;
-
- public DnDEvent(UIComponent component) {
- super(component);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DnDEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,46 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+
+/**
+ *
+ * <br /><br />
+ *
+ * Created 12.11.2007
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public abstract class DnDEvent extends FacesEvent {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2455016405742082110L;
+
+ public DnDEvent(UIComponent component) {
+ super(component);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,102 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.component.Draggable;
-import org.richfaces.component.Dropzone;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.12.2006
- *
- */
-public class DragEvent extends DnDEvent {
-
- private Dropzone dropTarget;
- private Object acceptedTypes;
- private Object dropValue;
- /**
- *
- */
- private static final long serialVersionUID = 6179268394391836905L;
-
- public DragEvent(UIComponent uiComponent) {
- super(uiComponent);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener faceslistener) {
- return faceslistener instanceof DragListener;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener faceslistener) {
- ((DragListener) faceslistener).processDrag(this);
- }
-
- public Object getDragValue() {
- return ((Draggable) this.getSource()).getDragValue();
- }
-
- public Dropzone getDropTarget() {
- return dropTarget;
- }
-
- /**
- * @see java.util.EventObject#toString()
- */
-/* public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
- append("component", getComponent()).append("source", getSource()).append("phaseId", getPhaseId()).
- append("dragValue", getDragValue()).
- append("dropTarget", getDropTarget()).
- append("dropValue", getDropValue()).
- toString();
- }
-*/
- public void setDropTarget(Dropzone dropTarget) {
- this.dropTarget = dropTarget;
- }
-
- public Object getAcceptedTypes() {
- return acceptedTypes;
- }
-
- public void setAcceptedTypes(Object acceptedTypes) {
- this.acceptedTypes = acceptedTypes;
- }
-
- public Object getDropValue() {
- return dropValue;
- }
-
- public void setDropValue(Object dropValue) {
- this.dropValue = dropValue;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,102 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.12.2006
+ *
+ */
+public class DragEvent extends DnDEvent {
+
+ private Dropzone dropTarget;
+ private Object acceptedTypes;
+ private Object dropValue;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6179268394391836905L;
+
+ public DragEvent(UIComponent uiComponent) {
+ super(uiComponent);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener faceslistener) {
+ return faceslistener instanceof DragListener;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener faceslistener) {
+ ((DragListener) faceslistener).processDrag(this);
+ }
+
+ public Object getDragValue() {
+ return ((Draggable) this.getSource()).getDragValue();
+ }
+
+ public Dropzone getDropTarget() {
+ return dropTarget;
+ }
+
+ /**
+ * @see java.util.EventObject#toString()
+ */
+/* public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
+ append("component", getComponent()).append("source", getSource()).append("phaseId", getPhaseId()).
+ append("dragValue", getDragValue()).
+ append("dropTarget", getDropTarget()).
+ append("dropValue", getDropValue()).
+ toString();
+ }
+*/
+ public void setDropTarget(Dropzone dropTarget) {
+ this.dropTarget = dropTarget;
+ }
+
+ public Object getAcceptedTypes() {
+ return acceptedTypes;
+ }
+
+ public void setAcceptedTypes(Object acceptedTypes) {
+ this.acceptedTypes = acceptedTypes;
+ }
+
+ public Object getDropValue() {
+ return dropValue;
+ }
+
+ public void setDropValue(Object dropValue) {
+ this.dropValue = dropValue;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,34 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.12.2006
- *
- */
-public interface DragListener extends FacesListener {
- public void processDrag(DragEvent event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DragListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.12.2006
+ *
+ */
+public interface DragListener extends FacesListener {
+ public void processDrag(DragEvent event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,107 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.component.Draggable;
-import org.richfaces.component.Dropzone;
-
-/**
- * @author shura
- *
- */
-public class DropEvent extends DnDEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 1660545054556302746L;
-
- private Draggable draggableSource;
- private String dragType;
- private Object dragValue;
-
- public DropEvent(UIComponent component) {
- super(component);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof DropListener;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((DropListener) listener).processDrop(this);
- }
-
- /**
- * @return the dropValue
- */
- public Object getDropValue() {
- return ((Dropzone) this.getSource()).getDropValue();
- }
-
- public Draggable getDraggableSource() {
- return draggableSource;
- }
-
- /**
- * @see java.util.EventObject#toString()
- */
-/* public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
- append("component", getComponent()).
- append("source", getSource()).
- append("phaseId", getPhaseId()).
- append("dropValue", getDropValue()).
- append("draggableSource", getDraggableSource()).
- append("dragValue", getDragValue()).
- toString();
- }
-*/
- public void setDraggableSource(Draggable draggableSource) {
- this.draggableSource = draggableSource;
- }
-
- public String getDragType() {
- return dragType;
- }
-
- public void setDragType(String dragType) {
- this.dragType = dragType;
- }
-
- public Object getDragValue() {
- return dragValue;
- }
-
- public void setDragValue(Object dragValue) {
- this.dragValue = dragValue;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,107 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
+
+/**
+ * @author shura
+ *
+ */
+public class DropEvent extends DnDEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1660545054556302746L;
+
+ private Draggable draggableSource;
+ private String dragType;
+ private Object dragValue;
+
+ public DropEvent(UIComponent component) {
+ super(component);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof DropListener;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((DropListener) listener).processDrop(this);
+ }
+
+ /**
+ * @return the dropValue
+ */
+ public Object getDropValue() {
+ return ((Dropzone) this.getSource()).getDropValue();
+ }
+
+ public Draggable getDraggableSource() {
+ return draggableSource;
+ }
+
+ /**
+ * @see java.util.EventObject#toString()
+ */
+/* public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
+ append("component", getComponent()).
+ append("source", getSource()).
+ append("phaseId", getPhaseId()).
+ append("dropValue", getDropValue()).
+ append("draggableSource", getDraggableSource()).
+ append("dragValue", getDragValue()).
+ toString();
+ }
+*/
+ public void setDraggableSource(Draggable draggableSource) {
+ this.draggableSource = draggableSource;
+ }
+
+ public String getDragType() {
+ return dragType;
+ }
+
+ public void setDragType(String dragType) {
+ this.dragType = dragType;
+ }
+
+ public Object getDragValue() {
+ return dragValue;
+ }
+
+ public void setDragValue(Object dragValue) {
+ this.dragValue = dragValue;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,39 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * Listener for process Drop events
- * @author shura
- *
- */
-public interface DropListener extends FacesListener {
-
- /**
- * Process event on Drop for this component.
- * @param event
- */
- public void processDrop(DropEvent event);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,39 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * Listener for process Drop events
+ * @author shura
+ *
+ */
+public interface DropListener extends FacesListener {
+
+ /**
+ * Process event on Drop for this component.
+ * @param event
+ */
+ public void processDrop(DropEvent event);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,54 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.el.MethodBinding;
-
-/**
- * Interface for component applicable to process drag/drop events.
- * @author shura
- *
- */
-public interface DropSource {
-
- /**
- * Append drop listener to component listeners collection
- * @param listener
- */
- public void addDropListener(DropListener listener);
-
- /**
- * Get array of all Drop Listeners
- * @return
- */
- public DropListener[] getDropListeners();
-
- /**
- * Remove drop listener from component listeners array.
- * @param listener
- */
- public void removeDropListener(DropListener listener);
-
- public void setDropListener(MethodBinding binding);
- public MethodBinding getDropListener();
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/DropSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,54 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import javax.faces.el.MethodBinding;
+
+/**
+ * Interface for component applicable to process drag/drop events.
+ * @author shura
+ *
+ */
+public interface DropSource {
+
+ /**
+ * Append drop listener to component listeners collection
+ * @param listener
+ */
+ public void addDropListener(DropListener listener);
+
+ /**
+ * Get array of all Drop Listeners
+ * @return
+ */
+ public DropListener[] getDropListeners();
+
+ /**
+ * Remove drop listener from component listeners array.
+ * @param listener
+ */
+ public void removeDropListener(DropListener listener);
+
+ public void setDropListener(MethodBinding binding);
+ public MethodBinding getDropListener();
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,29 +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.event;
-
-import javax.faces.event.FacesListener;
-
-public interface FileUploadListener extends FacesListener {
-
- public void processUpload(UploadEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/FileUploadListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,29 @@
+/**
+ * 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.event;
+
+import javax.faces.event.FacesListener;
+
+public interface FileUploadListener extends FacesListener {
+
+ public void processUpload(UploadEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,38 +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
- */
-
-/*
- * Created on 11.07.2006
- */
-package org.richfaces.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author igels
- */
-
-//TODO by nick - denis - add addToggleListener method to component
-public interface ISimpleToggleListener extends FacesListener {
-
- public void processToggle(SimpleToggleEvent event);
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,38 @@
+/**
+ * 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
+ */
+
+/*
+ * Created on 11.07.2006
+ */
+package org.richfaces.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author igels
+ */
+
+//TODO by nick - denis - add addToggleListener method to component
+public interface ISimpleToggleListener extends FacesListener {
+
+ public void processToggle(SimpleToggleEvent event);
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,58 +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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.11.2006
- *
- */
-public class NodeExpandedEvent extends FacesEvent {
-
- public NodeExpandedEvent(UIComponent component) {
- super(component);
- }
-
- /**
- *
- */
- private static final long serialVersionUID = 2620359072575831666L;
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof NodeExpandedListener;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((NodeExpandedListener) listener).processExpansion(this);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,58 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.11.2006
+ *
+ */
+public class NodeExpandedEvent extends FacesEvent {
+
+ public NodeExpandedEvent(UIComponent component) {
+ super(component);
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2620359072575831666L;
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof NodeExpandedListener;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((NodeExpandedListener) listener).processExpansion(this);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,34 +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.event;
-
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.11.2006
- *
- */
-public interface NodeExpandedListener extends FacesListener {
- public void processExpansion(NodeExpandedEvent nodeExpandedEvent) throws AbortProcessingException;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeExpandedListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,34 @@
+/**
+ * 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.event;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.11.2006
+ *
+ */
+public interface NodeExpandedListener extends FacesListener {
+ public void processExpansion(NodeExpandedEvent nodeExpandedEvent) throws AbortProcessingException;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,69 +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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.model.TreeRowKey;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.11.2006
- *
- */
-public class NodeSelectedEvent extends FacesEvent {
-
- private TreeRowKey oldSelection;
-
- public NodeSelectedEvent(UIComponent component, TreeRowKey oldSelection) {
- super(component);
-
- this.oldSelection = oldSelection;
- }
-
- /**
- *
- */
- private static final long serialVersionUID = -1292268859927735863L;
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
-
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof NodeSelectedListener;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
-
- public void processListener(FacesListener listener) {
- ((NodeSelectedListener) listener).processSelection(this);
- }
-
- public TreeRowKey getOldSelection() {
- return oldSelection;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,69 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.model.TreeRowKey;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.11.2006
+ *
+ */
+public class NodeSelectedEvent extends FacesEvent {
+
+ private TreeRowKey oldSelection;
+
+ public NodeSelectedEvent(UIComponent component, TreeRowKey oldSelection) {
+ super(component);
+
+ this.oldSelection = oldSelection;
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1292268859927735863L;
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof NodeSelectedListener;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+
+ public void processListener(FacesListener listener) {
+ ((NodeSelectedListener) listener).processSelection(this);
+ }
+
+ public TreeRowKey getOldSelection() {
+ return oldSelection;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,34 +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.event;
-
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.11.2006
- *
- */
-public interface NodeSelectedListener extends FacesListener {
- public void processSelection(NodeSelectedEvent nodeSelectedEvent) throws AbortProcessingException;
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/NodeSelectedListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,34 @@
+/**
+ * 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.event;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.11.2006
+ *
+ */
+public interface NodeSelectedListener extends FacesListener {
+ public void processSelection(NodeSelectedEvent nodeSelectedEvent) throws AbortProcessingException;
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,36 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.PhaseEvent;
-
-public interface RenderPhaseComponentVisitor {
-
- Object beforeRoot(PhaseEvent event);
-
- void beforeComponent(UIComponent component, PhaseEvent event, Object state);
-
- void afterComponent(UIComponent component, PhaseEvent event, Object state);
-
- void afterRoot(PhaseEvent event, Object state);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/RenderPhaseComponentVisitor.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,36 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.PhaseEvent;
+
+public interface RenderPhaseComponentVisitor {
+
+ Object beforeRoot(PhaseEvent event);
+
+ void beforeComponent(UIComponent component, PhaseEvent event, Object state);
+
+ void afterComponent(UIComponent component, PhaseEvent event, Object state);
+
+ void afterRoot(PhaseEvent event, Object state);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,70 +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.event;
-
-import javax.faces.component.UIComponent;
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public abstract class ScrollableGridViewEvent extends AttributedEvent {
-
-
- /**
- *
- */
- private static final long serialVersionUID = -7417387605074667926L;
- /**
- * number of rows to update
- */
- protected int rows;
- /**
- * start position of update
- */
- protected int first;
-
-
- public ScrollableGridViewEvent(UIComponent component, int rows, int first) {
- super(component);
- this.rows = rows;
- this.first = first;
- }
-
- public int getFirst() {
- return first;
- }
-
- public int getRows() {
- return rows;
- }
-
- public void setFirst(int first) {
- this.first = first;
- }
-
- public void setRows(int rows) {
- this.rows = rows;
- }
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,70 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class ScrollableGridViewEvent extends AttributedEvent {
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7417387605074667926L;
+ /**
+ * number of rows to update
+ */
+ protected int rows;
+ /**
+ * start position of update
+ */
+ protected int first;
+
+
+ public ScrollableGridViewEvent(UIComponent component, int rows, int first) {
+ super(component);
+ this.rows = rows;
+ this.first = first;
+ }
+
+ public int getFirst() {
+ return first;
+ }
+
+ public int getRows() {
+ return rows;
+ }
+
+ public void setFirst(int first) {
+ this.first = first;
+ }
+
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,81 +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
- */
-
-/*
- * Created on 11.07.2006
- */
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author igels
- */
-public class SimpleToggleEvent extends ActionEvent {
-
- private static final long serialVersionUID = 5582624805941635421L;
- private boolean _opened;
-
- /**
- * @param source
- * @param opened
- */
- public SimpleToggleEvent(UIComponent source, boolean opened) {
- super(source);
- this._opened = opened;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof ISimpleToggleListener || super.isAppropriateListener(listener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- if (listener instanceof ISimpleToggleListener) {
- ((ISimpleToggleListener) listener).processToggle(this);
- } else {
- super.processListener(listener);
- }
-
- }
-
- /**
- * @return Returns the _state.
- */
- public boolean isIsOpen() {
- return _opened;
- }
-
- /**
- *
- * @param opened The state to set
- */
- public void setIsOpen(boolean opened) {
- this._opened = opened;
- }
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,81 @@
+/**
+ * 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
+ */
+
+/*
+ * Created on 11.07.2006
+ */
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author igels
+ */
+public class SimpleToggleEvent extends ActionEvent {
+
+ private static final long serialVersionUID = 5582624805941635421L;
+ private boolean _opened;
+
+ /**
+ * @param source
+ * @param opened
+ */
+ public SimpleToggleEvent(UIComponent source, boolean opened) {
+ super(source);
+ this._opened = opened;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof ISimpleToggleListener || super.isAppropriateListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ if (listener instanceof ISimpleToggleListener) {
+ ((ISimpleToggleListener) listener).processToggle(this);
+ } else {
+ super.processListener(listener);
+ }
+
+ }
+
+ /**
+ * @return Returns the _state.
+ */
+ public boolean isIsOpen() {
+ return _opened;
+ }
+
+ /**
+ *
+ * @param opened The state to set
+ */
+ public void setIsOpen(boolean opened) {
+ this._opened = opened;
+ }
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,55 +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.event;
-
-import javax.faces.component.UIComponent;
-
-import org.ajax4jsf.event.AjaxEvent;
-
-/**
- * Event send by tree component in case of AJAX of action (node expansion/collapsion or selection).
- * Contains data to distinguish between different action types in order to support different re-rendering
- * behaviors for particular actions.
- *
- * @author Nick Belaevski
- * @since 3.3.0
- */
-
-public class TreeAjaxEvent extends AjaxEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = -2410803626536767706L;
-
- private TreeAjaxEventType eventType;
-
- public TreeAjaxEvent(UIComponent component, TreeAjaxEventType eventType) {
- super(component);
-
- this.eventType = eventType;
- }
-
- public TreeAjaxEventType getEventType() {
- return eventType;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,55 @@
+/**
+ * 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.event;
+
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.event.AjaxEvent;
+
+/**
+ * Event send by tree component in case of AJAX of action (node expansion/collapsion or selection).
+ * Contains data to distinguish between different action types in order to support different re-rendering
+ * behaviors for particular actions.
+ *
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class TreeAjaxEvent extends AjaxEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2410803626536767706L;
+
+ private TreeAjaxEventType eventType;
+
+ public TreeAjaxEvent(UIComponent component, TreeAjaxEventType eventType) {
+ super(component);
+
+ this.eventType = eventType;
+ }
+
+ public TreeAjaxEventType getEventType() {
+ return eventType;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +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.event;
-
-/**
- * Types enumeration for possible tree actions to be used in {@link TreeAjaxEvent}
- *
- * @author Nick Belaevski
- * @since 3.3.0
- */
-
-public enum TreeAjaxEventType {
- EXPANSION, SELECTION
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+ * 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.event;
+
+/**
+ * Types enumeration for possible tree actions to be used in {@link TreeAjaxEvent}
+ *
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public enum TreeAjaxEventType {
+ EXPANSION, SELECTION
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,51 +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.event;
-
-import javax.faces.el.MethodBinding;
-
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 29.11.2006
- *
- * Base tree events interface
- */
-public interface TreeListenerEventsProducer {
- public abstract void setChangeExpandListener(MethodBinding binding);
- public abstract MethodBinding getChangeExpandListener();
-
- public abstract void setNodeSelectListener(MethodBinding binding);
- public abstract MethodBinding getNodeSelectListener();
-
- public abstract void setDropListener(MethodBinding binding);
- public abstract MethodBinding getDropListener();
-
- public abstract void setDragListener(MethodBinding binding);
- public abstract MethodBinding getDragListener();
-
- public void addNodeSelectListener(NodeSelectedListener listener);
- public void addChangeExpandListener(NodeExpandedListener listener);
-
- //TODO - rename this
- public boolean hasAjaxSubmitSelection();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,51 @@
+/**
+ * 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.event;
+
+import javax.faces.el.MethodBinding;
+
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 29.11.2006
+ *
+ * Base tree events interface
+ */
+public interface TreeListenerEventsProducer {
+ public abstract void setChangeExpandListener(MethodBinding binding);
+ public abstract MethodBinding getChangeExpandListener();
+
+ public abstract void setNodeSelectListener(MethodBinding binding);
+ public abstract MethodBinding getNodeSelectListener();
+
+ public abstract void setDropListener(MethodBinding binding);
+ public abstract MethodBinding getDropListener();
+
+ public abstract void setDragListener(MethodBinding binding);
+ public abstract MethodBinding getDragListener();
+
+ public void addNodeSelectListener(NodeSelectedListener listener);
+ public void addChangeExpandListener(NodeExpandedListener listener);
+
+ //TODO - rename this
+ public boolean hasAjaxSubmitSelection();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,78 +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.event;
-
-import java.util.List;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.model.UploadItem;
-
-public class UploadEvent extends FacesEvent{
-
- private static final long serialVersionUID = -7645197191376210068L;
- private List<UploadItem> uploadItems = null;
-
- public UploadEvent(UIComponent component, List<UploadItem> uploadItems) {
- super(component);
- this.uploadItems = uploadItems;
- }
-
-
- public boolean isAppropriateListener(FacesListener listener) {
- return false;
- }
-
-
- public void processListener(FacesListener listener) {
-
- }
-
- /**Returns UploadItem instance.
- * Returns first element of list of UploadItems in case of multiple upload.
- * @return the uploadItem
- */
- public UploadItem getUploadItem() {
- if (uploadItems != null && uploadItems.size() > 0) {
- return uploadItems.get(0);
- }
- return null;
- }
-
- /**
- * Return list of UploadItems
- * @return the uploadItem
- * @since 3.2.2
- */
- public List<UploadItem> getUploadItems() {
- return uploadItems;
- }
-
- /** Return true if multiple files were uploaded with form
- * @return boolean
- * @since 3.2.2
- */
- public boolean isMultiUpload() {
- return (uploadItems != null && uploadItems.size() > 1);
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/UploadEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,78 @@
+/**
+ * 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.event;
+
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.model.UploadItem;
+
+public class UploadEvent extends FacesEvent{
+
+ private static final long serialVersionUID = -7645197191376210068L;
+ private List<UploadItem> uploadItems = null;
+
+ public UploadEvent(UIComponent component, List<UploadItem> uploadItems) {
+ super(component);
+ this.uploadItems = uploadItems;
+ }
+
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return false;
+ }
+
+
+ public void processListener(FacesListener listener) {
+
+ }
+
+ /**Returns UploadItem instance.
+ * Returns first element of list of UploadItems in case of multiple upload.
+ * @return the uploadItem
+ */
+ public UploadItem getUploadItem() {
+ if (uploadItems != null && uploadItems.size() > 0) {
+ return uploadItems.get(0);
+ }
+ return null;
+ }
+
+ /**
+ * Return list of UploadItems
+ * @return the uploadItem
+ * @since 3.2.2
+ */
+ public List<UploadItem> getUploadItems() {
+ return uploadItems;
+ }
+
+ /** Return true if multiple files were uploaded with form
+ * @return boolean
+ * @since 3.2.2
+ */
+ public boolean isMultiUpload() {
+ return (uploadItems != null && uploadItems.size() > 1);
+ }
+}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,65 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class ChangeColumnVisibilityEvent extends FacesEvent {
-
- private static final long serialVersionUID = 178097339066092532L;
-
- private String columnId;
-
- public ChangeColumnVisibilityEvent(UIComponent component, String columnId) {
- super(component);
- this.columnId = columnId;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof ChangeColumnVisibilityListener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((ChangeColumnVisibilityListener)listener).processChangeVisibility(this);
- }
-
- public String getColumnId() {
- return columnId;
- }
-
- public void setColumnId(String columnId) {
- this.columnId = columnId;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,65 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ChangeColumnVisibilityEvent extends FacesEvent {
+
+ private static final long serialVersionUID = 178097339066092532L;
+
+ private String columnId;
+
+ public ChangeColumnVisibilityEvent(UIComponent component, String columnId) {
+ super(component);
+ this.columnId = columnId;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof ChangeColumnVisibilityListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((ChangeColumnVisibilityListener)listener).processChangeVisibility(this);
+ }
+
+ public String getColumnId() {
+ return columnId;
+ }
+
+ public void setColumnId(String columnId) {
+ this.columnId = columnId;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface ChangeColumnVisibilityListener extends FacesListener {
-
- public void processChangeVisibility(ChangeColumnVisibilityEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ChangeColumnVisibilityListener extends FacesListener {
+
+ public void processChangeVisibility(ChangeColumnVisibilityEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,65 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class ColumnResizeEvent extends FacesEvent {
-
- private static final long serialVersionUID = -8424890931071484456L;
-
- private String columnWidths;
-
- public ColumnResizeEvent(UIComponent component, String columnWidths) {
- super(component);
- this.columnWidths = columnWidths;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof ColumnResizeListener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((ColumnResizeListener)listener).processColumnResize(this);
- }
-
- public String getColumnWidths() {
- return columnWidths;
- }
-
- public void setColumnWidths(String columnWidths) {
- this.columnWidths = columnWidths;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,65 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ColumnResizeEvent extends FacesEvent {
+
+ private static final long serialVersionUID = -8424890931071484456L;
+
+ private String columnWidths;
+
+ public ColumnResizeEvent(UIComponent component, String columnWidths) {
+ super(component);
+ this.columnWidths = columnWidths;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof ColumnResizeListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((ColumnResizeListener)listener).processColumnResize(this);
+ }
+
+ public String getColumnWidths() {
+ return columnWidths;
+ }
+
+ public void setColumnWidths(String columnWidths) {
+ this.columnWidths = columnWidths;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface ColumnResizeListener extends FacesListener {
-
- public void processColumnResize(ColumnResizeEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ColumnResizeListener extends FacesListener {
+
+ public void processColumnResize(ColumnResizeEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,85 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class DragDropEvent extends FacesEvent {
-
- private static final long serialVersionUID = 2589493255876683993L;
-
- private Object dragValue;
- private Object dropValue;
- private String dragType;
- private boolean dropBefore;
-
- public DragDropEvent(UIComponent component) {
- super(component);
- }
-
- public void processListener(FacesListener listener) {
- ((DragDropListener)listener).processDragDrop(this);
- }
-
- public Object getDragValue() {
- return dragValue;
- }
-
- public void setDragValue(Object dragValue) {
- this.dragValue = dragValue;
- }
-
- public Object getDropValue() {
- return dropValue;
- }
-
- public void setDropValue(Object dropValue) {
- this.dropValue = dropValue;
- }
-
- public String getDragType() {
- return dragType;
- }
-
- public void setDragType(String dragType) {
- this.dragType = dragType;
- }
-
- public boolean isDropBefore() {
- return dropBefore;
- }
-
- public void setDropBefore(boolean dropBefore) {
- this.dropBefore = dropBefore;
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof DragDropListener);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,85 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class DragDropEvent extends FacesEvent {
+
+ private static final long serialVersionUID = 2589493255876683993L;
+
+ private Object dragValue;
+ private Object dropValue;
+ private String dragType;
+ private boolean dropBefore;
+
+ public DragDropEvent(UIComponent component) {
+ super(component);
+ }
+
+ public void processListener(FacesListener listener) {
+ ((DragDropListener)listener).processDragDrop(this);
+ }
+
+ public Object getDragValue() {
+ return dragValue;
+ }
+
+ public void setDragValue(Object dragValue) {
+ this.dragValue = dragValue;
+ }
+
+ public Object getDropValue() {
+ return dropValue;
+ }
+
+ public void setDropValue(Object dropValue) {
+ this.dropValue = dropValue;
+ }
+
+ public String getDragType() {
+ return dragType;
+ }
+
+ public void setDragType(String dragType) {
+ this.dragType = dragType;
+ }
+
+ public boolean isDropBefore() {
+ return dropBefore;
+ }
+
+ public void setDropBefore(boolean dropBefore) {
+ this.dropBefore = dropBefore;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof DragDropListener);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface DragDropListener extends FacesListener {
-
- public void processDragDrop(DragDropEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface DragDropListener extends FacesListener {
+
+ public void processDragDrop(DragDropEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,57 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class ExtTableFilterEvent extends FacesEvent {
-
- private static final long serialVersionUID = -5710321006307753098L;
-
- public ExtTableFilterEvent(UIComponent uiComponent) {
- super(uiComponent);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- @Override
- public boolean isAppropriateListener(FacesListener faceslistener) {
- return (faceslistener instanceof ExtTableFilterListener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- @Override
- public void processListener(FacesListener faceslistener) {
- ((ExtTableFilterListener)faceslistener).processFilter(this);
-
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,57 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ExtTableFilterEvent extends FacesEvent {
+
+ private static final long serialVersionUID = -5710321006307753098L;
+
+ public ExtTableFilterEvent(UIComponent uiComponent) {
+ super(uiComponent);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ @Override
+ public boolean isAppropriateListener(FacesListener faceslistener) {
+ return (faceslistener instanceof ExtTableFilterListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ @Override
+ public void processListener(FacesListener faceslistener) {
+ ((ExtTableFilterListener)faceslistener).processFilter(this);
+
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface ExtTableFilterListener extends FacesListener {
-
- public void processFilter(ExtTableFilterEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ExtTableFilterListener extends FacesListener {
+
+ public void processFilter(ExtTableFilterEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,57 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class ExtTableSortEvent extends FacesEvent {
-
- private static final long serialVersionUID = 2971879679208358501L;
-
- public ExtTableSortEvent(UIComponent uiComponent) {
- super(uiComponent);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- //@Override
- public boolean isAppropriateListener(FacesListener faceslistener) {
- return (faceslistener instanceof ExtTableSortListener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- //@Override
- public void processListener(FacesListener faceslistener) {
- ((ExtTableSortListener)faceslistener).processSort(this);
-
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,57 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ExtTableSortEvent extends FacesEvent {
+
+ private static final long serialVersionUID = 2971879679208358501L;
+
+ public ExtTableSortEvent(UIComponent uiComponent) {
+ super(uiComponent);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ //@Override
+ public boolean isAppropriateListener(FacesListener faceslistener) {
+ return (faceslistener instanceof ExtTableSortListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ //@Override
+ public void processListener(FacesListener faceslistener) {
+ ((ExtTableSortListener)faceslistener).processSort(this);
+
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* 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.event.extdt;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface ExtTableSortListener extends FacesListener {
-
- public void processSort(ExtTableSortEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* 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.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ExtTableSortListener extends FacesListener {
+
+ public void processSort(ExtTableSortEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Interfaces and classes of events and listeners of RichFaces components
- */
-package org.richfaces.event;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Interfaces and classes of events and listeners of RichFaces components
+ */
+package org.richfaces.event;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,51 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event.scroll;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.event.ScrollableGridViewEvent;
-
-
-/**
- * @author Anton Belevich
- *
- */
-public class ScrollEvent extends ScrollableGridViewEvent {
-
- private static final long serialVersionUID = 3786221668771853810L;
-
- public ScrollEvent(UIComponent component, int rows, int first){
- super(component, rows, first);
- this.rows = rows;
- this.first = first;
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof ScrollListener;
- }
-
- public void processListener(FacesListener listener) {
- ((ScrollListener) listener).processScroll(this);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event.scroll;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.event.ScrollableGridViewEvent;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class ScrollEvent extends ScrollableGridViewEvent {
+
+ private static final long serialVersionUID = 3786221668771853810L;
+
+ public ScrollEvent(UIComponent component, int rows, int first){
+ super(component, rows, first);
+ this.rows = rows;
+ this.first = first;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof ScrollListener;
+ }
+
+ public void processListener(FacesListener listener) {
+ ((ScrollListener) listener).processScroll(this);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,32 +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.event.scroll;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface ScrollListener extends FacesListener {
- public void processScroll(ScrollEvent event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,32 @@
+/**
+ * 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.event.scroll;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ScrollListener extends FacesListener {
+ public void processScroll(ScrollEvent event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Interfaces and classes of events and listeners of scrollable RichFaces components
- */
-package org.richfaces.event.scroll;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/scroll/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Interfaces and classes of events and listeners of scrollable RichFaces components
+ */
+package org.richfaces.event.scroll;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,71 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortEvent.java,v $
- * $Revision: 1.2 $
- */
-
-package org.richfaces.event.sort;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesListener;
-
-import org.richfaces.event.ScrollableGridViewEvent;
-
-/**
- * @author Maksim Kaszynski
- * @modified by Anton Belevich
- *
- */
-public class SortEvent extends ScrollableGridViewEvent {
-
- private static final long serialVersionUID = -1453867412542792281L;
-
- private String sortColumn;
-
- private Boolean suggestedOrder = null;
-
- public SortEvent(UIComponent component, String sortColumn, int rows, int first) {
-
- super(component, rows, first);
- this.sortColumn = sortColumn;
-
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof SortListener);
- }
-
- public void processListener(FacesListener listener) {
- ((SortListener) listener).processSort(this);
- }
-
- /**
- * @return the sortField
- */
- public String getSortColumn() {
- return sortColumn;
- }
-
- /**
- * @see java.util.EventObject#toString()
- */
- public String toString() {
- return "SortEvent: {sortColumn: " + sortColumn + "}";
- }
-
- public void setSortColumn(String sortColumn) {
- this.sortColumn = sortColumn;
- }
-
- public Boolean getSuggestedOrder() {
- return suggestedOrder;
- }
-
- public void setProposedOrder(Boolean proposedOrder) {
- this.suggestedOrder = proposedOrder;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,71 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortEvent.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.event.sort;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.event.ScrollableGridViewEvent;
+
+/**
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ *
+ */
+public class SortEvent extends ScrollableGridViewEvent {
+
+ private static final long serialVersionUID = -1453867412542792281L;
+
+ private String sortColumn;
+
+ private Boolean suggestedOrder = null;
+
+ public SortEvent(UIComponent component, String sortColumn, int rows, int first) {
+
+ super(component, rows, first);
+ this.sortColumn = sortColumn;
+
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof SortListener);
+ }
+
+ public void processListener(FacesListener listener) {
+ ((SortListener) listener).processSort(this);
+ }
+
+ /**
+ * @return the sortField
+ */
+ public String getSortColumn() {
+ return sortColumn;
+ }
+
+ /**
+ * @see java.util.EventObject#toString()
+ */
+ public String toString() {
+ return "SortEvent: {sortColumn: " + sortColumn + "}";
+ }
+
+ public void setSortColumn(String sortColumn) {
+ this.sortColumn = sortColumn;
+ }
+
+ public Boolean getSuggestedOrder() {
+ return suggestedOrder;
+ }
+
+ public void setProposedOrder(Boolean proposedOrder) {
+ this.suggestedOrder = proposedOrder;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,69 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event.sort;
-
-import javax.el.ValueExpression;
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortEvent2 extends FacesEvent{
-
- private static final long serialVersionUID = -3141067055845421505L;
-
- //TODO: making ValueExpression here - should redesign SortOrder/SortField?
- private ValueExpression sortExpression;
-
- private boolean force;
-
- public SortEvent2(UIComponent component, ValueExpression sortExpression,
- boolean force) {
- super(component);
- this.sortExpression = sortExpression;
- this.force = force;
- }
-
- public SortEvent2(UIComponent component, ValueExpression sortExpression) {
- this(component, sortExpression, false);
- }
-
- @Override
- public boolean isAppropriateListener(FacesListener listener) {
- return listener instanceof SortListener2;
- }
-
- @Override
- public void processListener(FacesListener listener) {
- ((SortListener2) listener).processSorting(this);
- }
-
- public boolean isForce() {
- return force;
- }
-
- public ValueExpression getSortExpression() {
- return sortExpression;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortEvent2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,69 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event.sort;
+
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SortEvent2 extends FacesEvent{
+
+ private static final long serialVersionUID = -3141067055845421505L;
+
+ //TODO: making ValueExpression here - should redesign SortOrder/SortField?
+ private ValueExpression sortExpression;
+
+ private boolean force;
+
+ public SortEvent2(UIComponent component, ValueExpression sortExpression,
+ boolean force) {
+ super(component);
+ this.sortExpression = sortExpression;
+ this.force = force;
+ }
+
+ public SortEvent2(UIComponent component, ValueExpression sortExpression) {
+ this(component, sortExpression, false);
+ }
+
+ @Override
+ public boolean isAppropriateListener(FacesListener listener) {
+ return listener instanceof SortListener2;
+ }
+
+ @Override
+ public void processListener(FacesListener listener) {
+ ((SortListener2) listener).processSorting(this);
+ }
+
+ public boolean isForce() {
+ return force;
+ }
+
+ public ValueExpression getSortExpression() {
+ return sortExpression;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,22 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortListener.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.event.sort;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface SortListener extends FacesListener {
- public void processSort(SortEvent e);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,22 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortListener.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.event.sort;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface SortListener extends FacesListener {
+ public void processSort(SortEvent e);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,27 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event.sort;
-
-import javax.faces.event.FacesListener;
-
-public interface SortListener2 extends FacesListener{
- public void processSorting(SortEvent2 event);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortListener2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,27 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.event.sort;
+
+import javax.faces.event.FacesListener;
+
+public interface SortListener2 extends FacesListener{
+ public void processSorting(SortEvent2 event);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,21 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortSource.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.event.sort;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface SortSource {
- public void addSortListener(SortListener listener);
- public void removeSortListener(SortListener listener);
- public SortListener[] getSortListeners();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/SortSource.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,21 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/event/sort/SortSource.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.event.sort;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface SortSource {
+ public void addSortListener(SortListener listener);
+ public void removeSortListener(SortListener listener);
+ public SortListener[] getSortListeners();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Interfaces and classes of events and listeners of sortable RichFaces components
- */
-package org.richfaces.event.sort;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/event/sort/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Interfaces and classes of events and listeners of sortable RichFaces components
+ */
+package org.richfaces.event.sort;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,176 +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.model;
-
-import java.io.IOException;
-
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-
-/**
- * Base class for all tree data models
- * @author Nick Belaevski - nbelaevski(a)exadel.com created 07.12.2006
- */
-public abstract class AbstractTreeDataModel extends ExtendedDataModel {
- public final static char SEPARATOR = NamingContainer.SEPARATOR_CHAR;
-
- public final int getRowCount() {
- return -1;
- }
-
- public final int getRowIndex() {
- return -1;
- }
-
- public final void setRowIndex(int rowIndex) {
- if(rowIndex!=-1) {
- throw new IllegalArgumentException("In AbstractTreeDataModel rowIndex must be -1.");
- }
- }
-
- public final void walk(FacesContext context, DataVisitor dataVisitor,
- Range range, Object argument) throws IOException {
- walk(context, dataVisitor, range, null, argument, false);
- }
-
- /**
- * walk sub-model having row key argument as its root
- * @param context faces context
- * @param dataVisitor {@link org.ajax4jsf.ajax.repeat.UIDataAdaptor.ComponentVisitor}
- * @param range {@link TreeRange} to constraint the walk
- * @param rowKey row key to treat as root of sub-model
- * @param argument implementation specific argument
- * @param last boolean flag indicating whether we started our walk from last element
- * @throws IOException
- *
- * @see {@link ExtendedDataModel#walk(FacesContext, DataVisitor, Range, Object)}
- */
- public abstract void walk(FacesContext context, DataVisitor dataVisitor,
- Range range, Object rowKey, Object argument, boolean last) throws IOException;
-
- /**
- * returns whether this node is leaf
- * @return
- */
- public abstract boolean isLeaf();
-
- /**
- * Walk backing sub-model having row key argument as its root. If there is no backing model
- * configured, calling this method is equivalent to calling {@link #walk(FacesContext, DataVisitor, Range, Object, Object, boolean)}
- * @param facesContext faces context
- * @param visitor {@link org.ajax4jsf.ajax.repeat.UIDataAdaptor.ComponentVisitor} instance
- * @param range {@link Range} to constraint the walk
- * @param key row key to treat as root of sub-model
- * @param argument implementation-specific argument
- * @throws IOException
- *
- * @see {@link #walk(FacesContext, DataVisitor, Range, TreeRowKey, Object, boolean)}
- */
- public abstract void walkModel(FacesContext facesContext, DataVisitor visitor, Range range, Object key, Object argument, boolean last) throws IOException;
-
- /**
- * Processes concrete tree node. Knows about {@link LastElementAware} interface and handles it
- * properly. Checks if argument is instance of {@link SubTreeChildrenAppender} and if it is so
- * does appending current element
- * @param context
- * @param dataVisitor
- * @param argument
- * @param treeRowKey
- * @param last
- * @throws IOException
- */
- protected void processElement(FacesContext context, DataVisitor dataVisitor, Object argument, TreeRowKey treeRowKey, boolean last) throws IOException {
- if (last && dataVisitor instanceof LastElementAware) {
- try {
- ((LastElementAware) dataVisitor).setLastElement();
- dataVisitor.process(context, treeRowKey, argument);
- } finally {
- ((LastElementAware) dataVisitor).resetLastElement();
- }
- } else {
- dataVisitor.process(context, treeRowKey, argument);
- }
- }
-
- /**
- * Get current tree node.
- * Note: valid only for classical TreeNode based tree data model implementation
- *
- * @return current tree node
- */
- public abstract TreeNode getTreeNode();
-
- /**
- * Get model node recursively with all sub nodes.
- * Note: valid only for classical TreeNode based tree data model implementation
- *
- * @return current tree node
- */
- public TreeNode getModelTreeNode() {
- return getTreeNode();
- }
-
- public abstract Object convertToKey(FacesContext context, String keyString,
- UIComponent component, Converter converter);
-
- /**
- * Get row key for certain tree node object
- *
- * @param node to get key for
- * @return node row key
- */
- public Object getTreeNodeRowKey(Object node) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Get node local id in it's parent childs collection
- *
- * @param childNode node to get identifier for
- * @return node local identifier
- */
- public Object getChildNodeId(Object childNode) {
- throw new UnsupportedOperationException();
- }
-
- public Object getParentRowKey(Object key) {
- return ((TreeRowKey) key).getParentKey();
- }
-
- public void addNode(Object parentRowKey, Object newNode, Object id) {
- throw new UnsupportedOperationException();
- }
-
- public void addNode(Object parentRowKey, TreeNode newNode, Object id) {
- throw new UnsupportedOperationException();
- }
-
- public void removeNode(Object rowKey) {
- throw new UnsupportedOperationException();
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,176 @@
+/**
+ * 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.model;
+
+import java.io.IOException;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+
+/**
+ * Base class for all tree data models
+ * @author Nick Belaevski - nbelaevski(a)exadel.com created 07.12.2006
+ */
+public abstract class AbstractTreeDataModel extends ExtendedDataModel {
+ public final static char SEPARATOR = NamingContainer.SEPARATOR_CHAR;
+
+ public final int getRowCount() {
+ return -1;
+ }
+
+ public final int getRowIndex() {
+ return -1;
+ }
+
+ public final void setRowIndex(int rowIndex) {
+ if(rowIndex!=-1) {
+ throw new IllegalArgumentException("In AbstractTreeDataModel rowIndex must be -1.");
+ }
+ }
+
+ public final void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object argument) throws IOException {
+ walk(context, dataVisitor, range, null, argument, false);
+ }
+
+ /**
+ * walk sub-model having row key argument as its root
+ * @param context faces context
+ * @param dataVisitor {@link org.ajax4jsf.ajax.repeat.UIDataAdaptor.ComponentVisitor}
+ * @param range {@link TreeRange} to constraint the walk
+ * @param rowKey row key to treat as root of sub-model
+ * @param argument implementation specific argument
+ * @param last boolean flag indicating whether we started our walk from last element
+ * @throws IOException
+ *
+ * @see {@link ExtendedDataModel#walk(FacesContext, DataVisitor, Range, Object)}
+ */
+ public abstract void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last) throws IOException;
+
+ /**
+ * returns whether this node is leaf
+ * @return
+ */
+ public abstract boolean isLeaf();
+
+ /**
+ * Walk backing sub-model having row key argument as its root. If there is no backing model
+ * configured, calling this method is equivalent to calling {@link #walk(FacesContext, DataVisitor, Range, Object, Object, boolean)}
+ * @param facesContext faces context
+ * @param visitor {@link org.ajax4jsf.ajax.repeat.UIDataAdaptor.ComponentVisitor} instance
+ * @param range {@link Range} to constraint the walk
+ * @param key row key to treat as root of sub-model
+ * @param argument implementation-specific argument
+ * @throws IOException
+ *
+ * @see {@link #walk(FacesContext, DataVisitor, Range, TreeRowKey, Object, boolean)}
+ */
+ public abstract void walkModel(FacesContext facesContext, DataVisitor visitor, Range range, Object key, Object argument, boolean last) throws IOException;
+
+ /**
+ * Processes concrete tree node. Knows about {@link LastElementAware} interface and handles it
+ * properly. Checks if argument is instance of {@link SubTreeChildrenAppender} and if it is so
+ * does appending current element
+ * @param context
+ * @param dataVisitor
+ * @param argument
+ * @param treeRowKey
+ * @param last
+ * @throws IOException
+ */
+ protected void processElement(FacesContext context, DataVisitor dataVisitor, Object argument, TreeRowKey treeRowKey, boolean last) throws IOException {
+ if (last && dataVisitor instanceof LastElementAware) {
+ try {
+ ((LastElementAware) dataVisitor).setLastElement();
+ dataVisitor.process(context, treeRowKey, argument);
+ } finally {
+ ((LastElementAware) dataVisitor).resetLastElement();
+ }
+ } else {
+ dataVisitor.process(context, treeRowKey, argument);
+ }
+ }
+
+ /**
+ * Get current tree node.
+ * Note: valid only for classical TreeNode based tree data model implementation
+ *
+ * @return current tree node
+ */
+ public abstract TreeNode getTreeNode();
+
+ /**
+ * Get model node recursively with all sub nodes.
+ * Note: valid only for classical TreeNode based tree data model implementation
+ *
+ * @return current tree node
+ */
+ public TreeNode getModelTreeNode() {
+ return getTreeNode();
+ }
+
+ public abstract Object convertToKey(FacesContext context, String keyString,
+ UIComponent component, Converter converter);
+
+ /**
+ * Get row key for certain tree node object
+ *
+ * @param node to get key for
+ * @return node row key
+ */
+ public Object getTreeNodeRowKey(Object node) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Get node local id in it's parent childs collection
+ *
+ * @param childNode node to get identifier for
+ * @return node local identifier
+ */
+ public Object getChildNodeId(Object childNode) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object getParentRowKey(Object key) {
+ return ((TreeRowKey) key).getParentKey();
+ }
+
+ public void addNode(Object parentRowKey, Object newNode, Object id) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addNode(Object parentRowKey, TreeNode newNode, Object id) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeNode(Object rowKey) {
+ throw new UnsupportedOperationException();
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,43 +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.model;
-
-/**
- * This class provides the solution for "false leaves" issue of cacheable trees
- *
- * @author Nick Belaevski
- * @since 3.3.1
- */
-
-public class CacheableSwingTreeNodeImpl extends SwingTreeNodeImpl {
-
- private boolean notLeaf = false;
-
- @Override
- public boolean isLeaf() {
- return !this.notLeaf && super.isLeaf();
- }
-
- public void setNotLeaf(boolean notLeaf) {
- this.notLeaf = notLeaf;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,43 @@
+/**
+ * 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.model;
+
+/**
+ * This class provides the solution for "false leaves" issue of cacheable trees
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+public class CacheableSwingTreeNodeImpl extends SwingTreeNodeImpl {
+
+ private boolean notLeaf = false;
+
+ @Override
+ public boolean isLeaf() {
+ return !this.notLeaf && super.isLeaf();
+ }
+
+ public void setNotLeaf(boolean notLeaf) {
+ this.notLeaf = notLeaf;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,226 +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.model;
-
-import java.io.IOException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.Range;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Extension of {@link TreeDataModel} supporting lazy data fetching for caching
- *
- * created 08.01.2007
- *
- * @author Nick - mailto:nbelaevski@exadel.com
- */
-public abstract class CacheableTreeDataModel<T> extends TreeDataModel<T> {
-
- private Log log = LogFactory.getLog(CacheableTreeDataModel.class);
-
- private final class CacheFillingVisitor implements DataVisitor {
-
- private CacheFillingVisitor() {
- }
-
- public void process(FacesContext context, Object rowKey, Object argument)
- throws IOException {
- TreeRowKey treeRowKey = (TreeRowKey) rowKey;
- treeDataModel.setRowKey(treeRowKey);
- setDefaultNodeData(locateTreeNode(treeRowKey, true), treeDataModel.getRowData());
- }
-
- }
-
- private final static DataVisitor NULL_VISITOR = new DataVisitor() {
-
- public void process(FacesContext context, Object rowKey, Object argument) throws IOException {
- //do nothing
- }
-
- };
-
- private TreeDataModel<T> treeDataModel;
-
- public boolean isLeaf() {
- TreeRowKey rowKey = (TreeRowKey) getRowKey();
- T treeNode = locateTreeNode(rowKey);
- if (treeNode != null && !nodeAdaptor.isLeaf(treeNode)) {
- return false;
- }
-
- treeNode = treeDataModel.locateTreeNode(rowKey);
- if (treeNode != null) {
- return nodeAdaptor.isLeaf(treeNode);
- }
-
- return false;
- }
-
- public CacheableTreeDataModel(TreeDataModel<T> model, MissingNodeHandler<T> missingNodeHandler) {
- super(model.getClazz(), model.getNodeAdaptor(), missingNodeHandler);
- setWrappedData(missingNodeHandler.handleMissingNode(null, null));
- setTreeDataModel(model);
- }
-
- public void walkModel(FacesContext context, DataVisitor visitor,
- Range range, Object key, Object argument, boolean last)
- throws IOException {
- treeDataModel.walkModel(context, visitor, range, key,
- argument, last);
- }
-
- public void setTreeDataModel(TreeDataModel<T> treeDataModel) {
- this.treeDataModel = treeDataModel;
- }
-
- public TreeDataModel<T> getTreeDataModel() {
- return treeDataModel;
- }
-
- public void walk(FacesContext context, final DataVisitor dataVisitor,
- Range range, Object rowKey, Object argument, boolean last)
- throws IOException {
-
- T cachedTreeNode = locateTreeNode((TreeRowKey) rowKey);
- T treeNode = treeDataModel.locateTreeNode((TreeRowKey) rowKey);
-
- if (treeNode != null) {
- if (cachedTreeNode == null || (nodeAdaptor.isLeaf(cachedTreeNode) && !nodeAdaptor.isLeaf(treeNode))) {
- //fill cache
- treeDataModel.walk(context, new CacheFillingVisitor(), range,
- rowKey, argument, last);
- }
-
- super.walk(context, dataVisitor, range, rowKey, argument, last);
- }
- }
-
- public void setTransient(boolean newTransientValue) {
- if (!newTransientValue) {
- throw new IllegalArgumentException(
- "ReplaceableTreeDataModel shouldn't be transient!");
- }
- }
-
- protected abstract void setDefaultNodeData(T node, Object data);
-
- @Override
- public Object convertToKey(FacesContext context, String keyString, UIComponent component, Converter converter) {
- Object convertedKey = treeDataModel.convertToKey(context, keyString, component, converter);
-
- if (convertedKey != null) {
- final TreeRowKey treeRowKey = (TreeRowKey) convertedKey;
- try {
- walk(context, NULL_VISITOR, new TreeRange() {
-
- public boolean processChildren(TreeRowKey rowKey) {
- return rowKey == null || rowKey.isSubKey(treeRowKey);
- }
-
- public boolean processNode(TreeRowKey rowKey) {
- return this.processChildren(rowKey) || rowKey.equals(treeRowKey);
- }
-
- }, null);
- } catch (IOException e) {
- context.getExternalContext().log(e.getLocalizedMessage(), e);
-
- return null;
- }
- }
-
- return convertedKey;
- }
-
- @Override
- public T locateTreeNode(TreeRowKey rowKey) {
- return locateTreeNode(rowKey, true);
- }
-
- @Override
- public void addNode(Object parentRowKey, TreeNode newNode, Object id) {
- super.addNode(parentRowKey, newNode, id);
-
- if (treeDataModel != null) {
- Object savedRowKey = treeDataModel.getRowKey();
-
- try {
- treeDataModel.setRowKey(getRowKey());
- treeDataModel.addNode(parentRowKey, newNode, id);
- } finally {
- try {
- treeDataModel.setRowKey(savedRowKey);
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
- }
- }
- }
-
- @Override
- public void removeNode(Object rowKey) {
- super.removeNode(rowKey);
-
- if (treeDataModel != null) {
- Object savedRowKey = treeDataModel.getRowKey();
-
- try {
- treeDataModel.setRowKey(getRowKey());
- treeDataModel.removeNode(rowKey);
- } finally {
- try {
- treeDataModel.setRowKey(savedRowKey);
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
- }
- }
- }
-
- @Override
- public TreeNode getModelTreeNode() {
- TreeNode node = null;
- if (treeDataModel != null) {
- Object savedRowKey = treeDataModel.getRowKey();
-
- try {
- treeDataModel.setRowKey(getRowKey());
- node = treeDataModel.getModelTreeNode();
- } finally {
- try {
- treeDataModel.setRowKey(savedRowKey);
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
- }
- }
-
- return node;
- }
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,226 @@
+/**
+ * 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.model;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.Range;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Extension of {@link TreeDataModel} supporting lazy data fetching for caching
+ *
+ * created 08.01.2007
+ *
+ * @author Nick - mailto:nbelaevski@exadel.com
+ */
+public abstract class CacheableTreeDataModel<T> extends TreeDataModel<T> {
+
+ private Log log = LogFactory.getLog(CacheableTreeDataModel.class);
+
+ private final class CacheFillingVisitor implements DataVisitor {
+
+ private CacheFillingVisitor() {
+ }
+
+ public void process(FacesContext context, Object rowKey, Object argument)
+ throws IOException {
+ TreeRowKey treeRowKey = (TreeRowKey) rowKey;
+ treeDataModel.setRowKey(treeRowKey);
+ setDefaultNodeData(locateTreeNode(treeRowKey, true), treeDataModel.getRowData());
+ }
+
+ }
+
+ private final static DataVisitor NULL_VISITOR = new DataVisitor() {
+
+ public void process(FacesContext context, Object rowKey, Object argument) throws IOException {
+ //do nothing
+ }
+
+ };
+
+ private TreeDataModel<T> treeDataModel;
+
+ public boolean isLeaf() {
+ TreeRowKey rowKey = (TreeRowKey) getRowKey();
+ T treeNode = locateTreeNode(rowKey);
+ if (treeNode != null && !nodeAdaptor.isLeaf(treeNode)) {
+ return false;
+ }
+
+ treeNode = treeDataModel.locateTreeNode(rowKey);
+ if (treeNode != null) {
+ return nodeAdaptor.isLeaf(treeNode);
+ }
+
+ return false;
+ }
+
+ public CacheableTreeDataModel(TreeDataModel<T> model, MissingNodeHandler<T> missingNodeHandler) {
+ super(model.getClazz(), model.getNodeAdaptor(), missingNodeHandler);
+ setWrappedData(missingNodeHandler.handleMissingNode(null, null));
+ setTreeDataModel(model);
+ }
+
+ public void walkModel(FacesContext context, DataVisitor visitor,
+ Range range, Object key, Object argument, boolean last)
+ throws IOException {
+ treeDataModel.walkModel(context, visitor, range, key,
+ argument, last);
+ }
+
+ public void setTreeDataModel(TreeDataModel<T> treeDataModel) {
+ this.treeDataModel = treeDataModel;
+ }
+
+ public TreeDataModel<T> getTreeDataModel() {
+ return treeDataModel;
+ }
+
+ public void walk(FacesContext context, final DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last)
+ throws IOException {
+
+ T cachedTreeNode = locateTreeNode((TreeRowKey) rowKey);
+ T treeNode = treeDataModel.locateTreeNode((TreeRowKey) rowKey);
+
+ if (treeNode != null) {
+ if (cachedTreeNode == null || (nodeAdaptor.isLeaf(cachedTreeNode) && !nodeAdaptor.isLeaf(treeNode))) {
+ //fill cache
+ treeDataModel.walk(context, new CacheFillingVisitor(), range,
+ rowKey, argument, last);
+ }
+
+ super.walk(context, dataVisitor, range, rowKey, argument, last);
+ }
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ if (!newTransientValue) {
+ throw new IllegalArgumentException(
+ "ReplaceableTreeDataModel shouldn't be transient!");
+ }
+ }
+
+ protected abstract void setDefaultNodeData(T node, Object data);
+
+ @Override
+ public Object convertToKey(FacesContext context, String keyString, UIComponent component, Converter converter) {
+ Object convertedKey = treeDataModel.convertToKey(context, keyString, component, converter);
+
+ if (convertedKey != null) {
+ final TreeRowKey treeRowKey = (TreeRowKey) convertedKey;
+ try {
+ walk(context, NULL_VISITOR, new TreeRange() {
+
+ public boolean processChildren(TreeRowKey rowKey) {
+ return rowKey == null || rowKey.isSubKey(treeRowKey);
+ }
+
+ public boolean processNode(TreeRowKey rowKey) {
+ return this.processChildren(rowKey) || rowKey.equals(treeRowKey);
+ }
+
+ }, null);
+ } catch (IOException e) {
+ context.getExternalContext().log(e.getLocalizedMessage(), e);
+
+ return null;
+ }
+ }
+
+ return convertedKey;
+ }
+
+ @Override
+ public T locateTreeNode(TreeRowKey rowKey) {
+ return locateTreeNode(rowKey, true);
+ }
+
+ @Override
+ public void addNode(Object parentRowKey, TreeNode newNode, Object id) {
+ super.addNode(parentRowKey, newNode, id);
+
+ if (treeDataModel != null) {
+ Object savedRowKey = treeDataModel.getRowKey();
+
+ try {
+ treeDataModel.setRowKey(getRowKey());
+ treeDataModel.addNode(parentRowKey, newNode, id);
+ } finally {
+ try {
+ treeDataModel.setRowKey(savedRowKey);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void removeNode(Object rowKey) {
+ super.removeNode(rowKey);
+
+ if (treeDataModel != null) {
+ Object savedRowKey = treeDataModel.getRowKey();
+
+ try {
+ treeDataModel.setRowKey(getRowKey());
+ treeDataModel.removeNode(rowKey);
+ } finally {
+ try {
+ treeDataModel.setRowKey(savedRowKey);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ @Override
+ public TreeNode getModelTreeNode() {
+ TreeNode node = null;
+ if (treeDataModel != null) {
+ Object savedRowKey = treeDataModel.getRowKey();
+
+ try {
+ treeDataModel.setRowKey(getRowKey());
+ node = treeDataModel.getModelTreeNode();
+ } finally {
+ try {
+ treeDataModel.setRowKey(savedRowKey);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+ }
+
+ return node;
+ }
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,48 +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.model;
-
-/**
- * This class provides the solution for "false leaves" issue of cacheable trees
- *
- * @author Nick Belaevski
- * @since 3.3.1
- */
-
-public class CacheableTreeNodeImpl<T> extends TreeNodeImpl<T> {
-
- /**
- *
- */
- private static final long serialVersionUID = -5918388225735277820L;
-
- private boolean notLeaf = false;
-
- @Override
- public boolean isLeaf() {
- return !this.notLeaf && super.isLeaf();
- }
-
- public void setNotLeaf(boolean notLeaf) {
- this.notLeaf = notLeaf;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,48 @@
+/**
+ * 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.model;
+
+/**
+ * This class provides the solution for "false leaves" issue of cacheable trees
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+public class CacheableTreeNodeImpl<T> extends TreeNodeImpl<T> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5918388225735277820L;
+
+ private boolean notLeaf = false;
+
+ @Override
+ public boolean isLeaf() {
+ return !this.notLeaf && super.isLeaf();
+ }
+
+ public void setNotLeaf(boolean notLeaf) {
+ this.notLeaf = notLeaf;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,44 +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.model;
-
-import java.util.Date;
-/**
- * @author Alexej Kushunin
- * created 19.06.2007
- *
- */
-public interface CalendarDataModel {
-
- /**
- * @return array of CalendarDataModelItems for selected dates.
- * This method will be called every time when components will need next block of CalendarDataItems.
- * That may happens when calendar rendered, or when user navigate to next(previous) month or in any other case when calendar renders.
- * This method will be called in Ajax mode when Calendar renders new page.
- * */
- public CalendarDataModelItem[] getData(Date[] dateArray);
-
- /**
- * @return tool tip when it's used in "single" mode
- * This method used when tool tips are displayed in "single" mode
- * */
- public Object getToolTip(Date date);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,44 @@
+/**
+ * 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.model;
+
+import java.util.Date;
+/**
+ * @author Alexej Kushunin
+ * created 19.06.2007
+ *
+ */
+public interface CalendarDataModel {
+
+ /**
+ * @return array of CalendarDataModelItems for selected dates.
+ * This method will be called every time when components will need next block of CalendarDataItems.
+ * That may happens when calendar rendered, or when user navigate to next(previous) month or in any other case when calendar renders.
+ * This method will be called in Ajax mode when Calendar renders new page.
+ * */
+ public CalendarDataModelItem[] getData(Date[] dateArray);
+
+ /**
+ * @return tool tip when it's used in "single" mode
+ * This method used when tool tips are displayed in "single" mode
+ * */
+ public Object getToolTip(Date date);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,68 +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.model;
-
-
-
-/**
- * @author Alexej Kushunin
- * created 19.06.2007
- *
- */
-
-public interface CalendarDataModelItem {
-
- /**
- *@return true if date is �selectable� on calendar, default implementation return true
- **/
- public boolean isEnabled();
-
- /**
- * @return String that will be appended to style class for that date span.
- * For example it may be �relevant holyday� � that mean class will be like �rich-cal-day relevant holyday�.
- * Default implementation return empty string.
- * */
- public String getStyleClass();
-
- /**
- * @return any additional payload that must be JSON-serialazable object.
- * May be used in custom date representation on calendar (inside custom facet).*/
- public Object getData();
-
- /**
- * @return true if given date has an associated with it tooltip data.
- * Default implementation return false.*/
- public boolean hasToolTip();
-
- /**
- *@return tool tip data that will be used in �batch� tooltip loading mode.
- **/
- public Object getToolTip();
-
- /**
- *@return day of the month on which data must be shown.
- **/
- public int getDay();
-
-}
-
-
-
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,68 @@
+/**
+ * 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.model;
+
+
+
+/**
+ * @author Alexej Kushunin
+ * created 19.06.2007
+ *
+ */
+
+public interface CalendarDataModelItem {
+
+ /**
+ *@return true if date is �selectable� on calendar, default implementation return true
+ **/
+ public boolean isEnabled();
+
+ /**
+ * @return String that will be appended to style class for that date span.
+ * For example it may be �relevant holyday� � that mean class will be like �rich-cal-day relevant holyday�.
+ * Default implementation return empty string.
+ * */
+ public String getStyleClass();
+
+ /**
+ * @return any additional payload that must be JSON-serialazable object.
+ * May be used in custom date representation on calendar (inside custom facet).*/
+ public Object getData();
+
+ /**
+ * @return true if given date has an associated with it tooltip data.
+ * Default implementation return false.*/
+ public boolean hasToolTip();
+
+ /**
+ *@return tool tip data that will be used in �batch� tooltip loading mode.
+ **/
+ public Object getToolTip();
+
+ /**
+ *@return day of the month on which data must be shown.
+ **/
+ public int getDay();
+
+}
+
+
+
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,73 +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.model;
-
-/**
- * {@link CacheableTreeDataModel} implementation for classic {@link TreeNode} instances
- *
- * Created 01.11.2007
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class ClassicCacheableTreeDataModel extends CacheableTreeDataModel<TreeNode> {
-
- private static final MissingNodeHandler<TreeNode> missingNodeHandler = new MissingNodeHandler<TreeNode>() {
-
- public TreeNode handleMissingNode(TreeNode parentNode,
- Object pathSegment) {
-
- TreeNodeImpl childNode = new CacheableTreeNodeImpl();
-
- if (parentNode != null) {
- parentNode.addChild(pathSegment, childNode);
- }
-
- return childNode;
- }
-
- };
-
- public ClassicCacheableTreeDataModel(TreeDataModel<TreeNode> model) {
- super(model, missingNodeHandler);
- }
-
- @Override
- protected void setDefaultNodeData(TreeNode node, Object data) {
- if (node != null) {
- CacheableTreeNodeImpl cacheableTreeNode = (CacheableTreeNodeImpl) node;
- cacheableTreeNode.setData(data);
- cacheableTreeNode.setNotLeaf(!isLeaf());
- }
- }
-
- @Override
- public TreeNode getTreeNode() {
- if (isRowAvailable()) {
- return locateTreeNode((TreeRowKey) getRowKey());
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,73 @@
+/**
+ * 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.model;
+
+/**
+ * {@link CacheableTreeDataModel} implementation for classic {@link TreeNode} instances
+ *
+ * Created 01.11.2007
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class ClassicCacheableTreeDataModel extends CacheableTreeDataModel<TreeNode> {
+
+ private static final MissingNodeHandler<TreeNode> missingNodeHandler = new MissingNodeHandler<TreeNode>() {
+
+ public TreeNode handleMissingNode(TreeNode parentNode,
+ Object pathSegment) {
+
+ TreeNodeImpl childNode = new CacheableTreeNodeImpl();
+
+ if (parentNode != null) {
+ parentNode.addChild(pathSegment, childNode);
+ }
+
+ return childNode;
+ }
+
+ };
+
+ public ClassicCacheableTreeDataModel(TreeDataModel<TreeNode> model) {
+ super(model, missingNodeHandler);
+ }
+
+ @Override
+ protected void setDefaultNodeData(TreeNode node, Object data) {
+ if (node != null) {
+ CacheableTreeNodeImpl cacheableTreeNode = (CacheableTreeNodeImpl) node;
+ cacheableTreeNode.setData(data);
+ cacheableTreeNode.setNotLeaf(!isLeaf());
+ }
+ }
+
+ @Override
+ public TreeNode getTreeNode() {
+ if (isRowAvailable()) {
+ return locateTreeNode((TreeRowKey) getRowKey());
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,94 +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.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map.Entry;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-/**
- * {@link TreeDataModel} implementation for classic {@link TreeNode} instances
- *
- * Created 01.11.2007
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class ClassicTreeDataModel extends TreeDataModel<TreeNode> {
-
- public ClassicTreeDataModel() {
- super(TreeNode.class, TreeDataModelNodeAdaptor.classicTreeNodeAdaptor, null);
- }
-
- @Override
- public TreeNode getTreeNode() {
- if (isRowAvailable()) {
- return locateTreeNode((TreeRowKey) getRowKey());
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- @Override
- public Object convertToKey(FacesContext context, String keyString, UIComponent component, Converter converter) {
- //TODO optimize search for empty string
- String[] strings = ListRowKey.fromString(keyString);
- List<Object> list = new ArrayList<Object>(strings.length);
- TreeNode node = (TreeNode) getWrappedData();
-
- for (int i = 0; i < strings.length; i++) {
- String key = strings[i];
- TreeNode<?> child = node.getChild(key);
- if (child != null) {
- node = child;
- list.add(key);
- } else {
- boolean found = false;
- Iterator<Entry<Object, TreeNode>> children = node.getChildren();
-
- while (children.hasNext() && !found) {
- Entry<Object, TreeNode> entry = children.next();
- Object keyObject = entry.getKey();
- if (key.equals(keyObject.toString())) {
- node = entry.getValue();
- list.add(keyObject);
- found = true;
- }
- }
-
- if (!found) {
- return null;
- }
- }
- }
-
- return new ListRowKey<Object>(list);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,94 @@
+/**
+ * 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.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map.Entry;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * {@link TreeDataModel} implementation for classic {@link TreeNode} instances
+ *
+ * Created 01.11.2007
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class ClassicTreeDataModel extends TreeDataModel<TreeNode> {
+
+ public ClassicTreeDataModel() {
+ super(TreeNode.class, TreeDataModelNodeAdaptor.classicTreeNodeAdaptor, null);
+ }
+
+ @Override
+ public TreeNode getTreeNode() {
+ if (isRowAvailable()) {
+ return locateTreeNode((TreeRowKey) getRowKey());
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ @Override
+ public Object convertToKey(FacesContext context, String keyString, UIComponent component, Converter converter) {
+ //TODO optimize search for empty string
+ String[] strings = ListRowKey.fromString(keyString);
+ List<Object> list = new ArrayList<Object>(strings.length);
+ TreeNode node = (TreeNode) getWrappedData();
+
+ for (int i = 0; i < strings.length; i++) {
+ String key = strings[i];
+ TreeNode<?> child = node.getChild(key);
+ if (child != null) {
+ node = child;
+ list.add(key);
+ } else {
+ boolean found = false;
+ Iterator<Entry<Object, TreeNode>> children = node.getChildren();
+
+ while (children.hasNext() && !found) {
+ Entry<Object, TreeNode> entry = children.next();
+ Object keyObject = entry.getKey();
+ if (key.equals(keyObject.toString())) {
+ node = entry.getValue();
+ list.add(keyObject);
+ found = true;
+ }
+ }
+
+ if (!found) {
+ return null;
+ }
+ }
+ }
+
+ return new ListRowKey<Object>(list);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,36 +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.model;
-
-/**
- * Marks complex tree row keys containing several segments
- *
- * @author Nick Belaevski
- * @since 3.3.1
- */
-
-public interface ComplexTreeRowKey {
-
- public int getKeySegmentsCount();
-
- public Object getKeySegment(int i);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,36 @@
+/**
+ * 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.model;
+
+/**
+ * Marks complex tree row keys containing several segments
+ *
+ * @author Nick Belaevski
+ * @since 3.3.1
+ */
+
+public interface ComplexTreeRowKey {
+
+ public int getKeySegmentsCount();
+
+ public Object getKeySegment(int i);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,51 +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.model;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-/**
- * Models that can handle keys conversion should implement this interface
- *
- * For internal use only
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public interface ConvertableKeyModel {
-
- /**
- * Converts {@link String} to model object key
- *
- * @param context
- * @param key
- * @param component
- * @param converter
- * @return
- */
- public Object getKeyAsObject(FacesContext context, String key,
- UIComponent component, Converter converter);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,51 @@
+/**
+ * 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.model;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * Models that can handle keys conversion should implement this interface
+ *
+ * For internal use only
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public interface ConvertableKeyModel {
+
+ /**
+ * Converts {@link String} to model object key
+ *
+ * @param context
+ * @param key
+ * @param component
+ * @param converter
+ * @return
+ */
+ public Object getKeyAsObject(FacesContext context, String key,
+ UIComponent component, Converter converter);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,68 +0,0 @@
-/**
-* License Agreement.
-*
-* JBoss RichFaces - Ajax4jsf Component Library
-*
-* Copyright (C) 2008 CompuGROUP Holding AG
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License version 2.1 as published by the Free Software Foundation.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-*/
-package org.richfaces.model;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * DataProvider is an interface that defines methods for manage loading data.<br>
- * Usage:
- * <pre>
- * DataProvider<SomeDataType> dataProvider = new DataProvider<SomeDataType>();
- * </pre>
- * @author pawelgo
- *
- */
-public interface DataProvider<T> extends Serializable {
-
- /**
- * Get number of all rows.
- * @return number of rows.
- */
- public int getRowCount();
-
- /**
- * Loads elements from given range.
- * Starting from startRow, and up to but excluding endRow.
- * @param firstRow first row to load
- * @param endRow end row to load
- * @return element list
- */
- public List<T> getItemsByRange(int firstRow, int endRow);
-
- /**
- * Load single element by given key.
- * @param key element key to be loaded.
- * @return element or null, if not found
- */
- public T getItemByKey(Object key);
-
- /**
- * Get element key.
- * If key is not instance of Integer or org.richfaces.model.ScrollableTableDataModel.SimpleRowKey,
- * it is necessary to implement javax.faces.convert.Converter for key type.
- * @param item element, which key to be get
- * @return element key
- */
- public Object getKey(T item);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/DataProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,68 @@
+/**
+* License Agreement.
+*
+* JBoss RichFaces - Ajax4jsf Component Library
+*
+* Copyright (C) 2008 CompuGROUP Holding AG
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License version 2.1 as published by the Free Software Foundation.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+*/
+package org.richfaces.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * DataProvider is an interface that defines methods for manage loading data.<br>
+ * Usage:
+ * <pre>
+ * DataProvider<SomeDataType> dataProvider = new DataProvider<SomeDataType>();
+ * </pre>
+ * @author pawelgo
+ *
+ */
+public interface DataProvider<T> extends Serializable {
+
+ /**
+ * Get number of all rows.
+ * @return number of rows.
+ */
+ public int getRowCount();
+
+ /**
+ * Loads elements from given range.
+ * Starting from startRow, and up to but excluding endRow.
+ * @param firstRow first row to load
+ * @param endRow end row to load
+ * @return element list
+ */
+ public List<T> getItemsByRange(int firstRow, int endRow);
+
+ /**
+ * Load single element by given key.
+ * @param key element key to be loaded.
+ * @return element or null, if not found
+ */
+ public T getItemByKey(Object key);
+
+ /**
+ * Get element key.
+ * If key is not instance of Integer or org.richfaces.model.ScrollableTableDataModel.SimpleRowKey,
+ * it is necessary to implement javax.faces.convert.Converter for key type.
+ * @param item element, which key to be get
+ * @return element key
+ */
+ public Object getKey(T item);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,50 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import javax.el.Expression;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class ExtendedFilterField extends FilterField{
-
- /**
- *
- */
- private static final long serialVersionUID = 5443560922389498666L;
-
- private String filterValue;
-
- public ExtendedFilterField(Expression expression, String filterValue) {
- super(expression);
- this.filterValue = filterValue;
- }
-
- public ExtendedFilterField(Expression expression) {
- this(expression, "");
- }
-
- public String getFilterValue() {
- return filterValue;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ExtendedFilterField.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,50 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import javax.el.Expression;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class ExtendedFilterField extends FilterField{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5443560922389498666L;
+
+ private String filterValue;
+
+ public ExtendedFilterField(Expression expression, String filterValue) {
+ super(expression);
+ this.filterValue = filterValue;
+ }
+
+ public ExtendedFilterField(Expression expression) {
+ this(expression, "");
+ }
+
+ public String getFilterValue() {
+ return filterValue;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,75 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-import javax.el.Expression;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public abstract class Field implements Serializable{
-
- private static final long serialVersionUID = 7576046308828980778L;
-
- private Expression expression;
-
- public Field(Expression expression) {
- this.expression = expression;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Field other = (Field) obj;
- if (expression == null) {
- if (other.expression != null)
- return false;
- } else {
- return expression.equals(other.expression);
- }
- return true;
- }
-
- public Expression getExpression() {
- return expression;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((expression == null) ? 0 : expression.hashCode());
- return result;
- }
-
- public void setExpression(Expression expression) {
- this.expression = expression;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Field.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,75 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+import javax.el.Expression;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public abstract class Field implements Serializable{
+
+ private static final long serialVersionUID = 7576046308828980778L;
+
+ private Expression expression;
+
+ public Field(Expression expression) {
+ this.expression = expression;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Field other = (Field) obj;
+ if (expression == null) {
+ if (other.expression != null)
+ return false;
+ } else {
+ return expression.equals(other.expression);
+ }
+ return true;
+ }
+
+ public Expression getExpression() {
+ return expression;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((expression == null) ? 0 : expression.hashCode());
+ return result;
+ }
+
+ public void setExpression(Expression expression) {
+ this.expression = expression;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import javax.el.Expression;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public class FilterField extends Field{
-
- private static final long serialVersionUID = -5453359866996963829L;
-
- public FilterField(Expression expression) {
- super(expression);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/FilterField.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import javax.el.Expression;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class FilterField extends Field{
+
+ private static final long serialVersionUID = -5453359866996963829L;
+
+ public FilterField(Expression expression) {
+ super(expression);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,43 +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.model;
-
-/**
- * {@link org.ajax4jsf.ajax.repeat.UIDataAdaptor.ComponentVisitor} instances can implement this interface in order to
- * be notified of last element occurence at the current tree level. {@link #setLastElement()}
- * method is invoked before visiting last element and {@link #resetLastElement()} is called after
- * visiting last element.
- *
- * @author Konstantin Mishin
- */
-public interface LastElementAware {
-
- /**
- * The method is invoked to notify that last element occured
- */
- public void setLastElement();
- /**
- * The method is invoked to notify that we're done with last element
- */
- public void resetLastElement();
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LastElementAware.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,43 @@
+/**
+ * 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.model;
+
+/**
+ * {@link org.ajax4jsf.ajax.repeat.UIDataAdaptor.ComponentVisitor} instances can implement this interface in order to
+ * be notified of last element occurence at the current tree level. {@link #setLastElement()}
+ * method is invoked before visiting last element and {@link #resetLastElement()} is called after
+ * visiting last element.
+ *
+ * @author Konstantin Mishin
+ */
+public interface LastElementAware {
+
+ /**
+ * The method is invoked to notify that last element occured
+ */
+ public void setLastElement();
+ /**
+ * The method is invoked to notify that we're done with last element
+ */
+ public void resetLastElement();
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,265 +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.model;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.faces.component.NamingContainer;
-
-/**
- * Default {@link TreeRowKey} implementation based on {@link ArrayList}
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 17.11.2006
- */
-public class ListRowKey<T> extends TreeRowKey<T> {
-
- private ArrayList<T> path;
-
- /**
- *
- */
- private static final long serialVersionUID = 7718335783201397177L;
-
- public String toString() {
- return getPath();
- }
-
- /**
- * Default constructor
- */
- public ListRowKey() {
- super();
- this.path = new ArrayList<T>();
- }
-
- /**
- * Copy constructor
- * @param parentRowKey row key to clone
- */
-
- @SuppressWarnings("unchecked")
- public ListRowKey(ListRowKey<T> parentRowKey) {
- super();
- if (parentRowKey != null) {
- this.path = (ArrayList<T>) parentRowKey.path.clone();
- } else {
- this.path = new ArrayList<T>();
- }
- }
-
- /**
- * Appending constructor
- *
- * @param parentRowKey base row key
- * @param pathElement path segment to append to base row key
- */
- public ListRowKey(ListRowKey<T> parentRowKey, T pathElement) {
- this(parentRowKey);
- this.path.add(pathElement);
- }
-
- /**
- * Appending constructor
- * @param parentRowKey base row key
- * @param pathElement path segment to append to base row key
- */
- public ListRowKey(ListRowKey<T> parentRowKey, ListRowKey<T> childRowKey) {
- this(parentRowKey);
- this.path.addAll(childRowKey.path);
- }
-
- protected ListRowKey(ArrayList<T> list) {
- super();
-
- this.path = list;
- }
-
- /**
- * Path object constructor
- * @param path first path segment
- * @deprecated
- */
- public ListRowKey(T path) {
- super();
- this.path = new ArrayList<T>(1);
- this.path.add(path);
- }
-
- /**
- * List constructor
- * @param list List of strings to create corresponding row key from
- */
- public ListRowKey(List<T> list) {
- super();
-
- this.path = new ArrayList<T>(list);
- }
-
- public int depth() {
- return path.size();
- }
-
- public Iterator<T> iterator() {
- return path.iterator();
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((path == null) ? 0 : path.hashCode());
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final ListRowKey<?> other = (ListRowKey<?>) obj;
- if (path == null) {
- if (other.path != null)
- return false;
- } else if (!path.equals(other.path))
- return false;
- return true;
- }
-
- public Iterator<T> getSubPathIterator(int fromIndex) {
- return path.listIterator(fromIndex);
- }
-
- @Override
- public TreeRowKey<T> getSubKey(int fromIndex) {
- return new ListRowKey<T>(path.subList(fromIndex, path.size()));
- }
-
-
- @SuppressWarnings("unchecked")
- public boolean isSubKey(TreeRowKey<T> rowKey) {
- if (rowKey instanceof ListRowKey) {
- ListRowKey<T> listRowKey = (ListRowKey<T>) rowKey;
-
- return depth() == getCommonPathLength(listRowKey);
- } else {
- return super.isSubKey(rowKey);
- }
- }
-
- private void appendSegment(StringBuilder builder, String segment) {
- StringBuilder escapedSubPath = new StringBuilder();
- for (int i = 0; i < segment.length(); i++) {
- char ch = segment.charAt(i);
-
- //escape
- if (AbstractTreeDataModel.SEPARATOR == ch || ListRowKey.SEPARATOR_ESCAPE_CHAR == ch) {
- escapedSubPath.append(ListRowKey.SEPARATOR_ESCAPE_CHAR);
- }
-
- escapedSubPath.append(ch);
- }
-
- builder.append(escapedSubPath.toString());
- }
-
- public String getPath() {
- StringBuilder result = new StringBuilder();
- Iterator<T> iterator = path.iterator();
- boolean hasNext = iterator.hasNext();
-
- while (hasNext) {
- T segment = iterator.next();
-
- if (segment instanceof ComplexTreeRowKey) {
- ComplexTreeRowKey complexKey = (ComplexTreeRowKey) segment;
-
- int segmentsCount = complexKey.getKeySegmentsCount();
- for (int i = 0; i < segmentsCount; i++) {
- appendSegment(result, complexKey.getKeySegment(i).toString());
- if (i < segmentsCount - 1) {
- result.append(AbstractTreeDataModel.SEPARATOR);
- }
- }
-
- } else {
- appendSegment(result, segment.toString());
- }
-
- hasNext = iterator.hasNext();
-
- if (hasNext) {
- result.append(AbstractTreeDataModel.SEPARATOR);
- }
- }
-
- return result.toString();
- }
-
- public int getCommonPathLength(TreeRowKey<T> otherRowKey) {
- if (otherRowKey == null)
- return 0;
- Iterator<T> iterator = this.iterator();
- Iterator<T> otherIterator = otherRowKey.iterator();
- int length = 0;
- while (iterator.hasNext() && otherIterator.hasNext()
- && iterator.next().equals(otherIterator.next()))
- length++;
- return length;
- }
-
- public T get(int i) {
- return path.get(i);
- }
-
- private static final String SEPARATOR = "(?<!" + ListRowKey.SEPARATOR_ESCAPE_CHAR + ")\\"
- + NamingContainer.SEPARATOR_CHAR;
-
- public static String[] fromString(String keyString) {
- String[] split = keyString.split(SEPARATOR);
- for (int i = 0; i < split.length; i++) {
- //TODO exception if not escaped properly
- split[i] = split[i].replaceAll("_(:|_)", "$1");
- }
-
- return split;
- }
-
- public static void main(String[] args) {
- System.out.println(Arrays.toString(fromString("test_:abc:123:a__b")));
- }
-
- @Override
- public TreeRowKey<T> getParentKey() {
- int toIdx = path.size() - 1;
- TreeRowKey<T> result = null;
-
- if (toIdx >= 0) {
- result = new ListRowKey<T>(new ArrayList<T>(path.subList(0, toIdx)));
- }
-
- return result;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,265 @@
+/**
+ * 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.model;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.NamingContainer;
+
+/**
+ * Default {@link TreeRowKey} implementation based on {@link ArrayList}
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 17.11.2006
+ */
+public class ListRowKey<T> extends TreeRowKey<T> {
+
+ private ArrayList<T> path;
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7718335783201397177L;
+
+ public String toString() {
+ return getPath();
+ }
+
+ /**
+ * Default constructor
+ */
+ public ListRowKey() {
+ super();
+ this.path = new ArrayList<T>();
+ }
+
+ /**
+ * Copy constructor
+ * @param parentRowKey row key to clone
+ */
+
+ @SuppressWarnings("unchecked")
+ public ListRowKey(ListRowKey<T> parentRowKey) {
+ super();
+ if (parentRowKey != null) {
+ this.path = (ArrayList<T>) parentRowKey.path.clone();
+ } else {
+ this.path = new ArrayList<T>();
+ }
+ }
+
+ /**
+ * Appending constructor
+ *
+ * @param parentRowKey base row key
+ * @param pathElement path segment to append to base row key
+ */
+ public ListRowKey(ListRowKey<T> parentRowKey, T pathElement) {
+ this(parentRowKey);
+ this.path.add(pathElement);
+ }
+
+ /**
+ * Appending constructor
+ * @param parentRowKey base row key
+ * @param pathElement path segment to append to base row key
+ */
+ public ListRowKey(ListRowKey<T> parentRowKey, ListRowKey<T> childRowKey) {
+ this(parentRowKey);
+ this.path.addAll(childRowKey.path);
+ }
+
+ protected ListRowKey(ArrayList<T> list) {
+ super();
+
+ this.path = list;
+ }
+
+ /**
+ * Path object constructor
+ * @param path first path segment
+ * @deprecated
+ */
+ public ListRowKey(T path) {
+ super();
+ this.path = new ArrayList<T>(1);
+ this.path.add(path);
+ }
+
+ /**
+ * List constructor
+ * @param list List of strings to create corresponding row key from
+ */
+ public ListRowKey(List<T> list) {
+ super();
+
+ this.path = new ArrayList<T>(list);
+ }
+
+ public int depth() {
+ return path.size();
+ }
+
+ public Iterator<T> iterator() {
+ return path.iterator();
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final ListRowKey<?> other = (ListRowKey<?>) obj;
+ if (path == null) {
+ if (other.path != null)
+ return false;
+ } else if (!path.equals(other.path))
+ return false;
+ return true;
+ }
+
+ public Iterator<T> getSubPathIterator(int fromIndex) {
+ return path.listIterator(fromIndex);
+ }
+
+ @Override
+ public TreeRowKey<T> getSubKey(int fromIndex) {
+ return new ListRowKey<T>(path.subList(fromIndex, path.size()));
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public boolean isSubKey(TreeRowKey<T> rowKey) {
+ if (rowKey instanceof ListRowKey) {
+ ListRowKey<T> listRowKey = (ListRowKey<T>) rowKey;
+
+ return depth() == getCommonPathLength(listRowKey);
+ } else {
+ return super.isSubKey(rowKey);
+ }
+ }
+
+ private void appendSegment(StringBuilder builder, String segment) {
+ StringBuilder escapedSubPath = new StringBuilder();
+ for (int i = 0; i < segment.length(); i++) {
+ char ch = segment.charAt(i);
+
+ //escape
+ if (AbstractTreeDataModel.SEPARATOR == ch || ListRowKey.SEPARATOR_ESCAPE_CHAR == ch) {
+ escapedSubPath.append(ListRowKey.SEPARATOR_ESCAPE_CHAR);
+ }
+
+ escapedSubPath.append(ch);
+ }
+
+ builder.append(escapedSubPath.toString());
+ }
+
+ public String getPath() {
+ StringBuilder result = new StringBuilder();
+ Iterator<T> iterator = path.iterator();
+ boolean hasNext = iterator.hasNext();
+
+ while (hasNext) {
+ T segment = iterator.next();
+
+ if (segment instanceof ComplexTreeRowKey) {
+ ComplexTreeRowKey complexKey = (ComplexTreeRowKey) segment;
+
+ int segmentsCount = complexKey.getKeySegmentsCount();
+ for (int i = 0; i < segmentsCount; i++) {
+ appendSegment(result, complexKey.getKeySegment(i).toString());
+ if (i < segmentsCount - 1) {
+ result.append(AbstractTreeDataModel.SEPARATOR);
+ }
+ }
+
+ } else {
+ appendSegment(result, segment.toString());
+ }
+
+ hasNext = iterator.hasNext();
+
+ if (hasNext) {
+ result.append(AbstractTreeDataModel.SEPARATOR);
+ }
+ }
+
+ return result.toString();
+ }
+
+ public int getCommonPathLength(TreeRowKey<T> otherRowKey) {
+ if (otherRowKey == null)
+ return 0;
+ Iterator<T> iterator = this.iterator();
+ Iterator<T> otherIterator = otherRowKey.iterator();
+ int length = 0;
+ while (iterator.hasNext() && otherIterator.hasNext()
+ && iterator.next().equals(otherIterator.next()))
+ length++;
+ return length;
+ }
+
+ public T get(int i) {
+ return path.get(i);
+ }
+
+ private static final String SEPARATOR = "(?<!" + ListRowKey.SEPARATOR_ESCAPE_CHAR + ")\\"
+ + NamingContainer.SEPARATOR_CHAR;
+
+ public static String[] fromString(String keyString) {
+ String[] split = keyString.split(SEPARATOR);
+ for (int i = 0; i < split.length; i++) {
+ //TODO exception if not escaped properly
+ split[i] = split[i].replaceAll("_(:|_)", "$1");
+ }
+
+ return split;
+ }
+
+ public static void main(String[] args) {
+ System.out.println(Arrays.toString(fromString("test_:abc:123:a__b")));
+ }
+
+ @Override
+ public TreeRowKey<T> getParentKey() {
+ int toIdx = path.size() - 1;
+ TreeRowKey<T> result = null;
+
+ if (toIdx >= 0) {
+ result = new ListRowKey<T>(new ArrayList<T>(path.subList(0, toIdx)));
+ }
+
+ return result;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,168 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.DataModel;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.ajax4jsf.model.SequenceDataModel;
-
-/**
- * Dual map-based extended data model for model-translating components like list shuttle
- * @author Nick Belaevski
- *
- */
-public class ListShuttleDataModel extends ExtendedDataModel {
-
- private ListShuttleRowKey rowKey;
-
- private SequenceDataModel sourceModel;
- private SequenceDataModel targetModel;
-
- private Map<Object, Object> data;
-
- private Object wrappedData;
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
- */
- public Object getRowKey() {
- return rowKey;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.model.ExtendedDataModel#setRowKey(java.lang.Object)
- */
- public void setRowKey(Object key) {
- this.rowKey = (ListShuttleRowKey) key;
- }
-
- public void walk(final FacesContext context, final DataVisitor visitor, final Range range,
- final Object argument) throws IOException {
- if (data != null) {
- Iterator<Entry<Object, Object>> iterator = data.entrySet().iterator();
-
- while (iterator.hasNext()) {
- Entry<Object, Object> entry = iterator.next();
-
- visitor.process(context, entry.getKey(), argument);
- }
-
- } else {
- sourceModel.walk(context, new DataVisitor() {
-
- public void process(FacesContext context, Object rowKey,
- Object argument) throws IOException {
-
- ListShuttleRowKey key = new ListShuttleRowKey(rowKey, true);
- visitor.process(context, key, argument);
- }
- }, range, argument);
-
- targetModel.walk(context, new DataVisitor() {
-
- public void process(FacesContext context, Object rowKey,
- Object argument) throws IOException {
-
- ListShuttleRowKey key = new ListShuttleRowKey(rowKey, false);
- visitor.process(context, key, argument);
- }
-
- }, range, argument);
- }
- }
-
- public int getRowCount() {
- if (data != null) {
- return data.size();
- } else {
- return sourceModel.getRowCount() + targetModel.getRowCount();
- }
- }
-
- public Object getRowData() {
- if (data != null) {
- return data.get(rowKey);
- } else {
- if (this.rowKey != null) {
- if (this.rowKey.isSource()) {
- return sourceModel.getRowData();
- } else {
- return targetModel.getRowData();
- }
- } else {
- return null;
- }
- }
- }
-
- public int getRowIndex() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public Object getWrappedData() {
- return wrappedData;
- }
-
- public boolean isRowAvailable() {
- if (data != null) {
- return data.containsKey(rowKey);
- } else {
- if (rowKey != null) {
- if (rowKey.isSource()) {
- return sourceModel.isRowAvailable();
- } else {
- return targetModel.isRowAvailable();
- }
- } else {
- return false;
- }
- }
- }
-
- public void setRowIndex(int rowIndex) {
- // TODO Auto-generated method stub
-
- }
-
- public void setWrappedData(Object data) {
- this.rowKey = null;
- this.wrappedData = data;
-
- if (data instanceof Map) {
- this.data = (Map<Object, Object>) data;
- } else {
- DataModel[] models = (DataModel[]) data;
- this.sourceModel = new SequenceDataModel(models[0]);
- this.targetModel = new SequenceDataModel(models[1]);
- }
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,168 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceDataModel;
+
+/**
+ * Dual map-based extended data model for model-translating components like list shuttle
+ * @author Nick Belaevski
+ *
+ */
+public class ListShuttleDataModel extends ExtendedDataModel {
+
+ private ListShuttleRowKey rowKey;
+
+ private SequenceDataModel sourceModel;
+ private SequenceDataModel targetModel;
+
+ private Map<Object, Object> data;
+
+ private Object wrappedData;
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
+ */
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.model.ExtendedDataModel#setRowKey(java.lang.Object)
+ */
+ public void setRowKey(Object key) {
+ this.rowKey = (ListShuttleRowKey) key;
+ }
+
+ public void walk(final FacesContext context, final DataVisitor visitor, final Range range,
+ final Object argument) throws IOException {
+ if (data != null) {
+ Iterator<Entry<Object, Object>> iterator = data.entrySet().iterator();
+
+ while (iterator.hasNext()) {
+ Entry<Object, Object> entry = iterator.next();
+
+ visitor.process(context, entry.getKey(), argument);
+ }
+
+ } else {
+ sourceModel.walk(context, new DataVisitor() {
+
+ public void process(FacesContext context, Object rowKey,
+ Object argument) throws IOException {
+
+ ListShuttleRowKey key = new ListShuttleRowKey(rowKey, true);
+ visitor.process(context, key, argument);
+ }
+ }, range, argument);
+
+ targetModel.walk(context, new DataVisitor() {
+
+ public void process(FacesContext context, Object rowKey,
+ Object argument) throws IOException {
+
+ ListShuttleRowKey key = new ListShuttleRowKey(rowKey, false);
+ visitor.process(context, key, argument);
+ }
+
+ }, range, argument);
+ }
+ }
+
+ public int getRowCount() {
+ if (data != null) {
+ return data.size();
+ } else {
+ return sourceModel.getRowCount() + targetModel.getRowCount();
+ }
+ }
+
+ public Object getRowData() {
+ if (data != null) {
+ return data.get(rowKey);
+ } else {
+ if (this.rowKey != null) {
+ if (this.rowKey.isSource()) {
+ return sourceModel.getRowData();
+ } else {
+ return targetModel.getRowData();
+ }
+ } else {
+ return null;
+ }
+ }
+ }
+
+ public int getRowIndex() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public Object getWrappedData() {
+ return wrappedData;
+ }
+
+ public boolean isRowAvailable() {
+ if (data != null) {
+ return data.containsKey(rowKey);
+ } else {
+ if (rowKey != null) {
+ if (rowKey.isSource()) {
+ return sourceModel.isRowAvailable();
+ } else {
+ return targetModel.isRowAvailable();
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+
+ public void setRowIndex(int rowIndex) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setWrappedData(Object data) {
+ this.rowKey = null;
+ this.wrappedData = data;
+
+ if (data instanceof Map) {
+ this.data = (Map<Object, Object>) data;
+ } else {
+ DataModel[] models = (DataModel[]) data;
+ this.sourceModel = new SequenceDataModel(models[0]);
+ this.targetModel = new SequenceDataModel(models[1]);
+ }
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,99 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-/**
- * Special type of row key containing information on item origin and new placement
- *
- * @author Nick Belaevski
- *
- */
-public class ListShuttleRowKey implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 3308741255288495879L;
-
- private boolean source;
-
- private boolean facadeSource;
-
- private Object rowKey;
-
- public boolean isSource() {
- return source;
- }
-
- public boolean isFacadeSource() {
- return facadeSource;
- }
-
- public Object getRowKey() {
- return rowKey;
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((rowKey == null) ? 0 : rowKey.hashCode());
- result = prime * result + (source ? 1231 : 1237);
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ListShuttleRowKey other = (ListShuttleRowKey) obj;
- if (rowKey == null) {
- if (other.rowKey != null)
- return false;
- } else if (!rowKey.equals(other.rowKey))
- return false;
- if (source != other.source)
- return false;
- return true;
- }
-
- public String toString() {
- return (source ? "" : "t") + rowKey.toString();
- }
-
- public ListShuttleRowKey(Object rowKey, boolean source) {
- super();
- this.rowKey = rowKey;
- this.source = source;
- this.facadeSource = source;
- }
-
- public ListShuttleRowKey(Object rowKey, boolean source, boolean facadeSource) {
- super();
- this.rowKey = rowKey;
- this.source = source;
- this.facadeSource = facadeSource;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,99 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+/**
+ * Special type of row key containing information on item origin and new placement
+ *
+ * @author Nick Belaevski
+ *
+ */
+public class ListShuttleRowKey implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3308741255288495879L;
+
+ private boolean source;
+
+ private boolean facadeSource;
+
+ private Object rowKey;
+
+ public boolean isSource() {
+ return source;
+ }
+
+ public boolean isFacadeSource() {
+ return facadeSource;
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((rowKey == null) ? 0 : rowKey.hashCode());
+ result = prime * result + (source ? 1231 : 1237);
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ListShuttleRowKey other = (ListShuttleRowKey) obj;
+ if (rowKey == null) {
+ if (other.rowKey != null)
+ return false;
+ } else if (!rowKey.equals(other.rowKey))
+ return false;
+ if (source != other.source)
+ return false;
+ return true;
+ }
+
+ public String toString() {
+ return (source ? "" : "t") + rowKey.toString();
+ }
+
+ public ListShuttleRowKey(Object rowKey, boolean source) {
+ super();
+ this.rowKey = rowKey;
+ this.source = source;
+ this.facadeSource = source;
+ }
+
+ public ListShuttleRowKey(Object rowKey, boolean source, boolean facadeSource) {
+ super();
+ this.rowKey = rowKey;
+ this.source = source;
+ this.facadeSource = facadeSource;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,38 +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.model;
-
-import java.util.Locale;
-
-/**
- * Models that are based on locale-dependent operations should implement this interface
- *
- * @author Nick Belaevski
- * @since 3.3.0
- */
-
-public interface LocaleAware {
-
- public Locale getLocale();
-
- public void setLocale(Locale locale);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/LocaleAware.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,38 @@
+/**
+ * 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.model;
+
+import java.util.Locale;
+
+/**
+ * Models that are based on locale-dependent operations should implement this interface
+ *
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public interface LocaleAware {
+
+ public Locale getLocale();
+
+ public void setLocale(Locale locale);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,240 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski mailto:nbelaevski@exadel.com created 30.07.2007
- */
-public class MapDataModel extends ExtendedDataModel implements ConvertableKeyModel {
-
- private Map<Object, Object> map;
- private Object rowKey;
- private Object wrappedData;
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
- */
- public Object getRowKey() {
- return rowKey;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.model.ExtendedDataModel#setRowKey(java.lang.Object)
- */
-
- public void setRowKey(Object key) {
- this.rowKey = key;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext,
- * org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range,
- * java.lang.Object)
- */
-
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
- if (map != null) {
- for (Iterator<Object> iterator = map.keySet().iterator(); iterator.hasNext();) {
- Object key = (Object) iterator.next();
-
- visitor.process(context, key, argument);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#getRowCount()
- */
-
- public int getRowCount() {
- return map != null ? map.size() : 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#getRowData()
- */
-
- public Object getRowData() {
- return map != null ? map.get(rowKey) : null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#getRowIndex()
- */
-
- public int getRowIndex() {
- return 0;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#getWrappedData()
- */
- public Object getWrappedData() {
- return wrappedData;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#isRowAvailable()
- */
- public boolean isRowAvailable() {
- return map != null && map.containsKey(rowKey);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#setRowIndex(int)
- */
- public void setRowIndex(int rowIndex) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
- */
- public void setWrappedData(Object data) {
- this.wrappedData = data;
- if (data instanceof NamedNodeMap) {
- this.map = new AbstractMap<Object, Object>() {
-
- private Set<Entry<Object, Object>> entrySet = new AbstractSet<Entry<Object, Object>>() {
-
- public Iterator<Entry<Object, Object>> iterator() {
- return new Iterator<Entry<Object, Object>>() {
- private int index = 0;
-
- public boolean hasNext() {
- return index < ((NamedNodeMap) getWrappedData()).getLength();
- }
-
- public Entry<Object, Object> next() {
- final Node node = ((NamedNodeMap) getWrappedData()).item(index++);
- if (node == null) {
- throw new NoSuchElementException();
- } else {
- return new Map.Entry<Object, Object>() {
-
- public Object getKey() {
- return node.getNodeName();
- }
-
- public Object getValue() {
- return node;
- }
-
- public Object setValue(Object arg0) {
- throw new UnsupportedOperationException();
- }
-
- };
- }
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
-
- public int size() {
- return ((NamedNodeMap) getWrappedData()).getLength();
- }
-
- };
-
- public boolean containsKey(Object key) {
- return ((NamedNodeMap) getWrappedData()).getNamedItem((String) key) != null;
- }
-
- public Object get(Object key) {
- return ((NamedNodeMap) getWrappedData()).getNamedItem((String) key);
- }
-
- public Set<Entry<Object, Object>> entrySet() {
- return entrySet;
- }
-
- };
- } else if (data != null) {
- this.map = (Map<Object, Object>) data;
- } else {
- this.map = null;
- }
- }
-
- public Object getKeyAsObject(FacesContext context, String key, UIComponent component, Converter converter) {
- if (this.map != null) {
- if (this.map.containsKey(key)) {
- return key;
- } else {
- Set<Entry<Object,Object>> set = this.map.entrySet();
- for (Entry<Object, Object> entry : set) {
- Object keyObject = entry.getKey();
- if (key.equals(keyObject.toString())) {
- return keyObject;
- }
- }
- }
- }
-
- return null;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,240 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.util.AbstractMap;
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski mailto:nbelaevski@exadel.com created 30.07.2007
+ */
+public class MapDataModel extends ExtendedDataModel implements ConvertableKeyModel {
+
+ private Map<Object, Object> map;
+ private Object rowKey;
+ private Object wrappedData;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
+ */
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.model.ExtendedDataModel#setRowKey(java.lang.Object)
+ */
+
+ public void setRowKey(Object key) {
+ this.rowKey = key;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext,
+ * org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range,
+ * java.lang.Object)
+ */
+
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+ if (map != null) {
+ for (Iterator<Object> iterator = map.keySet().iterator(); iterator.hasNext();) {
+ Object key = (Object) iterator.next();
+
+ visitor.process(context, key, argument);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+
+ public int getRowCount() {
+ return map != null ? map.size() : 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#getRowData()
+ */
+
+ public Object getRowData() {
+ return map != null ? map.get(rowKey) : null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#getRowIndex()
+ */
+
+ public int getRowIndex() {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#getWrappedData()
+ */
+ public Object getWrappedData() {
+ return wrappedData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ return map != null && map.containsKey(rowKey);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#setRowIndex(int)
+ */
+ public void setRowIndex(int rowIndex) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object data) {
+ this.wrappedData = data;
+ if (data instanceof NamedNodeMap) {
+ this.map = new AbstractMap<Object, Object>() {
+
+ private Set<Entry<Object, Object>> entrySet = new AbstractSet<Entry<Object, Object>>() {
+
+ public Iterator<Entry<Object, Object>> iterator() {
+ return new Iterator<Entry<Object, Object>>() {
+ private int index = 0;
+
+ public boolean hasNext() {
+ return index < ((NamedNodeMap) getWrappedData()).getLength();
+ }
+
+ public Entry<Object, Object> next() {
+ final Node node = ((NamedNodeMap) getWrappedData()).item(index++);
+ if (node == null) {
+ throw new NoSuchElementException();
+ } else {
+ return new Map.Entry<Object, Object>() {
+
+ public Object getKey() {
+ return node.getNodeName();
+ }
+
+ public Object getValue() {
+ return node;
+ }
+
+ public Object setValue(Object arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ }
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
+
+ public int size() {
+ return ((NamedNodeMap) getWrappedData()).getLength();
+ }
+
+ };
+
+ public boolean containsKey(Object key) {
+ return ((NamedNodeMap) getWrappedData()).getNamedItem((String) key) != null;
+ }
+
+ public Object get(Object key) {
+ return ((NamedNodeMap) getWrappedData()).getNamedItem((String) key);
+ }
+
+ public Set<Entry<Object, Object>> entrySet() {
+ return entrySet;
+ }
+
+ };
+ } else if (data != null) {
+ this.map = (Map<Object, Object>) data;
+ } else {
+ this.map = null;
+ }
+ }
+
+ public Object getKeyAsObject(FacesContext context, String key, UIComponent component, Converter converter) {
+ if (this.map != null) {
+ if (this.map.containsKey(key)) {
+ return key;
+ } else {
+ Set<Entry<Object,Object>> set = this.map.entrySet();
+ for (Entry<Object, Object> entry : set) {
+ Object keyObject = entry.getKey();
+ if (key.equals(keyObject.toString())) {
+ return keyObject;
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,32 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.util.List;
-
-/**
- * @author Konstantin Mishin
- *
- */
-public interface Modifiable{
-
- void modify(List<FilterField> filterFields, List<SortField2> sortFields);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Modifiable.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,32 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.util.List;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public interface Modifiable{
+
+ void modify(List<FilterField> filterFields, List<SortField2> sortFields);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,31 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-/**
- *
- * @author Maksim Kaszynski
- *
- */
-public enum Ordering {
- ASCENDING,
- DESCENDING,
- UNSORTED
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/Ordering.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,31 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+/**
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+public enum Ordering {
+ ASCENDING,
+ DESCENDING,
+ UNSORTED
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,101 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-
-/**
- * Map-based extended data model for model-translating components like ordering list
- *
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 07.11.2007
- *
- */
-public class OrderingListDataModel extends ExtendedDataModel {
-
- private Map<Object, Object> data;
-
- private Object rowKey;
-
- public Object getRowKey() {
- return rowKey;
- }
-
- public void setRowKey(Object rowKey) {
- this.rowKey = rowKey;
- }
-
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
-
- Set<Entry<Object,Object>> entrySet = data.entrySet();
- Iterator<Entry<Object, Object>> iterator = entrySet.iterator();
-
- while (iterator.hasNext()) {
- Entry<Object, Object> entry = iterator.next();
-
- visitor.process(context, entry.getKey(), argument);
- }
- }
-
- public int getRowCount() {
- return data.size();
- }
-
- public Object getRowData() {
- return data.get(rowKey);
- }
-
- public int getRowIndex() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public Object getWrappedData() {
- return data;
- }
-
- public boolean isRowAvailable() {
- return data.containsKey(rowKey);
- }
-
- public void setRowIndex(int rowIndex) {
- // TODO Auto-generated method stub
-
- }
-
- public void setWrappedData(Object data) {
- this.rowKey = null;
- this.data = (Map<Object, Object>) data;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,101 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+
+/**
+ * Map-based extended data model for model-translating components like ordering list
+ *
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 07.11.2007
+ *
+ */
+public class OrderingListDataModel extends ExtendedDataModel {
+
+ private Map<Object, Object> data;
+
+ private Object rowKey;
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public void setRowKey(Object rowKey) {
+ this.rowKey = rowKey;
+ }
+
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ Set<Entry<Object,Object>> entrySet = data.entrySet();
+ Iterator<Entry<Object, Object>> iterator = entrySet.iterator();
+
+ while (iterator.hasNext()) {
+ Entry<Object, Object> entry = iterator.next();
+
+ visitor.process(context, entry.getKey(), argument);
+ }
+ }
+
+ public int getRowCount() {
+ return data.size();
+ }
+
+ public Object getRowData() {
+ return data.get(rowKey);
+ }
+
+ public int getRowIndex() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public Object getWrappedData() {
+ return data;
+ }
+
+ public boolean isRowAvailable() {
+ return data.containsKey(rowKey);
+ }
+
+ public void setRowIndex(int rowIndex) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setWrappedData(Object data) {
+ this.rowKey = null;
+ this.data = (Map<Object, Object>) data;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,267 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Base class for data models
- * Subclasses must implement {@link #loadData(int, int, SortOrder)}
- * For certain features (like selection and sorting) to work correctly together,
- * both {@link #getId(Object)} and {@link #getObjectById(Object)}
- * methods need to be overriden
- *
- * @author Maksim Kaszynski
- *
- */
-public abstract class ScrollableTableDataModel<T> extends ExtendedDataModel {
-
- /**
- * Simple implementation - index-based row key
- * @author Maksim Kaszynski
- *
- */
- public static class SimpleRowKey extends Number implements Serializable{
-
- private static final long serialVersionUID = 1L;
-
- public static final String PREFIX = "srk";
- private int i;
-
- public SimpleRowKey(int i) {
- super();
- this.i = i;
- }
-
- public int intValue() {
- return i;
- }
-
- public String toString() {
- return PREFIX + String.valueOf(i);
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + i;
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final SimpleRowKey other = (SimpleRowKey) obj;
- if (i != other.i)
- return false;
- return true;
- }
- @Override
- public double doubleValue() {
- return i;
- }
- @Override
- public float floatValue() {
- return i;
- }
- @Override
- public long longValue() {
- return i;
- }
-
- }
-
-
- private static final Log log = LogFactory.getLog(ScrollableTableDataModel.class);
-
- private Object rowKey;
-
- private Map<Object, T> mapping;
-
- protected SortOrder lastSortOrder;
-
-
- /**
- * Load range of data items from the source.
- * Starting from startRow, and up to but excluding endRow
- * @param startRow
- * @param endRow
- * @param sortOrder
- * @return list of ordered data
- */
- public abstract List<T> loadData(int startRow, int endRow, SortOrder sortOrder);
-
-
- /**
- * Load data range, and iterate over it
- */
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
-
- if (log.isTraceEnabled()) {
- log.trace("Starting walk");
- }
-
- ScrollableTableDataRange sequenceRange = (ScrollableTableDataRange) range;
-
- int startIndex = sequenceRange.getFirst();
- int last = sequenceRange.getLast();
-
- lastSortOrder = sequenceRange.getSortOrder();
-
- List<T> objects = loadData(startIndex, last, lastSortOrder);
-
- mapping = new HashMap<Object, T>();
-
- for (int i = 0; i < objects.size(); i++,startIndex++) {
- T data = objects.get(i);
- Object key = getId(data);
-
- if (key == null) {
- key = new SimpleRowKey(startIndex);
- }
-
- mapping.put(key, data);
-
- visitor.process(context, key, argument);
-
- }
-
- if (log.isTraceEnabled()) {
- log.trace("Ending walk");
- }
-
- }
-
-
- /**
- * This method is the reverse of {@link #getId(Object)}
- * If you override this method, you need to override {@link #getId(Object)} as well
- * @param id
- * @return
- */
- public T getObjectById(Object id) {
-
- if (id instanceof SimpleRowKey) {
- int i = ((SimpleRowKey) id).intValue();
-
- List<T> l = loadData(i, i + 1, lastSortOrder);
-
- return l.get(0);
-
- }
-
- return null;
- }
-
- /**
- * Implementations may override it to provide domain-specific searches
- * Id should be serializable
- * Default implementation returns <code>null</code> anyway
- * If you override this method, you need to override {@link #getObjectById(Object)} as well
- * @param o
- * @return
- */
- public Object getId(T o) {
- return null;
- }
-
-
- public Object getRowData() {
-
- if (mapping != null && mapping.containsKey(rowKey)) {
- return mapping.get(rowKey);
- } else {
- return loadAndMap(rowKey);
- }
-
- }
-
- /**
- * Row indexes navigation is no longer supported
- */
- public int getRowIndex() {
- return -1;
- }
-
- /**
- * Quite simple implementation - data will be cached, so the call will be cheap
- */
- public boolean isRowAvailable() {
- return getRowData() != null;
- }
-
- /**
- * Row indexes navigation is no longer supported
- */
- public void setRowIndex(int index) {
- //if(index != -1)
- //throw new UnsupportedOperationException("setRowIndex");
- //setRowKey(null);
- }
-
- public Object getRowKey() {
- return rowKey;
- }
-
- public void setRowKey(Object key) {
- rowKey = key;
- }
-
- private Object loadAndMap(Object id) {
-
- if (log.isTraceEnabled()) {
- log.trace("loadAndMap " + id);
- }
-
- T t = getObjectById(id);
- if (t != null) {
- if (mapping == null) {
- mapping = new HashMap<Object, T>();
- }
- mapping.put(id, t);
- }
- return t;
- }
- /*
- * FIXME: This method is most likely redundant
- public void setSortOrder(SortOrder sortOrder) {
- lastSortOrder = sortOrder;
- }
- */
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,267 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Base class for data models
+ * Subclasses must implement {@link #loadData(int, int, SortOrder)}
+ * For certain features (like selection and sorting) to work correctly together,
+ * both {@link #getId(Object)} and {@link #getObjectById(Object)}
+ * methods need to be overriden
+ *
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class ScrollableTableDataModel<T> extends ExtendedDataModel {
+
+ /**
+ * Simple implementation - index-based row key
+ * @author Maksim Kaszynski
+ *
+ */
+ public static class SimpleRowKey extends Number implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PREFIX = "srk";
+ private int i;
+
+ public SimpleRowKey(int i) {
+ super();
+ this.i = i;
+ }
+
+ public int intValue() {
+ return i;
+ }
+
+ public String toString() {
+ return PREFIX + String.valueOf(i);
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + i;
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SimpleRowKey other = (SimpleRowKey) obj;
+ if (i != other.i)
+ return false;
+ return true;
+ }
+ @Override
+ public double doubleValue() {
+ return i;
+ }
+ @Override
+ public float floatValue() {
+ return i;
+ }
+ @Override
+ public long longValue() {
+ return i;
+ }
+
+ }
+
+
+ private static final Log log = LogFactory.getLog(ScrollableTableDataModel.class);
+
+ private Object rowKey;
+
+ private Map<Object, T> mapping;
+
+ protected SortOrder lastSortOrder;
+
+
+ /**
+ * Load range of data items from the source.
+ * Starting from startRow, and up to but excluding endRow
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return list of ordered data
+ */
+ public abstract List<T> loadData(int startRow, int endRow, SortOrder sortOrder);
+
+
+ /**
+ * Load data range, and iterate over it
+ */
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ if (log.isTraceEnabled()) {
+ log.trace("Starting walk");
+ }
+
+ ScrollableTableDataRange sequenceRange = (ScrollableTableDataRange) range;
+
+ int startIndex = sequenceRange.getFirst();
+ int last = sequenceRange.getLast();
+
+ lastSortOrder = sequenceRange.getSortOrder();
+
+ List<T> objects = loadData(startIndex, last, lastSortOrder);
+
+ mapping = new HashMap<Object, T>();
+
+ for (int i = 0; i < objects.size(); i++,startIndex++) {
+ T data = objects.get(i);
+ Object key = getId(data);
+
+ if (key == null) {
+ key = new SimpleRowKey(startIndex);
+ }
+
+ mapping.put(key, data);
+
+ visitor.process(context, key, argument);
+
+ }
+
+ if (log.isTraceEnabled()) {
+ log.trace("Ending walk");
+ }
+
+ }
+
+
+ /**
+ * This method is the reverse of {@link #getId(Object)}
+ * If you override this method, you need to override {@link #getId(Object)} as well
+ * @param id
+ * @return
+ */
+ public T getObjectById(Object id) {
+
+ if (id instanceof SimpleRowKey) {
+ int i = ((SimpleRowKey) id).intValue();
+
+ List<T> l = loadData(i, i + 1, lastSortOrder);
+
+ return l.get(0);
+
+ }
+
+ return null;
+ }
+
+ /**
+ * Implementations may override it to provide domain-specific searches
+ * Id should be serializable
+ * Default implementation returns <code>null</code> anyway
+ * If you override this method, you need to override {@link #getObjectById(Object)} as well
+ * @param o
+ * @return
+ */
+ public Object getId(T o) {
+ return null;
+ }
+
+
+ public Object getRowData() {
+
+ if (mapping != null && mapping.containsKey(rowKey)) {
+ return mapping.get(rowKey);
+ } else {
+ return loadAndMap(rowKey);
+ }
+
+ }
+
+ /**
+ * Row indexes navigation is no longer supported
+ */
+ public int getRowIndex() {
+ return -1;
+ }
+
+ /**
+ * Quite simple implementation - data will be cached, so the call will be cheap
+ */
+ public boolean isRowAvailable() {
+ return getRowData() != null;
+ }
+
+ /**
+ * Row indexes navigation is no longer supported
+ */
+ public void setRowIndex(int index) {
+ //if(index != -1)
+ //throw new UnsupportedOperationException("setRowIndex");
+ //setRowKey(null);
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public void setRowKey(Object key) {
+ rowKey = key;
+ }
+
+ private Object loadAndMap(Object id) {
+
+ if (log.isTraceEnabled()) {
+ log.trace("loadAndMap " + id);
+ }
+
+ T t = getObjectById(id);
+ if (t != null) {
+ if (mapping == null) {
+ mapping = new HashMap<Object, T>();
+ }
+ mapping.put(id, t);
+ }
+ return t;
+ }
+ /*
+ * FIXME: This method is most likely redundant
+ public void setSortOrder(SortOrder sortOrder) {
+ lastSortOrder = sortOrder;
+ }
+ */
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,121 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/ScrollableTableDataRange.java,v $
- * $Revision: 1.7 $
- */
-
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.ajax4jsf.model.SequenceRange;
-
-/**
- * Iteration range for Scrollable Grid
- * @author Maksim Kaszynski
- * @modified by Anton Belevich
- */
-public class ScrollableTableDataRange extends SequenceRange implements Serializable{
-
- private static final long serialVersionUID = -6675002421400464892L;
-
- private SortOrder sortOrder;
-
- public ScrollableTableDataRange() {
- super();
- }
-
- public ScrollableTableDataRange(int first, int last, SortOrder sortOrder) {
- super(first, last > 0 ? last - first : -1);
- this.sortOrder = sortOrder;
- }
-
- /**
- * @return the bufferSize
- */
- public int getLast() {
- return getFirstRow() + getRows();
- }
- /**
- * @param bufferSize the bufferSize to set
- */
- public void setLast(int lastRow) {
- setRows(lastRow > 0 ? lastRow - getFirstRow() : -1);
- }
- /**
- * @return the first
- */
- public int getFirst() {
- return getFirstRow();
- }
- /**
- * @param first the first to set
- */
- public void setFirst(int first) {
- setFirstRow(first);
- }
-
- public SortOrder getSortOrder() {
- return sortOrder;
- }
-
- public void setSortOrder(SortOrder sortOrder) {
- this.sortOrder = sortOrder;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + getFirstRow();
- result = prime * result + getRows();
- result = prime * result
- + ((sortOrder == null) ? 0 : sortOrder.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;
- ScrollableTableDataRange other = (ScrollableTableDataRange) obj;
- if (getFirstRow() != other.getFirstRow())
- return false;
- if (getRows() != other.getRows())
- return false;
- if (sortOrder == null) {
- if (other.sortOrder != null)
- return false;
- } else if (!sortOrder.equals(other.sortOrder))
- return false;
- return true;
- }
-
- private void writeObject(java.io.ObjectOutputStream out)
- throws IOException {
-
- out.defaultWriteObject();
-
- out.writeInt(getFirstRow());
- out.writeInt(getRows());
- }
-
- private void readObject(java.io.ObjectInputStream in)
- throws IOException, ClassNotFoundException {
-
- in.defaultReadObject();
-
- setFirstRow(in.readInt());
- setRows(in.readInt());
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,121 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/ScrollableTableDataRange.java,v $
+ * $Revision: 1.7 $
+ */
+
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.ajax4jsf.model.SequenceRange;
+
+/**
+ * Iteration range for Scrollable Grid
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ */
+public class ScrollableTableDataRange extends SequenceRange implements Serializable{
+
+ private static final long serialVersionUID = -6675002421400464892L;
+
+ private SortOrder sortOrder;
+
+ public ScrollableTableDataRange() {
+ super();
+ }
+
+ public ScrollableTableDataRange(int first, int last, SortOrder sortOrder) {
+ super(first, last > 0 ? last - first : -1);
+ this.sortOrder = sortOrder;
+ }
+
+ /**
+ * @return the bufferSize
+ */
+ public int getLast() {
+ return getFirstRow() + getRows();
+ }
+ /**
+ * @param bufferSize the bufferSize to set
+ */
+ public void setLast(int lastRow) {
+ setRows(lastRow > 0 ? lastRow - getFirstRow() : -1);
+ }
+ /**
+ * @return the first
+ */
+ public int getFirst() {
+ return getFirstRow();
+ }
+ /**
+ * @param first the first to set
+ */
+ public void setFirst(int first) {
+ setFirstRow(first);
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + getFirstRow();
+ result = prime * result + getRows();
+ result = prime * result
+ + ((sortOrder == null) ? 0 : sortOrder.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;
+ ScrollableTableDataRange other = (ScrollableTableDataRange) obj;
+ if (getFirstRow() != other.getFirstRow())
+ return false;
+ if (getRows() != other.getRows())
+ return false;
+ if (sortOrder == null) {
+ if (other.sortOrder != null)
+ return false;
+ } else if (!sortOrder.equals(other.sortOrder))
+ return false;
+ return true;
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out)
+ throws IOException {
+
+ out.defaultWriteObject();
+
+ out.writeInt(getFirstRow());
+ out.writeInt(getRows());
+ }
+
+ private void readObject(java.io.ObjectInputStream in)
+ throws IOException, ClassNotFoundException {
+
+ in.defaultReadObject();
+
+ setFirstRow(in.readInt());
+ setRows(in.readInt());
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,36 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-/**
- *
- * @author Konstantin Mishin
- *
- */
-public enum SelectionMode {
- none,
- single,
- multi;
-
- public boolean isSelectionEnabled() {
- return !equals(none);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SelectionMode.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,36 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+/**
+ *
+ * @author Konstantin Mishin
+ *
+ */
+public enum SelectionMode {
+ none,
+ single,
+ multi;
+
+ public boolean isSelectionEnabled() {
+ return !equals(none);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,171 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.AbstractList;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.w3c.dom.NodeList;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 30.07.2007
- *
- */
-public class SequenceDataModel extends ExtendedDataModel implements ConvertableKeyModel {
-
- private Object wrappedData;
- private List list;
- private Integer key;
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
- */
- public Object getRowKey() {
- return key;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.model.ExtendedDataModel#setRowKey(java.lang.Object)
- */
- public void setRowKey(Object key) {
- this.key = (Integer) key;
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext, org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range, java.lang.Object)
- */
- public void walk(FacesContext context, DataVisitor visitor, Range range,
- Object argument) throws IOException {
-
- if (list != null) {
- int i = 0;
- for (Iterator iterator = list.iterator(); iterator.hasNext();) {
- iterator.next();
-
- visitor.process(context, new Integer(i), argument);
-
- i++;
- }
- }
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getRowCount()
- */
- public int getRowCount() {
- return list != null ? list.size() : 0;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getRowData()
- */
- public Object getRowData() {
- return (list != null && key != null) ? list.get(key.intValue()) : null;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getRowIndex()
- */
- public int getRowIndex() {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#getWrappedData()
- */
- public Object getWrappedData() {
- return wrappedData;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#isRowAvailable()
- */
- public boolean isRowAvailable() {
- return list != null && key != null && list.size() > key.intValue();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#setRowIndex(int)
- */
- public void setRowIndex(int rowIndex) {
- }
-
- /* (non-Javadoc)
- * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
- */
- public void setWrappedData(Object data) {
- this.wrappedData = data;
- if (data instanceof List) {
- this.list = (List) data;
- } else if (data instanceof Collection) {
- this.list = new ArrayList((Collection) data);
- //copying all collection content into new collection here should prevent us
- //from possible issues caused by iteration tricks. e.g.: returning custom iterator
- //caching current element and comparing indices inside get()
- //
- //possible concurrent collection modifications and multithreading will break the magic
- } else if (data instanceof NodeList) {
- this.list = new AbstractList() {
-
- public Object get(int index) {
- return ((NodeList) getWrappedData()).item(index);
- }
-
- public int size() {
- return ((NodeList) getWrappedData()).getLength();
- }
-
- };
- } else if (data instanceof Object[]) {
- this.list = Arrays.asList((Object[]) data);
- } else if (data != null) {
- this.list = Collections.singletonList(data);
- } else {
- this.list = null;
- }
- }
-
- public Object getKeyAsObject(FacesContext context, String keyString, UIComponent component, Converter converter) {
- int key = Integer.parseInt(keyString);
- if (key >= 0 && this.list != null && key < this.list.size()) {
- return key;
- } else {
- return null;
- }
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,171 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.w3c.dom.NodeList;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 30.07.2007
+ *
+ */
+public class SequenceDataModel extends ExtendedDataModel implements ConvertableKeyModel {
+
+ private Object wrappedData;
+ private List list;
+ private Integer key;
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
+ */
+ public Object getRowKey() {
+ return key;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.model.ExtendedDataModel#setRowKey(java.lang.Object)
+ */
+ public void setRowKey(Object key) {
+ this.key = (Integer) key;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.model.ExtendedDataModel#walk(javax.faces.context.FacesContext, org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range, java.lang.Object)
+ */
+ public void walk(FacesContext context, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ if (list != null) {
+ int i = 0;
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ iterator.next();
+
+ visitor.process(context, new Integer(i), argument);
+
+ i++;
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ public int getRowCount() {
+ return list != null ? list.size() : 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowData()
+ */
+ public Object getRowData() {
+ return (list != null && key != null) ? list.get(key.intValue()) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getRowIndex()
+ */
+ public int getRowIndex() {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#getWrappedData()
+ */
+ public Object getWrappedData() {
+ return wrappedData;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ return list != null && key != null && list.size() > key.intValue();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#setRowIndex(int)
+ */
+ public void setRowIndex(int rowIndex) {
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object data) {
+ this.wrappedData = data;
+ if (data instanceof List) {
+ this.list = (List) data;
+ } else if (data instanceof Collection) {
+ this.list = new ArrayList((Collection) data);
+ //copying all collection content into new collection here should prevent us
+ //from possible issues caused by iteration tricks. e.g.: returning custom iterator
+ //caching current element and comparing indices inside get()
+ //
+ //possible concurrent collection modifications and multithreading will break the magic
+ } else if (data instanceof NodeList) {
+ this.list = new AbstractList() {
+
+ public Object get(int index) {
+ return ((NodeList) getWrappedData()).item(index);
+ }
+
+ public int size() {
+ return ((NodeList) getWrappedData()).getLength();
+ }
+
+ };
+ } else if (data instanceof Object[]) {
+ this.list = Arrays.asList((Object[]) data);
+ } else if (data != null) {
+ this.list = Collections.singletonList(data);
+ } else {
+ this.list = null;
+ }
+ }
+
+ public Object getKeyAsObject(FacesContext context, String keyString, UIComponent component, Converter converter) {
+ int key = Integer.parseInt(keyString);
+ if (key >= 0 && this.list != null && key < this.list.size()) {
+ return key;
+ } else {
+ return null;
+ }
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,93 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-/**
- * Sort field is the piece of {@link SortOrder}
- * @author Maksim Kaszynski
- *
- */
-public class SortField implements Serializable{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private String name = null;
- private Boolean ascending = null;
-
-
-
- public SortField(String name, Boolean ascending) {
- super();
- this.name = name;
- this.ascending = ascending;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Boolean getAscending() {
- return ascending;
- }
-
- public void setAscending(Boolean ascending) {
- this.ascending = ascending;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((ascending == null) ? 0 : ascending.hashCode());
- result = prime * result + ((name == null) ? 0 : name.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;
- SortField other = (SortField) obj;
- if (ascending == null) {
- if (other.ascending != null)
- return false;
- } else if (!ascending.equals(other.ascending))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,93 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+/**
+ * Sort field is the piece of {@link SortOrder}
+ * @author Maksim Kaszynski
+ *
+ */
+public class SortField implements Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String name = null;
+ private Boolean ascending = null;
+
+
+
+ public SortField(String name, Boolean ascending) {
+ super();
+ this.name = name;
+ this.ascending = ascending;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Boolean getAscending() {
+ return ascending;
+ }
+
+ public void setAscending(Boolean ascending) {
+ this.ascending = ascending;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((ascending == null) ? 0 : ascending.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.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;
+ SortField other = (SortField) obj;
+ if (ascending == null) {
+ if (other.ascending != null)
+ return false;
+ } else if (!ascending.equals(other.ascending))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,78 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import javax.el.Expression;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortField2 extends Field{
-
- private static final long serialVersionUID = 4578290842517554179L;
-
- private Ordering ordering;
-
- public SortField2(Expression expression) {
- super(expression);
- }
-
- public SortField2(Expression expression, Ordering ordering) {
- super(expression);
- this.ordering = ordering;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result
- + ((ordering == null) ? 0 : ordering.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- SortField2 other = (SortField2) obj;
- if (ordering == null) {
- if (other.ordering != null)
- return false;
- } else if (!ordering.equals(other.ordering))
- return false;
- return true;
- }
-
- public Ordering getOrdering() {
- return ordering;
- }
-
- public void setOrdering(Ordering ordering) {
- this.ordering = ordering;
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortField2.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,78 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import javax.el.Expression;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SortField2 extends Field{
+
+ private static final long serialVersionUID = 4578290842517554179L;
+
+ private Ordering ordering;
+
+ public SortField2(Expression expression) {
+ super(expression);
+ }
+
+ public SortField2(Expression expression, Ordering ordering) {
+ super(expression);
+ this.ordering = ordering;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((ordering == null) ? 0 : ordering.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SortField2 other = (SortField2) obj;
+ if (ordering == null) {
+ if (other.ordering != null)
+ return false;
+ } else if (!ordering.equals(other.ordering))
+ return false;
+ return true;
+ }
+
+ public Ordering getOrdering() {
+ return ordering;
+ }
+
+ public void setOrdering(Ordering ordering) {
+ this.ordering = ordering;
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,91 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.Serializable;
-import java.util.Arrays;
-/**
- * Class representing grid sort order
- * Sort Order is the combination of {@link SortField}
- * Order of occurrence of sort fields must be maintained
- * to guarantee stable sorting
- * @author Maksim Kaszynski
- */
-public class SortOrder implements Serializable {
-
- private static final long serialVersionUID = 2423450561570551363L;
-
- private static int hashCode(Object[] array) {
- final int prime = 31;
- if (array == null)
- return 0;
- int result = 1;
- for (int index = 0; index < array.length; index++) {
- result = prime * result
- + (array[index] == null ? 0 : array[index].hashCode());
- }
- return result;
- }
-
- private SortField [] fields;
-
- public SortOrder() {
-
- }
-
- public SortOrder(SortField[] fields) {
- super();
- this.fields = fields;
- }
-
-
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final SortOrder other = (SortOrder) obj;
- if (!Arrays.equals(fields, other.fields))
- return false;
- return true;
- }
-
- public SortField[] getFields() {
- return fields;
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + SortOrder.hashCode(fields);
- return result;
- }
-
- public void setFields(SortField[] fields) {
- this.fields = fields;
- }
-
-
-
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SortOrder.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,91 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.Serializable;
+import java.util.Arrays;
+/**
+ * Class representing grid sort order
+ * Sort Order is the combination of {@link SortField}
+ * Order of occurrence of sort fields must be maintained
+ * to guarantee stable sorting
+ * @author Maksim Kaszynski
+ */
+public class SortOrder implements Serializable {
+
+ private static final long serialVersionUID = 2423450561570551363L;
+
+ private static int hashCode(Object[] array) {
+ final int prime = 31;
+ if (array == null)
+ return 0;
+ int result = 1;
+ for (int index = 0; index < array.length; index++) {
+ result = prime * result
+ + (array[index] == null ? 0 : array[index].hashCode());
+ }
+ return result;
+ }
+
+ private SortField [] fields;
+
+ public SortOrder() {
+
+ }
+
+ public SortOrder(SortField[] fields) {
+ super();
+ this.fields = fields;
+ }
+
+
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final SortOrder other = (SortOrder) obj;
+ if (!Arrays.equals(fields, other.fields))
+ return false;
+ return true;
+ }
+
+ public SortField[] getFields() {
+ return fields;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + SortOrder.hashCode(fields);
+ return result;
+ }
+
+ public void setFields(SortField[] fields) {
+ this.fields = fields;
+ }
+
+
+
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,615 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.collections.iterators.FilterIterator;
-import org.w3c.dom.NamedNodeMap;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
- *
- */
-public class StackingTreeModel extends AbstractTreeDataModel {
-
- //ctor arguments
- private String id;
- private String var;
- private StackingTreeModelDataProvider dataProvider;
-
- //structural elements
- private StackingTreeModel parent;
- private Map<String, StackingTreeModel> models = new LinkedHashMap<String, StackingTreeModel>();
-
- private Object rowKey;
-
- private class StackEntry {
- private Object modelKey;
- private Object varObject;
- private StackingTreeModel model;
- private Object rowData;
-
- public StackEntry(Object varObject, Object modelKey, Object rowData, StackingTreeModel model) {
- super();
- this.varObject = varObject;
- this.modelKey = modelKey;
- this.rowData = rowData;
- this.model = model;
- }
- }
-
-// private StackingTreeModel stackingTreeModel;
- private LinkedList<StackEntry> stackEntries = new LinkedList<StackEntry>();
-
- public ExtendedDataModel getDataModel() {
- Object data = dataProvider.getData();
- ExtendedDataModel dataModel;
- if (data instanceof Map || data instanceof NamedNodeMap) {
- dataModel = new MapDataModel();
- } else {
- dataModel = new SequenceDataModel();
- }
-
- dataModel.setWrappedData(data);
- return dataModel;
- }
-
- protected StackingTreeModel getCurrentModel() {
- if (this.rowKey == null) {
- return this;
- }
-
- if (isRowAvailable()) {
- return ((StackEntry) stackEntries.getLast()).model;
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- public boolean isEmpty() {
- //TODO optimize that
- return getDataModel().getRowCount() == 0;
- }
-
- private void leaveModel(Iterator<StackEntry> iterator, StackEntry currentEntry, FacesContext context) {
- if (iterator == null) {
- return ;
- }
-
- LinkedList<StackEntry> stack = new LinkedList<StackEntry>();
-
- StackingTreeModel lastModel = null;
- if (currentEntry != null) {
- iterator.remove();
- stack.addFirst(currentEntry);
- lastModel = currentEntry.model;
- }
-
- while (iterator.hasNext()) {
- StackEntry entry = (StackEntry) iterator.next();
- if (entry.model != lastModel) {
- //always true for non-recursive models
- lastModel = entry.model;
- stack.addFirst(entry);
- }
-
- iterator.remove();
- }
-
- for (Iterator<StackEntry> iterator2 = stack.iterator(); iterator2.hasNext();) {
- StackEntry stackEntry = (StackEntry) iterator2.next();
- stackEntry.model.setupVariable(stackEntry.varObject, context);
- }
- }
-
- protected StackingTreeModel doSetupKey(Iterator<StackingTreeModelKey> keyIterator, Iterator<StackEntry> entriesIterator, FacesContext context, Object modelKey) {
- if (modelKey != null) {
- if (!setupModel(modelKey, context)) {
- //no key is available
- leaveModel(getRoot().stackEntries.iterator(), null, context);
- return null;
- }
-
- //TODO what's here?
- }
-
- if (keyIterator != null && keyIterator.hasNext()) {
- StackingTreeModelKey key = keyIterator.next();
- StackingTreeModel stackingTreeModel = this.getInternalModelById(key.modelId);
- Iterator<StackEntry> nextEntriesIterator = null;
- Object nextModelKey = key.modelKey;
-
- if (entriesIterator != null && entriesIterator.hasNext()) {
- StackEntry entry = entriesIterator.next();
- if (!entry.model.equals(stackingTreeModel) || !entry.modelKey.equals(nextModelKey)) {
- leaveModel(entriesIterator, entry, context);
- } else {
- //continue iterating entries, they still lead us by key path
- nextEntriesIterator = entriesIterator;
- nextModelKey = null;
- }
- }
-
- //should not be called when nextEntriesIterator & nextModelKey are both valid
- return stackingTreeModel.doSetupKey(keyIterator, nextEntriesIterator, context, nextModelKey);
-
- } else {
- leaveModel(entriesIterator, null, context);
- return this;
- }
- }
-
- protected StackingTreeModel setupKey(Object key, FacesContext context) {
- if (key == this.rowKey) {
- if (stackEntries.isEmpty()) {
- return this;
- } else {
- return (stackEntries.getLast()).model;
- }
- } else {
- Iterator<StackingTreeModelKey> keyIterator = null;
- if (key != null) {
- keyIterator = ((ListRowKey<StackingTreeModelKey>) key).iterator();
- }
-
- StackingTreeModel model = doSetupKey(keyIterator, stackEntries.iterator(), context, null);
- this.rowKey = key;
-
- return model;
- }
- }
-
- public StackingTreeModel(String id, String var, StackingTreeModelDataProvider dataProvider) {
- super();
- this.id = id;
- this.var = var;
- this.dataProvider = dataProvider;
- }
-
- public StackingTreeModel() {
- this(null, null, null);
- }
-
- private Object setupVariable(Object variable, FacesContext context) {
- if (var != null) {
- Map<String, Object> map = context.getExternalContext().getRequestMap();
- return map.put(var, variable);
- }
-
- return null;
- }
-
- public boolean setupModel(Object key, FacesContext facesContext) {
- ExtendedDataModel dataModel = getDataModel();
- dataModel.setRowKey(key);
-
- if (dataModel.isRowAvailable()) {
- Object rowData = dataModel.getRowData();
- //System.out.println("StackingTreeModel.setupModel() " + rowData);
- Object varObject = setupVariable(rowData, facesContext);
-
- getRoot().stackEntries.add(new StackEntry(varObject, key, rowData, this));
-
- return true;
- }
-
- return false;
- }
-
- public void setParent(StackingTreeModel parent) {
- this.parent = parent;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.model.AbstractTreeDataModel#getTreeNode()
- */
- public TreeNode getTreeNode() {
- if (isRowAvailable()) {
- return null;
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.model.AbstractTreeDataModel#isLeaf()
- */
- public boolean isLeaf() {
- if (isRowAvailable()) {
- StackEntry lastEntry = (StackEntry) stackEntries.getLast();
- for (Iterator<StackingTreeModel> iterator = lastEntry.model.getInternalModelsIterator(); iterator.hasNext();) {
- StackingTreeModel stackingTreeModel = iterator.next();
-
- if (!stackingTreeModel.isEmpty()) {
- return false;
- }
- }
-
- return true;
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- protected StackingTreeModel getRoot() {
- if (parent != null) {
- return parent.getRoot();
- }
-
- return this;
- }
-
- protected void doWalk(FacesContext context, DataVisitor dataVisitor,
- Range range, ListRowKey argumentKey, Object argument,
- boolean last) throws IOException {
-
- TreeRange treeRange = (TreeRange) range;
-
- if (treeRange == null || treeRange.processNode(argumentKey)) {
- StackingTreeModel rootModel = getRoot();
-
- if (argumentKey != null) {
- processElement(context, dataVisitor, argument, argumentKey, last);
- }
-
- final ShiftingDataVisitor shiftingDataVisitor = new ShiftingDataVisitor(
- new Visitor1(dataVisitor));
-
- if (treeRange == null || treeRange.processChildren(argumentKey)) {
-
- Object savedRowKey = rootModel.getRowKey();
- //setup key in order for nested components to initialize data models
- rootModel.setRowKey(context, argumentKey);
- Iterator<StackingTreeModel> iterator = this.getInternalModelsIterator();
- rootModel.setRowKey(context, savedRowKey);
-
- while (iterator.hasNext()) {
- final StackingTreeModel model = iterator.next();
-
- savedRowKey = rootModel.getRowKey();
- rootModel.setRowKey(context, argumentKey);
- final ExtendedDataModel scalarModel = model.getDataModel();
- rootModel.setRowKey(context, savedRowKey);
-
- Argument argument2 = new Argument();
- argument2.listRowKey = argumentKey;
- argument2.argument = argument;
- // setup current model
- argument2.model = model;
- argument2.range = range;
-
- scalarModel.walk(context, new DataVisitor() {
-
- public void process(FacesContext context,
- Object rowKey, Object argument)
- throws IOException {
-
- Object key = scalarModel.getRowKey();
- scalarModel.setRowKey(rowKey);
- Object data = scalarModel.getRowData();
-
- Object variable = model.setupVariable(data, context);
- boolean activeData = model.isActiveData();
- model.setupVariable(variable, context);
- scalarModel.setRowKey(key);
-
- if (activeData) {
- shiftingDataVisitor.process(context, rowKey, argument);
- }
- }
-
- }, null, argument2);
-
- }
- }
-
- shiftingDataVisitor.end(context);
- }
- }
-
- private StackingTreeModel getInternalModelById(String id) {
- StackingTreeModel model = getModelById(id);
- if (model.isActive()) {
- return model;
- }
-
- throw new IllegalStateException();
- }
-
- public StackingTreeModel getModelById(String id) {
- return (StackingTreeModel) models.get(id);
- }
-
- private Iterator<StackingTreeModel> getInternalModelsIterator() {
- return new FilterIterator(getModelsIterator(), ACTIVE_MODEL_PREDICATE);
- }
-
- public Iterator<StackingTreeModel> getModelsIterator() {
- return models.values().iterator();
- }
-
- public void walk(FacesContext context, DataVisitor dataVisitor,
- Range range, Object rowKey, Object argument,
- boolean last) throws IOException {
- StackingTreeModel rootModel = getRoot();
-
- if (rowKey != null) {
- ListRowKey listRowKey = (ListRowKey) rowKey;
-
- StackingTreeModel treeModel = rootModel.setupKey(listRowKey, context);
-
- treeModel.doWalk(context, dataVisitor, range, listRowKey, argument,
- last);
-
- } else {
- doWalk(context, dataVisitor, range,
- (ListRowKey) rowKey, argument, last);
- }
- }
-
- private class Argument {
- private ListRowKey listRowKey;
- private StackingTreeModel model;
- private Range range;
- private Object argument;
- }
-
- private class Visitor1 implements DataVisitor, LastElementAware {
- private DataVisitor dataVisitor;
- private boolean theLast;
-
- public Visitor1(DataVisitor dataVisitor) {
- super();
- this.dataVisitor = dataVisitor;
- }
-
- public void process(FacesContext context, Object rowKey, Object argument)
- throws IOException {
-
- Argument a = (Argument) argument;
- ListRowKey listRowKey = new ListRowKey(a.listRowKey, new StackingTreeModelKey(
- a.model.id, rowKey));
- //System.out.println(".walk() " + (theLast ? " * " : "") + listRowKey);
-
- a.model.doWalk(context, dataVisitor, a.range, listRowKey, a.argument,
- theLast);
- }
-
- public void resetLastElement() {
- theLast = false;
- }
-
- public void setLastElement() {
- theLast = true;
- }
-
- }
-
- private static class ShiftingDataVisitor implements DataVisitor {
-
- private DataVisitor dataVisitor;
-
- public ShiftingDataVisitor(DataVisitor dataVisitor) {
- super();
- this.dataVisitor = dataVisitor;
- }
-
- private Object rowKey;
- private Object argument;
- private boolean shifted = false;
-
- public void process(FacesContext context, Object rowKey, Object argument)
- throws IOException {
-
- if (!shifted) {
- this.rowKey = rowKey;
- this.argument = argument;
- this.shifted = true;
- } else {
- dataVisitor.process(context, this.rowKey, this.argument);
- this.rowKey = rowKey;
- this.argument = argument;
- }
- }
-
- public void end(FacesContext context) throws IOException {
- if (shifted) {
- try {
- ((LastElementAware) dataVisitor).setLastElement();
- dataVisitor.process(context, this.rowKey, argument);
- } finally {
- ((LastElementAware) dataVisitor).resetLastElement();
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.model.AbstractTreeDataModel#walkModel(javax.faces.context.FacesContext,
- * org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range,
- * java.lang.Object, java.lang.Object, boolean)
- */
- public void walkModel(FacesContext facesContext, DataVisitor visitor,
- Range range, Object key, Object argument, boolean last)
- throws IOException {
-
- walk(facesContext, visitor, range, key, argument, last);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
- */
- public Object getRowKey() {
- return rowKey;
- }
-
- public void setRowKey(Object key) {
- setRowKey(FacesContext.getCurrentInstance(), key);
- }
-
- public void setRowKey(FacesContext context, Object key) {
- setupKey(key, context);
- }
-
- public void addStackingModel(StackingTreeModel model) {
- this.models.put(model.id, model);
- model.setParent(this);
- }
-
- public void removeStackingModel(StackingTreeModel model) {
- this.models.remove(model.id);
- model.setParent(null);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#getRowData()
- */
- public Object getRowData() {
- if (isRowAvailable()) {
- StackEntry lastEntry = (StackEntry) stackEntries.getLast();
- return lastEntry.rowData;
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.model.DataModel#isRowAvailable()
- */
- public boolean isRowAvailable() {
- return !stackEntries.isEmpty();
- }
-
- public StackingTreeModel getParent() {
- return parent;
- }
-
- protected boolean isActiveData() {
- return true;
- }
-
- protected boolean isActive() {
- return true;
- }
-
- private final static Predicate ACTIVE_MODEL_PREDICATE = new Predicate() {
-
- public boolean evaluate(Object object) {
- StackingTreeModel model = (StackingTreeModel) object;
- if (model == null) {
- return false;
- }
-
- return model.isActive();
- }
-
- };
-
- @Override
- public Object getWrappedData() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setWrappedData(Object data) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Object convertToKey(FacesContext context, String keyString,
- UIComponent component, Converter converter) {
-
- //force model leave
- setRowKey(context, null);
-
- String[] strings = ListRowKey.fromString(keyString);
- int l = strings.length / 2;
- List<Object> list = new ArrayList<Object>(l);
- StackingTreeModel model = getRoot();
-
- for (int i = 0; i < l; i++) {
- int idx = i*2;
-
- String modelId = strings[idx];
- model = model.getModelById(modelId);
- if (model.isActive()) {
- Object key = model.convert(context, strings[idx + 1], component, converter);
- if (key == null) {
- return null;
- }
-
- list.add(new StackingTreeModelKey(modelId, key));
-
- if (!model.setupModel(key, context) || !model.isActiveData()) {
- return null;
- }
- } else {
- return null;
- }
- }
-
- return new ListRowKey<Object>(list);
- }
-
- protected Object convert(FacesContext context, String string,
- UIComponent component, Converter converter) {
-
- ConvertableKeyModel convertable = (ConvertableKeyModel) getDataModel();
- return convertable.getKeyAsObject(context, string, component, converter);
- }
-
- public String getId() {
- return id;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,615 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections.iterators.FilterIterator;
+import org.w3c.dom.NamedNodeMap;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
+ *
+ */
+public class StackingTreeModel extends AbstractTreeDataModel {
+
+ //ctor arguments
+ private String id;
+ private String var;
+ private StackingTreeModelDataProvider dataProvider;
+
+ //structural elements
+ private StackingTreeModel parent;
+ private Map<String, StackingTreeModel> models = new LinkedHashMap<String, StackingTreeModel>();
+
+ private Object rowKey;
+
+ private class StackEntry {
+ private Object modelKey;
+ private Object varObject;
+ private StackingTreeModel model;
+ private Object rowData;
+
+ public StackEntry(Object varObject, Object modelKey, Object rowData, StackingTreeModel model) {
+ super();
+ this.varObject = varObject;
+ this.modelKey = modelKey;
+ this.rowData = rowData;
+ this.model = model;
+ }
+ }
+
+// private StackingTreeModel stackingTreeModel;
+ private LinkedList<StackEntry> stackEntries = new LinkedList<StackEntry>();
+
+ public ExtendedDataModel getDataModel() {
+ Object data = dataProvider.getData();
+ ExtendedDataModel dataModel;
+ if (data instanceof Map || data instanceof NamedNodeMap) {
+ dataModel = new MapDataModel();
+ } else {
+ dataModel = new SequenceDataModel();
+ }
+
+ dataModel.setWrappedData(data);
+ return dataModel;
+ }
+
+ protected StackingTreeModel getCurrentModel() {
+ if (this.rowKey == null) {
+ return this;
+ }
+
+ if (isRowAvailable()) {
+ return ((StackEntry) stackEntries.getLast()).model;
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ public boolean isEmpty() {
+ //TODO optimize that
+ return getDataModel().getRowCount() == 0;
+ }
+
+ private void leaveModel(Iterator<StackEntry> iterator, StackEntry currentEntry, FacesContext context) {
+ if (iterator == null) {
+ return ;
+ }
+
+ LinkedList<StackEntry> stack = new LinkedList<StackEntry>();
+
+ StackingTreeModel lastModel = null;
+ if (currentEntry != null) {
+ iterator.remove();
+ stack.addFirst(currentEntry);
+ lastModel = currentEntry.model;
+ }
+
+ while (iterator.hasNext()) {
+ StackEntry entry = (StackEntry) iterator.next();
+ if (entry.model != lastModel) {
+ //always true for non-recursive models
+ lastModel = entry.model;
+ stack.addFirst(entry);
+ }
+
+ iterator.remove();
+ }
+
+ for (Iterator<StackEntry> iterator2 = stack.iterator(); iterator2.hasNext();) {
+ StackEntry stackEntry = (StackEntry) iterator2.next();
+ stackEntry.model.setupVariable(stackEntry.varObject, context);
+ }
+ }
+
+ protected StackingTreeModel doSetupKey(Iterator<StackingTreeModelKey> keyIterator, Iterator<StackEntry> entriesIterator, FacesContext context, Object modelKey) {
+ if (modelKey != null) {
+ if (!setupModel(modelKey, context)) {
+ //no key is available
+ leaveModel(getRoot().stackEntries.iterator(), null, context);
+ return null;
+ }
+
+ //TODO what's here?
+ }
+
+ if (keyIterator != null && keyIterator.hasNext()) {
+ StackingTreeModelKey key = keyIterator.next();
+ StackingTreeModel stackingTreeModel = this.getInternalModelById(key.modelId);
+ Iterator<StackEntry> nextEntriesIterator = null;
+ Object nextModelKey = key.modelKey;
+
+ if (entriesIterator != null && entriesIterator.hasNext()) {
+ StackEntry entry = entriesIterator.next();
+ if (!entry.model.equals(stackingTreeModel) || !entry.modelKey.equals(nextModelKey)) {
+ leaveModel(entriesIterator, entry, context);
+ } else {
+ //continue iterating entries, they still lead us by key path
+ nextEntriesIterator = entriesIterator;
+ nextModelKey = null;
+ }
+ }
+
+ //should not be called when nextEntriesIterator & nextModelKey are both valid
+ return stackingTreeModel.doSetupKey(keyIterator, nextEntriesIterator, context, nextModelKey);
+
+ } else {
+ leaveModel(entriesIterator, null, context);
+ return this;
+ }
+ }
+
+ protected StackingTreeModel setupKey(Object key, FacesContext context) {
+ if (key == this.rowKey) {
+ if (stackEntries.isEmpty()) {
+ return this;
+ } else {
+ return (stackEntries.getLast()).model;
+ }
+ } else {
+ Iterator<StackingTreeModelKey> keyIterator = null;
+ if (key != null) {
+ keyIterator = ((ListRowKey<StackingTreeModelKey>) key).iterator();
+ }
+
+ StackingTreeModel model = doSetupKey(keyIterator, stackEntries.iterator(), context, null);
+ this.rowKey = key;
+
+ return model;
+ }
+ }
+
+ public StackingTreeModel(String id, String var, StackingTreeModelDataProvider dataProvider) {
+ super();
+ this.id = id;
+ this.var = var;
+ this.dataProvider = dataProvider;
+ }
+
+ public StackingTreeModel() {
+ this(null, null, null);
+ }
+
+ private Object setupVariable(Object variable, FacesContext context) {
+ if (var != null) {
+ Map<String, Object> map = context.getExternalContext().getRequestMap();
+ return map.put(var, variable);
+ }
+
+ return null;
+ }
+
+ public boolean setupModel(Object key, FacesContext facesContext) {
+ ExtendedDataModel dataModel = getDataModel();
+ dataModel.setRowKey(key);
+
+ if (dataModel.isRowAvailable()) {
+ Object rowData = dataModel.getRowData();
+ //System.out.println("StackingTreeModel.setupModel() " + rowData);
+ Object varObject = setupVariable(rowData, facesContext);
+
+ getRoot().stackEntries.add(new StackEntry(varObject, key, rowData, this));
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public void setParent(StackingTreeModel parent) {
+ this.parent = parent;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.model.AbstractTreeDataModel#getTreeNode()
+ */
+ public TreeNode getTreeNode() {
+ if (isRowAvailable()) {
+ return null;
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.model.AbstractTreeDataModel#isLeaf()
+ */
+ public boolean isLeaf() {
+ if (isRowAvailable()) {
+ StackEntry lastEntry = (StackEntry) stackEntries.getLast();
+ for (Iterator<StackingTreeModel> iterator = lastEntry.model.getInternalModelsIterator(); iterator.hasNext();) {
+ StackingTreeModel stackingTreeModel = iterator.next();
+
+ if (!stackingTreeModel.isEmpty()) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ protected StackingTreeModel getRoot() {
+ if (parent != null) {
+ return parent.getRoot();
+ }
+
+ return this;
+ }
+
+ protected void doWalk(FacesContext context, DataVisitor dataVisitor,
+ Range range, ListRowKey argumentKey, Object argument,
+ boolean last) throws IOException {
+
+ TreeRange treeRange = (TreeRange) range;
+
+ if (treeRange == null || treeRange.processNode(argumentKey)) {
+ StackingTreeModel rootModel = getRoot();
+
+ if (argumentKey != null) {
+ processElement(context, dataVisitor, argument, argumentKey, last);
+ }
+
+ final ShiftingDataVisitor shiftingDataVisitor = new ShiftingDataVisitor(
+ new Visitor1(dataVisitor));
+
+ if (treeRange == null || treeRange.processChildren(argumentKey)) {
+
+ Object savedRowKey = rootModel.getRowKey();
+ //setup key in order for nested components to initialize data models
+ rootModel.setRowKey(context, argumentKey);
+ Iterator<StackingTreeModel> iterator = this.getInternalModelsIterator();
+ rootModel.setRowKey(context, savedRowKey);
+
+ while (iterator.hasNext()) {
+ final StackingTreeModel model = iterator.next();
+
+ savedRowKey = rootModel.getRowKey();
+ rootModel.setRowKey(context, argumentKey);
+ final ExtendedDataModel scalarModel = model.getDataModel();
+ rootModel.setRowKey(context, savedRowKey);
+
+ Argument argument2 = new Argument();
+ argument2.listRowKey = argumentKey;
+ argument2.argument = argument;
+ // setup current model
+ argument2.model = model;
+ argument2.range = range;
+
+ scalarModel.walk(context, new DataVisitor() {
+
+ public void process(FacesContext context,
+ Object rowKey, Object argument)
+ throws IOException {
+
+ Object key = scalarModel.getRowKey();
+ scalarModel.setRowKey(rowKey);
+ Object data = scalarModel.getRowData();
+
+ Object variable = model.setupVariable(data, context);
+ boolean activeData = model.isActiveData();
+ model.setupVariable(variable, context);
+ scalarModel.setRowKey(key);
+
+ if (activeData) {
+ shiftingDataVisitor.process(context, rowKey, argument);
+ }
+ }
+
+ }, null, argument2);
+
+ }
+ }
+
+ shiftingDataVisitor.end(context);
+ }
+ }
+
+ private StackingTreeModel getInternalModelById(String id) {
+ StackingTreeModel model = getModelById(id);
+ if (model.isActive()) {
+ return model;
+ }
+
+ throw new IllegalStateException();
+ }
+
+ public StackingTreeModel getModelById(String id) {
+ return (StackingTreeModel) models.get(id);
+ }
+
+ private Iterator<StackingTreeModel> getInternalModelsIterator() {
+ return new FilterIterator(getModelsIterator(), ACTIVE_MODEL_PREDICATE);
+ }
+
+ public Iterator<StackingTreeModel> getModelsIterator() {
+ return models.values().iterator();
+ }
+
+ public void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument,
+ boolean last) throws IOException {
+ StackingTreeModel rootModel = getRoot();
+
+ if (rowKey != null) {
+ ListRowKey listRowKey = (ListRowKey) rowKey;
+
+ StackingTreeModel treeModel = rootModel.setupKey(listRowKey, context);
+
+ treeModel.doWalk(context, dataVisitor, range, listRowKey, argument,
+ last);
+
+ } else {
+ doWalk(context, dataVisitor, range,
+ (ListRowKey) rowKey, argument, last);
+ }
+ }
+
+ private class Argument {
+ private ListRowKey listRowKey;
+ private StackingTreeModel model;
+ private Range range;
+ private Object argument;
+ }
+
+ private class Visitor1 implements DataVisitor, LastElementAware {
+ private DataVisitor dataVisitor;
+ private boolean theLast;
+
+ public Visitor1(DataVisitor dataVisitor) {
+ super();
+ this.dataVisitor = dataVisitor;
+ }
+
+ public void process(FacesContext context, Object rowKey, Object argument)
+ throws IOException {
+
+ Argument a = (Argument) argument;
+ ListRowKey listRowKey = new ListRowKey(a.listRowKey, new StackingTreeModelKey(
+ a.model.id, rowKey));
+ //System.out.println(".walk() " + (theLast ? " * " : "") + listRowKey);
+
+ a.model.doWalk(context, dataVisitor, a.range, listRowKey, a.argument,
+ theLast);
+ }
+
+ public void resetLastElement() {
+ theLast = false;
+ }
+
+ public void setLastElement() {
+ theLast = true;
+ }
+
+ }
+
+ private static class ShiftingDataVisitor implements DataVisitor {
+
+ private DataVisitor dataVisitor;
+
+ public ShiftingDataVisitor(DataVisitor dataVisitor) {
+ super();
+ this.dataVisitor = dataVisitor;
+ }
+
+ private Object rowKey;
+ private Object argument;
+ private boolean shifted = false;
+
+ public void process(FacesContext context, Object rowKey, Object argument)
+ throws IOException {
+
+ if (!shifted) {
+ this.rowKey = rowKey;
+ this.argument = argument;
+ this.shifted = true;
+ } else {
+ dataVisitor.process(context, this.rowKey, this.argument);
+ this.rowKey = rowKey;
+ this.argument = argument;
+ }
+ }
+
+ public void end(FacesContext context) throws IOException {
+ if (shifted) {
+ try {
+ ((LastElementAware) dataVisitor).setLastElement();
+ dataVisitor.process(context, this.rowKey, argument);
+ } finally {
+ ((LastElementAware) dataVisitor).resetLastElement();
+ }
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.model.AbstractTreeDataModel#walkModel(javax.faces.context.FacesContext,
+ * org.ajax4jsf.model.DataVisitor, org.ajax4jsf.model.Range,
+ * java.lang.Object, java.lang.Object, boolean)
+ */
+ public void walkModel(FacesContext facesContext, DataVisitor visitor,
+ Range range, Object key, Object argument, boolean last)
+ throws IOException {
+
+ walk(facesContext, visitor, range, key, argument, last);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.model.ExtendedDataModel#getRowKey()
+ */
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ public void setRowKey(Object key) {
+ setRowKey(FacesContext.getCurrentInstance(), key);
+ }
+
+ public void setRowKey(FacesContext context, Object key) {
+ setupKey(key, context);
+ }
+
+ public void addStackingModel(StackingTreeModel model) {
+ this.models.put(model.id, model);
+ model.setParent(this);
+ }
+
+ public void removeStackingModel(StackingTreeModel model) {
+ this.models.remove(model.id);
+ model.setParent(null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#getRowData()
+ */
+ public Object getRowData() {
+ if (isRowAvailable()) {
+ StackEntry lastEntry = (StackEntry) stackEntries.getLast();
+ return lastEntry.rowData;
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ return !stackEntries.isEmpty();
+ }
+
+ public StackingTreeModel getParent() {
+ return parent;
+ }
+
+ protected boolean isActiveData() {
+ return true;
+ }
+
+ protected boolean isActive() {
+ return true;
+ }
+
+ private final static Predicate ACTIVE_MODEL_PREDICATE = new Predicate() {
+
+ public boolean evaluate(Object object) {
+ StackingTreeModel model = (StackingTreeModel) object;
+ if (model == null) {
+ return false;
+ }
+
+ return model.isActive();
+ }
+
+ };
+
+ @Override
+ public Object getWrappedData() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object convertToKey(FacesContext context, String keyString,
+ UIComponent component, Converter converter) {
+
+ //force model leave
+ setRowKey(context, null);
+
+ String[] strings = ListRowKey.fromString(keyString);
+ int l = strings.length / 2;
+ List<Object> list = new ArrayList<Object>(l);
+ StackingTreeModel model = getRoot();
+
+ for (int i = 0; i < l; i++) {
+ int idx = i*2;
+
+ String modelId = strings[idx];
+ model = model.getModelById(modelId);
+ if (model.isActive()) {
+ Object key = model.convert(context, strings[idx + 1], component, converter);
+ if (key == null) {
+ return null;
+ }
+
+ list.add(new StackingTreeModelKey(modelId, key));
+
+ if (!model.setupModel(key, context) || !model.isActiveData()) {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ return new ListRowKey<Object>(list);
+ }
+
+ protected Object convert(FacesContext context, String string,
+ UIComponent component, Converter converter) {
+
+ ConvertableKeyModel convertable = (ConvertableKeyModel) getDataModel();
+ return convertable.getKeyAsObject(context, string, component, converter);
+ }
+
+ public String getId() {
+ return id;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,33 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 30.07.2007
- *
- */
-public interface StackingTreeModelDataProvider {
- public Object getData();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,33 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 30.07.2007
+ *
+ */
+public interface StackingTreeModelDataProvider {
+ public Object getData();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,103 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski
- */
-public class StackingTreeModelKey<T> implements Serializable, ComplexTreeRowKey {
- /**
- *
- */
- private static final long serialVersionUID = -6821854350257816571L;
- protected T modelKey;
- protected String modelId;
-
- public StackingTreeModelKey(String modelId, T modelKey) {
- super();
- this.modelId = modelId;
- this.modelKey = modelKey;
- }
-
- public String toString() {
- return this.modelId + AbstractTreeDataModel.SEPARATOR + this.modelKey;
- }
-
- 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;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final StackingTreeModelKey other = (StackingTreeModelKey) 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;
- }
-
- public String getModelId() {
- return modelId;
- }
-
- public Object getModelKey() {
- return modelKey;
- }
-
- public int getKeySegmentsCount() {
- return 2;
- }
-
- public Object getKeySegment(int i) {
- switch (i) {
- case 0:
- return modelId;
- case 1:
- return modelKey;
-
- default:
- throw new IllegalArgumentException(String.valueOf(i));
- }
- }
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,103 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski
+ */
+public class StackingTreeModelKey<T> implements Serializable, ComplexTreeRowKey {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6821854350257816571L;
+ protected T modelKey;
+ protected String modelId;
+
+ public StackingTreeModelKey(String modelId, T modelKey) {
+ super();
+ this.modelId = modelId;
+ this.modelKey = modelKey;
+ }
+
+ public String toString() {
+ return this.modelId + AbstractTreeDataModel.SEPARATOR + this.modelKey;
+ }
+
+ 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;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final StackingTreeModelKey other = (StackingTreeModelKey) 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;
+ }
+
+ public String getModelId() {
+ return modelId;
+ }
+
+ public Object getModelKey() {
+ return modelKey;
+ }
+
+ public int getKeySegmentsCount() {
+ return 2;
+ }
+
+ public Object getKeySegment(int i) {
+ switch (i) {
+ case 0:
+ return modelId;
+ case 1:
+ return modelKey;
+
+ default:
+ throw new IllegalArgumentException(String.valueOf(i));
+ }
+ }
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,78 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
- *
- */
-public abstract class StackingTreeModelProvider extends UIComponentBase {
-
- public abstract Object getNodes();
- public abstract void setNodes(Object nodes);
-
- public Object getData() {
- return getNodes();
- }
-
- protected abstract StackingTreeModel createStackingTreeModel();
-
- private List<StackingTreeModel> createChildModelsList() {
- List<StackingTreeModel> childModels = new ArrayList<StackingTreeModel>();
-
- if (getChildCount() > 0) {
- Iterator<UIComponent> children = getChildren().iterator();
- while (children.hasNext()) {
- UIComponent component = children.next();
- if (component instanceof StackingTreeModelProvider) {
- StackingTreeModelProvider provider = (StackingTreeModelProvider) component;
- childModels.add(provider.getStackingModel());
- }
- }
- }
-
- return childModels;
- }
-
- protected void addChildModels(StackingTreeModel model, List<StackingTreeModel> childModels) {
- for (StackingTreeModel childModel : childModels) {
- model.addStackingModel(childModel);
- }
- }
-
- public StackingTreeModel getStackingModel() {
- StackingTreeModel stackingTreeModel = createStackingTreeModel();
-
- addChildModels(stackingTreeModel, createChildModelsList());
-
- return stackingTreeModel;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,78 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
+ *
+ */
+public abstract class StackingTreeModelProvider extends UIComponentBase {
+
+ public abstract Object getNodes();
+ public abstract void setNodes(Object nodes);
+
+ public Object getData() {
+ return getNodes();
+ }
+
+ protected abstract StackingTreeModel createStackingTreeModel();
+
+ private List<StackingTreeModel> createChildModelsList() {
+ List<StackingTreeModel> childModels = new ArrayList<StackingTreeModel>();
+
+ if (getChildCount() > 0) {
+ Iterator<UIComponent> children = getChildren().iterator();
+ while (children.hasNext()) {
+ UIComponent component = children.next();
+ if (component instanceof StackingTreeModelProvider) {
+ StackingTreeModelProvider provider = (StackingTreeModelProvider) component;
+ childModels.add(provider.getStackingModel());
+ }
+ }
+ }
+
+ return childModels;
+ }
+
+ protected void addChildModels(StackingTreeModel model, List<StackingTreeModel> childModels) {
+ for (StackingTreeModel childModel : childModels) {
+ model.addStackingModel(childModel);
+ }
+ }
+
+ public StackingTreeModel getStackingModel() {
+ StackingTreeModel stackingTreeModel = createStackingTreeModel();
+
+ addChildModels(stackingTreeModel, createChildModelsList());
+
+ return stackingTreeModel;
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,77 +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.model;
-
-import javax.swing.tree.TreeNode;
-
-/**
- * {@link CacheableTreeDataModel} implementation for Swing {@link TreeNode} instances
- *
- * Created 01.11.2007
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class SwingCacheableTreeDataModel extends CacheableTreeDataModel<TreeNode> {
-
- private static final MissingNodeHandler<TreeNode> missingNodeHandler = new MissingNodeHandler<TreeNode>() {
-
- public TreeNode handleMissingNode(TreeNode parent,
- Object pathSegment) {
-
- SwingTreeNodeImpl childNode = new CacheableSwingTreeNodeImpl();
-
- if (parent != null) {
- SwingTreeNodeImpl parentNode = (SwingTreeNodeImpl) parent;
-
- parentNode.addChild(pathSegment, childNode);
- childNode.setParent(parentNode);
- }
-
- return childNode;
- }
-
- };
-
- public SwingCacheableTreeDataModel(TreeDataModel<TreeNode> model) {
- super(model, missingNodeHandler);
- }
-
- @Override
- public Object getRowData() {
- SwingTreeNodeImpl swingTreeNodeImpl = ((SwingTreeNodeImpl) super.getRowData());
- if (swingTreeNodeImpl != null) {
- return swingTreeNodeImpl.getData();
- } else {
- return null;
- }
- }
-
- @Override
- protected void setDefaultNodeData(TreeNode node, Object data) {
- CacheableSwingTreeNodeImpl cacheableTreeNode = (CacheableSwingTreeNodeImpl) node;
- cacheableTreeNode.setData(data);
- cacheableTreeNode.setNotLeaf(!isLeaf());
- }
-}
-
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,77 @@
+/**
+ * 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.model;
+
+import javax.swing.tree.TreeNode;
+
+/**
+ * {@link CacheableTreeDataModel} implementation for Swing {@link TreeNode} instances
+ *
+ * Created 01.11.2007
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class SwingCacheableTreeDataModel extends CacheableTreeDataModel<TreeNode> {
+
+ private static final MissingNodeHandler<TreeNode> missingNodeHandler = new MissingNodeHandler<TreeNode>() {
+
+ public TreeNode handleMissingNode(TreeNode parent,
+ Object pathSegment) {
+
+ SwingTreeNodeImpl childNode = new CacheableSwingTreeNodeImpl();
+
+ if (parent != null) {
+ SwingTreeNodeImpl parentNode = (SwingTreeNodeImpl) parent;
+
+ parentNode.addChild(pathSegment, childNode);
+ childNode.setParent(parentNode);
+ }
+
+ return childNode;
+ }
+
+ };
+
+ public SwingCacheableTreeDataModel(TreeDataModel<TreeNode> model) {
+ super(model, missingNodeHandler);
+ }
+
+ @Override
+ public Object getRowData() {
+ SwingTreeNodeImpl swingTreeNodeImpl = ((SwingTreeNodeImpl) super.getRowData());
+ if (swingTreeNodeImpl != null) {
+ return swingTreeNodeImpl.getData();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ protected void setDefaultNodeData(TreeNode node, Object data) {
+ CacheableSwingTreeNodeImpl cacheableTreeNode = (CacheableSwingTreeNodeImpl) node;
+ cacheableTreeNode.setData(data);
+ cacheableTreeNode.setNotLeaf(!isLeaf());
+ }
+}
+
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,110 +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.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.swing.tree.TreeNode;
-
-/**
- * {@link TreeDataModel} implementation for classic {@link TreeNode} instances
- *
- * Created 01.11.2007
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class SwingTreeDataModel extends TreeDataModel<TreeNode> {
-
- private TreeNode treeNode;
-
- public SwingTreeDataModel() {
- super(TreeNode.class, TreeDataModelNodeAdaptor.swingTreeNodeAdaptor, null);
- }
-
- @Override
- protected TreeNode getData() {
- return treeNode;
- }
-
- @Override
- public void setWrappedData(Object data) {
- if (data != null) {
- SwingTreeNodeImpl treeNodeImpl = new SwingTreeNodeImpl();
-
- if (data instanceof Collection<?>) {
- Collection<?> collection = (Collection<?>) data;
-
- for (Iterator<?> iterator = collection.iterator(); iterator
- .hasNext();) {
- treeNodeImpl.addChild((TreeNode) iterator.next());
- }
- } else if (data.getClass().isArray()) {
- Object[] nodes = (Object[]) data;
- for (int i = 0; i < nodes.length; i++) {
- treeNodeImpl.addChild((TreeNode) nodes[i]);
- }
- } else {
- treeNodeImpl.addChild((TreeNode) data);
- }
-
- this.treeNode = treeNodeImpl;
- } else {
- this.treeNode = null;
- }
-
- super.setWrappedData(data);
- }
-
-
- @Override
- public Object convertToKey(FacesContext context, String keyString, UIComponent component, Converter converter) {
- String[] strings = ListRowKey.fromString(keyString);
- List<Integer> list = new ArrayList<Integer>(strings.length);
- TreeNode node = this.treeNode;
-
- if (node != null) {
- TreeDataModelNodeAdaptor<TreeNode> adaptor = getNodeAdaptor();
-
- for (int i = 0; i < strings.length; i++) {
- int key = Integer.parseInt(strings[i]);
-
- node = adaptor.getChild(node, key);
- if (node != null) {
- list.add(key);
- } else {
- return null;
- }
- }
- }
-
- return new ListRowKey<Integer>(list);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,110 @@
+/**
+ * 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.model;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.swing.tree.TreeNode;
+
+/**
+ * {@link TreeDataModel} implementation for classic {@link TreeNode} instances
+ *
+ * Created 01.11.2007
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class SwingTreeDataModel extends TreeDataModel<TreeNode> {
+
+ private TreeNode treeNode;
+
+ public SwingTreeDataModel() {
+ super(TreeNode.class, TreeDataModelNodeAdaptor.swingTreeNodeAdaptor, null);
+ }
+
+ @Override
+ protected TreeNode getData() {
+ return treeNode;
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ if (data != null) {
+ SwingTreeNodeImpl treeNodeImpl = new SwingTreeNodeImpl();
+
+ if (data instanceof Collection<?>) {
+ Collection<?> collection = (Collection<?>) data;
+
+ for (Iterator<?> iterator = collection.iterator(); iterator
+ .hasNext();) {
+ treeNodeImpl.addChild((TreeNode) iterator.next());
+ }
+ } else if (data.getClass().isArray()) {
+ Object[] nodes = (Object[]) data;
+ for (int i = 0; i < nodes.length; i++) {
+ treeNodeImpl.addChild((TreeNode) nodes[i]);
+ }
+ } else {
+ treeNodeImpl.addChild((TreeNode) data);
+ }
+
+ this.treeNode = treeNodeImpl;
+ } else {
+ this.treeNode = null;
+ }
+
+ super.setWrappedData(data);
+ }
+
+
+ @Override
+ public Object convertToKey(FacesContext context, String keyString, UIComponent component, Converter converter) {
+ String[] strings = ListRowKey.fromString(keyString);
+ List<Integer> list = new ArrayList<Integer>(strings.length);
+ TreeNode node = this.treeNode;
+
+ if (node != null) {
+ TreeDataModelNodeAdaptor<TreeNode> adaptor = getNodeAdaptor();
+
+ for (int i = 0; i < strings.length; i++) {
+ int key = Integer.parseInt(strings[i]);
+
+ node = adaptor.getChild(node, key);
+ if (node != null) {
+ list.add(key);
+ } else {
+ return null;
+ }
+ }
+ }
+
+ return new ListRowKey<Integer>(list);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,145 +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.model;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.tree.TreeNode;
-
-/**
- * Map-based Swing {@link TreeNode} implementation
- *
- * Created 01.11.2007
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-@Deprecated
-public class SwingTreeNodeImpl implements TreeNode {
-
- private List<TreeNode> children = new ArrayList<TreeNode>();
-
- private TreeNode parent;
-
- private Object data;
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#children()
- */
- public Enumeration children() {
- return new Enumeration() {
- private Iterator<?> iterator = children.iterator();
-
- public boolean hasMoreElements() {
- return iterator.hasNext();
- }
-
- public Object nextElement() {
- return iterator.next();
- }
- };
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#getAllowsChildren()
- */
- public boolean getAllowsChildren() {
- return true;
- }
-
- public void setAllowsChildren(boolean allowsChildren) {
- if (!allowsChildren) {
- throw new IllegalArgumentException();
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#getChildAt(int)
- */
- public TreeNode getChildAt(int childIndex) {
- return children.get(childIndex);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#getChildCount()
- */
- public int getChildCount() {
- return children.size();
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#getIndex(javax.swing.tree.TreeNode)
- */
- public int getIndex(TreeNode node) {
- return children.indexOf(node);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#getParent()
- */
- public TreeNode getParent() {
- return parent;
- }
-
- public void setParent(TreeNode parent) {
- this.parent = parent;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.tree.TreeNode#isLeaf()
- */
- public boolean isLeaf() {
- return children.isEmpty();
- }
-
- public void addChild(TreeNode node) {
- children.add(node);
- }
-
- public void addChild(Object key, TreeNode node) {
- if (Integer.valueOf(children.size()).equals(key)) {
- children.add(node);
- } else {
- throw new IllegalArgumentException();
- }
- }
-
- public Object getData() {
- return data;
- }
-
- public void setData(Object data) {
- this.data = data;
- }
-
- public void removeChild(TreeNode node) {
- this.children.remove(node);
- }
-
- public void removeChildByKey(Object key) {
- this.children.remove(((Integer) key).intValue());
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,145 @@
+/**
+ * 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.model;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.tree.TreeNode;
+
+/**
+ * Map-based Swing {@link TreeNode} implementation
+ *
+ * Created 01.11.2007
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+@Deprecated
+public class SwingTreeNodeImpl implements TreeNode {
+
+ private List<TreeNode> children = new ArrayList<TreeNode>();
+
+ private TreeNode parent;
+
+ private Object data;
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#children()
+ */
+ public Enumeration children() {
+ return new Enumeration() {
+ private Iterator<?> iterator = children.iterator();
+
+ public boolean hasMoreElements() {
+ return iterator.hasNext();
+ }
+
+ public Object nextElement() {
+ return iterator.next();
+ }
+ };
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#getAllowsChildren()
+ */
+ public boolean getAllowsChildren() {
+ return true;
+ }
+
+ public void setAllowsChildren(boolean allowsChildren) {
+ if (!allowsChildren) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#getChildAt(int)
+ */
+ public TreeNode getChildAt(int childIndex) {
+ return children.get(childIndex);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#getChildCount()
+ */
+ public int getChildCount() {
+ return children.size();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#getIndex(javax.swing.tree.TreeNode)
+ */
+ public int getIndex(TreeNode node) {
+ return children.indexOf(node);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#getParent()
+ */
+ public TreeNode getParent() {
+ return parent;
+ }
+
+ public void setParent(TreeNode parent) {
+ this.parent = parent;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.tree.TreeNode#isLeaf()
+ */
+ public boolean isLeaf() {
+ return children.isEmpty();
+ }
+
+ public void addChild(TreeNode node) {
+ children.add(node);
+ }
+
+ public void addChild(Object key, TreeNode node) {
+ if (Integer.valueOf(children.size()).equals(key)) {
+ children.add(node);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ public void removeChild(TreeNode node) {
+ this.children.remove(node);
+ }
+
+ public void removeChildByKey(Object key) {
+ this.children.remove(((Integer) key).intValue());
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,401 +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.model;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.Range;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski - nbelaevski(a)exadel.com created 16.11.2006
- *
- */
-public abstract class TreeDataModel<T> extends AbstractTreeDataModel {
-
- private Object wrappedData;
- private Class<T> clazz;
-
- private TreeRowKey currentRowKey;
-
- private TreeRowKey oldRowKey;
-
- private Boolean rowAvailable = Boolean.FALSE;
- private T rowTreeData;
-
- protected final TreeDataModelNodeAdaptor<T> nodeAdaptor;
-
- private MissingNodeHandler<T> missingNodeHandler;
-
- /**
- * Interface aimed to handle missing nodes for externally-generated keys.
- * Typical usage for the interface is filling model cache
- * @param <T> generic tree node type
- *
- * @author Nick Belaevski
- * @since 3.2
- */
- public static interface MissingNodeHandler<T> {
- T handleMissingNode(T parentNode, Object pathSegment);
- };
-
- public TreeDataModel(Class<T> clazz, TreeDataModelNodeAdaptor<T> nodeAdaptor,
- MissingNodeHandler<T> missingNodeHandler) {
-
- this.clazz = clazz;
- this.nodeAdaptor = nodeAdaptor;
- this.missingNodeHandler = missingNodeHandler;
- }
-
- public final Class<T> getClazz() {
- return clazz;
- }
-
- public final TreeDataModelNodeAdaptor<T> getNodeAdaptor() {
- return nodeAdaptor;
- }
-
- public Object getRowKey() {
- return this.currentRowKey;
- }
-
- public void setRowKey(Object rowKey) {
- if (rowKey != null) {
- ListRowKey newRowKey = (ListRowKey) rowKey;
- this.currentRowKey = newRowKey;
- this.rowAvailable = null;
- } else {
- this.currentRowKey = null;
- this.oldRowKey = null;
- this.rowTreeData = null;
- this.rowAvailable = Boolean.FALSE;
- }
- }
-
- protected void doWalk(FacesContext context, DataVisitor dataVisitor,
- Range range, Object rowKey, Object argument, boolean last) throws IOException {
- ListRowKey listRowKey = (ListRowKey) rowKey;
-
- T node = locateTreeNode(listRowKey);
-
- if (node != null) {
- TreeRange treeRange = (TreeRange) range;
-
- if (treeRange == null || treeRange.processNode(listRowKey)) {
-
- //root node is not processed, it is considered fake for this class of models
- if (listRowKey != null && listRowKey.depth() > 0) {
- processElement(context, dataVisitor, argument, listRowKey, last);
- }
-
- if (treeRange == null || treeRange.processChildren(listRowKey)) {
- if (!nodeAdaptor.isLeaf(node)) {
- Iterator<Map.Entry<Object, T>> children = nodeAdaptor.getChildren(node);
-
- if (children != null) {
- Map.Entry<Object, T> childEntry = children.hasNext() ? children.next() : null;
- T childNode;
- Object identifier;
-
- if (childEntry != null) {
- childNode = childEntry.getValue();
- identifier = childEntry.getKey();
- } else {
- childNode = null;
- identifier = null;
- }
-
- do {
- Map.Entry<Object, T> nextChildEntry = children.hasNext() ? children.next() : null;
- T nextChildNode;
- Object nextIdentifier;
-
- if (nextChildEntry != null) {
- //TODO consider lazy initialization of value
- nextChildNode = nextChildEntry.getValue();
- nextIdentifier = nextChildEntry.getKey();
- } else {
- nextChildNode = null;
- nextIdentifier = null;
- }
-
- if (childNode != null) {
-
- boolean isLast = nextChildNode == null;
-
- ListRowKey newRowKey = new ListRowKey(listRowKey, identifier);
- this.doWalk(context, dataVisitor, range, newRowKey, argument, isLast);
- }
-
- identifier = nextIdentifier;
- childNode = nextChildNode;
- } while (childNode != null);
- }
- }
- }
- }
- }
- }
-
- public void walk(FacesContext context, DataVisitor dataVisitor,
- Range range, Object rowKey, Object argument, boolean last) throws IOException {
-
- if (rowKey != null) {
- setRowKey(rowKey);
- if (!isRowAvailable()) {
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
- }
-
- doWalk(context, dataVisitor, range, rowKey, argument, last);
- }
-
- public T locateTreeNode(TreeRowKey rowKey) {
- return locateTreeNode(rowKey, false);
- }
-
- public T locateTreeNode(TreeRowKey rowKey, boolean allowCreate) {
- T tmpRowTreeData = this.rowTreeData;
- TreeRowKey tmpOldRowKey = this.oldRowKey;
-
- boolean useCached = (rowTreeData != null && rowKey != null && rowKey.equals(tmpOldRowKey));
- if (!useCached) {
- T rootNode = getData();
-
- if (rootNode != null) {
- if (rowKey != null) {
- int commonPathLength = rowKey.getCommonPathLength(tmpOldRowKey);
- if (tmpOldRowKey == null) {
- tmpRowTreeData = rootNode;
- } else {
- int rootOpsCount = rowKey.depth();
- int currentUpOpsCount = tmpOldRowKey.depth() - commonPathLength;
- int currentOpsCount = currentUpOpsCount + rootOpsCount - commonPathLength;
-
- if (rootOpsCount > currentOpsCount) {
- for (int i = 0; i < tmpOldRowKey.depth()
- - commonPathLength; i++) {
-
- tmpRowTreeData = nodeAdaptor.getParent(tmpRowTreeData);
- }
- } else {
- commonPathLength = 0;
- tmpRowTreeData = rootNode;
- tmpOldRowKey = null;
- }
- }
- tmpOldRowKey = rowKey;
- Iterator<?> iterator = rowKey.getSubPathIterator(commonPathLength);
- while (iterator.hasNext()) {
- //TODO nick - check rowTreeData for null
-
- Object pathSegment = iterator.next();
- T childRowTreeData = nodeAdaptor.getChild(tmpRowTreeData, pathSegment);
-
- if (childRowTreeData == null) {
- if (!allowCreate) {
- //TODO nick - reset rowTreeData
- return null;
- } else {
- if (missingNodeHandler != null) {
- childRowTreeData = missingNodeHandler.
- handleMissingNode(tmpRowTreeData, pathSegment);
-
- if (childRowTreeData == null) {
- return null;
- }
- } else {
- return null;
- }
- }
- }
-
- tmpRowTreeData = childRowTreeData;
- }
- } else {
- return rootNode;
- }
- } else {
- return null;
- }
- }
-
- // check whether we were found something and store it
- if (tmpRowTreeData != null) {
- rowTreeData = tmpRowTreeData;
- oldRowKey = tmpOldRowKey;
- }
- return rowTreeData;
- }
-
- public boolean isRowAvailable() {
- if (Boolean.FALSE.equals(rowAvailable)) {
- return false;
- }
-
- T data = locateTreeNode(this.currentRowKey);
-
- if (data != null) {
- return true;
- }
-
- return false;
- }
-
- public Object getRowData() {
- if (isRowAvailable()) {
- T treeNode = locateTreeNode(this.currentRowKey);
- if (treeNode != null) {
- return nodeAdaptor.getRowData(treeNode);
- }
-
- return null;
- }
-
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- public boolean isLeaf() {
- if (isRowAvailable()) {
- T treeNode = locateTreeNode(this.currentRowKey);
- if (treeNode != null) {
- return nodeAdaptor.isLeaf(treeNode);
- }
- }
-
- throw new IllegalStateException(
- "No tree element available or row key not set!");
- }
-
- public void walkModel(FacesContext context, DataVisitor visitor, Range range, Object key, Object argument, boolean last) throws IOException {
- walk(context, visitor, range, key, argument, last);
- }
-
- @Override
- public Object getWrappedData() {
- return wrappedData;
- }
-
- @Override
- public void setWrappedData(Object data) {
- this.wrappedData = data;
- }
-
- protected T getData() {
- return clazz.cast(wrappedData);
- }
-
- public TreeNode<T> getTreeNode() {
- return null;
- }
-
- /**
- * Get row key for certain tree node object
- *
- * @param node to get key for
- * @return node row key
- */
- @Override
- @SuppressWarnings("unchecked")
- public Object getTreeNodeRowKey(Object node) {
- if (node == null) {
- throw new UnsupportedOperationException();
- }
-
- T childNode = (T) node;
- List<Object> path = new LinkedList<Object>();
- Object id = nodeAdaptor.getChildNodeId(childNode);
- if (id != null) {
- path.add(id);
- }
-
- T parentNode = childNode;
- while ((parentNode = nodeAdaptor.getParent(parentNode)) != null) {
- id = nodeAdaptor.getChildNodeId(parentNode);
- if (id != null) {
- path.add(0, id);
- } else if (nodeAdaptor.getParent(parentNode) != null) {
- throw new UnsupportedOperationException();
- }
- }
- return new ListRowKey(path);
- }
-
- /**
- * Get node local id in it's parent childs collection
- *
- * @param childNode node to get identifier for
- * @return node local identifier
- */
- @Override
- public Object getChildNodeId(Object childNode) {
- return getNodeAdaptor().getChildNodeId((T) childNode);
- }
-
- @Override
- public void addNode(Object parentRowKey, TreeNode newNode, Object id) {
- addNode(parentRowKey, (Object) newNode, id);
- }
-
- public void addNode(Object parentRowKey, Object newNode, Object id) {
- Object initialRowKey = getRowKey();
- try {
- T parentTreeNode = locateTreeNode((TreeRowKey) parentRowKey);
-
- if (parentTreeNode == null) {
- throw new IllegalArgumentException("Parent node not found!");
- }
-
- getNodeAdaptor().appendChild(parentTreeNode, id, clazz.cast(newNode));
- } finally {
- setRowKey(initialRowKey);
- }
- }
-
- @Override
- public void removeNode(Object rowKey) {
- Object initialRowKey = getRowKey();
- try {
- T treeNode = locateTreeNode((TreeRowKey) rowKey);
-
- if (treeNode == null) {
- throw new IllegalArgumentException("Node not fond!");
- }
-
- getNodeAdaptor().removeFromParent(treeNode);
- } finally {
- setRowKey(initialRowKey);
- }
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,401 @@
+/**
+ * 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.model;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.Range;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski - nbelaevski(a)exadel.com created 16.11.2006
+ *
+ */
+public abstract class TreeDataModel<T> extends AbstractTreeDataModel {
+
+ private Object wrappedData;
+ private Class<T> clazz;
+
+ private TreeRowKey currentRowKey;
+
+ private TreeRowKey oldRowKey;
+
+ private Boolean rowAvailable = Boolean.FALSE;
+ private T rowTreeData;
+
+ protected final TreeDataModelNodeAdaptor<T> nodeAdaptor;
+
+ private MissingNodeHandler<T> missingNodeHandler;
+
+ /**
+ * Interface aimed to handle missing nodes for externally-generated keys.
+ * Typical usage for the interface is filling model cache
+ * @param <T> generic tree node type
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+ public static interface MissingNodeHandler<T> {
+ T handleMissingNode(T parentNode, Object pathSegment);
+ };
+
+ public TreeDataModel(Class<T> clazz, TreeDataModelNodeAdaptor<T> nodeAdaptor,
+ MissingNodeHandler<T> missingNodeHandler) {
+
+ this.clazz = clazz;
+ this.nodeAdaptor = nodeAdaptor;
+ this.missingNodeHandler = missingNodeHandler;
+ }
+
+ public final Class<T> getClazz() {
+ return clazz;
+ }
+
+ public final TreeDataModelNodeAdaptor<T> getNodeAdaptor() {
+ return nodeAdaptor;
+ }
+
+ public Object getRowKey() {
+ return this.currentRowKey;
+ }
+
+ public void setRowKey(Object rowKey) {
+ if (rowKey != null) {
+ ListRowKey newRowKey = (ListRowKey) rowKey;
+ this.currentRowKey = newRowKey;
+ this.rowAvailable = null;
+ } else {
+ this.currentRowKey = null;
+ this.oldRowKey = null;
+ this.rowTreeData = null;
+ this.rowAvailable = Boolean.FALSE;
+ }
+ }
+
+ protected void doWalk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last) throws IOException {
+ ListRowKey listRowKey = (ListRowKey) rowKey;
+
+ T node = locateTreeNode(listRowKey);
+
+ if (node != null) {
+ TreeRange treeRange = (TreeRange) range;
+
+ if (treeRange == null || treeRange.processNode(listRowKey)) {
+
+ //root node is not processed, it is considered fake for this class of models
+ if (listRowKey != null && listRowKey.depth() > 0) {
+ processElement(context, dataVisitor, argument, listRowKey, last);
+ }
+
+ if (treeRange == null || treeRange.processChildren(listRowKey)) {
+ if (!nodeAdaptor.isLeaf(node)) {
+ Iterator<Map.Entry<Object, T>> children = nodeAdaptor.getChildren(node);
+
+ if (children != null) {
+ Map.Entry<Object, T> childEntry = children.hasNext() ? children.next() : null;
+ T childNode;
+ Object identifier;
+
+ if (childEntry != null) {
+ childNode = childEntry.getValue();
+ identifier = childEntry.getKey();
+ } else {
+ childNode = null;
+ identifier = null;
+ }
+
+ do {
+ Map.Entry<Object, T> nextChildEntry = children.hasNext() ? children.next() : null;
+ T nextChildNode;
+ Object nextIdentifier;
+
+ if (nextChildEntry != null) {
+ //TODO consider lazy initialization of value
+ nextChildNode = nextChildEntry.getValue();
+ nextIdentifier = nextChildEntry.getKey();
+ } else {
+ nextChildNode = null;
+ nextIdentifier = null;
+ }
+
+ if (childNode != null) {
+
+ boolean isLast = nextChildNode == null;
+
+ ListRowKey newRowKey = new ListRowKey(listRowKey, identifier);
+ this.doWalk(context, dataVisitor, range, newRowKey, argument, isLast);
+ }
+
+ identifier = nextIdentifier;
+ childNode = nextChildNode;
+ } while (childNode != null);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last) throws IOException {
+
+ if (rowKey != null) {
+ setRowKey(rowKey);
+ if (!isRowAvailable()) {
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+ }
+
+ doWalk(context, dataVisitor, range, rowKey, argument, last);
+ }
+
+ public T locateTreeNode(TreeRowKey rowKey) {
+ return locateTreeNode(rowKey, false);
+ }
+
+ public T locateTreeNode(TreeRowKey rowKey, boolean allowCreate) {
+ T tmpRowTreeData = this.rowTreeData;
+ TreeRowKey tmpOldRowKey = this.oldRowKey;
+
+ boolean useCached = (rowTreeData != null && rowKey != null && rowKey.equals(tmpOldRowKey));
+ if (!useCached) {
+ T rootNode = getData();
+
+ if (rootNode != null) {
+ if (rowKey != null) {
+ int commonPathLength = rowKey.getCommonPathLength(tmpOldRowKey);
+ if (tmpOldRowKey == null) {
+ tmpRowTreeData = rootNode;
+ } else {
+ int rootOpsCount = rowKey.depth();
+ int currentUpOpsCount = tmpOldRowKey.depth() - commonPathLength;
+ int currentOpsCount = currentUpOpsCount + rootOpsCount - commonPathLength;
+
+ if (rootOpsCount > currentOpsCount) {
+ for (int i = 0; i < tmpOldRowKey.depth()
+ - commonPathLength; i++) {
+
+ tmpRowTreeData = nodeAdaptor.getParent(tmpRowTreeData);
+ }
+ } else {
+ commonPathLength = 0;
+ tmpRowTreeData = rootNode;
+ tmpOldRowKey = null;
+ }
+ }
+ tmpOldRowKey = rowKey;
+ Iterator<?> iterator = rowKey.getSubPathIterator(commonPathLength);
+ while (iterator.hasNext()) {
+ //TODO nick - check rowTreeData for null
+
+ Object pathSegment = iterator.next();
+ T childRowTreeData = nodeAdaptor.getChild(tmpRowTreeData, pathSegment);
+
+ if (childRowTreeData == null) {
+ if (!allowCreate) {
+ //TODO nick - reset rowTreeData
+ return null;
+ } else {
+ if (missingNodeHandler != null) {
+ childRowTreeData = missingNodeHandler.
+ handleMissingNode(tmpRowTreeData, pathSegment);
+
+ if (childRowTreeData == null) {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+ }
+
+ tmpRowTreeData = childRowTreeData;
+ }
+ } else {
+ return rootNode;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ // check whether we were found something and store it
+ if (tmpRowTreeData != null) {
+ rowTreeData = tmpRowTreeData;
+ oldRowKey = tmpOldRowKey;
+ }
+ return rowTreeData;
+ }
+
+ public boolean isRowAvailable() {
+ if (Boolean.FALSE.equals(rowAvailable)) {
+ return false;
+ }
+
+ T data = locateTreeNode(this.currentRowKey);
+
+ if (data != null) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public Object getRowData() {
+ if (isRowAvailable()) {
+ T treeNode = locateTreeNode(this.currentRowKey);
+ if (treeNode != null) {
+ return nodeAdaptor.getRowData(treeNode);
+ }
+
+ return null;
+ }
+
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ public boolean isLeaf() {
+ if (isRowAvailable()) {
+ T treeNode = locateTreeNode(this.currentRowKey);
+ if (treeNode != null) {
+ return nodeAdaptor.isLeaf(treeNode);
+ }
+ }
+
+ throw new IllegalStateException(
+ "No tree element available or row key not set!");
+ }
+
+ public void walkModel(FacesContext context, DataVisitor visitor, Range range, Object key, Object argument, boolean last) throws IOException {
+ walk(context, visitor, range, key, argument, last);
+ }
+
+ @Override
+ public Object getWrappedData() {
+ return wrappedData;
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ this.wrappedData = data;
+ }
+
+ protected T getData() {
+ return clazz.cast(wrappedData);
+ }
+
+ public TreeNode<T> getTreeNode() {
+ return null;
+ }
+
+ /**
+ * Get row key for certain tree node object
+ *
+ * @param node to get key for
+ * @return node row key
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public Object getTreeNodeRowKey(Object node) {
+ if (node == null) {
+ throw new UnsupportedOperationException();
+ }
+
+ T childNode = (T) node;
+ List<Object> path = new LinkedList<Object>();
+ Object id = nodeAdaptor.getChildNodeId(childNode);
+ if (id != null) {
+ path.add(id);
+ }
+
+ T parentNode = childNode;
+ while ((parentNode = nodeAdaptor.getParent(parentNode)) != null) {
+ id = nodeAdaptor.getChildNodeId(parentNode);
+ if (id != null) {
+ path.add(0, id);
+ } else if (nodeAdaptor.getParent(parentNode) != null) {
+ throw new UnsupportedOperationException();
+ }
+ }
+ return new ListRowKey(path);
+ }
+
+ /**
+ * Get node local id in it's parent childs collection
+ *
+ * @param childNode node to get identifier for
+ * @return node local identifier
+ */
+ @Override
+ public Object getChildNodeId(Object childNode) {
+ return getNodeAdaptor().getChildNodeId((T) childNode);
+ }
+
+ @Override
+ public void addNode(Object parentRowKey, TreeNode newNode, Object id) {
+ addNode(parentRowKey, (Object) newNode, id);
+ }
+
+ public void addNode(Object parentRowKey, Object newNode, Object id) {
+ Object initialRowKey = getRowKey();
+ try {
+ T parentTreeNode = locateTreeNode((TreeRowKey) parentRowKey);
+
+ if (parentTreeNode == null) {
+ throw new IllegalArgumentException("Parent node not found!");
+ }
+
+ getNodeAdaptor().appendChild(parentTreeNode, id, clazz.cast(newNode));
+ } finally {
+ setRowKey(initialRowKey);
+ }
+ }
+
+ @Override
+ public void removeNode(Object rowKey) {
+ Object initialRowKey = getRowKey();
+ try {
+ T treeNode = locateTreeNode((TreeRowKey) rowKey);
+
+ if (treeNode == null) {
+ throw new IllegalArgumentException("Node not fond!");
+ }
+
+ getNodeAdaptor().removeFromParent(treeNode);
+ } finally {
+ setRowKey(initialRowKey);
+ }
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,278 +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.model;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.swing.tree.MutableTreeNode;
-import javax.swing.tree.TreeNode;
-
-/**
- * {@link TreeDataModel} adaptor for generic types. Contains adaptors for Swing & classic ({@link TreeNode})
- * tree node types embedded into this interface as static instances
- *
- * Created 01.11.2007
- *
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public interface TreeDataModelNodeAdaptor<T> {
- public T getParent(T node);
-
- public boolean isLeaf(T node);
-
- public T getChild(T node, Object key);
-
- public Iterator<Map.Entry<Object, T>> getChildren(T node);
-
- public Object getRowData(T node);
-
- /**
- * Get node local id in it's parent childs collection
- *
- * @param childNode node to get identifier for
- * @return node local identifier
- */
- public Object getChildNodeId(T childNode);
-
- public void appendChild(T parentNode, Object key, T childNode);
-
- public void removeFromParent(T childNode);
-
- /**
- * Instance of {@link TreeDataModelNodeAdaptor} for {@link org.richfaces.model.TreeNode} nodes handling
- */
- @SuppressWarnings("unchecked")
- public static final TreeDataModelNodeAdaptor<org.richfaces.model.TreeNode> classicTreeNodeAdaptor =
- new TreeDataModelNodeAdaptor<org.richfaces.model.TreeNode>() {
-
- public org.richfaces.model.TreeNode getChild(org.richfaces.model.TreeNode node, Object key) {
- return node.getChild(key);
- }
-
- public Iterator<Entry<Object, org.richfaces.model.TreeNode>> getChildren(
- org.richfaces.model.TreeNode node) {
- return node.getChildren();
- }
-
- public org.richfaces.model.TreeNode getParent(org.richfaces.model.TreeNode node) {
- return node.getParent();
- }
-
- public Object getRowData(org.richfaces.model.TreeNode node) {
- return node.getData();
- }
-
- public boolean isLeaf(org.richfaces.model.TreeNode node) {
- return node.isLeaf();
- }
-
- /**
- * Get node local id in it's parent childs collection
- *
- * @param childNode node to get identifier for
- * @return node local identifier
- */
- public Object getChildNodeId(org.richfaces.model.TreeNode childNode) {
- org.richfaces.model.TreeNode parentNode = getParent(childNode);
- if (childNode != null && parentNode != null) {
- Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
- while (iter != null && iter.hasNext()) {
- Map.Entry<Object, TreeNode> entry = iter.next();
- if (entry != null && childNode.equals(entry.getValue())) {
- return entry.getKey();
- }
- }
- }
- return null;
- }
-
- public void appendChild(org.richfaces.model.TreeNode parentNode,
- Object childKey, org.richfaces.model.TreeNode childNode) {
-
- parentNode.addChild(childKey, childNode);
- }
-
- public void removeFromParent(org.richfaces.model.TreeNode childNode) {
- org.richfaces.model.TreeNode parent = childNode.getParent();
- Object childNodeId = getChildNodeId(childNode);
- if (childNodeId != null) {
- parent.removeChild(childNodeId);
- }
- }
- };
-
- /**
- * Instance of {@link TreeDataModelNodeAdaptor} for {@link javax.swing.tree.TreeNode} nodes handling
- */
- public static final TreeDataModelNodeAdaptor<javax.swing.tree.TreeNode> swingTreeNodeAdaptor =
- new TreeDataModelNodeAdaptor<javax.swing.tree.TreeNode>() {
-
- final class SwingNodeMapEntry implements Map.Entry<Object, TreeNode> {
-
- private Object key;
- private TreeNode child;
-
- public SwingNodeMapEntry(int i, TreeNode child) {
- this.key = Integer.valueOf(i);
- this.child = child;
- }
-
- public Object getKey() {
- return this.key;
- }
-
- public TreeNode getValue() {
- return child;
- }
-
- public TreeNode setValue(TreeNode value) {
- TreeNode node = this.child;
- this.child = value;
-
- return node;
- }
-
- };
-
- public javax.swing.tree.TreeNode getChild(
- javax.swing.tree.TreeNode node, Object key) {
-
- int intKey = ((Integer) key).intValue();
- if (intKey < node.getChildCount() && intKey >= 0) {
- return node.getChildAt(intKey);
- }
-
- return null;
- }
-
- public Iterator<Entry<Object, javax.swing.tree.TreeNode>> getChildren(
- final javax.swing.tree.TreeNode node) {
-
- if (node.getAllowsChildren()) {
- return new Iterator<Entry<Object,javax.swing.tree.TreeNode>>() {
-
- private final Enumeration<?> e = node.children();
- private int counter = 0;
-
- public boolean hasNext() {
- return e.hasMoreElements();
- }
-
- public Entry<Object, javax.swing.tree.TreeNode> next() {
- javax.swing.tree.TreeNode child = (javax.swing.tree.TreeNode) e.nextElement();
- SwingNodeMapEntry entry = new SwingNodeMapEntry(counter++, child);
- return entry;
-
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- };
- }
-
- return null;
- }
-
- public javax.swing.tree.TreeNode getParent(
- javax.swing.tree.TreeNode node) {
- return node.getParent();
- }
-
- public Object getRowData(javax.swing.tree.TreeNode node) {
- return node;
- }
-
- public boolean isLeaf(javax.swing.tree.TreeNode node) {
- return !node.getAllowsChildren() || node.isLeaf();
- }
-
- /**
- * Get node local id in it's parent childs collection
- *
- * @param childNode node to get identifier for
- * @return node local identifier
- */
- public Object getChildNodeId(javax.swing.tree.TreeNode childNode) {
- javax.swing.tree.TreeNode parentNode = getParent(childNode);
- if (childNode != null && parentNode != null) {
- int idx = parentNode.getIndex(childNode);
- if (idx != -1) {
- return idx;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- @SuppressWarnings("deprecation")
- public void appendChild(javax.swing.tree.TreeNode parentNode, Object key,
- javax.swing.tree.TreeNode childNode) {
-
- if (childNode instanceof MutableTreeNode) {
- MutableTreeNode mutableChildNode = (MutableTreeNode) childNode;
- MutableTreeNode mutableParentNode = (MutableTreeNode) parentNode;
- int idx;
-
- if (key != null) {
- idx = (Integer) key;
- } else {
- idx = mutableParentNode.getChildCount();
- }
-
- mutableParentNode.insert(mutableChildNode, idx);
- } else {
- SwingTreeNodeImpl swingTreeNodeImpl = (SwingTreeNodeImpl) childNode;
- SwingTreeNodeImpl parent = (SwingTreeNodeImpl) parentNode;
-
- if (key != null) {
- parent.addChild(key, swingTreeNodeImpl);
- } else {
- parent.addChild(swingTreeNodeImpl);
- }
-
- swingTreeNodeImpl.setParent(parent);
- }
- }
-
- @SuppressWarnings("deprecation")
- public void removeFromParent(javax.swing.tree.TreeNode node) {
- if (node instanceof MutableTreeNode) {
- ((MutableTreeNode) node).removeFromParent();
- } else {
- SwingTreeNodeImpl swingTreeNodeImpl = (SwingTreeNodeImpl) node;
- SwingTreeNodeImpl parent = (SwingTreeNodeImpl) swingTreeNodeImpl.getParent();
-
- parent.removeChild(swingTreeNodeImpl);
- swingTreeNodeImpl.setParent(null);
- }
- }
- };
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,278 @@
+/**
+ * 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.model;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.swing.tree.MutableTreeNode;
+import javax.swing.tree.TreeNode;
+
+/**
+ * {@link TreeDataModel} adaptor for generic types. Contains adaptors for Swing & classic ({@link TreeNode})
+ * tree node types embedded into this interface as static instances
+ *
+ * Created 01.11.2007
+ *
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public interface TreeDataModelNodeAdaptor<T> {
+ public T getParent(T node);
+
+ public boolean isLeaf(T node);
+
+ public T getChild(T node, Object key);
+
+ public Iterator<Map.Entry<Object, T>> getChildren(T node);
+
+ public Object getRowData(T node);
+
+ /**
+ * Get node local id in it's parent childs collection
+ *
+ * @param childNode node to get identifier for
+ * @return node local identifier
+ */
+ public Object getChildNodeId(T childNode);
+
+ public void appendChild(T parentNode, Object key, T childNode);
+
+ public void removeFromParent(T childNode);
+
+ /**
+ * Instance of {@link TreeDataModelNodeAdaptor} for {@link org.richfaces.model.TreeNode} nodes handling
+ */
+ @SuppressWarnings("unchecked")
+ public static final TreeDataModelNodeAdaptor<org.richfaces.model.TreeNode> classicTreeNodeAdaptor =
+ new TreeDataModelNodeAdaptor<org.richfaces.model.TreeNode>() {
+
+ public org.richfaces.model.TreeNode getChild(org.richfaces.model.TreeNode node, Object key) {
+ return node.getChild(key);
+ }
+
+ public Iterator<Entry<Object, org.richfaces.model.TreeNode>> getChildren(
+ org.richfaces.model.TreeNode node) {
+ return node.getChildren();
+ }
+
+ public org.richfaces.model.TreeNode getParent(org.richfaces.model.TreeNode node) {
+ return node.getParent();
+ }
+
+ public Object getRowData(org.richfaces.model.TreeNode node) {
+ return node.getData();
+ }
+
+ public boolean isLeaf(org.richfaces.model.TreeNode node) {
+ return node.isLeaf();
+ }
+
+ /**
+ * Get node local id in it's parent childs collection
+ *
+ * @param childNode node to get identifier for
+ * @return node local identifier
+ */
+ public Object getChildNodeId(org.richfaces.model.TreeNode childNode) {
+ org.richfaces.model.TreeNode parentNode = getParent(childNode);
+ if (childNode != null && parentNode != null) {
+ Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
+ while (iter != null && iter.hasNext()) {
+ Map.Entry<Object, TreeNode> entry = iter.next();
+ if (entry != null && childNode.equals(entry.getValue())) {
+ return entry.getKey();
+ }
+ }
+ }
+ return null;
+ }
+
+ public void appendChild(org.richfaces.model.TreeNode parentNode,
+ Object childKey, org.richfaces.model.TreeNode childNode) {
+
+ parentNode.addChild(childKey, childNode);
+ }
+
+ public void removeFromParent(org.richfaces.model.TreeNode childNode) {
+ org.richfaces.model.TreeNode parent = childNode.getParent();
+ Object childNodeId = getChildNodeId(childNode);
+ if (childNodeId != null) {
+ parent.removeChild(childNodeId);
+ }
+ }
+ };
+
+ /**
+ * Instance of {@link TreeDataModelNodeAdaptor} for {@link javax.swing.tree.TreeNode} nodes handling
+ */
+ public static final TreeDataModelNodeAdaptor<javax.swing.tree.TreeNode> swingTreeNodeAdaptor =
+ new TreeDataModelNodeAdaptor<javax.swing.tree.TreeNode>() {
+
+ final class SwingNodeMapEntry implements Map.Entry<Object, TreeNode> {
+
+ private Object key;
+ private TreeNode child;
+
+ public SwingNodeMapEntry(int i, TreeNode child) {
+ this.key = Integer.valueOf(i);
+ this.child = child;
+ }
+
+ public Object getKey() {
+ return this.key;
+ }
+
+ public TreeNode getValue() {
+ return child;
+ }
+
+ public TreeNode setValue(TreeNode value) {
+ TreeNode node = this.child;
+ this.child = value;
+
+ return node;
+ }
+
+ };
+
+ public javax.swing.tree.TreeNode getChild(
+ javax.swing.tree.TreeNode node, Object key) {
+
+ int intKey = ((Integer) key).intValue();
+ if (intKey < node.getChildCount() && intKey >= 0) {
+ return node.getChildAt(intKey);
+ }
+
+ return null;
+ }
+
+ public Iterator<Entry<Object, javax.swing.tree.TreeNode>> getChildren(
+ final javax.swing.tree.TreeNode node) {
+
+ if (node.getAllowsChildren()) {
+ return new Iterator<Entry<Object,javax.swing.tree.TreeNode>>() {
+
+ private final Enumeration<?> e = node.children();
+ private int counter = 0;
+
+ public boolean hasNext() {
+ return e.hasMoreElements();
+ }
+
+ public Entry<Object, javax.swing.tree.TreeNode> next() {
+ javax.swing.tree.TreeNode child = (javax.swing.tree.TreeNode) e.nextElement();
+ SwingNodeMapEntry entry = new SwingNodeMapEntry(counter++, child);
+ return entry;
+
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ }
+
+ return null;
+ }
+
+ public javax.swing.tree.TreeNode getParent(
+ javax.swing.tree.TreeNode node) {
+ return node.getParent();
+ }
+
+ public Object getRowData(javax.swing.tree.TreeNode node) {
+ return node;
+ }
+
+ public boolean isLeaf(javax.swing.tree.TreeNode node) {
+ return !node.getAllowsChildren() || node.isLeaf();
+ }
+
+ /**
+ * Get node local id in it's parent childs collection
+ *
+ * @param childNode node to get identifier for
+ * @return node local identifier
+ */
+ public Object getChildNodeId(javax.swing.tree.TreeNode childNode) {
+ javax.swing.tree.TreeNode parentNode = getParent(childNode);
+ if (childNode != null && parentNode != null) {
+ int idx = parentNode.getIndex(childNode);
+ if (idx != -1) {
+ return idx;
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void appendChild(javax.swing.tree.TreeNode parentNode, Object key,
+ javax.swing.tree.TreeNode childNode) {
+
+ if (childNode instanceof MutableTreeNode) {
+ MutableTreeNode mutableChildNode = (MutableTreeNode) childNode;
+ MutableTreeNode mutableParentNode = (MutableTreeNode) parentNode;
+ int idx;
+
+ if (key != null) {
+ idx = (Integer) key;
+ } else {
+ idx = mutableParentNode.getChildCount();
+ }
+
+ mutableParentNode.insert(mutableChildNode, idx);
+ } else {
+ SwingTreeNodeImpl swingTreeNodeImpl = (SwingTreeNodeImpl) childNode;
+ SwingTreeNodeImpl parent = (SwingTreeNodeImpl) parentNode;
+
+ if (key != null) {
+ parent.addChild(key, swingTreeNodeImpl);
+ } else {
+ parent.addChild(swingTreeNodeImpl);
+ }
+
+ swingTreeNodeImpl.setParent(parent);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void removeFromParent(javax.swing.tree.TreeNode node) {
+ if (node instanceof MutableTreeNode) {
+ ((MutableTreeNode) node).removeFromParent();
+ } else {
+ SwingTreeNodeImpl swingTreeNodeImpl = (SwingTreeNodeImpl) node;
+ SwingTreeNodeImpl parent = (SwingTreeNodeImpl) swingTreeNodeImpl.getParent();
+
+ parent.removeChild(swingTreeNodeImpl);
+ swingTreeNodeImpl.setParent(null);
+ }
+ }
+ };
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,35 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import javax.faces.component.UIComponent;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 29.07.2007
- *
- */
-public interface TreeModelVisualComponentProvider {
- public UIComponent getComponent();
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,35 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 29.07.2007
+ *
+ */
+public interface TreeModelVisualComponentProvider {
+ public UIComponent getComponent();
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,112 +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.model;
-
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.faces.component.NamingContainer;
-
-
-/**
- * Interface representing tree ADT nodes
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 16.11.2006
- */
-public interface TreeNode<T> extends Serializable{
-
- /**
- * getter for node attached data
- * @return node attached data
- */
- public T getData();
- /**
- * setter for node attached data
- * @param data data to set as attached node data
- */
- public void setData(T data);
-
- /**
- * Returns whether this node is leaf
- * @return <code>true</code> if this node is leaf else returns <code>false</code>
- */
- public boolean isLeaf();
-
- /**
- * Getter for children entries. Each children entry contains identifier (key) and child node (value).
- *
- * Identifiers are used to generate model keys representing paths to tree node. Model keys are used:
- * <ol>
- * <li>
- * For persisting tree state. That means that identifiers should be serializable when
- * some JSF features are used, e.g. client-side state saving.
- * </li>
- * <li>
- * For constructing client identifiers. Client identifier for tree nodes consists of
- * {@link Object#toString()} representations of identifier separated with
- * {@link NamingContainer#SEPARATOR_CHAR} chars. String representation of identifier
- * should be a valid XML ID, e.g. conform to this: <a href="http://www.w3.org/TR/xml11/#NT-Name">
- * XML Name Production</a>
- * production.
- * </li>
- * </ol>
- *
- * @return {@link Iterator} of {@link Map.Entry} instances containing {@link TreeNode} as values
- * and their identifiers as keys.
- *
- */
- public Iterator<Map.Entry<Object, TreeNode<T>>> getChildren();
- /**
- * find child by id
- * Please see {@link #getChildren()} for more information about identifier constraints.
- * @param id identifier of the child to find
- * @return designated {@link TreeNode} instance or <code>null</code>
- */
- public TreeNode<T> getChild(Object id);
-
- /**
- * adds child to children collection
- * @param identifier child identifier.
- * Please see {@link #getChildren()} for more information about identifier constraints.
- * @param child child
- */
- public void addChild(Object identifier, TreeNode<T> child);
-
- /**
- * Please see {@link #getChildren()} for more information about identifier constraints.
- * removes child from children collection by child id
- * @param id id of the child to remove
- */
- public void removeChild(Object id);
-
- /**
- * getter for parent {@link TreeNode}
- * @return parent {@link TreeNode} instance or <code>null</code> if this node is root
- */
- public TreeNode<T> getParent();
- /**
- * setter for parent {@link TreeNode}
- * @param parent {@link TreeNode} to set as parent
- */
- public void setParent(TreeNode<T> parent);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNode.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,112 @@
+/**
+ * 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.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.component.NamingContainer;
+
+
+/**
+ * Interface representing tree ADT nodes
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 16.11.2006
+ */
+public interface TreeNode<T> extends Serializable{
+
+ /**
+ * getter for node attached data
+ * @return node attached data
+ */
+ public T getData();
+ /**
+ * setter for node attached data
+ * @param data data to set as attached node data
+ */
+ public void setData(T data);
+
+ /**
+ * Returns whether this node is leaf
+ * @return <code>true</code> if this node is leaf else returns <code>false</code>
+ */
+ public boolean isLeaf();
+
+ /**
+ * Getter for children entries. Each children entry contains identifier (key) and child node (value).
+ *
+ * Identifiers are used to generate model keys representing paths to tree node. Model keys are used:
+ * <ol>
+ * <li>
+ * For persisting tree state. That means that identifiers should be serializable when
+ * some JSF features are used, e.g. client-side state saving.
+ * </li>
+ * <li>
+ * For constructing client identifiers. Client identifier for tree nodes consists of
+ * {@link Object#toString()} representations of identifier separated with
+ * {@link NamingContainer#SEPARATOR_CHAR} chars. String representation of identifier
+ * should be a valid XML ID, e.g. conform to this: <a href="http://www.w3.org/TR/xml11/#NT-Name">
+ * XML Name Production</a>
+ * production.
+ * </li>
+ * </ol>
+ *
+ * @return {@link Iterator} of {@link Map.Entry} instances containing {@link TreeNode} as values
+ * and their identifiers as keys.
+ *
+ */
+ public Iterator<Map.Entry<Object, TreeNode<T>>> getChildren();
+ /**
+ * find child by id
+ * Please see {@link #getChildren()} for more information about identifier constraints.
+ * @param id identifier of the child to find
+ * @return designated {@link TreeNode} instance or <code>null</code>
+ */
+ public TreeNode<T> getChild(Object id);
+
+ /**
+ * adds child to children collection
+ * @param identifier child identifier.
+ * Please see {@link #getChildren()} for more information about identifier constraints.
+ * @param child child
+ */
+ public void addChild(Object identifier, TreeNode<T> child);
+
+ /**
+ * Please see {@link #getChildren()} for more information about identifier constraints.
+ * removes child from children collection by child id
+ * @param id id of the child to remove
+ */
+ public void removeChild(Object id);
+
+ /**
+ * getter for parent {@link TreeNode}
+ * @return parent {@link TreeNode} instance or <code>null</code> if this node is root
+ */
+ public TreeNode<T> getParent();
+ /**
+ * setter for parent {@link TreeNode}
+ * @param parent {@link TreeNode} to set as parent
+ */
+ public void setParent(TreeNode<T> parent);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,84 +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.model;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Default {@link TreeNode} implementation based on {@link LinkedHashMap} to preserve
- * elements ordering
- *
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 16.11.2006
- */
-public class TreeNodeImpl<T> implements TreeNode<T> {
-
- private static final long serialVersionUID = -5498990493803705085L;
- private T data;
- private TreeNode<T> parent;
-
- private Map<Object, TreeNode<T>> childrenMap =
- new LinkedHashMap<Object, TreeNode<T>>();
-
- public T getData() {
- return data;
- }
-
- public TreeNode<T> getChild(Object identifier) {
- return (TreeNode<T>) childrenMap.get(identifier);
- }
-
- public void addChild(Object identifier, TreeNode<T> child) {
- child.setParent(this);
- childrenMap.put(identifier, child);
- }
-
- public void removeChild(Object identifier) {
- TreeNode<T> treeNode = childrenMap.remove(identifier);
- if (treeNode != null) {
- treeNode.setParent(null);
- }
- }
-
- public void setData(T data) {
- this.data = data;
- }
-
- public TreeNode<T> getParent() {
- return parent;
- }
-
- public void setParent(TreeNode<T> parent) {
- this.parent = parent;
- }
-
- public Iterator<Map.Entry<Object, TreeNode<T>>> getChildren() {
- return childrenMap.entrySet().iterator();
- }
-
- public boolean isLeaf() {
- return childrenMap.isEmpty();
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,84 @@
+/**
+ * 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.model;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Default {@link TreeNode} implementation based on {@link LinkedHashMap} to preserve
+ * elements ordering
+ *
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 16.11.2006
+ */
+public class TreeNodeImpl<T> implements TreeNode<T> {
+
+ private static final long serialVersionUID = -5498990493803705085L;
+ private T data;
+ private TreeNode<T> parent;
+
+ private Map<Object, TreeNode<T>> childrenMap =
+ new LinkedHashMap<Object, TreeNode<T>>();
+
+ public T getData() {
+ return data;
+ }
+
+ public TreeNode<T> getChild(Object identifier) {
+ return (TreeNode<T>) childrenMap.get(identifier);
+ }
+
+ public void addChild(Object identifier, TreeNode<T> child) {
+ child.setParent(this);
+ childrenMap.put(identifier, child);
+ }
+
+ public void removeChild(Object identifier) {
+ TreeNode<T> treeNode = childrenMap.remove(identifier);
+ if (treeNode != null) {
+ treeNode.setParent(null);
+ }
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
+ public TreeNode<T> getParent() {
+ return parent;
+ }
+
+ public void setParent(TreeNode<T> parent) {
+ this.parent = parent;
+ }
+
+ public Iterator<Map.Entry<Object, TreeNode<T>>> getChildren() {
+ return childrenMap.entrySet().iterator();
+ }
+
+ public boolean isLeaf() {
+ return childrenMap.isEmpty();
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,66 +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.model;
-
-import org.ajax4jsf.model.Range;
-
-/**
- * {@link Range} implmentation variant for {@link AbstractTreeDataModel}
- *
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 23.11.2006
- */
-public interface TreeRange extends Range {
-
- /**
- * Returns <code>true</code> if node with that rowKey should be processed.
- * If <code>false</code> is returned, then skips processing child nodes also.
- * @param rowKey {@link TreeRowKey} key instance
- * @return <code>true</code> or <code>false</code>
- */
- public boolean processNode(TreeRowKey rowKey);
-
- /**
- * Returns <code>true</code> if children of the node with that rowKey should be processed
- * @param rowKey {@link TreeRowKey} key instance
- * @return <code>true</code> or <code>false</code>
- */
- public boolean processChildren(TreeRowKey rowKey);
-
-
- /**
- * Unconstrained variant of {@link TreeRange}.
- * Is stateless and safe to use in multi-threaded environments.
- *
- * @since 3.2.2
- * @author Nick Belaevski
- */
- public final static TreeRange RANGE_UNCONSTRAINED = new TreeRange() {
- public boolean processChildren(TreeRowKey rowKey) {
- return true;
- }
-
- public boolean processNode(TreeRowKey rowKey) {
- return true;
- }
- };
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRange.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,66 @@
+/**
+ * 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.model;
+
+import org.ajax4jsf.model.Range;
+
+/**
+ * {@link Range} implmentation variant for {@link AbstractTreeDataModel}
+ *
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 23.11.2006
+ */
+public interface TreeRange extends Range {
+
+ /**
+ * Returns <code>true</code> if node with that rowKey should be processed.
+ * If <code>false</code> is returned, then skips processing child nodes also.
+ * @param rowKey {@link TreeRowKey} key instance
+ * @return <code>true</code> or <code>false</code>
+ */
+ public boolean processNode(TreeRowKey rowKey);
+
+ /**
+ * Returns <code>true</code> if children of the node with that rowKey should be processed
+ * @param rowKey {@link TreeRowKey} key instance
+ * @return <code>true</code> or <code>false</code>
+ */
+ public boolean processChildren(TreeRowKey rowKey);
+
+
+ /**
+ * Unconstrained variant of {@link TreeRange}.
+ * Is stateless and safe to use in multi-threaded environments.
+ *
+ * @since 3.2.2
+ * @author Nick Belaevski
+ */
+ public final static TreeRange RANGE_UNCONSTRAINED = new TreeRange() {
+ public boolean processChildren(TreeRowKey rowKey) {
+ return true;
+ }
+
+ public boolean processNode(TreeRowKey rowKey) {
+ return true;
+ }
+ };
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,103 +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.model;
-
-import java.io.Serializable;
-import java.util.Iterator;
-
-/**
- * Base abstract clas for all tree row keys
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 06.12.2006
- */
-public abstract class TreeRowKey<T> implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -7318192501938658798L;
-
- public static final char SEPARATOR_ESCAPE_CHAR = '_';
-
- /**
- * getter for key depth
- * @return key depth
- */
- public abstract int depth();
-
- /**
- * getter for subpath iterator
- * @param fromIndex
- * @return subpath segments iterator
- */
- public abstract Iterator<T> getSubPathIterator(int fromIndex);
-
- /**
- * getter for path string representation
- * @return path string
- */
- public abstract String getPath();
-
- public String toString() {
- return getPath();
- }
-
- /**
- * tests if specified rowKey is sub-key of this row key
- * @param rowKey
- * @return
- */
- public boolean isSubKey(TreeRowKey<T> rowKey) {
- if (rowKey == null) {
- return false;
- }
-
- String otherPath = rowKey.getPath();
- String path = getPath();
-
- if (otherPath.startsWith(path)) {
- return otherPath.length() == path.length() ||
- otherPath.charAt(path.length()) == AbstractTreeDataModel.SEPARATOR;
- } else {
- return false;
- }
- }
-
- /**
- * getter for path iterator
- * @return path segments iterator
- */
- public abstract Iterator<T> iterator();
-
- /**
- * returns this row key and otherRowKey argument row key common path segments count
- * @param otherRowKey {@link TreeRowKey} to count common path segments for
- * @return common path segmments count
- */
- public abstract int getCommonPathLength(TreeRowKey<T> otherRowKey);
-
- public abstract TreeRowKey<T> getParentKey();
-
- public TreeRowKey<T> getSubKey(int fromIndex) {
- throw new UnsupportedOperationException();
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,103 @@
+/**
+ * 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.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+
+/**
+ * Base abstract clas for all tree row keys
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 06.12.2006
+ */
+public abstract class TreeRowKey<T> implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7318192501938658798L;
+
+ public static final char SEPARATOR_ESCAPE_CHAR = '_';
+
+ /**
+ * getter for key depth
+ * @return key depth
+ */
+ public abstract int depth();
+
+ /**
+ * getter for subpath iterator
+ * @param fromIndex
+ * @return subpath segments iterator
+ */
+ public abstract Iterator<T> getSubPathIterator(int fromIndex);
+
+ /**
+ * getter for path string representation
+ * @return path string
+ */
+ public abstract String getPath();
+
+ public String toString() {
+ return getPath();
+ }
+
+ /**
+ * tests if specified rowKey is sub-key of this row key
+ * @param rowKey
+ * @return
+ */
+ public boolean isSubKey(TreeRowKey<T> rowKey) {
+ if (rowKey == null) {
+ return false;
+ }
+
+ String otherPath = rowKey.getPath();
+ String path = getPath();
+
+ if (otherPath.startsWith(path)) {
+ return otherPath.length() == path.length() ||
+ otherPath.charAt(path.length()) == AbstractTreeDataModel.SEPARATOR;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * getter for path iterator
+ * @return path segments iterator
+ */
+ public abstract Iterator<T> iterator();
+
+ /**
+ * returns this row key and otherRowKey argument row key common path segments count
+ * @param otherRowKey {@link TreeRowKey} to count common path segments for
+ * @return common path segmments count
+ */
+ public abstract int getCommonPathLength(TreeRowKey<T> otherRowKey);
+
+ public abstract TreeRowKey<T> getParentKey();
+
+ public TreeRowKey<T> getSubKey(int fromIndex) {
+ throw new UnsupportedOperationException();
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,122 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.model;
-
-import java.io.File;
-import java.io.Serializable;
-
-/**
- * Class provides object holder for file uploaded.
- * Instance of this type will be returned by UploadEvent after appropriate listener called after uploading has been completed.
- * @author "Andrey Markavtsov"
- *
- */
-public class UploadItem implements Serializable{
-
- /**
- * Serial id
- */
- private static final long serialVersionUID = -111723029745124147L;
-
- /** Users file name */
- private String fileName;
-
- /** Content type */
- private String contentType;
-
- /** java.io.File instance */
- private File file;
-
- /** File byte content */
- private byte [] bytes;
-
- /** File size */
- private int fileSize;
-
- /**
- * Constructor for the UploadItem
- */
- public UploadItem(String fileName, int fileSize, String contentType, Object file) {
- this.fileName = fileName;
- this.contentType = contentType;
- this.fileSize = fileSize;
- if (null != file) {
- if (file.getClass().isAssignableFrom(File.class)) {
- this.file = (File) file;
- } else if (file.getClass().isAssignableFrom(byte[].class)) {
- this.bytes = (byte[]) file;
- }
- }
- }
-
- /**
- * Return true if file is holding as java.io.File type.
- * If true getFile method should be invoked to get file uploaded.
- * In another case getData method should be invoked to get file's bytes.
- * @return
- */
- public boolean isTempFile () {
- return (null != file);
- }
-
- /**
- * This method should called only in case of TRUE value returned by {@link #isTempFile()} method.
- * Otherwise null value will be returned by this method.
- * @return the file
- */
- public File getFile() {
- return file;
- }
-
- /**
- * This method should called only in case of FALSE value returned by {@link #isTempFile()} method.
- * Otherwise null value will be returned by this method.
- * @return the bytes
- * @throws Exception
- */
- public byte[] getData() {
- return bytes;
- }
-
- /**
- * @return the fileName
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
- * @return the contentType
- */
- public String getContentType() {
- return contentType;
- }
-
- /**
- * @return the fileSize
- */
- public int getFileSize() {
- return fileSize;
- }
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/UploadItem.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,122 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model;
+
+import java.io.File;
+import java.io.Serializable;
+
+/**
+ * Class provides object holder for file uploaded.
+ * Instance of this type will be returned by UploadEvent after appropriate listener called after uploading has been completed.
+ * @author "Andrey Markavtsov"
+ *
+ */
+public class UploadItem implements Serializable{
+
+ /**
+ * Serial id
+ */
+ private static final long serialVersionUID = -111723029745124147L;
+
+ /** Users file name */
+ private String fileName;
+
+ /** Content type */
+ private String contentType;
+
+ /** java.io.File instance */
+ private File file;
+
+ /** File byte content */
+ private byte [] bytes;
+
+ /** File size */
+ private int fileSize;
+
+ /**
+ * Constructor for the UploadItem
+ */
+ public UploadItem(String fileName, int fileSize, String contentType, Object file) {
+ this.fileName = fileName;
+ this.contentType = contentType;
+ this.fileSize = fileSize;
+ if (null != file) {
+ if (file.getClass().isAssignableFrom(File.class)) {
+ this.file = (File) file;
+ } else if (file.getClass().isAssignableFrom(byte[].class)) {
+ this.bytes = (byte[]) file;
+ }
+ }
+ }
+
+ /**
+ * Return true if file is holding as java.io.File type.
+ * If true getFile method should be invoked to get file uploaded.
+ * In another case getData method should be invoked to get file's bytes.
+ * @return
+ */
+ public boolean isTempFile () {
+ return (null != file);
+ }
+
+ /**
+ * This method should called only in case of TRUE value returned by {@link #isTempFile()} method.
+ * Otherwise null value will be returned by this method.
+ * @return the file
+ */
+ public File getFile() {
+ return file;
+ }
+
+ /**
+ * This method should called only in case of FALSE value returned by {@link #isTempFile()} method.
+ * Otherwise null value will be returned by this method.
+ * @return the bytes
+ * @throws Exception
+ */
+ public byte[] getData() {
+ return bytes;
+ }
+
+ /**
+ * @return the fileName
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ /**
+ * @return the contentType
+ */
+ public String getContentType() {
+ return contentType;
+ }
+
+ /**
+ * @return the fileSize
+ */
+ public int getFileSize() {
+ return fileSize;
+ }
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,61 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model;
-
-import javax.faces.component.UIComponent;
-
-/**
- * That is intended for internal use
- *
- * @author Nick Belaevski
- * mailto:nbelaevski@exadel.com
- * created 15.08.2007
- *
- */
-public class VisualStackingTreeModel extends StackingTreeModel implements TreeModelVisualComponentProvider {
- private UIComponent component;
-
- public VisualStackingTreeModel(UIComponent component) {
- super();
-
- this.component = component;
- }
-
- public VisualStackingTreeModel(String id, String var,
- StackingTreeModelDataProvider dataProvider, UIComponent component) {
- super(id, var, dataProvider);
-
- this.component = component;
- }
-
- public UIComponent getComponent() {
- if (this.component != null) {
- return this.component;
- }
-
- StackingTreeModel currentModel = getCurrentModel();
- if (currentModel != null && currentModel != this) {
- return ((TreeModelVisualComponentProvider) currentModel).getComponent();
- }
-
- return null;
- }
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,61 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * That is intended for internal use
+ *
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 15.08.2007
+ *
+ */
+public class VisualStackingTreeModel extends StackingTreeModel implements TreeModelVisualComponentProvider {
+ private UIComponent component;
+
+ public VisualStackingTreeModel(UIComponent component) {
+ super();
+
+ this.component = component;
+ }
+
+ public VisualStackingTreeModel(String id, String var,
+ StackingTreeModelDataProvider dataProvider, UIComponent component) {
+ super(id, var, dataProvider);
+
+ this.component = component;
+ }
+
+ public UIComponent getComponent() {
+ if (this.component != null) {
+ return this.component;
+ }
+
+ StackingTreeModel currentModel = getCurrentModel();
+ if (currentModel != null && currentModel != this) {
+ return ((TreeModelVisualComponentProvider) currentModel).getComponent();
+ }
+
+ return null;
+ }
+}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,29 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model.filter;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Filter<T> {
- public boolean accept(T t);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/Filter.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model.filter;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface Filter<T> {
+ public boolean accept(T t);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Model interfaces and classes of filterable RichFaces components
- */
-package org.richfaces.model.filter;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/filter/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Model interfaces and classes of filterable RichFaces components
+ */
+package org.richfaces.model.filter;
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Model APIs of RichFaces components
- */
-package org.richfaces.model;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Model APIs of RichFaces components
+ */
+package org.richfaces.model;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,37 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model.selection;
-
-import java.io.Serializable;
-import java.util.Iterator;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Selection extends Serializable {
-
- public Iterator<Object> getKeys();
-
- public int size();
-
- public boolean isSelected(Object rowKey);
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,37 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model.selection;
+
+import java.io.Serializable;
+import java.util.Iterator;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface Selection extends Serializable {
+
+ public Iterator<Object> getKeys();
+
+ public int size();
+
+ public boolean isSelected(Object rowKey);
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,109 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.model.selection;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SimpleSelection implements Selection {
-
- private static final long serialVersionUID = 1L;
-
- private Set<Object> keys = new LinkedHashSet<Object>();
-
- private boolean selectAll = false;
-
- public boolean addKey(Object rowKey) {
- return keys.add(rowKey);
- }
-
- public boolean removeKey(Object rowKey) {
- selectAll = false;
- return keys.remove(rowKey);
- }
-
- public Iterator<Object> getKeys() {
- Iterator<Object> result = Collections.emptyList().iterator();;
- if (!selectAll) {
- result = keys.iterator();
- }
- return result;
- }
-
- public int size() {
- int result = -1;
- if (!selectAll) {
- result = keys.size();
- }
- return result;
- }
-
- public boolean isSelected(Object rowKey) {
- return selectAll || keys.contains(rowKey);
- }
-
- public void clear() {
- selectAll = false;
- keys.clear();
- }
-
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((keys == null) ? 0 : keys.hashCode());
- result = prime * result + (selectAll ? 1231 : 1237);
- return result;
- }
-
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- SimpleSelection other = (SimpleSelection) obj;
- if (keys == null) {
- if (other.keys != null)
- return false;
- } else if (!keys.equals(other.keys))
- return false;
- if (selectAll != other.selectAll)
- return false;
- return true;
- }
-
- public void setSelectAll(boolean selectAll) {
- this.selectAll = selectAll;
- }
-
- public boolean isSelectAll() {
- return selectAll;
- }
-
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,109 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model.selection;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SimpleSelection implements Selection {
+
+ private static final long serialVersionUID = 1L;
+
+ private Set<Object> keys = new LinkedHashSet<Object>();
+
+ private boolean selectAll = false;
+
+ public boolean addKey(Object rowKey) {
+ return keys.add(rowKey);
+ }
+
+ public boolean removeKey(Object rowKey) {
+ selectAll = false;
+ return keys.remove(rowKey);
+ }
+
+ public Iterator<Object> getKeys() {
+ Iterator<Object> result = Collections.emptyList().iterator();;
+ if (!selectAll) {
+ result = keys.iterator();
+ }
+ return result;
+ }
+
+ public int size() {
+ int result = -1;
+ if (!selectAll) {
+ result = keys.size();
+ }
+ return result;
+ }
+
+ public boolean isSelected(Object rowKey) {
+ return selectAll || keys.contains(rowKey);
+ }
+
+ public void clear() {
+ selectAll = false;
+ keys.clear();
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((keys == null) ? 0 : keys.hashCode());
+ result = prime * result + (selectAll ? 1231 : 1237);
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ SimpleSelection other = (SimpleSelection) obj;
+ if (keys == null) {
+ if (other.keys != null)
+ return false;
+ } else if (!keys.equals(other.keys))
+ return false;
+ if (selectAll != other.selectAll)
+ return false;
+ return true;
+ }
+
+ public void setSelectAll(boolean selectAll) {
+ this.selectAll = selectAll;
+ }
+
+ public boolean isSelectAll() {
+ return selectAll;
+ }
+
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Interfaces and classes representing selection in RichFaces components
- */
-package org.richfaces.model.selection;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/model/selection/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Interfaces and classes representing selection in RichFaces components
+ */
+package org.richfaces.model.selection;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin)
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,343 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.skin;
-
-import javax.faces.context.FacesContext;
-
-/**
- * Main interface for configurable parameters.
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
- *
- */
-public interface Skin {
- // parameters names constants
-
-// parameters names constants
-
- /**
- * used for define url with general CSS file for current skin.
- */
- public static final String generalStyleSheet = "generalStyleSheet";
-
- /**
- * used for define url with extended CSS file for current skin.
- */
- public static final String extendedStyleSheet = "extendedStyleSheet";
-
- /**
- * used for defining a header background color in the panel, a tabpanel active tab
- * background color, a bar background color for ddmenu, tables background color,
- * buttons background color. Default value #1D7DB3.
- */
- public static final String headerBackgroundColor = "headerBackgroundColor";
-
- /**
- * used for defining color of the titles of the top level of the menu, the panel header
- * color, the table header color, color of the title of the active tab in the tabpanel,
- * color of the title on the buttons. Default value #FFFFFF.
- */
- public static final String headTextColor = "headTextColor";
-
- /**
- * used for defining the background color of the bar under the header in the panel and
- * the tabpanel, color of the border for the top level of the ddmenu, background
- * highlight color of the selected item in the dropdown list boxes of the ddmenu,
- * background color of the footer in the tables, color of the text for the inactive and
- * disabled tab in the tabpanel, color of the border of the buttons. Default value
- * #BFD7E4.
- */
- public static final String selectBackgroundColor = "selectBackgroundColor";
-
- /**
- * used for defining the background color of the basic area of the panel and tabpanels,
- * background color of the dropdown list boxes of ddmenu. Default value #BFD7E4.
- */
- public static final String generalBackgroundColor = "generalBackgroundColor";
-
- /**
- * used for defining color of the basic text, color of the text in the dropdown list
- * boxes of ddmenu, color of the right and top borders for the controls like text,
- * textArea, secret. Default value #000000.
- */
- public static final String generalTextColor = "generalTextColor";
-
- /**
- * used for defining shadow background color of the panels, color of the bottom and right
- * borders for the dropdown list box in ddmenu. Default value #AFB1B2.
- */
- public static final String shadowBackgroundColor = "shadowBackgroundColor";
-
- /**
- * used for defining the seamlessness of the tip shadow. Default value 2.
- */
- public static final String shadowOpacity = "shadowOpacity";
-
- /**
- * used for defining tables border color, color of the bottom and left controls like
- * text, textArea, secret, color of the top and left borders for the dropdown list box in
- * the ddmenu. Default value #CCCCCC.
- */
- public static final String tableBorderColor = "tableBorderColor";
-
- /**
- * used for defining tables and controls background color. Default value #FFFFFF.
- */
- public static final String tableBackgroundColor = "tableBackgroundColor";
-
- /**
- * Font size for the displaying panels headers and top level of the ddmenu. Default
- * value 12px.
- */
- public static final String headerSizeFont = "headerSizeFont";
-
- /**
- * Font name for the displaying panels headers and top level of the ddmenu.Default value
- * Arial, Verdana.
- */
- public static final String headerFamilyFont = "headerFamilyFont";
-
- /**
- * Font size for displaying tab titles. Default value 11px.
- */
- public static final String tabSizeFont = "tabSizeFont";
-
- /**
- * Font name for displaying tab titles. Default value Arial, Verdana.
- *
- */
- public static final String tabFamilyFont = "tabFamilyFont";
-
- /**
- * Rounding-off radius of the tabs corners. Default value 5px.
- */
- public static final String tabRadiusCorner = "tabRadiusCorner";
-
- /**
- * Font size for displaying buttons titles. Default value 11px.
- */
- public static final String buttonSizeFont = "buttonSizeFont";
-
- /**
- * Font name for displaying buttons titles. Default value Arial, Verdana.
- */
- public static final String buttonFamilyFont = "buttonFamilyFont";
-
- /**
- * Rounding-off radius of the buttons corners. Default value 13px.
- *
- */
- public static final String buttonRadiusCorner = "buttonRadiusCorner";
-
- /**
- * Rounding-off radius of the panels corners. Default value 5px.
- */
- public static final String panelRadiusCorner = "panelRadiusCorner";
-
- /**
- * Style of the text displaying on the button. Default value normal.
- *
- */
- public static final String buttonStyleFont = "buttonStyleFont";
-
- /**
- * Depth of the text displaying on the button. Default value bold.
- */
- public static final String buttonWeightFont = "buttonWeightFont";
-
- /**
- * Style of the text displaying on the active (selected) tabs.Default value normal.
- */
- public static final String activetabStyleFont = "activetabStyleFont";
-
- /**
- * Depth of the text displaying on the active (selected) tabs.Default value bold.
- */
- public static final String activetabWeightFont = "activetabWeightFont";
-
- /**
- * Style of of the text displaying on the inactive (unselected) tabs. Default value
- * normal.
- */
- public static final String tabStyleFont = "tabStyleFont";
-
- /**
- * Depth of the text displaying on the inactive (unselected) tabs.Default value normal.
- */
- public static final String tabWeightFont = "tabWeightFont";
-
- /**
- * Style of the text displaying on the disabled tabs.Default value normal.
- */
- public static final String disabledTabStyleFont = "disabledTabStyleFont";
-
- /**
- * Depth of the text displaying on the disabled tabs.Default value normal.
- */
- public static final String disabledTabWeightFont = "disabledTabWeightFont";
-
- /**
- * Color for selected checkbox or selectOneRadio.
- */
- public static final String selectControlColor = "selectControlColor";
-
- /**
- * Responsible for the borders color of the radiobutton and checkbox and color of light
- * part of the fields and text area border. Default value #B0B0B0.
- */
- public static final String controlBorderColor = "controlBorderColor";
-
- /**
- * Parameter responsible for 3D Look of panels and buttons.
- */
-
- public static final String interfaceLevel3D = "interfaceLevel3D";
-
- /**
- * defines the layout of the tabs in the panel. Possible values Top. Left. Bottom, Right.
- * Default value ???.
- */
- public static final String preferableTabPosition = "preferableTabPosition";
-
- /**
- * defines the variant of text writing. Values - Hor (horisontal position), Vert
- * (vertical position - letters are arranged into column), VertCW (vertical
- * position with text rotation anticlockwise). Default value Hor.
- */
- public static final String preferableTabTextOrientation = "preferableTabTextOrientation";
- /**
- * text aligning in the tabs with the fixed tab length (hight). Values Left, Center,Right
- * for the horizontal oriented tabs, values Top, center, Bottom - for vertical oriented
- * tabs. Default value center.
- */
-
-
- public static final String preferableTabTextDirection = "preferableTabTextDirection";
-
-
- /**
- *
- */
- public static final String overAllBackground = "overAllBackground";
- /**
- *
- */
- public static final String generalLinkColor = "generalLinkColor";
-
- public static final String panelTextColor = "panelTextColor";
-
- public static final String headerGradientColor = "headerGradientColor";
-
- public static final String additionalBackgroundColor = "additionalBackgroundColor";
-
- public static final String controlBackgroundColor = "controlBackgroundColor";
-
- public static final String generalSizeFont = "generalSizeFont";
-
- public static final String loadStyleSheets = "loadStyleSheets";
-
- public static final String gradientType = "gradientType";
-
- public static final String baseSkin = "baseSkin";
-
- // Preferable parameters
- /**
- * Preferable parameters names for skin ( in common, for Preferable.Name
- * parameter will PreferableName )
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
- *
- */
-
- public interface Preferable {
- /**
- *
- */
- public static final String dataSizeFont = "preferableDataSizeFont";
-
- /**
- *
- */
- public static final String dataFamilyFont = "preferableDataFamilyFont";
-
- /**
- *
- */
- public static final String panelBodyPadding = "preferablePanelBodyPadding";
-
- /**
- *
- */
- public static final String headerWeightFont = "preferableHeaderWeightFont";
-
- }
-
- /**
- * Get Rener Kit name for this skin.
- *
- * @param context -
- * {@link FacesContext } for current request. need for
- * {@link javax.faces.el.ValueBinding} evaluation.
- * @return RenderKitId for this skin, or <code>null</code> for default.
- */
- public String getRenderKitId(FacesContext context);
-
- /**
- * Get value for configuration parameter. If parameter set as EL-expression,
- * calculate it value.
- *
- * @param context -
- * {@link FacesContext } for current request.
- * @param name
- * name of paremeter.
- * @return value of parameter in config, or null
- */
- public Object getParameter(FacesContext context, String name);
-
- /**
- * Get value for configuration parameter. If parameter set as EL-expression,
- * calculate it value.
- *
- * @param context -
- * {@link FacesContext } for current request.
- * @param name
- * name of paremeter.
- * @param defaultValue - default value if parameter not present in Skin
- * @return value of parameter in config, or null
- */
- public Object getParameter(FacesContext context, String name, Object defaultValue);
-
- /**
- * @param name
- * @return
- */
- public boolean containsProperty(String name);
-
- /**
- * Calculate unique ( as possible ) code to identity this skin instance. Used for generate hash key in skin-depended resources
- * @param context
- * @return
- */
- public int hashCode(FacesContext context);
-}
\ No newline at end of file
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Skin.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,343 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.skin;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Main interface for configurable parameters.
+ *
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
+ *
+ */
+public interface Skin {
+ // parameters names constants
+
+// parameters names constants
+
+ /**
+ * used for define url with general CSS file for current skin.
+ */
+ public static final String generalStyleSheet = "generalStyleSheet";
+
+ /**
+ * used for define url with extended CSS file for current skin.
+ */
+ public static final String extendedStyleSheet = "extendedStyleSheet";
+
+ /**
+ * used for defining a header background color in the panel, a tabpanel active tab
+ * background color, a bar background color for ddmenu, tables background color,
+ * buttons background color. Default value #1D7DB3.
+ */
+ public static final String headerBackgroundColor = "headerBackgroundColor";
+
+ /**
+ * used for defining color of the titles of the top level of the menu, the panel header
+ * color, the table header color, color of the title of the active tab in the tabpanel,
+ * color of the title on the buttons. Default value #FFFFFF.
+ */
+ public static final String headTextColor = "headTextColor";
+
+ /**
+ * used for defining the background color of the bar under the header in the panel and
+ * the tabpanel, color of the border for the top level of the ddmenu, background
+ * highlight color of the selected item in the dropdown list boxes of the ddmenu,
+ * background color of the footer in the tables, color of the text for the inactive and
+ * disabled tab in the tabpanel, color of the border of the buttons. Default value
+ * #BFD7E4.
+ */
+ public static final String selectBackgroundColor = "selectBackgroundColor";
+
+ /**
+ * used for defining the background color of the basic area of the panel and tabpanels,
+ * background color of the dropdown list boxes of ddmenu. Default value #BFD7E4.
+ */
+ public static final String generalBackgroundColor = "generalBackgroundColor";
+
+ /**
+ * used for defining color of the basic text, color of the text in the dropdown list
+ * boxes of ddmenu, color of the right and top borders for the controls like text,
+ * textArea, secret. Default value #000000.
+ */
+ public static final String generalTextColor = "generalTextColor";
+
+ /**
+ * used for defining shadow background color of the panels, color of the bottom and right
+ * borders for the dropdown list box in ddmenu. Default value #AFB1B2.
+ */
+ public static final String shadowBackgroundColor = "shadowBackgroundColor";
+
+ /**
+ * used for defining the seamlessness of the tip shadow. Default value 2.
+ */
+ public static final String shadowOpacity = "shadowOpacity";
+
+ /**
+ * used for defining tables border color, color of the bottom and left controls like
+ * text, textArea, secret, color of the top and left borders for the dropdown list box in
+ * the ddmenu. Default value #CCCCCC.
+ */
+ public static final String tableBorderColor = "tableBorderColor";
+
+ /**
+ * used for defining tables and controls background color. Default value #FFFFFF.
+ */
+ public static final String tableBackgroundColor = "tableBackgroundColor";
+
+ /**
+ * Font size for the displaying panels headers and top level of the ddmenu. Default
+ * value 12px.
+ */
+ public static final String headerSizeFont = "headerSizeFont";
+
+ /**
+ * Font name for the displaying panels headers and top level of the ddmenu.Default value
+ * Arial, Verdana.
+ */
+ public static final String headerFamilyFont = "headerFamilyFont";
+
+ /**
+ * Font size for displaying tab titles. Default value 11px.
+ */
+ public static final String tabSizeFont = "tabSizeFont";
+
+ /**
+ * Font name for displaying tab titles. Default value Arial, Verdana.
+ *
+ */
+ public static final String tabFamilyFont = "tabFamilyFont";
+
+ /**
+ * Rounding-off radius of the tabs corners. Default value 5px.
+ */
+ public static final String tabRadiusCorner = "tabRadiusCorner";
+
+ /**
+ * Font size for displaying buttons titles. Default value 11px.
+ */
+ public static final String buttonSizeFont = "buttonSizeFont";
+
+ /**
+ * Font name for displaying buttons titles. Default value Arial, Verdana.
+ */
+ public static final String buttonFamilyFont = "buttonFamilyFont";
+
+ /**
+ * Rounding-off radius of the buttons corners. Default value 13px.
+ *
+ */
+ public static final String buttonRadiusCorner = "buttonRadiusCorner";
+
+ /**
+ * Rounding-off radius of the panels corners. Default value 5px.
+ */
+ public static final String panelRadiusCorner = "panelRadiusCorner";
+
+ /**
+ * Style of the text displaying on the button. Default value normal.
+ *
+ */
+ public static final String buttonStyleFont = "buttonStyleFont";
+
+ /**
+ * Depth of the text displaying on the button. Default value bold.
+ */
+ public static final String buttonWeightFont = "buttonWeightFont";
+
+ /**
+ * Style of the text displaying on the active (selected) tabs.Default value normal.
+ */
+ public static final String activetabStyleFont = "activetabStyleFont";
+
+ /**
+ * Depth of the text displaying on the active (selected) tabs.Default value bold.
+ */
+ public static final String activetabWeightFont = "activetabWeightFont";
+
+ /**
+ * Style of of the text displaying on the inactive (unselected) tabs. Default value
+ * normal.
+ */
+ public static final String tabStyleFont = "tabStyleFont";
+
+ /**
+ * Depth of the text displaying on the inactive (unselected) tabs.Default value normal.
+ */
+ public static final String tabWeightFont = "tabWeightFont";
+
+ /**
+ * Style of the text displaying on the disabled tabs.Default value normal.
+ */
+ public static final String disabledTabStyleFont = "disabledTabStyleFont";
+
+ /**
+ * Depth of the text displaying on the disabled tabs.Default value normal.
+ */
+ public static final String disabledTabWeightFont = "disabledTabWeightFont";
+
+ /**
+ * Color for selected checkbox or selectOneRadio.
+ */
+ public static final String selectControlColor = "selectControlColor";
+
+ /**
+ * Responsible for the borders color of the radiobutton and checkbox and color of light
+ * part of the fields and text area border. Default value #B0B0B0.
+ */
+ public static final String controlBorderColor = "controlBorderColor";
+
+ /**
+ * Parameter responsible for 3D Look of panels and buttons.
+ */
+
+ public static final String interfaceLevel3D = "interfaceLevel3D";
+
+ /**
+ * defines the layout of the tabs in the panel. Possible values Top. Left. Bottom, Right.
+ * Default value ???.
+ */
+ public static final String preferableTabPosition = "preferableTabPosition";
+
+ /**
+ * defines the variant of text writing. Values - Hor (horisontal position), Vert
+ * (vertical position - letters are arranged into column), VertCW (vertical
+ * position with text rotation anticlockwise). Default value Hor.
+ */
+ public static final String preferableTabTextOrientation = "preferableTabTextOrientation";
+ /**
+ * text aligning in the tabs with the fixed tab length (hight). Values Left, Center,Right
+ * for the horizontal oriented tabs, values Top, center, Bottom - for vertical oriented
+ * tabs. Default value center.
+ */
+
+
+ public static final String preferableTabTextDirection = "preferableTabTextDirection";
+
+
+ /**
+ *
+ */
+ public static final String overAllBackground = "overAllBackground";
+ /**
+ *
+ */
+ public static final String generalLinkColor = "generalLinkColor";
+
+ public static final String panelTextColor = "panelTextColor";
+
+ public static final String headerGradientColor = "headerGradientColor";
+
+ public static final String additionalBackgroundColor = "additionalBackgroundColor";
+
+ public static final String controlBackgroundColor = "controlBackgroundColor";
+
+ public static final String generalSizeFont = "generalSizeFont";
+
+ public static final String loadStyleSheets = "loadStyleSheets";
+
+ public static final String gradientType = "gradientType";
+
+ public static final String baseSkin = "baseSkin";
+
+ // Preferable parameters
+ /**
+ * Preferable parameters names for skin ( in common, for Preferable.Name
+ * parameter will PreferableName )
+ *
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
+ *
+ */
+
+ public interface Preferable {
+ /**
+ *
+ */
+ public static final String dataSizeFont = "preferableDataSizeFont";
+
+ /**
+ *
+ */
+ public static final String dataFamilyFont = "preferableDataFamilyFont";
+
+ /**
+ *
+ */
+ public static final String panelBodyPadding = "preferablePanelBodyPadding";
+
+ /**
+ *
+ */
+ public static final String headerWeightFont = "preferableHeaderWeightFont";
+
+ }
+
+ /**
+ * Get Rener Kit name for this skin.
+ *
+ * @param context -
+ * {@link FacesContext } for current request. need for
+ * {@link javax.faces.el.ValueBinding} evaluation.
+ * @return RenderKitId for this skin, or <code>null</code> for default.
+ */
+ public String getRenderKitId(FacesContext context);
+
+ /**
+ * Get value for configuration parameter. If parameter set as EL-expression,
+ * calculate it value.
+ *
+ * @param context -
+ * {@link FacesContext } for current request.
+ * @param name
+ * name of paremeter.
+ * @return value of parameter in config, or null
+ */
+ public Object getParameter(FacesContext context, String name);
+
+ /**
+ * Get value for configuration parameter. If parameter set as EL-expression,
+ * calculate it value.
+ *
+ * @param context -
+ * {@link FacesContext } for current request.
+ * @param name
+ * name of paremeter.
+ * @param defaultValue - default value if parameter not present in Skin
+ * @return value of parameter in config, or null
+ */
+ public Object getParameter(FacesContext context, String name, Object defaultValue);
+
+ /**
+ * @param name
+ * @return
+ */
+ public boolean containsProperty(String name);
+
+ /**
+ * Calculate unique ( as possible ) code to identity this skin instance. Used for generate hash key in skin-depended resources
+ * @param context
+ * @return
+ */
+ public int hashCode(FacesContext context);
+}
\ No newline at end of file
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,70 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.skin;
-
-import javax.faces.context.FacesContext;
-
-/**
- * Fine tuning parameters for components configuration.
- * For any skin, calculation of concrete component parameners done by special "configuration",
- * pointed as special skin parameter ( or by default configuration ).
- * Work like "transformation" of limited set Skin parameters to fine-grained individual component
- * parameters.
- * @author shura
- *
- */
-public interface SkinConfiguration {
-
- /**
- * Get value for configuration parameter. If parameter set as EL-expression,
- * calculate it value.
- *
- * @param context -
- * {@link FacesContext } for current request.
- * @param name
- * name of paremeter.
- * @return value of parameter in config, or null
- */
- public Object getParameter(FacesContext context, String name);
-
- /**
- * Get value for skin parameter, for build extensible ( mandatory/fine tuning ) with three-stage checks :
- * <ul>
- * <li>first, check value for parameter with given name. If value not null, return it</li>
- * <li>second, got parameter value from skin by skinName key. If not null, return it.</li>
- * <li>if both above parameters is null, return default value.</li>
- * </ul>
- * @param context - Current JSF context.
- * @param name - name of parameter.
- * @param skinName - name of according ( default ) parameter i Skin for same purpose. may be <code>null</code>.
- * @param defaultValue - default parameter value.
- * @return - value of parameter.
- */
- public Object getParameter(FacesContext context, String name,String skinName, Object defaultValue);
- /**
- * Test for present parameter for given name.
- * @param name of parameter to test
- * @return true if parameter present in configuration.
- */
- public boolean containsParameter(String name);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinConfiguration.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.skin;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Fine tuning parameters for components configuration.
+ * For any skin, calculation of concrete component parameners done by special "configuration",
+ * pointed as special skin parameter ( or by default configuration ).
+ * Work like "transformation" of limited set Skin parameters to fine-grained individual component
+ * parameters.
+ * @author shura
+ *
+ */
+public interface SkinConfiguration {
+
+ /**
+ * Get value for configuration parameter. If parameter set as EL-expression,
+ * calculate it value.
+ *
+ * @param context -
+ * {@link FacesContext } for current request.
+ * @param name
+ * name of paremeter.
+ * @return value of parameter in config, or null
+ */
+ public Object getParameter(FacesContext context, String name);
+
+ /**
+ * Get value for skin parameter, for build extensible ( mandatory/fine tuning ) with three-stage checks :
+ * <ul>
+ * <li>first, check value for parameter with given name. If value not null, return it</li>
+ * <li>second, got parameter value from skin by skinName key. If not null, return it.</li>
+ * <li>if both above parameters is null, return default value.</li>
+ * </ul>
+ * @param context - Current JSF context.
+ * @param name - name of parameter.
+ * @param skinName - name of according ( default ) parameter i Skin for same purpose. may be <code>null</code>.
+ * @param defaultValue - default parameter value.
+ * @return - value of parameter.
+ */
+ public Object getParameter(FacesContext context, String name,String skinName, Object defaultValue);
+ /**
+ * Test for present parameter for given name.
+ * @param name of parameter to test
+ * @return true if parameter present in configuration.
+ */
+ public boolean containsParameter(String name);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,213 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.skin;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.resource.util.URLToStreamHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Base factory class ( implement Singleton design pattern ). Produce self
- * instance to build current skin configuration. At present, realised as lazy
- * creation factory. TODO - select point to initialize.
- *
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
- *
- */
-public abstract class SkinFactory {
-
- /**
- * static instance variable.
- */
- private static Map<ClassLoader, SkinFactory> instances =
- Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
-
- private static final Log log = LogFactory.getLog(SkinFactory.class);
-
-
- public static void reset() {
- instances = Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
- }
-
- /**
- * Initialize skin factory. TODO - make call from init() method of any
- * servlet or custom faces element method ??? If exist resource
- * META-INF/services/org.richfaces.skin.SkinFactory , create
- * instance of class by name from first line of this file. If such class
- * have constructor with {@link SkinFactory} parameter, instantiate it with
- * instance of default factory ( as usual in JSF ). If any error occurs in
- * instantiate custom factory, return default.
- */
- public static final SkinFactory getInstance() {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- SkinFactory instance = (SkinFactory) instances.get(loader);
- if (instance == null) {
- // Pluggable factories.
- InputStream input = null; // loader.getResourceAsStream(SERVICE_RESOURCE);
- input = URLToStreamHelper.urlToStreamSafe(
- loader.getResource(SERVICE_RESOURCE));
- // have services file.
- if (input != null) {
- try {
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(input));
- String factoryClassName = reader.readLine();
- if (log.isDebugEnabled()) {
- log.debug(Messages.getMessage(
- Messages.SET_SKIN_FACTORY_INFO,
- factoryClassName));
- }
- instance = instantiateSkinFactory(factoryClassName, loader);
- } catch (Exception e) {
- log
- .warn(
- Messages
- .getMessage(Messages.CREATING_SKIN_FACTORY_ERROR),
- e);
- } finally {
- try {
- input.close();
- } catch (IOException e) {
- // can be ignored
- }
-
- }
- }
- if (instance == null) {
- // instantiate default implementation of SkinFactory - org.richfaces.skin.SkinFactoryImpl,
- // placed in the richfaces-impl.jar
- instance = instantiateSkinFactory(DEFAULT_SKIN_FACTORY_IMPL_CLASS, loader);
- }
- instances.put(loader, instance);
- }
-
- return instance;
- }
-
- /**
- * Create new instance of class with given name with the help of given <code>ClassLoader</code>.
- * Instantiated class should extend <code>SkinFactory</code> base class.
- * @param factoryClassName - class name of SkinFactory
- * @param classLoader - class loader
- * @return - instantiated <code>SkinFactory</code>
- * @throws FacesException - FacesException is thrown when instantiation fails;
- * causing exception is wrapped into <code>FacesException</code>
- */
- private static SkinFactory instantiateSkinFactory(String factoryClassName, ClassLoader classLoader) throws FacesException {
- SkinFactory instance = null;
- try {
- Class<?> clazz = Class.forName(factoryClassName, false, classLoader);
- try {
- // try construct factory chain.
- Constructor<?> factoryConstructor = clazz.getConstructor(new Class[] { SkinFactory.class });
- instance = (SkinFactory) factoryConstructor.newInstance(new Object[] { instance });
- } catch (NoSuchMethodException e) {
- // no chain constructor - attempt default.
- instance = (SkinFactory) clazz.newInstance();
- }
- } catch (InvocationTargetException ite) {
- log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), ite);
- throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", ite);
- } catch (InstantiationException ie) {
- log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), ie);
- throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", ie);
- } catch (IllegalAccessException iae) {
- log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), iae);
- throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", iae);
- } catch (ClassNotFoundException cnfe) {
- log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), cnfe);
- throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", cnfe);
- }
-
- return instance;
- }
-
- /**
- * Get default {@link Skin} implementation.
- *
- * @param context
- * @return
- */
- public abstract Skin getDefaultSkin(FacesContext context);
-
- /**
- * Get current {@link Skin} implementation.
- * @param context
- * @return
- */
- public abstract Skin getSkin(FacesContext context);
-
-// public abstract SkinConfiguration getSkinConfiguration(FacesContext context);
-
-
-
- /**
- * Resource Uri for file with name of class for application-wide SkinFactory same as SPI definitions for common Java SAX, Jsf etc. factories
- */
- public static final String SERVICE_RESOURCE = "META-INF/services/" + SkinFactory.class.getName();
-
- /**
- * Name of web application init parameter for current skin . Can be simple
- * String for non-modified name, or EL-expression for calculate current
- * skin. If EL evaluated to <code>String</code> - used as skin name, if to
- * instance of {@link Skin } - used this instance. by default -
- * "org.exadel.chameleon.SKIN"
- */
- public static final String SKIN_PARAMETER = "org.richfaces.SKIN";
-
- public static final String BASE_SKIN_PARAMETER = "org.richfaces.BASE_SKIN";
-
- /**
- * Full class name of default implementation of the SkinFactory class
- */
- public static final String DEFAULT_SKIN_FACTORY_IMPL_CLASS = "org.richfaces.skin.SkinFactoryImpl";
-
- /**
- * Get base {@link Skin} implementation
- * @param facesContext
- * @return
- */
- public abstract Skin getBaseSkin(FacesContext facesContext);
-
- /**
- * @param facesContext
- * @param name
- * @return
- */
- public abstract Theme getTheme(FacesContext facesContext, String name);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,213 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.skin;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Base factory class ( implement Singleton design pattern ). Produce self
+ * instance to build current skin configuration. At present, realised as lazy
+ * creation factory. TODO - select point to initialize.
+ *
+ * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:43 $
+ *
+ */
+public abstract class SkinFactory {
+
+ /**
+ * static instance variable.
+ */
+ private static Map<ClassLoader, SkinFactory> instances =
+ Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
+
+ private static final Log log = LogFactory.getLog(SkinFactory.class);
+
+
+ public static void reset() {
+ instances = Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
+ }
+
+ /**
+ * Initialize skin factory. TODO - make call from init() method of any
+ * servlet or custom faces element method ??? If exist resource
+ * META-INF/services/org.richfaces.skin.SkinFactory , create
+ * instance of class by name from first line of this file. If such class
+ * have constructor with {@link SkinFactory} parameter, instantiate it with
+ * instance of default factory ( as usual in JSF ). If any error occurs in
+ * instantiate custom factory, return default.
+ */
+ public static final SkinFactory getInstance() {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ SkinFactory instance = (SkinFactory) instances.get(loader);
+ if (instance == null) {
+ // Pluggable factories.
+ InputStream input = null; // loader.getResourceAsStream(SERVICE_RESOURCE);
+ input = URLToStreamHelper.urlToStreamSafe(
+ loader.getResource(SERVICE_RESOURCE));
+ // have services file.
+ if (input != null) {
+ try {
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(input));
+ String factoryClassName = reader.readLine();
+ if (log.isDebugEnabled()) {
+ log.debug(Messages.getMessage(
+ Messages.SET_SKIN_FACTORY_INFO,
+ factoryClassName));
+ }
+ instance = instantiateSkinFactory(factoryClassName, loader);
+ } catch (Exception e) {
+ log
+ .warn(
+ Messages
+ .getMessage(Messages.CREATING_SKIN_FACTORY_ERROR),
+ e);
+ } finally {
+ try {
+ input.close();
+ } catch (IOException e) {
+ // can be ignored
+ }
+
+ }
+ }
+ if (instance == null) {
+ // instantiate default implementation of SkinFactory - org.richfaces.skin.SkinFactoryImpl,
+ // placed in the richfaces-impl.jar
+ instance = instantiateSkinFactory(DEFAULT_SKIN_FACTORY_IMPL_CLASS, loader);
+ }
+ instances.put(loader, instance);
+ }
+
+ return instance;
+ }
+
+ /**
+ * Create new instance of class with given name with the help of given <code>ClassLoader</code>.
+ * Instantiated class should extend <code>SkinFactory</code> base class.
+ * @param factoryClassName - class name of SkinFactory
+ * @param classLoader - class loader
+ * @return - instantiated <code>SkinFactory</code>
+ * @throws FacesException - FacesException is thrown when instantiation fails;
+ * causing exception is wrapped into <code>FacesException</code>
+ */
+ private static SkinFactory instantiateSkinFactory(String factoryClassName, ClassLoader classLoader) throws FacesException {
+ SkinFactory instance = null;
+ try {
+ Class<?> clazz = Class.forName(factoryClassName, false, classLoader);
+ try {
+ // try construct factory chain.
+ Constructor<?> factoryConstructor = clazz.getConstructor(new Class[] { SkinFactory.class });
+ instance = (SkinFactory) factoryConstructor.newInstance(new Object[] { instance });
+ } catch (NoSuchMethodException e) {
+ // no chain constructor - attempt default.
+ instance = (SkinFactory) clazz.newInstance();
+ }
+ } catch (InvocationTargetException ite) {
+ log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), ite);
+ throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", ite);
+ } catch (InstantiationException ie) {
+ log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), ie);
+ throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", ie);
+ } catch (IllegalAccessException iae) {
+ log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), iae);
+ throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", iae);
+ } catch (ClassNotFoundException cnfe) {
+ log.error(Messages.getMessage(Messages.CREATING_SKIN_FACTORY_ERROR), cnfe);
+ throw new FacesException("Exception when creating instance of [" + SkinFactory.class.getName() + "]", cnfe);
+ }
+
+ return instance;
+ }
+
+ /**
+ * Get default {@link Skin} implementation.
+ *
+ * @param context
+ * @return
+ */
+ public abstract Skin getDefaultSkin(FacesContext context);
+
+ /**
+ * Get current {@link Skin} implementation.
+ * @param context
+ * @return
+ */
+ public abstract Skin getSkin(FacesContext context);
+
+// public abstract SkinConfiguration getSkinConfiguration(FacesContext context);
+
+
+
+ /**
+ * Resource Uri for file with name of class for application-wide SkinFactory same as SPI definitions for common Java SAX, Jsf etc. factories
+ */
+ public static final String SERVICE_RESOURCE = "META-INF/services/" + SkinFactory.class.getName();
+
+ /**
+ * Name of web application init parameter for current skin . Can be simple
+ * String for non-modified name, or EL-expression for calculate current
+ * skin. If EL evaluated to <code>String</code> - used as skin name, if to
+ * instance of {@link Skin } - used this instance. by default -
+ * "org.exadel.chameleon.SKIN"
+ */
+ public static final String SKIN_PARAMETER = "org.richfaces.SKIN";
+
+ public static final String BASE_SKIN_PARAMETER = "org.richfaces.BASE_SKIN";
+
+ /**
+ * Full class name of default implementation of the SkinFactory class
+ */
+ public static final String DEFAULT_SKIN_FACTORY_IMPL_CLASS = "org.richfaces.skin.SkinFactoryImpl";
+
+ /**
+ * Get base {@link Skin} implementation
+ * @param facesContext
+ * @return
+ */
+ public abstract Skin getBaseSkin(FacesContext facesContext);
+
+ /**
+ * @param facesContext
+ * @param name
+ * @return
+ */
+ public abstract Theme getTheme(FacesContext facesContext, String name);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.skin;
-
-import javax.faces.FacesException;
-
-public class SkinNotFoundException extends FacesException {
-
- /**
- *
- */
- private static final long serialVersionUID = -2498031536712930735L;
-
- public SkinNotFoundException() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- public SkinNotFoundException(String arg0) {
- super(arg0);
- // TODO Auto-generated constructor stub
- }
-
- public SkinNotFoundException(Throwable arg0) {
- super(arg0);
- // TODO Auto-generated constructor stub
- }
-
- public SkinNotFoundException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- // TODO Auto-generated constructor stub
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.skin;
+
+import javax.faces.FacesException;
+
+public class SkinNotFoundException extends FacesException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2498031536712930735L;
+
+ public SkinNotFoundException() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public SkinNotFoundException(String arg0) {
+ super(arg0);
+ // TODO Auto-generated constructor stub
+ }
+
+ public SkinNotFoundException(Throwable arg0) {
+ super(arg0);
+ // TODO Auto-generated constructor stub
+ }
+
+ public SkinNotFoundException(String arg0, Throwable arg1) {
+ super(arg0, arg1);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,20 +0,0 @@
-/**
- *
- */
-package org.richfaces.skin;
-
-/**
- * @author asmirnov
- *
- */
-public interface Theme {
-
- public String getRendererType();
-
- public String getStyle();
-
- public String getScript();
-
- public Object getProperty(String name);
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/Theme.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,20 @@
+/**
+ *
+ */
+package org.richfaces.skin;
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface Theme {
+
+ public String getRendererType();
+
+ public String getStyle();
+
+ public String getScript();
+
+ public Object getProperty(String name);
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,49 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.skin;
-
-import javax.faces.FacesException;
-
-public class ThemeNotFoundException extends FacesException {
-
- /**
- *
- */
- private static final long serialVersionUID = 2245209384496054860L;
-
- public ThemeNotFoundException() {
- super();
- }
-
- public ThemeNotFoundException(String arg0) {
- super(arg0);
- }
-
- public ThemeNotFoundException(Throwable arg0) {
- super(arg0);
- }
-
- public ThemeNotFoundException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- }
-
-}
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/ThemeNotFoundException.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,49 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.skin;
+
+import javax.faces.FacesException;
+
+public class ThemeNotFoundException extends FacesException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2245209384496054860L;
+
+ public ThemeNotFoundException() {
+ super();
+ }
+
+ public ThemeNotFoundException(String arg0) {
+ super(arg0);
+ }
+
+ public ThemeNotFoundException(Throwable arg0) {
+ super(arg0);
+ }
+
+ public ThemeNotFoundException(String arg0, Throwable arg1) {
+ super(arg0, arg1);
+ }
+
+}
Deleted: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,4 +0,0 @@
-/**
- * Skin functionality APIs
- */
-package org.richfaces.skin;
Copied: branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java (from rev 14809, branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java)
===================================================================
--- branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java (rev 0)
+++ branches/jsf2.0/framework/api/src/main/java/org/richfaces/skin/package-info.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,4 @@
+/**
+ * Skin functionality APIs
+ */
+package org.richfaces.skin;
Copied: branches/jsf2.0/framework/api/src/test (from rev 14809, branches/jsf2.0/framework/api/src/test)
Copied: branches/jsf2.0/framework/api/src/test/java (from rev 14809, branches/jsf2.0/framework/api/src/test/java)
Copied: branches/jsf2.0/framework/api/src/test/java/org (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org)
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf)
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework)
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util)
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript)
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript)
Deleted: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,209 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.javascript;
-
-import static org.easymock.EasyMock.aryEq;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.isNull;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.classextension.EasyMock.createStrictMock;
-import static org.easymock.classextension.EasyMock.replay;
-import static org.easymock.classextension.EasyMock.verify;
-
-import java.io.Writer;
-import java.lang.reflect.Array;
-import java.util.Random;
-
-import javax.faces.context.ResponseWriter;
-
-import junit.framework.TestCase;
-
-import org.easymock.IArgumentMatcher;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.2
- */
-public class ResponseWriterWrapperTest extends TestCase {
-
- private ResponseWriter mockWriter;
-
- private Writer writer;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- mockWriter = createStrictMock(ResponseWriter.class);
- writer = new ResponseWriterWrapper(mockWriter);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- this.writer = null;
- this.mockWriter = null;
- }
-
- public void testWrite1() throws Exception {
- char[] cs = new char[] {'a', 'b'};
- mockWriter.writeText(cs, 0, 2);
- replay(mockWriter);
-
- writer.write(cs);
- verify(mockWriter);
- }
-
- private static char[] expectSingleChar(final char c) {
- reportMatcher(new IArgumentMatcher() {
-
- private String failureMessage;
-
- public void appendTo(StringBuffer sb) {
- sb.append(failureMessage);
- }
-
- public boolean matches(Object o) {
- if (!(o instanceof char[])) {
- failureMessage = "Array of chars expected as argument";
- } else {
- if (Array.getLength(o) == 0) {
- failureMessage = "Array should be of non-zero length";
- } else {
- if (Array.getChar(o, 0) != c) {
- failureMessage = "["+c+"] expected as [0] char";
- }
- }
- }
-
- return failureMessage == null;
- }
-
- });
-
- return null;
- }
-
- private static char[] expectFirstChars(final char[] cs) {
- return expectFirstChars(cs, cs.length);
- }
-
- private static char[] expectFirstChars(final char[] cs, final int length) {
- reportMatcher(new IArgumentMatcher() {
-
- private String failureMessage;
-
- public void appendTo(StringBuffer sb) {
- sb.append(failureMessage);
- }
-
- public boolean matches(Object o) {
- if (!(o instanceof char[])) {
- failureMessage = "Array of chars expected as argument";
- } else {
- char[] argChars = (char[]) o;
- if (argChars.length < length) {
- failureMessage = "Array should have minimum " + length + " length, but has only: " + argChars.length;
- } else {
- for (int i = 0; i < length; i++) {
- if (argChars[i] != cs[i]) {
- failureMessage = "Char at offset [" + i + "] mismath: expected " + cs[i] + " but was " + argChars[i];
- break;
- }
- }
- }
- }
-
- return failureMessage == null;
- }
-
- });
-
- return null;
- }
-
- public void testWrite2() throws Exception {
- mockWriter.writeText(expectSingleChar((char) 0x5678), eq(0), eq(1));
- mockWriter.writeText(expectSingleChar((char) 0xBA98), eq(0), eq(1));
- replay(mockWriter);
- writer.write(0x12345678);
- writer.write(0xFECDBA98);
- verify(mockWriter);
- }
-
- public void testWrite3() throws Exception {
- mockWriter.writeText(eq("test"), (String) isNull());
- replay(mockWriter);
- writer.write("test");
- verify(mockWriter);
- }
-
- public void testWrite4() throws Exception {
- mockWriter.writeText(aryEq("abcd".toCharArray()), eq(1), eq(2));
- mockWriter.writeText(aryEq("efgh".toCharArray()), eq(0), eq(3));
- mockWriter.writeText(aryEq("ijklm".toCharArray()), eq(2), eq(3));
-
- replay(mockWriter);
- writer.write("abcd".toCharArray(), 1, 2);
- writer.write("efgh".toCharArray(), 0, 3);
- writer.write("ijklm".toCharArray(), 2, 3);
- verify(mockWriter);
- }
-
- public void testWrite5() throws Exception {
- mockWriter.writeText(expectFirstChars("string to".toCharArray()), eq(0), eq(9));
- mockWriter.writeText(expectFirstChars("one".toCharArray()), eq(0), eq(3));
-
- replay(mockWriter);
- writer.write("string to test", 0, 9);
- writer.write("short one", 6, 3);
- verify(mockWriter);
- }
-
- public void testWrite6() throws Exception {
- char[] cs = new char[4098];
- int length = cs.length - 2;
-
- for (int i = 0; i < cs.length; i++) {
- cs[i] = (char) new Random().nextInt(Character.MAX_VALUE + 1);
- }
-
- mockWriter.writeText(expectFirstChars(cs, length), eq(0), eq(length));
- replay(mockWriter);
- writer.write(String.valueOf(cs), 0, length);
- verify(mockWriter);
- }
-
- public void testFlush() throws Exception {
- mockWriter.flush();
- replay(mockWriter);
- writer.flush();
- verify(mockWriter);
- }
-
- public void testClose() throws Exception {
- mockWriter.close();
- replay(mockWriter);
- writer.close();
- verify(mockWriter);
- }
-}
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java)
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java (rev 0)
+++ branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ResponseWriterWrapperTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,209 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.javascript;
+
+import static org.easymock.EasyMock.aryEq;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.isNull;
+import static org.easymock.EasyMock.reportMatcher;
+import static org.easymock.classextension.EasyMock.createStrictMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+
+import java.io.Writer;
+import java.lang.reflect.Array;
+import java.util.Random;
+
+import javax.faces.context.ResponseWriter;
+
+import junit.framework.TestCase;
+
+import org.easymock.IArgumentMatcher;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.2
+ */
+public class ResponseWriterWrapperTest extends TestCase {
+
+ private ResponseWriter mockWriter;
+
+ private Writer writer;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ mockWriter = createStrictMock(ResponseWriter.class);
+ writer = new ResponseWriterWrapper(mockWriter);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+
+ this.writer = null;
+ this.mockWriter = null;
+ }
+
+ public void testWrite1() throws Exception {
+ char[] cs = new char[] {'a', 'b'};
+ mockWriter.writeText(cs, 0, 2);
+ replay(mockWriter);
+
+ writer.write(cs);
+ verify(mockWriter);
+ }
+
+ private static char[] expectSingleChar(final char c) {
+ reportMatcher(new IArgumentMatcher() {
+
+ private String failureMessage;
+
+ public void appendTo(StringBuffer sb) {
+ sb.append(failureMessage);
+ }
+
+ public boolean matches(Object o) {
+ if (!(o instanceof char[])) {
+ failureMessage = "Array of chars expected as argument";
+ } else {
+ if (Array.getLength(o) == 0) {
+ failureMessage = "Array should be of non-zero length";
+ } else {
+ if (Array.getChar(o, 0) != c) {
+ failureMessage = "["+c+"] expected as [0] char";
+ }
+ }
+ }
+
+ return failureMessage == null;
+ }
+
+ });
+
+ return null;
+ }
+
+ private static char[] expectFirstChars(final char[] cs) {
+ return expectFirstChars(cs, cs.length);
+ }
+
+ private static char[] expectFirstChars(final char[] cs, final int length) {
+ reportMatcher(new IArgumentMatcher() {
+
+ private String failureMessage;
+
+ public void appendTo(StringBuffer sb) {
+ sb.append(failureMessage);
+ }
+
+ public boolean matches(Object o) {
+ if (!(o instanceof char[])) {
+ failureMessage = "Array of chars expected as argument";
+ } else {
+ char[] argChars = (char[]) o;
+ if (argChars.length < length) {
+ failureMessage = "Array should have minimum " + length + " length, but has only: " + argChars.length;
+ } else {
+ for (int i = 0; i < length; i++) {
+ if (argChars[i] != cs[i]) {
+ failureMessage = "Char at offset [" + i + "] mismath: expected " + cs[i] + " but was " + argChars[i];
+ break;
+ }
+ }
+ }
+ }
+
+ return failureMessage == null;
+ }
+
+ });
+
+ return null;
+ }
+
+ public void testWrite2() throws Exception {
+ mockWriter.writeText(expectSingleChar((char) 0x5678), eq(0), eq(1));
+ mockWriter.writeText(expectSingleChar((char) 0xBA98), eq(0), eq(1));
+ replay(mockWriter);
+ writer.write(0x12345678);
+ writer.write(0xFECDBA98);
+ verify(mockWriter);
+ }
+
+ public void testWrite3() throws Exception {
+ mockWriter.writeText(eq("test"), (String) isNull());
+ replay(mockWriter);
+ writer.write("test");
+ verify(mockWriter);
+ }
+
+ public void testWrite4() throws Exception {
+ mockWriter.writeText(aryEq("abcd".toCharArray()), eq(1), eq(2));
+ mockWriter.writeText(aryEq("efgh".toCharArray()), eq(0), eq(3));
+ mockWriter.writeText(aryEq("ijklm".toCharArray()), eq(2), eq(3));
+
+ replay(mockWriter);
+ writer.write("abcd".toCharArray(), 1, 2);
+ writer.write("efgh".toCharArray(), 0, 3);
+ writer.write("ijklm".toCharArray(), 2, 3);
+ verify(mockWriter);
+ }
+
+ public void testWrite5() throws Exception {
+ mockWriter.writeText(expectFirstChars("string to".toCharArray()), eq(0), eq(9));
+ mockWriter.writeText(expectFirstChars("one".toCharArray()), eq(0), eq(3));
+
+ replay(mockWriter);
+ writer.write("string to test", 0, 9);
+ writer.write("short one", 6, 3);
+ verify(mockWriter);
+ }
+
+ public void testWrite6() throws Exception {
+ char[] cs = new char[4098];
+ int length = cs.length - 2;
+
+ for (int i = 0; i < cs.length; i++) {
+ cs[i] = (char) new Random().nextInt(Character.MAX_VALUE + 1);
+ }
+
+ mockWriter.writeText(expectFirstChars(cs, length), eq(0), eq(length));
+ replay(mockWriter);
+ writer.write(String.valueOf(cs), 0, length);
+ verify(mockWriter);
+ }
+
+ public void testFlush() throws Exception {
+ mockWriter.flush();
+ replay(mockWriter);
+ writer.flush();
+ verify(mockWriter);
+ }
+
+ public void testClose() throws Exception {
+ mockWriter.close();
+ replay(mockWriter);
+ writer.close();
+ verify(mockWriter);
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,307 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.javascript;
-
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.isNull;
-import static org.easymock.classextension.EasyMock.createNiceMock;
-import static org.easymock.classextension.EasyMock.replay;
-import static org.easymock.classextension.EasyMock.*;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import javax.faces.context.ResponseWriter;
-
-import junit.framework.TestCase;
-
-import org.easymock.Capture;
-import org.easymock.CaptureType;
-
-/**
- * @author shura
- *
- */
-public class ScriptUtilsTest extends TestCase {
-
- /**
- * @author shura
- *
- */
- public static class Bean {
-
- int _integer;
- boolean _bool;
- Object _foo;
-
- public Bean() {
- }
- /**
- * @param ineger
- * @param bool
- * @param foo
- */
- public Bean(int ineger, boolean bool, Object foo) {
- this._integer = ineger;
- this._bool = bool;
- this._foo = foo;
- }
- /**
- * @return the bool
- */
- public boolean isBool() {
- return this._bool;
- }
- /**
- * @param bool the bool to set
- */
- public void setBool(boolean bool) {
- this._bool = bool;
- }
- /**
- * @return the ineger
- */
- public int getInteger() {
- return this._integer;
- }
- /**
- * @param ineger the ineger to set
- */
- public void setInteger(int ineger) {
- this._integer = ineger;
- }
- /**
- * @return the foo
- */
- public Object getFoo() {
- return this._foo;
- }
- /**
- * @param foo the foo to set
- */
- public void setFoo(Object foo) {
- this._foo = foo;
- }
- }
-
- /**
- * @param name
- */
- public ScriptUtilsTest(String name) {
- super(name);
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testStringToScript() {
- Object obj = "foo";
- assertEquals("'foo'", ScriptUtils.toScript(obj));
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testArrayToScript() {
- int[] obj = {1,2,3,4,5};
- assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
- }
-
- public void testSqlDate() {
- java.sql.Time obj = new java.sql.Time(1);
- assertNotNull(ScriptUtils.toScript(obj));
-
- java.sql.Date obj1 = new java.sql.Date(1);
- assertNotNull(ScriptUtils.toScript(obj1));
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testTwoDimentionalArrayToScript() {
- int[][] obj = {{1,2},{3,4}};
- assertEquals("[[1,2] ,[3,4] ] ", ScriptUtils.toScript(obj));
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testTwoDimentionalStringArrayToScript() {
- String[][] obj = {{"one","two"},{"three","four"}};
- assertEquals("[['one','two'] ,['three','four'] ] ", ScriptUtils.toScript(obj));
- Map<String, Object> map = new TreeMap<String, Object>();
- map.put("a", obj);
- map.put("b", "c");
- assertEquals("{'a':[['one','two'] ,['three','four'] ] ,'b':'c'} ", ScriptUtils.toScript(map));
- }
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testListToScript() {
- List<Integer> obj = new ArrayList<Integer>();
- obj.add(new Integer(1));
- obj.add(new Integer(2));
- obj.add(new Integer(3));
- obj.add(new Integer(4));
- obj.add(new Integer(5));
- assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testSetToScript() {
- Set<Integer> obj = new TreeSet<Integer>();
- obj.add(new Integer(1));
- obj.add(new Integer(2));
- obj.add(new Integer(3));
- obj.add(new Integer(4));
- obj.add(new Integer(5));
- assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
- }
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testObjectArrayToScript() {
- Bean[] obj = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
- assertEquals("[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ", ScriptUtils.toScript(obj));
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testObjectListToScript() {
- Bean[] array = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
- List<Bean> obj = Arrays.asList(array);
- assertEquals("[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ", ScriptUtils.toScript(obj));
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
- */
- public void testMapToScript() {
- TreeMap<String, String> obj = new TreeMap<String, String>();
- obj.put("a", "foo");
- obj.put("b", "bar");
- obj.put("c", "baz");
- assertEquals("{'a':'foo','b':'bar','c':'baz'} ", ScriptUtils.toScript(obj));
- }
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer, java.lang.Object)}.
- */
- public void testAddEncodedString() {
- StringBuilder buff = new StringBuilder();
- ScriptUtils.addEncodedString(buff, "foo");
- assertEquals("'foo'", buff.toString());
- }
-
- /**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncoded(java.lang.StringBuffer, java.lang.Object)}.
- */
- public void testAddEncoded() {
- StringBuilder buff = new StringBuilder();
- ScriptUtils.addEncoded(buff, "foo\"\'");
- assertEquals("foo\\\"\\\'", buff.toString());
- }
-
- /**
- * Test method for {@link ScriptUtils#toScript(Object)}
- */
- public void testNull() throws Exception {
- assertEquals("null", ScriptUtils.toScript(null));
- }
-
- /**
- * Test method for {@link ScriptUtils#toScript(Object)}
- */
- public void testScriptString() throws Exception {
- assertEquals("alert(x<y);", ScriptUtils.toScript(new JSLiteral("alert(x<y);")));
- }
-
- private static enum TestEnum {
- A, B, C;
-
- @Override
- public String toString() {
- return "TestEnum: " + super.toString();
- }
- }
-
- /**
- * Test method for {@link ScriptUtils#toScript(Object)}
- */
- public void testEnum() throws Exception {
- assertEquals("'TestEnum: B'", ScriptUtils.toScript(TestEnum.B));
- }
-
- private void assertCaptureEquals(Capture<? extends Object> capture, String expected) {
- StringBuilder sb = new StringBuilder();
- List<? extends Object> list = capture.getValues();
- for (Object o : list) {
- assertNotNull(o);
- sb.append(o);
- }
-
- assertEquals(expected, sb.toString().trim());
- }
-
- /**
- * Test method for {@link ScriptUtils#writeToStream(javax.faces.context.ResponseWriter, Object)}
- */
- public void testWriteToStream() throws Exception {
- ResponseWriter mockWriter = createNiceMock(ResponseWriter.class);
- Capture<? extends Object> capture = new Capture<Object>(CaptureType.ALL) {
- /**
- *
- */
- private static final long serialVersionUID = -4915440411892856583L;
-
- @Override
- public void setValue(Object value) {
- if (value instanceof char[]) {
- char[] cs = (char[]) value;
- super.setValue(new String(cs, 0, 1));
- } else {
- super.setValue(value);
- }
- }
- };
-
-
- mockWriter.writeText(capture(capture), (String) isNull());
- expectLastCall().anyTimes();
- mockWriter.writeText((char[])capture(capture), eq(0), eq(1));
- expectLastCall().anyTimes();
-
- replay(mockWriter);
- ScriptUtils.writeToStream(mockWriter, Collections.singletonMap("delay", Integer.valueOf(1500)));
- verify(mockWriter);
-
- assertCaptureEquals(capture, "{'delay':1500}");
- }
-}
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java)
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java (rev 0)
+++ branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,307 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.javascript;
+
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.isNull;
+import static org.easymock.classextension.EasyMock.createNiceMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import javax.faces.context.ResponseWriter;
+
+import junit.framework.TestCase;
+
+import org.easymock.Capture;
+import org.easymock.CaptureType;
+
+/**
+ * @author shura
+ *
+ */
+public class ScriptUtilsTest extends TestCase {
+
+ /**
+ * @author shura
+ *
+ */
+ public static class Bean {
+
+ int _integer;
+ boolean _bool;
+ Object _foo;
+
+ public Bean() {
+ }
+ /**
+ * @param ineger
+ * @param bool
+ * @param foo
+ */
+ public Bean(int ineger, boolean bool, Object foo) {
+ this._integer = ineger;
+ this._bool = bool;
+ this._foo = foo;
+ }
+ /**
+ * @return the bool
+ */
+ public boolean isBool() {
+ return this._bool;
+ }
+ /**
+ * @param bool the bool to set
+ */
+ public void setBool(boolean bool) {
+ this._bool = bool;
+ }
+ /**
+ * @return the ineger
+ */
+ public int getInteger() {
+ return this._integer;
+ }
+ /**
+ * @param ineger the ineger to set
+ */
+ public void setInteger(int ineger) {
+ this._integer = ineger;
+ }
+ /**
+ * @return the foo
+ */
+ public Object getFoo() {
+ return this._foo;
+ }
+ /**
+ * @param foo the foo to set
+ */
+ public void setFoo(Object foo) {
+ this._foo = foo;
+ }
+ }
+
+ /**
+ * @param name
+ */
+ public ScriptUtilsTest(String name) {
+ super(name);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testStringToScript() {
+ Object obj = "foo";
+ assertEquals("'foo'", ScriptUtils.toScript(obj));
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testArrayToScript() {
+ int[] obj = {1,2,3,4,5};
+ assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
+ }
+
+ public void testSqlDate() {
+ java.sql.Time obj = new java.sql.Time(1);
+ assertNotNull(ScriptUtils.toScript(obj));
+
+ java.sql.Date obj1 = new java.sql.Date(1);
+ assertNotNull(ScriptUtils.toScript(obj1));
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testTwoDimentionalArrayToScript() {
+ int[][] obj = {{1,2},{3,4}};
+ assertEquals("[[1,2] ,[3,4] ] ", ScriptUtils.toScript(obj));
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testTwoDimentionalStringArrayToScript() {
+ String[][] obj = {{"one","two"},{"three","four"}};
+ assertEquals("[['one','two'] ,['three','four'] ] ", ScriptUtils.toScript(obj));
+ Map<String, Object> map = new TreeMap<String, Object>();
+ map.put("a", obj);
+ map.put("b", "c");
+ assertEquals("{'a':[['one','two'] ,['three','four'] ] ,'b':'c'} ", ScriptUtils.toScript(map));
+ }
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testListToScript() {
+ List<Integer> obj = new ArrayList<Integer>();
+ obj.add(new Integer(1));
+ obj.add(new Integer(2));
+ obj.add(new Integer(3));
+ obj.add(new Integer(4));
+ obj.add(new Integer(5));
+ assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testSetToScript() {
+ Set<Integer> obj = new TreeSet<Integer>();
+ obj.add(new Integer(1));
+ obj.add(new Integer(2));
+ obj.add(new Integer(3));
+ obj.add(new Integer(4));
+ obj.add(new Integer(5));
+ assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
+ }
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testObjectArrayToScript() {
+ Bean[] obj = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
+ assertEquals("[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ", ScriptUtils.toScript(obj));
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testObjectListToScript() {
+ Bean[] array = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
+ List<Bean> obj = Arrays.asList(array);
+ assertEquals("[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ", ScriptUtils.toScript(obj));
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ */
+ public void testMapToScript() {
+ TreeMap<String, String> obj = new TreeMap<String, String>();
+ obj.put("a", "foo");
+ obj.put("b", "bar");
+ obj.put("c", "baz");
+ assertEquals("{'a':'foo','b':'bar','c':'baz'} ", ScriptUtils.toScript(obj));
+ }
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer, java.lang.Object)}.
+ */
+ public void testAddEncodedString() {
+ StringBuilder buff = new StringBuilder();
+ ScriptUtils.addEncodedString(buff, "foo");
+ assertEquals("'foo'", buff.toString());
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncoded(java.lang.StringBuffer, java.lang.Object)}.
+ */
+ public void testAddEncoded() {
+ StringBuilder buff = new StringBuilder();
+ ScriptUtils.addEncoded(buff, "foo\"\'");
+ assertEquals("foo\\\"\\\'", buff.toString());
+ }
+
+ /**
+ * Test method for {@link ScriptUtils#toScript(Object)}
+ */
+ public void testNull() throws Exception {
+ assertEquals("null", ScriptUtils.toScript(null));
+ }
+
+ /**
+ * Test method for {@link ScriptUtils#toScript(Object)}
+ */
+ public void testScriptString() throws Exception {
+ assertEquals("alert(x<y);", ScriptUtils.toScript(new JSLiteral("alert(x<y);")));
+ }
+
+ private static enum TestEnum {
+ A, B, C;
+
+ @Override
+ public String toString() {
+ return "TestEnum: " + super.toString();
+ }
+ }
+
+ /**
+ * Test method for {@link ScriptUtils#toScript(Object)}
+ */
+ public void testEnum() throws Exception {
+ assertEquals("'TestEnum: B'", ScriptUtils.toScript(TestEnum.B));
+ }
+
+ private void assertCaptureEquals(Capture<? extends Object> capture, String expected) {
+ StringBuilder sb = new StringBuilder();
+ List<? extends Object> list = capture.getValues();
+ for (Object o : list) {
+ assertNotNull(o);
+ sb.append(o);
+ }
+
+ assertEquals(expected, sb.toString().trim());
+ }
+
+ /**
+ * Test method for {@link ScriptUtils#writeToStream(javax.faces.context.ResponseWriter, Object)}
+ */
+ public void testWriteToStream() throws Exception {
+ ResponseWriter mockWriter = createNiceMock(ResponseWriter.class);
+ Capture<? extends Object> capture = new Capture<Object>(CaptureType.ALL) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -4915440411892856583L;
+
+ @Override
+ public void setValue(Object value) {
+ if (value instanceof char[]) {
+ char[] cs = (char[]) value;
+ super.setValue(new String(cs, 0, 1));
+ } else {
+ super.setValue(value);
+ }
+ }
+ };
+
+
+ mockWriter.writeText(capture(capture), (String) isNull());
+ expectLastCall().anyTimes();
+ mockWriter.writeText((char[])capture(capture), eq(0), eq(1));
+ expectLastCall().anyTimes();
+
+ replay(mockWriter);
+ ScriptUtils.writeToStream(mockWriter, Collections.singletonMap("delay", Integer.valueOf(1500)));
+ verify(mockWriter);
+
+ assertCaptureEquals(capture, "{'delay':1500}");
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,97 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.javascript;
-
-import java.io.Writer;
-
-import junit.framework.TestCase;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.2
- */
-public class StringBuilderWriterTest extends TestCase {
-
- private StringBuilder builder;
-
- private Writer writer;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.builder = new StringBuilder();
- this.writer = new StringBuilderWriter(this.builder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
-
- this.builder = null;
- this.writer = null;
- }
-
- public void testWrite() throws Exception {
- writer.write(new char[] {'a', 'b'});
- assertEquals("ab", builder.toString());
- }
-
- public void testWrite2() throws Exception {
- writer.write(0x12345678);
-
- String s = builder.toString();
- assertEquals(1, s.length());
- assertEquals(0x5678, s.charAt(0));
- }
-
- public void testWrite3() throws Exception {
- writer.write("test");
-
- assertEquals("test", builder.toString());
- }
-
- public void testWrite4() throws Exception {
- writer.write("abcd".toCharArray(), 1, 2);
- assertEquals("bc", builder.toString());
- writer.write("efgh".toCharArray(), 0, 3);
- assertEquals("bcefg", builder.toString());
- writer.write("ijkl".toCharArray(), 2, 2);
- assertEquals("bcefgkl", builder.toString());
- }
-
- public void testWrite5() throws Exception {
- writer.write("abcd", 1, 2);
- assertEquals("bc", builder.toString());
- writer.write("efgh", 0, 3);
- assertEquals("bcefg", builder.toString());
- writer.write("ijklm", 2, 3);
- assertEquals("bcefgklm", builder.toString());
- }
-
- public void testFlush() throws Exception {
- writer.flush();
- }
-
- public void testClose() throws Exception {
- writer.close();
- }
-}
Copied: branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java)
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java (rev 0)
+++ branches/jsf2.0/framework/api/src/test/java/org/ajax4jsf/javascript/StringBuilderWriterTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,97 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.javascript;
+
+import java.io.Writer;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.2
+ */
+public class StringBuilderWriterTest extends TestCase {
+
+ private StringBuilder builder;
+
+ private Writer writer;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ this.builder = new StringBuilder();
+ this.writer = new StringBuilderWriter(this.builder);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+
+ this.builder = null;
+ this.writer = null;
+ }
+
+ public void testWrite() throws Exception {
+ writer.write(new char[] {'a', 'b'});
+ assertEquals("ab", builder.toString());
+ }
+
+ public void testWrite2() throws Exception {
+ writer.write(0x12345678);
+
+ String s = builder.toString();
+ assertEquals(1, s.length());
+ assertEquals(0x5678, s.charAt(0));
+ }
+
+ public void testWrite3() throws Exception {
+ writer.write("test");
+
+ assertEquals("test", builder.toString());
+ }
+
+ public void testWrite4() throws Exception {
+ writer.write("abcd".toCharArray(), 1, 2);
+ assertEquals("bc", builder.toString());
+ writer.write("efgh".toCharArray(), 0, 3);
+ assertEquals("bcefg", builder.toString());
+ writer.write("ijkl".toCharArray(), 2, 2);
+ assertEquals("bcefgkl", builder.toString());
+ }
+
+ public void testWrite5() throws Exception {
+ writer.write("abcd", 1, 2);
+ assertEquals("bc", builder.toString());
+ writer.write("efgh", 0, 3);
+ assertEquals("bcefg", builder.toString());
+ writer.write("ijklm", 2, 3);
+ assertEquals("bcefgklm", builder.toString());
+ }
+
+ public void testFlush() throws Exception {
+ writer.flush();
+ }
+
+ public void testClose() throws Exception {
+ writer.close();
+ }
+}
Copied: branches/jsf2.0/framework/api/src/test/java/org/richfaces (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/richfaces)
Copied: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/richfaces/model)
Deleted: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,142 +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.model;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-/**
- * Created 26.08.2008
- * @author Nick Belaevski
- * @since 3.2.2
- */
-
-public class ClassicTreeModelKeyConversionTest extends TestCase {
-
- private ClassicTreeDataModel dataModel;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- dataModel = new ClassicTreeDataModel();
-
- TreeNodeImpl<String> rootNode = new TreeNodeImpl<String>();
-
- TreeNodeImpl<String> node;
-
- node = new TreeNodeImpl<String>();
- node.addChild("0", new TreeNodeImpl<String>());
- node.addChild("1", new TreeNodeImpl<String>());
- for (int i = 2; i < 5; i++) {
- node.addChild(Long.valueOf(i), new TreeNodeImpl<String>());
- }
- rootNode.addChild("6", node);
-
- node = new TreeNodeImpl<String>();
- for (int i = 0; i < 3; i++) {
- node.addChild(Integer.valueOf(i), new TreeNodeImpl<String>());
- }
- rootNode.addChild("abc_cde:fgh", node);
-
- dataModel.setWrappedData(rootNode);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
-
- dataModel = null;
- }
-
- public void testEmptyString() throws Exception {
- TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "", null, null);
- assertNull(key);
- }
-
- public void testStraightWayShort() throws Exception {
- TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6", null, null);
- assertNotNull(key);
-
- Iterator<Object> iterator = key.iterator();
- assertEquals("6", iterator.next());
- assertFalse(iterator.hasNext());
- }
-
- public void testStraightWay() throws Exception {
- TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6:1", null, null);
- assertNotNull(key);
-
- Iterator<Object> iterator = key.iterator();
- assertEquals("6", iterator.next());
- assertEquals("1", iterator.next());
- assertFalse(iterator.hasNext());
-
- key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6:1", null, null);
- assertNotNull(key);
-
- iterator = key.iterator();
- assertEquals("6", iterator.next());
- assertEquals("1", iterator.next());
- assertFalse(iterator.hasNext());
- }
-
- public void testSearch() throws Exception {
- TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6:4", null, null);
- assertNotNull(key);
-
- Iterator<Object> iterator = key.iterator();
- assertEquals("6", iterator.next());
- assertEquals(Long.valueOf(4), iterator.next());
- assertFalse(iterator.hasNext());
-
- }
-
- public void testSearchMissing() throws Exception {
- assertNull(dataModel.convertToKey(null, "6:10", null, null));
- assertNull(dataModel.convertToKey(null, "7", null, null));
- }
-
- public void testUnescape() throws Exception {
- TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "abc__cde_:fgh:1", null, null);
- assertNotNull(key);
-
- Iterator<Object> iterator = key.iterator();
- assertEquals("abc_cde:fgh", iterator.next());
- assertEquals(Integer.valueOf(1), iterator.next());
- assertFalse(iterator.hasNext());
- }
-
- public void testUnescapeShort() throws Exception {
- TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "abc__cde_:fgh", null, null);
- assertNotNull(key);
-
- Iterator<Object> iterator = key.iterator();
- assertEquals("abc_cde:fgh", iterator.next());
- assertFalse(iterator.hasNext());
- }
-}
Copied: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java)
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java (rev 0)
+++ branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ClassicTreeModelKeyConversionTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,142 @@
+/**
+ * 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.model;
+
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+/**
+ * Created 26.08.2008
+ * @author Nick Belaevski
+ * @since 3.2.2
+ */
+
+public class ClassicTreeModelKeyConversionTest extends TestCase {
+
+ private ClassicTreeDataModel dataModel;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ dataModel = new ClassicTreeDataModel();
+
+ TreeNodeImpl<String> rootNode = new TreeNodeImpl<String>();
+
+ TreeNodeImpl<String> node;
+
+ node = new TreeNodeImpl<String>();
+ node.addChild("0", new TreeNodeImpl<String>());
+ node.addChild("1", new TreeNodeImpl<String>());
+ for (int i = 2; i < 5; i++) {
+ node.addChild(Long.valueOf(i), new TreeNodeImpl<String>());
+ }
+ rootNode.addChild("6", node);
+
+ node = new TreeNodeImpl<String>();
+ for (int i = 0; i < 3; i++) {
+ node.addChild(Integer.valueOf(i), new TreeNodeImpl<String>());
+ }
+ rootNode.addChild("abc_cde:fgh", node);
+
+ dataModel.setWrappedData(rootNode);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+
+ dataModel = null;
+ }
+
+ public void testEmptyString() throws Exception {
+ TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "", null, null);
+ assertNull(key);
+ }
+
+ public void testStraightWayShort() throws Exception {
+ TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6", null, null);
+ assertNotNull(key);
+
+ Iterator<Object> iterator = key.iterator();
+ assertEquals("6", iterator.next());
+ assertFalse(iterator.hasNext());
+ }
+
+ public void testStraightWay() throws Exception {
+ TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6:1", null, null);
+ assertNotNull(key);
+
+ Iterator<Object> iterator = key.iterator();
+ assertEquals("6", iterator.next());
+ assertEquals("1", iterator.next());
+ assertFalse(iterator.hasNext());
+
+ key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6:1", null, null);
+ assertNotNull(key);
+
+ iterator = key.iterator();
+ assertEquals("6", iterator.next());
+ assertEquals("1", iterator.next());
+ assertFalse(iterator.hasNext());
+ }
+
+ public void testSearch() throws Exception {
+ TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "6:4", null, null);
+ assertNotNull(key);
+
+ Iterator<Object> iterator = key.iterator();
+ assertEquals("6", iterator.next());
+ assertEquals(Long.valueOf(4), iterator.next());
+ assertFalse(iterator.hasNext());
+
+ }
+
+ public void testSearchMissing() throws Exception {
+ assertNull(dataModel.convertToKey(null, "6:10", null, null));
+ assertNull(dataModel.convertToKey(null, "7", null, null));
+ }
+
+ public void testUnescape() throws Exception {
+ TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "abc__cde_:fgh:1", null, null);
+ assertNotNull(key);
+
+ Iterator<Object> iterator = key.iterator();
+ assertEquals("abc_cde:fgh", iterator.next());
+ assertEquals(Integer.valueOf(1), iterator.next());
+ assertFalse(iterator.hasNext());
+ }
+
+ public void testUnescapeShort() throws Exception {
+ TreeRowKey<Object> key = (TreeRowKey<Object>) dataModel.convertToKey(null, "abc__cde_:fgh", null, null);
+ assertNotNull(key);
+
+ Iterator<Object> iterator = key.iterator();
+ assertEquals("abc_cde:fgh", iterator.next());
+ assertFalse(iterator.hasNext());
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,59 +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.model;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import junit.framework.TestCase;
-
-/**
- * @author Nick Belaevski
- * @since 3.3.0
- */
-
-public class ScrollableTableDataRangeSerializationTest extends TestCase {
-
- private ScrollableTableDataRange readWriteRange(ScrollableTableDataRange range) throws Exception {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(range);
- oos.close();
-
- ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- ObjectInputStream ois = new ObjectInputStream(bais);
-
- return (ScrollableTableDataRange) ois.readObject();
- }
-
- public void testSerialization() throws Exception {
- SortOrder order = new SortOrder(new SortField[] { new SortField("xxx", true) });
- ScrollableTableDataRange range = new ScrollableTableDataRange(10, 300, order);
-
- ScrollableTableDataRange serializedRange = readWriteRange(range);
-
- assertNotSame(range, serializedRange);
- assertEquals(range, serializedRange);
- }
-}
Copied: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java)
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java (rev 0)
+++ branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,59 @@
+/**
+ * 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.model;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class ScrollableTableDataRangeSerializationTest extends TestCase {
+
+ private ScrollableTableDataRange readWriteRange(ScrollableTableDataRange range) throws Exception {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(range);
+ oos.close();
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+
+ return (ScrollableTableDataRange) ois.readObject();
+ }
+
+ public void testSerialization() throws Exception {
+ SortOrder order = new SortOrder(new SortField[] { new SortField("xxx", true) });
+ ScrollableTableDataRange range = new ScrollableTableDataRange(10, 300, order);
+
+ ScrollableTableDataRange serializedRange = readWriteRange(range);
+
+ assertNotSame(range, serializedRange);
+ assertEquals(range, serializedRange);
+ }
+}
Deleted: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java 2009-07-07 13:27:48 UTC (rev 14809)
+++ branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -1,109 +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.model;
-
-import java.util.Iterator;
-
-import javax.swing.tree.TreeNode;
-
-import junit.framework.TestCase;
-
-/**
- * Created 26.08.2008
- * @author Nick Belaevski
- * @since 3.2.2
- */
-
-public class SwingTreeModelKeyConversionTest extends TestCase {
-
- private SwingTreeDataModel dataModel;
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
-
- dataModel = new SwingTreeDataModel();
-
- //1
- SwingTreeNodeImpl node = new SwingTreeNodeImpl();
- //1:0
- node.addChild(new SwingTreeNodeImpl());
- //1:1
- node.addChild(new SwingTreeNodeImpl());
- //1:2
- node.addChild(new SwingTreeNodeImpl());
-
- dataModel.setWrappedData(new TreeNode[] {
- new SwingTreeNodeImpl(), node
- });
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- protected void tearDown() throws Exception {
- super.tearDown();
-
- dataModel = null;
- }
-
- public void testEmptyString() throws Exception {
- //TODO make it work
-// Object key = dataModel.convertToKey(null, "", null, null);
-// assertNull(key);
- }
-
- public void testStraightWay() throws Exception {
- TreeRowKey<Integer> key;
- Iterator<Integer> iterator;
-
- key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "0", null, null);
- iterator = key.iterator();
- assertEquals(Integer.valueOf(0), iterator.next());
- assertFalse(iterator.hasNext());
-
- key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "1", null, null);
- iterator = key.iterator();
- assertEquals(Integer.valueOf(1), iterator.next());
- assertFalse(iterator.hasNext());
-
- key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "1:0", null, null);
- iterator = key.iterator();
- assertEquals(Integer.valueOf(1), iterator.next());
- assertEquals(Integer.valueOf(0), iterator.next());
- assertFalse(iterator.hasNext());
-
- key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "1:2", null, null);
- iterator = key.iterator();
- assertEquals(Integer.valueOf(1), iterator.next());
- assertEquals(Integer.valueOf(2), iterator.next());
- assertFalse(iterator.hasNext());
- }
-
- public void testMissingNodes() throws Exception {
- assertNull(dataModel.convertToKey(null, "2", null, null));
- assertNull(dataModel.convertToKey(null, "0:3", null, null));
- }
-}
-
Copied: branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java (from rev 14809, branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java)
===================================================================
--- branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java (rev 0)
+++ branches/jsf2.0/framework/api/src/test/java/org/richfaces/model/SwingTreeModelKeyConversionTest.java 2009-07-08 02:00:15 UTC (rev 14841)
@@ -0,0 +1,109 @@
+/**
+ * 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.model;
+
+import java.util.Iterator;
+
+import javax.swing.tree.TreeNode;
+
+import junit.framework.TestCase;
+
+/**
+ * Created 26.08.2008
+ * @author Nick Belaevski
+ * @since 3.2.2
+ */
+
+public class SwingTreeModelKeyConversionTest extends TestCase {
+
+ private SwingTreeDataModel dataModel;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ dataModel = new SwingTreeDataModel();
+
+ //1
+ SwingTreeNodeImpl node = new SwingTreeNodeImpl();
+ //1:0
+ node.addChild(new SwingTreeNodeImpl());
+ //1:1
+ node.addChild(new SwingTreeNodeImpl());
+ //1:2
+ node.addChild(new SwingTreeNodeImpl());
+
+ dataModel.setWrappedData(new TreeNode[] {
+ new SwingTreeNodeImpl(), node
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+
+ dataModel = null;
+ }
+
+ public void testEmptyString() throws Exception {
+ //TODO make it work
+// Object key = dataModel.convertToKey(null, "", null, null);
+// assertNull(key);
+ }
+
+ public void testStraightWay() throws Exception {
+ TreeRowKey<Integer> key;
+ Iterator<Integer> iterator;
+
+ key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "0", null, null);
+ iterator = key.iterator();
+ assertEquals(Integer.valueOf(0), iterator.next());
+ assertFalse(iterator.hasNext());
+
+ key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "1", null, null);
+ iterator = key.iterator();
+ assertEquals(Integer.valueOf(1), iterator.next());
+ assertFalse(iterator.hasNext());
+
+ key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "1:0", null, null);
+ iterator = key.iterator();
+ assertEquals(Integer.valueOf(1), iterator.next());
+ assertEquals(Integer.valueOf(0), iterator.next());
+ assertFalse(iterator.hasNext());
+
+ key = (TreeRowKey<Integer>) dataModel.convertToKey(null, "1:2", null, null);
+ iterator = key.iterator();
+ assertEquals(Integer.valueOf(1), iterator.next());
+ assertEquals(Integer.valueOf(2), iterator.next());
+ assertFalse(iterator.hasNext());
+ }
+
+ public void testMissingNodes() throws Exception {
+ assertNull(dataModel.convertToKey(null, "2", null, null));
+ assertNull(dataModel.convertToKey(null, "0:3", null, null));
+ }
+}
+
15 years, 6 months
JBoss Rich Faces SVN: r14840 - framework/trunk/api.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-07 21:08:15 -0400 (Tue, 07 Jul 2009)
New Revision: 14840
Removed:
framework/trunk/api/src/
Log:
framework code being moved into new build system again...
15 years, 6 months
JBoss Rich Faces SVN: r14838 - framework/trunk/impl.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-07 20:55:58 -0400 (Tue, 07 Jul 2009)
New Revision: 14838
Added:
framework/trunk/impl/src/
Log:
framework code being moved into new build system again...
Copied: framework/trunk/impl/src (from rev 14837, branches/jsf2.0/framework/impl/src)
15 years, 6 months
JBoss Rich Faces SVN: r14837 - framework/trunk/impl.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-07 20:53:20 -0400 (Tue, 07 Jul 2009)
New Revision: 14837
Removed:
framework/trunk/impl/src/
Log:
framework code being moved into new build system again...
15 years, 6 months
JBoss Rich Faces SVN: r14836 - framework/trunk/impl.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-07 20:49:08 -0400 (Tue, 07 Jul 2009)
New Revision: 14836
Added:
framework/trunk/impl/src/
Log:
framework code being moved into new build system again...
Copied: framework/trunk/impl/src (from rev 14807, branches/jsf2.0/framework/impl/src)
15 years, 6 months