Author: nbelaevski
Date: 2009-07-23 13:00:43 -0400 (Thu, 23 Jul 2009)
New Revision: 14987
Removed:
root/framework/trunk/api/src/main/java/org/richfaces/component/Column.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Draggable.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Dropzone.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Filterable.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Row.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Selectable.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable.java
root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable2.java
root/framework/trunk/api/src/main/java/org/richfaces/component/xml/
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerSource.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DnDEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DragEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DragListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DropEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DropListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/DropSource.java
root/framework/trunk/api/src/main/java/org/richfaces/event/FileUploadListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedListener.java
root/framework/trunk/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
root/framework/trunk/api/src/main/java/org/richfaces/event/UploadEvent.java
root/framework/trunk/api/src/main/java/org/richfaces/event/extdt/
root/framework/trunk/api/src/main/java/org/richfaces/event/scroll/
root/framework/trunk/api/src/main/java/org/richfaces/event/sort/
root/framework/trunk/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/DataProvider.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
root/framework/trunk/api/src/main/java/org/richfaces/model/Field.java
root/framework/trunk/api/src/main/java/org/richfaces/model/FilterField.java
root/framework/trunk/api/src/main/java/org/richfaces/model/LastElementAware.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ListRowKey.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java
root/framework/trunk/api/src/main/java/org/richfaces/model/LocaleAware.java
root/framework/trunk/api/src/main/java/org/richfaces/model/MapDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/Modifiable.java
root/framework/trunk/api/src/main/java/org/richfaces/model/Ordering.java
root/framework/trunk/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SelectionMode.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SequenceDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SortField.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SortField2.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SortOrder.java
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNode.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRange.java
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRowKey.java
root/framework/trunk/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java
root/framework/trunk/api/src/main/java/org/richfaces/model/filter/
root/framework/trunk/api/src/main/java/org/richfaces/model/package-info.java
root/framework/trunk/api/src/main/java/org/richfaces/model/selection/
root/framework/trunk/api/src/test/java/org/ajax4jsf/framework/util/javascript/
root/framework/trunk/api/src/test/java/org/richfaces/model/
Log:
Moving component APIs into ui-sandbox
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Column.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/component/Column.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/component/Column.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Draggable.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/component/Draggable.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/component/Draggable.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Dropzone.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/component/Dropzone.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/component/Dropzone.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Filterable.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/component/Filterable.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/component/Filterable.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Row.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/component/Row.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/component/Row.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Selectable.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/component/Selectable.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/component/Selectable.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable2.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable2.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/component/Sortable2.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/AjaxSelectedEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/CurrentDateChangeListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DataFilterSliderSource.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerSource.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DataScrollerSource.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/DnDEvent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/event/DnDEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/event/DnDEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/DragEvent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/event/DragEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/event/DragEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/DragListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DragListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DragListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/event/DropEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/event/DropEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/DropListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/DropListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/DropListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/DropSource.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/event/DropSource.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/event/DropSource.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/FileUploadListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/FileUploadListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/FileUploadListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/ISimpleToggleListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeExpandedListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedListener.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedListener.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/NodeSelectedListener.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/SimpleToggleEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeAjaxEventType.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/event/UploadEvent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/event/UploadEvent.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/event/UploadEvent.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableSwingTreeNodeImpl.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/CacheableTreeNodeImpl.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-
-}
-
-
-
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicCacheableTreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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!");
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ClassicTreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ComplexTreeRowKey.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ConvertableKeyModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/DataProvider.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/DataProvider.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/DataProvider.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ExtendedFilterField.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ExtendedFilterField.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ExtendedFilterField.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/Field.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/Field.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/Field.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/FilterField.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/FilterField.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/FilterField.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/LastElementAware.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/LastElementAware.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/LastElementAware.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/ListRowKey.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/ListRowKey.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/ListRowKey.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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]);
- }
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/LocaleAware.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/LocaleAware.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/LocaleAware.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/MapDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/MapDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/MapDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/Modifiable.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/Modifiable.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/Modifiable.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/Ordering.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/Ordering.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/Ordering.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
- */
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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());
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/SelectionMode.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/SelectionMode.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/SelectionMode.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/SequenceDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/SequenceDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/SortField.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/SortField.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/SortField.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/SortField2.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/SortField2.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/SortField2.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/SortOrder.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/SortOrder.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/SortOrder.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelDataProvider.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelKey.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingCacheableTreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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());
- }
-}
-
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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());
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
- }
-
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeDataModelNodeAdaptor.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
- }
- }
- };
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeModelVisualComponentProvider.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNode.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNode.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNode.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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);
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
- }
-
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRange.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRange.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRange.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
- };
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRowKey.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRowKey.java 2009-07-23
16:55:55 UTC (rev 14986)
+++ root/framework/trunk/api/src/main/java/org/richfaces/model/TreeRowKey.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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();
- }
-}
Deleted:
root/framework/trunk/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/VisualStackingTreeModel.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -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;
- }
-}
Deleted: root/framework/trunk/api/src/main/java/org/richfaces/model/package-info.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/richfaces/model/package-info.java 2009-07-23
16:55:55 UTC (rev 14986)
+++
root/framework/trunk/api/src/main/java/org/richfaces/model/package-info.java 2009-07-23
17:00:43 UTC (rev 14987)
@@ -1,4 +0,0 @@
-/**
- * Model APIs of RichFaces components
- */
-package org.richfaces.model;