Author: alexsmirnov
Date: 2007-07-03 17:46:38 -0400 (Tue, 03 Jul 2007)
New Revision: 1451
Added:
trunk/framework/api/src/main/java/org/ajax4jsf/event/
trunk/framework/api/src/main/java/org/ajax4jsf/event/DragEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/DragListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/DropEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListenerBinding.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/DropSource.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java
trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java
trunk/framework/api/src/main/java/org/richfaces/component/Dropzone.java
trunk/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
trunk/framework/api/src/main/java/org/richfaces/model/
trunk/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
trunk/framework/api/src/main/java/org/richfaces/model/LastElementAware.java
trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
Removed:
trunk/framework/api/src/main/java/org/ajax4jsf/ajax/PushEventListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Draggable.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Dropzone.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListenerBinding.java
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropSource.java
trunk/framework/api/src/main/java/org/richfaces/component/AbstractTreeDataModel.java
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModel.java
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModelItem.java
trunk/framework/api/src/main/java/org/richfaces/component/LastElementAware.java
trunk/framework/api/src/main/java/org/richfaces/component/ListRowKey.java
trunk/framework/api/src/main/java/org/richfaces/component/TreeDataModel.java
trunk/framework/api/src/main/java/org/richfaces/component/TreeListenerEventsProducer.java
trunk/framework/api/src/main/java/org/richfaces/component/TreeNode.java
trunk/framework/api/src/main/java/org/richfaces/component/TreeNodeImpl.java
trunk/framework/api/src/main/java/org/richfaces/component/TreeRowKey.java
trunk/framework/api/src/main/java/org/richfaces/component/state/TreeRange.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/ajax/PushEventsCounter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/dnd/taglib/DropSourceMetaRule.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDParametersEncoder.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropListenerTag.java
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeDataModel.java
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeRequestDataModel.java
trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java
trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java
trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/CollapseNodeCommandEvent.java
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/ExpandNodeCommandEvent.java
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandNodeEvent.java
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandsListener.java
trunk/ui/tree/src/main/java/org/richfaces/component/xml/XmlTreeDataBuilder.java
trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/tree/src/test/java/org/richfaces/component/ListRowKeyTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/CollapseNodeCommandEventTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/ExpandNodeCommandEventTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/MockTreeStateCommandsListener.java
trunk/ui/tree/src/test/java/org/richfaces/component/xml/TreeDataBuilderTest.java
Log:
packages and classes refactor
Deleted: trunk/framework/api/src/main/java/org/ajax4jsf/ajax/PushEventListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/ajax/PushEventListener.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/ajax/PushEventListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,10 +0,0 @@
-package org.ajax4jsf.ajax;
-
-import java.util.EventListener;
-import java.util.EventObject;
-
-public interface PushEventListener extends EventListener {
-
- public void onEvent(EventObject event);
-
-}
Deleted: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Draggable.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Draggable.java 2007-07-03 20:13:44
UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Draggable.java 2007-07-03 21:46:38
UTC (rev 1451)
@@ -1,108 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd;
-
-import javax.faces.el.MethodBinding;
-
-import org.ajax4jsf.dnd.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);
-
-
- /**
- * 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);
-
- /**
- *
- * @return
- */
- public String getOndragend();
- public void setOndragend(String ondrag);
-
-
- /**
- * 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();
-
-}
Deleted: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Dropzone.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Dropzone.java 2007-07-03 20:13:44
UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Dropzone.java 2007-07-03 21:46:38
UTC (rev 1451)
@@ -1,101 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd;
-
-import org.ajax4jsf.dnd.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 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);
-
-}
Deleted: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragEvent.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,103 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.12.2006
- *
- */
-public class DragEvent extends FacesEvent {
-
- 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: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragListener.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,34 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd.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: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropEvent.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,113 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
-
-/**
- * @author shura
- *
- */
-public class DropEvent extends FacesEvent {
-
- /**
- *
- */
- 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) {
- if (listener instanceof DropListener) {
- DropListener dropListener = (DropListener) listener;
- dropListener.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: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListener.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,39 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd.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:
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListenerBinding.java
===================================================================
---
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListenerBinding.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListenerBinding.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,104 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd.event;
-
-import javax.faces.component.StateHolder;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-
-/**
- * Wrapper for bind DrolListener to EL expression.
- * @author shura
- *
- */
-public class DropListenerBinding implements DropListener, StateHolder {
-
- private ValueBinding _binding;
-
- private String _dragType;
-
- private ValueBinding _dragTypeBinding;
-
- private boolean _transient = false;
-
- public DropListenerBinding() {
- }
-
- /**
- * @param binding
- */
- public DropListenerBinding(ValueBinding binding) {
- super();
- _binding = binding;
- }
-
- private DropListener getHandler(FacesContext context) {
- return (DropListener) _binding.getValue(context);
- }
-
- public void processDrop(DropEvent event) {
- DropListener handler = getHandler(FacesContext.getCurrentInstance());
- handler.processDrop(event);
- }
-
- public boolean isTransient() {
- // TODO Auto-generated method stub
- return _transient;
- }
-
- public void restoreState(FacesContext context, Object state) {
- _binding = (ValueBinding) UIComponentBase.restoreAttachedState(context, state);
-
- }
-
- public Object saveState(FacesContext context) {
- return UIComponentBase.saveAttachedState(context, _binding);
- }
-
- public void setTransient(boolean newTransientValue) {
- _transient = newTransientValue;
-
- }
-
- /**
- * @return the dragType
- */
- public String getDragType() {
- return _dragType;
- }
-
- /**
- * @param dragType the dragType to set
- */
- public void setDragType(String dragType) {
- _dragType = dragType;
- }
-
- /**
- * @param dragTypeBinding the dragTypeBinding to set
- */
- public void setDragTypeBinding(ValueBinding dragTypeBinding) {
- _dragTypeBinding = dragTypeBinding;
- }
-
-}
Deleted: trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropSource.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropSource.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropSource.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,54 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.dnd.event;
-
-import javax.faces.el.MethodBinding;
-
-/**
- * Interface for component applicable to process drag/drop events.
- * @author shura
- *
- */
-public interface DropSource {
-
- /**
- * Append drop listener to component listeners collection
- * @param listener
- */
- public void addDropListener(DropListener listener);
-
- /**
- * Get array of all Drop Listeners
- * @return
- */
- public DropListener[] getDropListeners();
-
- /**
- * Remove drop listener from component listeners array.
- * @param listener
- */
- public void removeDropListener(DropListener listener);
-
- public void setDropListener(MethodBinding binding);
- public MethodBinding getDropListener();
-
-}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/DragEvent.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragEvent.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/DragEvent.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/DragEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,103 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.12.2006
+ *
+ */
+public class DragEvent extends FacesEvent {
+
+ private Dropzone dropTarget;
+ private Object acceptedTypes;
+ private Object dropValue;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6179268394391836905L;
+
+ public DragEvent(UIComponent uiComponent) {
+ super(uiComponent);
+ }
+
+ /* (non-Javadoc)
+ * @see
javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener faceslistener) {
+ return faceslistener instanceof DragListener;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener faceslistener) {
+ ((DragListener) faceslistener).processDrag(this);
+ }
+
+ public Object getDragValue() {
+ return ((Draggable) this.getSource()).getDragValue();
+ }
+
+ public Dropzone getDropTarget() {
+ return dropTarget;
+ }
+
+ /**
+ * @see java.util.EventObject#toString()
+ */
+/* public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
+ append("component", getComponent()).append("source",
getSource()).append("phaseId", getPhaseId()).
+ append("dragValue", getDragValue()).
+ append("dropTarget", getDropTarget()).
+ append("dropValue", getDropValue()).
+ toString();
+ }
+*/
+ public void setDropTarget(Dropzone dropTarget) {
+ this.dropTarget = dropTarget;
+ }
+
+ public Object getAcceptedTypes() {
+ return acceptedTypes;
+ }
+
+ public void setAcceptedTypes(Object acceptedTypes) {
+ this.acceptedTypes = acceptedTypes;
+ }
+
+ public Object getDropValue() {
+ return dropValue;
+ }
+
+ public void setDropValue(Object dropValue) {
+ this.dropValue = dropValue;
+ }
+}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/DragListener.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DragListener.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/DragListener.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/DragListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 27.12.2006
+ *
+ */
+public interface DragListener extends FacesListener {
+ public void processDrag(DragEvent event);
+
+}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/DropEvent.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropEvent.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/DropEvent.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/DropEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,113 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
+
+/**
+ * @author shura
+ *
+ */
+public class DropEvent extends FacesEvent {
+
+ /**
+ *
+ */
+ 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) {
+ if (listener instanceof DropListener) {
+ DropListener dropListener = (DropListener) listener;
+ dropListener.processDrop(this);
+ }
+
+ }
+
+ /**
+ * @return the dropValue
+ */
+ public Object getDropValue() {
+ return ((Dropzone) this.getSource()).getDropValue();
+ }
+
+ public Draggable getDraggableSource() {
+ return draggableSource;
+ }
+
+ /**
+ * @see java.util.EventObject#toString()
+ */
+/* public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
+ append("component", getComponent()).
+ append("source", getSource()).
+ append("phaseId", getPhaseId()).
+ append("dropValue", getDropValue()).
+ append("draggableSource", getDraggableSource()).
+ append("dragValue", getDragValue()).
+ toString();
+ }
+*/
+ public void setDraggableSource(Draggable draggableSource) {
+ this.draggableSource = draggableSource;
+ }
+
+ public String getDragType() {
+ return dragType;
+ }
+
+ public void setDragType(String dragType) {
+ this.dragType = dragType;
+ }
+
+ public Object getDragValue() {
+ return dragValue;
+ }
+
+ public void setDragValue(Object dragValue) {
+ this.dragValue = dragValue;
+ }
+}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListener.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListener.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListener.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,39 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * Listener for process Drop events
+ * @author shura
+ *
+ */
+public interface DropListener extends FacesListener {
+
+ /**
+ * Process event on Drop for this component.
+ * @param event
+ */
+ public void processDrop(DropEvent event);
+
+}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListenerBinding.java
(from rev 1448,
trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropListenerBinding.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListenerBinding.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/ajax4jsf/event/DropListenerBinding.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,104 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * Wrapper for bind DrolListener to EL expression.
+ * @author shura
+ *
+ */
+public class DropListenerBinding implements DropListener, StateHolder {
+
+ private ValueBinding _binding;
+
+ private String _dragType;
+
+ private ValueBinding _dragTypeBinding;
+
+ private boolean _transient = false;
+
+ public DropListenerBinding() {
+ }
+
+ /**
+ * @param binding
+ */
+ public DropListenerBinding(ValueBinding binding) {
+ super();
+ _binding = binding;
+ }
+
+ private DropListener getHandler(FacesContext context) {
+ return (DropListener) _binding.getValue(context);
+ }
+
+ public void processDrop(DropEvent event) {
+ DropListener handler = getHandler(FacesContext.getCurrentInstance());
+ handler.processDrop(event);
+ }
+
+ public boolean isTransient() {
+ // TODO Auto-generated method stub
+ return _transient;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ _binding = (ValueBinding) UIComponentBase.restoreAttachedState(context, state);
+
+ }
+
+ public Object saveState(FacesContext context) {
+ return UIComponentBase.saveAttachedState(context, _binding);
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ _transient = newTransientValue;
+
+ }
+
+ /**
+ * @return the dragType
+ */
+ public String getDragType() {
+ return _dragType;
+ }
+
+ /**
+ * @param dragType the dragType to set
+ */
+ public void setDragType(String dragType) {
+ _dragType = dragType;
+ }
+
+ /**
+ * @param dragTypeBinding the dragTypeBinding to set
+ */
+ public void setDragTypeBinding(ValueBinding dragTypeBinding) {
+ _dragTypeBinding = dragTypeBinding;
+ }
+
+}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/DropSource.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/event/DropSource.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/DropSource.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/DropSource.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,54 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.event;
+
+import javax.faces.el.MethodBinding;
+
+/**
+ * Interface for component applicable to process drag/drop events.
+ * @author shura
+ *
+ */
+public interface DropSource {
+
+ /**
+ * Append drop listener to component listeners collection
+ * @param listener
+ */
+ public void addDropListener(DropListener listener);
+
+ /**
+ * Get array of all Drop Listeners
+ * @return
+ */
+ public DropListener[] getDropListeners();
+
+ /**
+ * Remove drop listener from component listeners array.
+ * @param listener
+ */
+ public void removeDropListener(DropListener listener);
+
+ public void setDropListener(MethodBinding binding);
+ public MethodBinding getDropListener();
+
+}
Copied: trunk/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java (from
rev 1448, trunk/framework/api/src/main/java/org/ajax4jsf/ajax/PushEventListener.java)
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/PushEventListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,10 @@
+package org.ajax4jsf.event;
+
+import java.util.EventListener;
+import java.util.EventObject;
+
+public interface PushEventListener extends EventListener {
+
+ public void onEvent(EventObject event);
+
+}
Deleted:
trunk/framework/api/src/main/java/org/richfaces/component/AbstractTreeDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/AbstractTreeDataModel.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/AbstractTreeDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,138 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.io.IOException;
-
-import javax.faces.component.NamingContainer;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.ExtendedDataModel;
-import org.ajax4jsf.model.Range;
-import org.richfaces.component.state.TreeRange;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com created 07.12.2006
- * Base class for all tree data models
- */
-public abstract class AbstractTreeDataModel extends ExtendedDataModel {
- public final static char SEPARATOR = NamingContainer.SEPARATOR_CHAR;
-
- private TreeNode wrappedData;
-
- 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 Object getWrappedData() {
- return wrappedData;
- }
-
- public final void setWrappedData(Object data) {
- wrappedData = (TreeNode) data;
- }
-
- 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 (argument instanceof SubTreeChildrenAppender) {
-// setRowKey(treeRowKey);
-//
-// if (isRowAvailable()) {
-// ((SubTreeChildrenAppender) argument).addChild(treeRowKey, getRowData(), last,
isLeaf(), getTreeNodeType());
-// }
-// }
-
- if (last && dataVisitor instanceof LastElementAware) {
- try {
- ((LastElementAware) dataVisitor).setLastElement();
- dataVisitor.process(context, treeRowKey, argument);
- } finally {
- ((LastElementAware) dataVisitor).resetLastElement();
- }
- } else {
- dataVisitor.process(context, treeRowKey, argument);
- }
- }
-
- public abstract TreeNode getTreeNode();
-}
Deleted: trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModel.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,44 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.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:
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModelItem.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModelItem.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModelItem.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,65 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.Date;
-
-
-/**
- * @author Alexej Kushunin
- * created 19.06.2007
- *
- */
-
-public interface CalendarDataModelItem {
-
- /**
- * @return date that this item for, default implementation return Date
- * */
- public Date getDate();
-
- /**
- *@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();
-}
Copied: trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Draggable.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,108 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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.el.MethodBinding;
+
+import org.ajax4jsf.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);
+
+
+ /**
+ * 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);
+
+ /**
+ *
+ * @return
+ */
+ public String getOndragend();
+ public void setOndragend(String ondrag);
+
+
+ /**
+ * 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();
+
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/component/Dropzone.java (from rev
1448, trunk/framework/api/src/main/java/org/ajax4jsf/dnd/Dropzone.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Dropzone.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Dropzone.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,101 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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.ajax4jsf.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 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);
+
+}
Deleted: trunk/framework/api/src/main/java/org/richfaces/component/LastElementAware.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/LastElementAware.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/LastElementAware.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,43 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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;
-
-/**
- * @author Konstantin Mishin
- *
- * {@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.
- */
-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: trunk/framework/api/src/main/java/org/richfaces/component/ListRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/ListRowKey.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/richfaces/component/ListRowKey.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,236 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 17.11.2006
- * Default {@link TreeRowKey} implementation based on {@link ArrayList}
- */
-public class ListRowKey extends TreeRowKey {
-
- private ArrayList path;
-
- /**
- *
- */
- private static final long serialVersionUID = 7718335783201397177L;
-
- public String toString() {
- return getPath();
- }
-
- /**
- * Default constructor
- */
- public ListRowKey() {
- super();
- this.path = new ArrayList();
- }
-
- /**
- * Copy constructor
- * @param parentRowKey row key to clone
- */
- protected ListRowKey(ListRowKey parentRowKey) {
- super();
- this.path = (ArrayList) parentRowKey.path.clone();
- }
-
- /**
- * Appending constructor
- * @param parentRowKey base row key
- * @param pathElement path segment to append to base row key
- */
- public ListRowKey(ListRowKey parentRowKey, Object pathElement) {
- this(parentRowKey);
- this.path.add(pathElement);
- }
-
- private static ArrayList parsePath(String path) {
- ArrayList result = new ArrayList();
-
- String trimmedPath = path.trim();
-
- StringBuffer sb = new StringBuffer();
- boolean escapedState = false;
- int pathLength = trimmedPath.length();
-
- //unescape
- for (int i = 0; i < pathLength; i++) {
- char c = trimmedPath.charAt(i);
-
- if (SEPARATOR_ESCAPE_CHAR == c) {
- if (escapedState) {
- sb.append(c);
- }
- escapedState = !escapedState;
- } else {
- if (c == AbstractTreeDataModel.SEPARATOR) {
- if (escapedState) {
- sb.append(c);
- } else {
- result.add(sb.toString());
- sb = new StringBuffer();
- }
- } else {
- sb.append(c);
- }
-
- escapedState = false;
- }
- }
-
- if (sb.length() != 0) {
- result.add(sb.toString());
- }
-
- return result;
- }
-
- /**
- * List constructor
- * @param list List of strings to create corresponding row key from
- */
- public ListRowKey(List list) {
- super();
-
- this.path = new ArrayList(list);
- }
-
- /**
- * Path object constructor
- * @param path first path segment
- */
- public ListRowKey(Object path) {
- super();
- this.path = new ArrayList(1);
- this.path.add(path);
- }
-
- /**
- * Path string constructor
- * @param path path string to create corresponding row key from
- */
- public ListRowKey(String path) {
- super();
- this.path = parsePath(path);
- }
-
- public int depth() {
- return path.size();
- }
-
- public Iterator 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 getSubPathIterator(int fromIndex) {
- return path.listIterator(fromIndex);
- }
-
- public boolean isSubKey(TreeRowKey rowKey) {
- if (rowKey instanceof ListRowKey) {
- ListRowKey listRowKey = (ListRowKey) rowKey;
-
- int commonLength = getCommonPathLength(listRowKey);
- if (commonLength != 0) {
- return commonLength == depth();
- } else {
- return rowKey.depth() == 0;
- }
- } else {
- return super.isSubKey(rowKey);
- }
- }
-
- public String getPath() {
- StringBuffer result = new StringBuffer();
- Iterator iterator = path.iterator();
- boolean hasNext = iterator.hasNext();
-
- while (hasNext) {
- String pathSegment = iterator.next().toString();
-
- StringBuffer escapedSubPath = new StringBuffer();
- for (int i = 0; i < pathSegment.length(); i++) {
- char ch = pathSegment.charAt(i);
-
- //escape
- if (AbstractTreeDataModel.SEPARATOR == ch || ListRowKey.SEPARATOR_ESCAPE_CHAR == ch)
{
- escapedSubPath.append(ListRowKey.SEPARATOR_ESCAPE_CHAR);
- }
-
- escapedSubPath.append(ch);
- }
-
- result.append(escapedSubPath.toString());
-
- hasNext = iterator.hasNext();
-
- if (hasNext) {
- result.append(AbstractTreeDataModel.SEPARATOR);
- }
- }
-
- return result.toString();
- }
-
- public int getCommonPathLength(TreeRowKey otherRowKey) {
- if (otherRowKey == null)
- return 0;
- Iterator iterator = this.iterator();
- Iterator otherIterator = otherRowKey.iterator();
- int length = 0;
- while (iterator.hasNext() && otherIterator.hasNext()
- && iterator.next().equals(otherIterator.next()))
- length++;
- return length;
- }
-}
Deleted: trunk/framework/api/src/main/java/org/richfaces/component/TreeDataModel.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/TreeDataModel.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/TreeDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,223 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.model.DataVisitor;
-import org.ajax4jsf.model.Range;
-import org.richfaces.component.state.TreeRange;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com created 16.11.2006
- *
- */
-public class TreeDataModel extends AbstractTreeDataModel {
- private TreeRowKey currentRowKey;
-
- private TreeRowKey oldRowKey;
-
- private TreeNode rowTreeData;
-
- public Object getRowKey() {
- return this.currentRowKey;
- }
-
- public void setRowKey(Object rowKey) {
- if (rowKey != null) {
- ListRowKey newRowKey = (ListRowKey) rowKey;
- this.currentRowKey = newRowKey;
- } else {
- this.currentRowKey = null;
- this.oldRowKey = null;
- this.rowTreeData = null;
- }
- }
-
-
- public void walk(FacesContext context, DataVisitor dataVisitor,
- Range range, Object rowKey, Object argument, boolean last) throws IOException {
-
- ListRowKey listRowKey = (ListRowKey) rowKey;
-
- TreeNode node = locateTreeNode(listRowKey);
-
- if (node != null) {
- TreeRange treeRange = (TreeRange) range;
-
- if (treeRange == null || treeRange.processNode(listRowKey)) {
-
- if (node.getParent() != null) {
- processElement(context, dataVisitor, argument, listRowKey, last);
- }
-
- if (treeRange == null || treeRange.processChildren(listRowKey)) {
- if (!node.isLeaf()) {
- Iterator children = node.getChildren();
-
- Map.Entry childEntry = children.hasNext() ? (Map.Entry) children.next() : null;
- TreeNode childNode;
- Object identifier;
-
- if (childEntry != null) {
- childNode = (TreeNode) childEntry.getValue();
- identifier = childEntry.getKey();
- } else {
- childNode = null;
- identifier = null;
- }
-
- do {
- Map.Entry nextChildEntry = children.hasNext() ? (Map.Entry) children.next() :
null;
- TreeNode nextChildNode;
- Object nextIdentifier;
-
- if (nextChildEntry != null) {
- nextChildNode = (TreeNode) nextChildEntry.getValue();
- nextIdentifier = nextChildEntry.getKey();
- } else {
- nextChildNode = null;
- nextIdentifier = null;
- }
-
- if (childNode != null) {
-
- boolean isLast = nextChildNode == null;
-
- ListRowKey newRowKey;
- if (rowKey != null) {
- newRowKey = new ListRowKey(listRowKey, identifier);
- } else {
- newRowKey = new ListRowKey(identifier);
- }
-
- this.walk(context, dataVisitor, range, newRowKey, argument, isLast);
- }
-
- identifier = nextIdentifier;
- childNode = nextChildNode;
- } while (childNode != null);
- }
- }
- }
- }
- }
-
- protected TreeNode locateTreeNode(TreeRowKey rowKey) {
- return locateTreeNode(rowKey, false);
- }
-
- protected TreeNode locateTreeNode(TreeRowKey rowKey, boolean allowCreate) {
- boolean useCached = (rowTreeData != null && rowKey != null &&
rowKey.equals(this.oldRowKey));
- if (!useCached) {
- TreeNode rootNode = (TreeNode) getWrappedData();
-
- if (rootNode != null) {
- if (rowKey != null) {
- int commonPathLength = rowKey.getCommonPathLength(oldRowKey);
- if (oldRowKey == null) {
- rowTreeData = rootNode;
- } else {
- int rootOpsCount = rowKey.depth();
- int currentUpOpsCount = oldRowKey.depth() - commonPathLength;
- int currentOpsCount = currentUpOpsCount + rootOpsCount - commonPathLength;
-
- if (rootOpsCount > currentOpsCount) {
- for (int i = 0; i < oldRowKey.depth()
- - commonPathLength; i++) {
-
- rowTreeData = rowTreeData.getParent();
- }
- } else {
- commonPathLength = 0;
- rowTreeData = rootNode;
- oldRowKey = null;
- }
- }
- oldRowKey = rowKey;
- Iterator iterator = rowKey.getSubPathIterator(commonPathLength);
- while (iterator.hasNext()) {
- Object pathSegment = iterator.next();
- TreeNode childRowTreeData = rowTreeData.getChild(pathSegment);
-
- if (childRowTreeData == null) {
- if (!allowCreate) {
- return null;
- } else {
- childRowTreeData = new TreeNodeImpl();
- rowTreeData.addChild(pathSegment, childRowTreeData);
- }
- }
-
- rowTreeData = childRowTreeData;
- }
- } else {
- return rootNode;
- }
- } else {
- return null;
- }
- }
- return rowTreeData;
- }
-
- public boolean isRowAvailable() {
- TreeNode data = locateTreeNode(this.currentRowKey);
-
- if (data != null) {
- return true;
- }
-
- return false;
- }
-
- public Object getRowData() {
- TreeNode treeNode = locateTreeNode(this.currentRowKey);
- if (treeNode != null) {
- return treeNode.getData();
- }
-
- return null;
- }
-
- public boolean isLeaf() {
- TreeNode treeNode = locateTreeNode(this.currentRowKey);
- if (treeNode != null) {
- return treeNode.isLeaf();
- }
-
- 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);
- }
-
- public TreeNode getTreeNode() {
- return locateTreeNode(this.currentRowKey);
- }
-}
Deleted:
trunk/framework/api/src/main/java/org/richfaces/component/TreeListenerEventsProducer.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/TreeListenerEventsProducer.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/TreeListenerEventsProducer.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.faces.el.MethodBinding;
-
-import org.richfaces.component.events.NodeExpandedListener;
-import org.richfaces.component.events.NodeSelectedListener;
-
-/**
- * @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: trunk/framework/api/src/main/java/org/richfaces/component/TreeNode.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/TreeNode.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/richfaces/component/TreeNode.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,89 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.io.Serializable;
-import java.util.Iterator;
-import java.util.Map;
-
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 16.11.2006
- * Interface representing tree ADT nodes
- */
-public interface TreeNode extends Serializable{
-
- /**
- * getter for node attached data
- * @return node attached data
- */
- public Object getData();
- /**
- * setter for node attached data
- * @param data data to set as attached node data
- */
- public void setData(Object 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
- * @return {@link Iterator} of {@link Map.Entry} instances containing {@link TreeNode}
as values
- * and their identifiers as keys
- */
- public Iterator getChildren();
- /**
- * find child by id
- * @param id identifier of the child to find
- * @return designated {@link TreeNode} instance or <code>null</code>
- */
- public TreeNode getChild(Object id);
-
- /**
- * adds child to children collection
- * @param identifier child identifier
- * @param child child
- */
- public void addChild(Object identifier, TreeNode child);
-
- /**
- * 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 getParent();
- /**
- * setter for parent {@link TreeNode}
- * @param parent {@link TreeNode} to set as parent
- */
- public void setParent(TreeNode parent);
-}
Deleted: trunk/framework/api/src/main/java/org/richfaces/component/TreeNodeImpl.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/TreeNodeImpl.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/richfaces/component/TreeNodeImpl.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,82 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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 java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 16.11.2006
- * Default {@link TreeNode} implementation based on {@link LinkedHashMap} to preserve
- * elements ordering
- */
-public class TreeNodeImpl implements TreeNode {
-
- private static final long serialVersionUID = -5498990493803705085L;
- private Object data;
- private TreeNode parent;
-
- private Map childrenMap = new LinkedHashMap();
-
- public Object getData() {
- return data;
- }
-
- public TreeNode getChild(Object identifier) {
- return (TreeNode) childrenMap.get(identifier);
- }
-
- public void addChild(Object identifier, TreeNode child) {
- child.setParent(this);
- childrenMap.put(identifier, child);
- }
-
- public void removeChild(Object identifier) {
- TreeNode treeNode = (TreeNode) childrenMap.remove(identifier);
- if (treeNode != null) {
- treeNode.setParent(null);
- }
- }
-
- public void setData(Object data) {
- this.data = data;
- }
-
- public TreeNode getParent() {
- return parent;
- }
-
- public void setParent(TreeNode parent) {
- this.parent = parent;
- }
-
- public Iterator getChildren() {
- return childrenMap.entrySet().iterator();
- }
-
- public boolean isLeaf() {
- return childrenMap.isEmpty();
- }
-
-}
Deleted: trunk/framework/api/src/main/java/org/richfaces/component/TreeRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/TreeRowKey.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/api/src/main/java/org/richfaces/component/TreeRowKey.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,85 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.io.Serializable;
-import java.util.Iterator;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 06.12.2006
- * Base abstract clas for all tree row keys
- */
-public abstract class TreeRowKey implements Serializable {
-
- 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 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 rowKey) {
- if (rowKey == null) {
- return false;
- }
-
- return (rowKey.getPath() + AbstractTreeDataModel.SEPARATOR).startsWith(getPath());
- }
-
- /**
- * getter for path iterator
- * @return path segments iterator
- */
- public abstract Iterator 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 otherRowKey);
-
-}
Deleted: trunk/framework/api/src/main/java/org/richfaces/component/state/TreeRange.java
===================================================================
---
trunk/framework/api/src/main/java/org/richfaces/component/state/TreeRange.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/api/src/main/java/org/richfaces/component/state/TreeRange.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -1,35 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - 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.state;
-
-import org.ajax4jsf.model.Range;
-import org.richfaces.component.TreeRowKey;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 23.11.2006
- *
- */
-public interface TreeRange extends Range {
- public boolean processNode(TreeRowKey rowKey);
- public boolean processChildren(TreeRowKey rowKey);
-}
Copied:
trunk/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
(from rev 1448,
trunk/framework/api/src/main/java/org/richfaces/component/TreeListenerEventsProducer.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/richfaces/event/TreeListenerEventsProducer.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+import org.richfaces.component.events.NodeExpandedListener;
+import org.richfaces.component.events.NodeSelectedListener;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 29.11.2006
+ *
+ * Base tree events interface
+ */
+public interface TreeListenerEventsProducer {
+ public abstract void setChangeExpandListener(MethodBinding binding);
+ public abstract MethodBinding getChangeExpandListener();
+
+ public abstract void setNodeSelectListener(MethodBinding binding);
+ public abstract MethodBinding getNodeSelectListener();
+
+ public abstract void setDropListener(MethodBinding binding);
+ public abstract MethodBinding getDropListener();
+
+ public abstract void setDragListener(MethodBinding binding);
+ public abstract MethodBinding getDragListener();
+
+ public void addNodeSelectListener(NodeSelectedListener listener);
+ public void addChangeExpandListener(NodeExpandedListener listener);
+
+ //TODO - rename this
+ public boolean hasAjaxSubmitSelection();
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
(from rev 1450,
trunk/framework/api/src/main/java/org/richfaces/component/AbstractTreeDataModel.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/richfaces/model/AbstractTreeDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,137 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com created 07.12.2006
+ * Base class for all tree data models
+ */
+public abstract class AbstractTreeDataModel extends ExtendedDataModel {
+ public final static char SEPARATOR = NamingContainer.SEPARATOR_CHAR;
+
+ private TreeNode wrappedData;
+
+ 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 Object getWrappedData() {
+ return wrappedData;
+ }
+
+ public final void setWrappedData(Object data) {
+ wrappedData = (TreeNode) data;
+ }
+
+ 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 (argument instanceof SubTreeChildrenAppender) {
+// setRowKey(treeRowKey);
+//
+// if (isRowAvailable()) {
+// ((SubTreeChildrenAppender) argument).addChild(treeRowKey, getRowData(), last,
isLeaf(), getTreeNodeType());
+// }
+// }
+
+ if (last && dataVisitor instanceof LastElementAware) {
+ try {
+ ((LastElementAware) dataVisitor).setLastElement();
+ dataVisitor.process(context, treeRowKey, argument);
+ } finally {
+ ((LastElementAware) dataVisitor).resetLastElement();
+ }
+ } else {
+ dataVisitor.process(context, treeRowKey, argument);
+ }
+ }
+
+ public abstract TreeNode getTreeNode();
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java (from
rev 1448,
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModel.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,44 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.model;
+
+import java.util.Date;
+/**
+ * @author Alexej Kushunin
+ * created 19.06.2007
+ *
+ */
+public interface CalendarDataModel {
+
+ /**
+ * @return array of CalendarDataModelItems for selected dates.
+ * This method will be called every time when components will need next block of
CalendarDataItems.
+ * That may happens when calendar rendered, or when user navigate to next(previous)
month or in any other case when calendar renders.
+ * This method will be called in Ajax mode when Calendar renders new page.
+ * */
+ public CalendarDataModelItem[] getData(Date[] dateArray);
+
+ /**
+ * @return tool tip when it's used in "single" mode
+ * This method used when tool tips are displayed in "single" mode
+ * */
+ public Object getToolTip(Date date);
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
(from rev 1448,
trunk/framework/api/src/main/java/org/richfaces/component/CalendarDataModelItem.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java
(rev 0)
+++
trunk/framework/api/src/main/java/org/richfaces/model/CalendarDataModelItem.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,65 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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 CalendarDataModelItem {
+
+ /**
+ * @return date that this item for, default implementation return Date
+ * */
+ public Date getDate();
+
+ /**
+ *@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();
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/LastElementAware.java (from
rev 1448,
trunk/framework/api/src/main/java/org/richfaces/component/LastElementAware.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/LastElementAware.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/LastElementAware.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,43 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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 Konstantin Mishin
+ *
+ * {@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.
+ */
+public interface LastElementAware {
+
+ /**
+ * The method is invoked to notify that last element occured
+ */
+ public void setLastElement();
+ /**
+ * The method is invoked to notify that we're done with last element
+ */
+ public void resetLastElement();
+
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java (from rev
1448, trunk/framework/api/src/main/java/org/richfaces/component/ListRowKey.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,236 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 17.11.2006
+ * Default {@link TreeRowKey} implementation based on {@link ArrayList}
+ */
+public class ListRowKey extends TreeRowKey {
+
+ private ArrayList path;
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7718335783201397177L;
+
+ public String toString() {
+ return getPath();
+ }
+
+ /**
+ * Default constructor
+ */
+ public ListRowKey() {
+ super();
+ this.path = new ArrayList();
+ }
+
+ /**
+ * Copy constructor
+ * @param parentRowKey row key to clone
+ */
+ protected ListRowKey(ListRowKey parentRowKey) {
+ super();
+ this.path = (ArrayList) parentRowKey.path.clone();
+ }
+
+ /**
+ * Appending constructor
+ * @param parentRowKey base row key
+ * @param pathElement path segment to append to base row key
+ */
+ public ListRowKey(ListRowKey parentRowKey, Object pathElement) {
+ this(parentRowKey);
+ this.path.add(pathElement);
+ }
+
+ private static ArrayList parsePath(String path) {
+ ArrayList result = new ArrayList();
+
+ String trimmedPath = path.trim();
+
+ StringBuffer sb = new StringBuffer();
+ boolean escapedState = false;
+ int pathLength = trimmedPath.length();
+
+ //unescape
+ for (int i = 0; i < pathLength; i++) {
+ char c = trimmedPath.charAt(i);
+
+ if (SEPARATOR_ESCAPE_CHAR == c) {
+ if (escapedState) {
+ sb.append(c);
+ }
+ escapedState = !escapedState;
+ } else {
+ if (c == AbstractTreeDataModel.SEPARATOR) {
+ if (escapedState) {
+ sb.append(c);
+ } else {
+ result.add(sb.toString());
+ sb = new StringBuffer();
+ }
+ } else {
+ sb.append(c);
+ }
+
+ escapedState = false;
+ }
+ }
+
+ if (sb.length() != 0) {
+ result.add(sb.toString());
+ }
+
+ return result;
+ }
+
+ /**
+ * List constructor
+ * @param list List of strings to create corresponding row key from
+ */
+ public ListRowKey(List list) {
+ super();
+
+ this.path = new ArrayList(list);
+ }
+
+ /**
+ * Path object constructor
+ * @param path first path segment
+ */
+ public ListRowKey(Object path) {
+ super();
+ this.path = new ArrayList(1);
+ this.path.add(path);
+ }
+
+ /**
+ * Path string constructor
+ * @param path path string to create corresponding row key from
+ */
+ public ListRowKey(String path) {
+ super();
+ this.path = parsePath(path);
+ }
+
+ public int depth() {
+ return path.size();
+ }
+
+ public Iterator 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 getSubPathIterator(int fromIndex) {
+ return path.listIterator(fromIndex);
+ }
+
+ public boolean isSubKey(TreeRowKey rowKey) {
+ if (rowKey instanceof ListRowKey) {
+ ListRowKey listRowKey = (ListRowKey) rowKey;
+
+ int commonLength = getCommonPathLength(listRowKey);
+ if (commonLength != 0) {
+ return commonLength == depth();
+ } else {
+ return rowKey.depth() == 0;
+ }
+ } else {
+ return super.isSubKey(rowKey);
+ }
+ }
+
+ public String getPath() {
+ StringBuffer result = new StringBuffer();
+ Iterator iterator = path.iterator();
+ boolean hasNext = iterator.hasNext();
+
+ while (hasNext) {
+ String pathSegment = iterator.next().toString();
+
+ StringBuffer escapedSubPath = new StringBuffer();
+ for (int i = 0; i < pathSegment.length(); i++) {
+ char ch = pathSegment.charAt(i);
+
+ //escape
+ if (AbstractTreeDataModel.SEPARATOR == ch || ListRowKey.SEPARATOR_ESCAPE_CHAR == ch)
{
+ escapedSubPath.append(ListRowKey.SEPARATOR_ESCAPE_CHAR);
+ }
+
+ escapedSubPath.append(ch);
+ }
+
+ result.append(escapedSubPath.toString());
+
+ hasNext = iterator.hasNext();
+
+ if (hasNext) {
+ result.append(AbstractTreeDataModel.SEPARATOR);
+ }
+ }
+
+ return result.toString();
+ }
+
+ public int getCommonPathLength(TreeRowKey otherRowKey) {
+ if (otherRowKey == null)
+ return 0;
+ Iterator iterator = this.iterator();
+ Iterator otherIterator = otherRowKey.iterator();
+ int length = 0;
+ while (iterator.hasNext() && otherIterator.hasNext()
+ && iterator.next().equals(otherIterator.next()))
+ length++;
+ return length;
+ }
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java (from rev
1450, trunk/framework/api/src/main/java/org/richfaces/component/TreeDataModel.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,222 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.Range;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com created 16.11.2006
+ *
+ */
+public class TreeDataModel extends AbstractTreeDataModel {
+ private TreeRowKey currentRowKey;
+
+ private TreeRowKey oldRowKey;
+
+ private TreeNode rowTreeData;
+
+ public Object getRowKey() {
+ return this.currentRowKey;
+ }
+
+ public void setRowKey(Object rowKey) {
+ if (rowKey != null) {
+ ListRowKey newRowKey = (ListRowKey) rowKey;
+ this.currentRowKey = newRowKey;
+ } else {
+ this.currentRowKey = null;
+ this.oldRowKey = null;
+ this.rowTreeData = null;
+ }
+ }
+
+
+ public void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last) throws IOException {
+
+ ListRowKey listRowKey = (ListRowKey) rowKey;
+
+ TreeNode node = locateTreeNode(listRowKey);
+
+ if (node != null) {
+ TreeRange treeRange = (TreeRange) range;
+
+ if (treeRange == null || treeRange.processNode(listRowKey)) {
+
+ if (node.getParent() != null) {
+ processElement(context, dataVisitor, argument, listRowKey, last);
+ }
+
+ if (treeRange == null || treeRange.processChildren(listRowKey)) {
+ if (!node.isLeaf()) {
+ Iterator children = node.getChildren();
+
+ Map.Entry childEntry = children.hasNext() ? (Map.Entry) children.next() : null;
+ TreeNode childNode;
+ Object identifier;
+
+ if (childEntry != null) {
+ childNode = (TreeNode) childEntry.getValue();
+ identifier = childEntry.getKey();
+ } else {
+ childNode = null;
+ identifier = null;
+ }
+
+ do {
+ Map.Entry nextChildEntry = children.hasNext() ? (Map.Entry) children.next() :
null;
+ TreeNode nextChildNode;
+ Object nextIdentifier;
+
+ if (nextChildEntry != null) {
+ nextChildNode = (TreeNode) nextChildEntry.getValue();
+ nextIdentifier = nextChildEntry.getKey();
+ } else {
+ nextChildNode = null;
+ nextIdentifier = null;
+ }
+
+ if (childNode != null) {
+
+ boolean isLast = nextChildNode == null;
+
+ ListRowKey newRowKey;
+ if (rowKey != null) {
+ newRowKey = new ListRowKey(listRowKey, identifier);
+ } else {
+ newRowKey = new ListRowKey(identifier);
+ }
+
+ this.walk(context, dataVisitor, range, newRowKey, argument, isLast);
+ }
+
+ identifier = nextIdentifier;
+ childNode = nextChildNode;
+ } while (childNode != null);
+ }
+ }
+ }
+ }
+ }
+
+ protected TreeNode locateTreeNode(TreeRowKey rowKey) {
+ return locateTreeNode(rowKey, false);
+ }
+
+ protected TreeNode locateTreeNode(TreeRowKey rowKey, boolean allowCreate) {
+ boolean useCached = (rowTreeData != null && rowKey != null &&
rowKey.equals(this.oldRowKey));
+ if (!useCached) {
+ TreeNode rootNode = (TreeNode) getWrappedData();
+
+ if (rootNode != null) {
+ if (rowKey != null) {
+ int commonPathLength = rowKey.getCommonPathLength(oldRowKey);
+ if (oldRowKey == null) {
+ rowTreeData = rootNode;
+ } else {
+ int rootOpsCount = rowKey.depth();
+ int currentUpOpsCount = oldRowKey.depth() - commonPathLength;
+ int currentOpsCount = currentUpOpsCount + rootOpsCount - commonPathLength;
+
+ if (rootOpsCount > currentOpsCount) {
+ for (int i = 0; i < oldRowKey.depth()
+ - commonPathLength; i++) {
+
+ rowTreeData = rowTreeData.getParent();
+ }
+ } else {
+ commonPathLength = 0;
+ rowTreeData = rootNode;
+ oldRowKey = null;
+ }
+ }
+ oldRowKey = rowKey;
+ Iterator iterator = rowKey.getSubPathIterator(commonPathLength);
+ while (iterator.hasNext()) {
+ Object pathSegment = iterator.next();
+ TreeNode childRowTreeData = rowTreeData.getChild(pathSegment);
+
+ if (childRowTreeData == null) {
+ if (!allowCreate) {
+ return null;
+ } else {
+ childRowTreeData = new TreeNodeImpl();
+ rowTreeData.addChild(pathSegment, childRowTreeData);
+ }
+ }
+
+ rowTreeData = childRowTreeData;
+ }
+ } else {
+ return rootNode;
+ }
+ } else {
+ return null;
+ }
+ }
+ return rowTreeData;
+ }
+
+ public boolean isRowAvailable() {
+ TreeNode data = locateTreeNode(this.currentRowKey);
+
+ if (data != null) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public Object getRowData() {
+ TreeNode treeNode = locateTreeNode(this.currentRowKey);
+ if (treeNode != null) {
+ return treeNode.getData();
+ }
+
+ return null;
+ }
+
+ public boolean isLeaf() {
+ TreeNode treeNode = locateTreeNode(this.currentRowKey);
+ if (treeNode != null) {
+ return treeNode.isLeaf();
+ }
+
+ 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);
+ }
+
+ public TreeNode getTreeNode() {
+ return locateTreeNode(this.currentRowKey);
+ }
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java (from rev
1448, trunk/framework/api/src/main/java/org/richfaces/component/TreeNode.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeNode.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,89 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 16.11.2006
+ * Interface representing tree ADT nodes
+ */
+public interface TreeNode extends Serializable{
+
+ /**
+ * getter for node attached data
+ * @return node attached data
+ */
+ public Object getData();
+ /**
+ * setter for node attached data
+ * @param data data to set as attached node data
+ */
+ public void setData(Object 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
+ * @return {@link Iterator} of {@link Map.Entry} instances containing {@link TreeNode}
as values
+ * and their identifiers as keys
+ */
+ public Iterator getChildren();
+ /**
+ * find child by id
+ * @param id identifier of the child to find
+ * @return designated {@link TreeNode} instance or <code>null</code>
+ */
+ public TreeNode getChild(Object id);
+
+ /**
+ * adds child to children collection
+ * @param identifier child identifier
+ * @param child child
+ */
+ public void addChild(Object identifier, TreeNode child);
+
+ /**
+ * 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 getParent();
+ /**
+ * setter for parent {@link TreeNode}
+ * @param parent {@link TreeNode} to set as parent
+ */
+ public void setParent(TreeNode parent);
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java (from rev
1448, trunk/framework/api/src/main/java/org/richfaces/component/TreeNodeImpl.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeNodeImpl.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,82 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 16.11.2006
+ * Default {@link TreeNode} implementation based on {@link LinkedHashMap} to preserve
+ * elements ordering
+ */
+public class TreeNodeImpl implements TreeNode {
+
+ private static final long serialVersionUID = -5498990493803705085L;
+ private Object data;
+ private TreeNode parent;
+
+ private Map childrenMap = new LinkedHashMap();
+
+ public Object getData() {
+ return data;
+ }
+
+ public TreeNode getChild(Object identifier) {
+ return (TreeNode) childrenMap.get(identifier);
+ }
+
+ public void addChild(Object identifier, TreeNode child) {
+ child.setParent(this);
+ childrenMap.put(identifier, child);
+ }
+
+ public void removeChild(Object identifier) {
+ TreeNode treeNode = (TreeNode) childrenMap.remove(identifier);
+ if (treeNode != null) {
+ treeNode.setParent(null);
+ }
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ public TreeNode getParent() {
+ return parent;
+ }
+
+ public void setParent(TreeNode parent) {
+ this.parent = parent;
+ }
+
+ public Iterator getChildren() {
+ return childrenMap.entrySet().iterator();
+ }
+
+ public boolean isLeaf() {
+ return childrenMap.isEmpty();
+ }
+
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java (from rev
1450, trunk/framework/api/src/main/java/org/richfaces/component/state/TreeRange.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 23.11.2006
+ *
+ */
+public interface TreeRange extends Range {
+ public boolean processNode(TreeRowKey rowKey);
+ public boolean processChildren(TreeRowKey rowKey);
+}
Copied: trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java (from rev
1448, trunk/framework/api/src/main/java/org/richfaces/component/TreeRowKey.java)
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
(rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -0,0 +1,85 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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;
+
+/**
+ * @author Nick Belaevski - nbelaevski(a)exadel.com
+ * created 06.12.2006
+ * Base abstract clas for all tree row keys
+ */
+public abstract class TreeRowKey implements Serializable {
+
+ 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 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 rowKey) {
+ if (rowKey == null) {
+ return false;
+ }
+
+ return (rowKey.getPath() + AbstractTreeDataModel.SEPARATOR).startsWith(getPath());
+ }
+
+ /**
+ * getter for path iterator
+ * @return path segments iterator
+ */
+ public abstract Iterator 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 otherRowKey);
+
+}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/ajax/PushEventsCounter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/ajax/PushEventsCounter.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/ajax/PushEventsCounter.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -3,6 +3,8 @@
import java.io.Serializable;
import java.util.EventObject;
+import org.ajax4jsf.event.PushEventListener;
+
public class PushEventsCounter implements PushEventListener,Serializable {
/**
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/dnd/taglib/DropSourceMetaRule.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/dnd/taglib/DropSourceMetaRule.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/dnd/taglib/DropSourceMetaRule.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -33,8 +33,9 @@
import javax.faces.el.MethodBinding;
-import org.ajax4jsf.dnd.event.DropEvent;
-import org.ajax4jsf.dnd.event.DropSource;
+import org.ajax4jsf.event.DropEvent;
+import org.ajax4jsf.event.DropSource;
+
import com.sun.facelets.FaceletContext;
import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.Metadata;
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -28,7 +28,6 @@
import org.ajax4jsf.ajax.repeat.UIRepeat;
import org.ajax4jsf.component.AjaxSupport;
-import org.ajax4jsf.dnd.Dropzone;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.FilterIterator;
import org.apache.commons.collections.iterators.IteratorChain;
Modified: trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-07-03 20:13:44 UTC
(rev 1450)
+++ trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-07-03 21:46:38 UTC
(rev 1451)
@@ -46,7 +46,7 @@
<description>
MethodBinding representing an action listener method that will be notified after drag
operation
</description>
- <methodargs>org.ajax4jsf.dnd.event.DragEvent.class</methodargs>
+ <methodargs>org.ajax4jsf.event.DragEvent.class</methodargs>
</property>
<property>
<name>disableDefault</name>
@@ -69,13 +69,13 @@
<listener>
<name>dragListener</name>
<listenerclass>
- org.ajax4jsf.dnd.event.DragListener
+ org.ajax4jsf.event.DragListener
</listenerclass>
<componentclass>
- org.ajax4jsf.dnd.Draggable
+ org.richfaces.component.Draggable
</componentclass>
<eventclass>
- org.ajax4jsf.dnd.event.DragEvent
+ org.ajax4jsf.event.DragEvent
</eventclass>
<taghandler generate="true">
<classname>
Modified: trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-07-03 20:13:44 UTC
(rev 1450)
+++ trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-07-03 21:46:38 UTC
(rev 1451)
@@ -39,7 +39,7 @@
MethodBinding representing an action listener method that will be notified after drop
operation.
]]>
</description>
- <methodargs>org.ajax4jsf.dnd.event.DropEvent.class</methodargs>
+ <methodargs>org.ajax4jsf.event.DropEvent.class</methodargs>
</property>
<property>
<name>disableDefault</name>
@@ -68,13 +68,13 @@
<listener>
<name>dropListener</name>
<listenerclass>
- org.ajax4jsf.dnd.event.DropListener
+ org.ajax4jsf.event.DropListener
</listenerclass>
<componentclass>
- org.ajax4jsf.dnd.event.DropSource
+ org.ajax4jsf.event.DropSource
</componentclass>
<eventclass>
- org.ajax4jsf.dnd.event.DropEvent
+ org.ajax4jsf.event.DropEvent
</eventclass>
<methodname>addDropListener</methodname>
<taghandler generate="true">
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -28,9 +28,8 @@
import javax.faces.event.PhaseId;
import org.ajax4jsf.component.AjaxActionComponent;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.event.DragEvent;
-import org.ajax4jsf.dnd.event.DragListener;
+import org.ajax4jsf.event.DragEvent;
+import org.ajax4jsf.event.DragListener;
import org.ajax4jsf.framework.ajax.AjaxEvent;
/**
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -28,9 +28,8 @@
import javax.faces.event.PhaseId;
import org.ajax4jsf.component.AjaxActionComponent;
-import org.ajax4jsf.dnd.Dropzone;
-import org.ajax4jsf.dnd.event.DropEvent;
-import org.ajax4jsf.dnd.event.DropListener;
+import org.ajax4jsf.event.DropEvent;
+import org.ajax4jsf.event.DropListener;
import org.ajax4jsf.framework.ajax.AjaxEvent;
/**
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -30,9 +30,9 @@
import javax.faces.context.FacesContext;
import javax.faces.event.FacesEvent;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
import org.apache.commons.collections.MultiHashMap;
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDParametersEncoder.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDParametersEncoder.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDParametersEncoder.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -35,8 +35,8 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
import org.richfaces.component.UIDndParam;
import org.richfaces.component.nsutils.NSUtils;
import org.richfaces.component.util.MessageUtil;
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -28,9 +28,9 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
import org.richfaces.component.util.MessageUtil;
/**
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -30,11 +30,11 @@
import javax.faces.event.FacesEvent;
import org.ajax4jsf.dnd.DnDScript;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
-import org.ajax4jsf.dnd.event.DragEvent;
+import org.ajax4jsf.event.DragEvent;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.ajax4jsf.framework.resource.PrototypeScript;
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
import org.richfaces.renderkit.DnDEventsExchangeMailer.EventCallback;
/**
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -29,15 +29,15 @@
import javax.faces.event.FacesEvent;
import org.ajax4jsf.dnd.DnDScript;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
-import org.ajax4jsf.dnd.event.DropEvent;
+import org.ajax4jsf.event.DropEvent;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.ajax4jsf.framework.resource.PrototypeScript;
import org.ajax4jsf.framework.util.javascript.JSFunction;
import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
import org.ajax4jsf.framework.util.javascript.JSReference;
import org.ajax4jsf.framework.util.javascript.ScriptUtils;
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
import org.richfaces.json.JSONCollection;
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -82,7 +82,7 @@
static class dragListenerMapper extends Metadata {
- private static final Class[] SIGNATURE = new Class[] {
org.ajax4jsf.dnd.event.DragEvent.class };
+ private static final Class[] SIGNATURE = new Class[] {
org.ajax4jsf.event.DragEvent.class };
private final TagAttribute _action;
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropListenerTag.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropListenerTag.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropListenerTag.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -30,9 +30,9 @@
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
-import org.ajax4jsf.dnd.event.DropListener;
-import org.ajax4jsf.dnd.event.DropListenerBinding;
-import org.ajax4jsf.dnd.event.DropSource;
+import org.ajax4jsf.event.DropListener;
+import org.ajax4jsf.event.DropListenerBinding;
+import org.ajax4jsf.event.DropSource;
/**
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java
===================================================================
---
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -81,7 +81,7 @@
static class dropListenerMapper extends Metadata {
- private static final Class[] SIGNATURE = new Class[] {
org.ajax4jsf.dnd.event.DropEvent.class };
+ private static final Class[] SIGNATURE = new Class[] {
org.ajax4jsf.event.DropEvent.class };
private final TagAttribute _action;
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeDataModel.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeDataModel.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -27,6 +27,11 @@
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.Range;
+import org.richfaces.model.LastElementAware;
+import org.richfaces.model.TreeDataModel;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick - mailto:nbelaevski@exadel.com created 08.01.2007
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeRequestDataModel.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeRequestDataModel.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/CacheableTreeRequestDataModel.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -21,7 +21,9 @@
package org.richfaces.component;
+import org.richfaces.model.TreeDataModel;
+
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 06.04.2007
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2007-07-03 20:13:44
UTC (rev 1450)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2007-07-03 21:46:38
UTC (rev 1451)
@@ -36,12 +36,10 @@
import javax.faces.event.PhaseId;
import org.ajax4jsf.ajax.repeat.UIDataAdaptor;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
-import org.ajax4jsf.dnd.event.DragEvent;
-import org.ajax4jsf.dnd.event.DragListener;
-import org.ajax4jsf.dnd.event.DropEvent;
-import org.ajax4jsf.dnd.event.DropListener;
+import org.ajax4jsf.event.DragEvent;
+import org.ajax4jsf.event.DragListener;
+import org.ajax4jsf.event.DropEvent;
+import org.ajax4jsf.event.DropListener;
import org.ajax4jsf.framework.ajax.AjaxEvent;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.ajax4jsf.model.DataComponentState;
@@ -54,13 +52,18 @@
import org.richfaces.component.events.NodeSelectedEvent;
import org.richfaces.component.events.NodeSelectedListener;
import org.richfaces.component.events.TreeEvents;
-import org.richfaces.component.state.TreeRange;
import org.richfaces.component.state.TreeState;
import org.richfaces.component.state.events.CollapseAllCommandEvent;
import org.richfaces.component.state.events.CollapseNodeCommandEvent;
import org.richfaces.component.state.events.ExpandAllCommandEvent;
import org.richfaces.component.state.events.ExpandNodeCommandEvent;
import org.richfaces.component.state.events.TreeStateCommandEvent;
+import org.richfaces.event.TreeListenerEventsProducer;
+import org.richfaces.model.AbstractTreeDataModel;
+import org.richfaces.model.TreeDataModel;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeRange;
+import org.richfaces.model.TreeRowKey;
/**
* @author igels Component class providing tree ADT behaviuor
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -12,17 +12,16 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
-import org.ajax4jsf.dnd.event.DragEvent;
-import org.ajax4jsf.dnd.event.DragListener;
-import org.ajax4jsf.dnd.event.DropEvent;
-import org.ajax4jsf.dnd.event.DropListener;
+import org.ajax4jsf.event.DragEvent;
+import org.ajax4jsf.event.DragListener;
+import org.ajax4jsf.event.DropEvent;
+import org.ajax4jsf.event.DropListener;
import org.ajax4jsf.framework.ajax.AjaxEvent;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.richfaces.component.events.NodeExpandedListener;
import org.richfaces.component.events.NodeSelectedListener;
import org.richfaces.component.events.TreeEvents;
+import org.richfaces.event.TreeListenerEventsProducer;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com created 22.11.2006 Component
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -26,10 +26,10 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
-import org.ajax4jsf.dnd.event.DragEvent;
-import org.ajax4jsf.dnd.event.DropEvent;
+import org.ajax4jsf.event.DragEvent;
+import org.ajax4jsf.event.DropEvent;
import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.richfaces.component.TreeListenerEventsProducer;
+import org.richfaces.event.TreeListenerEventsProducer;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com created 29.11.2006
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -32,9 +32,10 @@
import org.ajax4jsf.model.DataComponentState;
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.Range;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
import org.richfaces.component.state.events.TreeStateCommandsListener;
+import org.richfaces.model.TreeRange;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com created 23.11.2006
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/CollapseNodeCommandEvent.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/CollapseNodeCommandEvent.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/CollapseNodeCommandEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -25,8 +25,8 @@
import javax.faces.component.UIComponent;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick - mailto:nbelaevski@exadel.com
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/ExpandNodeCommandEvent.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/ExpandNodeCommandEvent.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/ExpandNodeCommandEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -25,8 +25,8 @@
import javax.faces.component.UIComponent;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick - mailto:nbelaevski@exadel.com
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandNodeEvent.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandNodeEvent.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandNodeEvent.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -23,7 +23,7 @@
import javax.faces.component.UIComponent;
-import org.richfaces.component.TreeRowKey;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick - mailto:nbelaevski@exadel.com
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandsListener.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandsListener.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/state/events/TreeStateCommandsListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -25,8 +25,8 @@
import javax.faces.event.FacesListener;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick - mailto:nbelaevski@exadel.com
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/xml/XmlTreeDataBuilder.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/component/xml/XmlTreeDataBuilder.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/component/xml/XmlTreeDataBuilder.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -29,8 +29,8 @@
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.RulesBase;
-import org.richfaces.component.TreeNode;
-import org.richfaces.component.TreeNodeImpl;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -12,14 +12,13 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.dnd.Draggable;
-import org.ajax4jsf.dnd.Dropzone;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.ajax4jsf.framework.renderer.ComponentVariables;
import org.ajax4jsf.framework.renderer.ComponentsVariableResolver;
import org.ajax4jsf.framework.util.javascript.JSFunction;
import org.ajax4jsf.framework.util.javascript.ScriptUtils;
-import org.richfaces.component.TreeRowKey;
+import org.richfaces.component.Draggable;
+import org.richfaces.component.Dropzone;
import org.richfaces.component.UITree;
import org.richfaces.component.UITreeNode;
import org.richfaces.component.events.AjaxSelectedEvent;
@@ -29,6 +28,7 @@
import org.richfaces.component.state.events.CollapseNodeCommandEvent;
import org.richfaces.component.state.events.ExpandNodeCommandEvent;
import org.richfaces.component.util.ViewUtil;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick - mailto:nbelaevski@exadel.com created 23.11.2006
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java
===================================================================
---
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeDataModelEventNavigator.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -25,9 +25,9 @@
import javax.faces.context.FacesContext;
-import org.richfaces.component.LastElementAware;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.LastElementAware;
+import org.richfaces.model.TreeRowKey;
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -43,14 +43,14 @@
import org.ajax4jsf.framework.util.javascript.JSReference;
import org.ajax4jsf.framework.util.javascript.ScriptUtils;
import org.ajax4jsf.model.DataVisitor;
-import org.richfaces.component.LastElementAware;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
import org.richfaces.component.UITreeNode;
import org.richfaces.component.nsutils.NSUtils;
-import org.richfaces.component.state.TreeRange;
import org.richfaces.component.state.TreeState;
import org.richfaces.component.state.TreeStateAdvisor;
+import org.richfaces.model.LastElementAware;
+import org.richfaces.model.TreeRange;
+import org.richfaces.model.TreeRowKey;
public abstract class TreeRendererBase extends CompositeRenderer {
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/ListRowKeyTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/ListRowKeyTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/ListRowKeyTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -30,6 +30,8 @@
import junit.framework.TestCase;
import org.apache.commons.collections.iterators.ArrayIterator;
+import org.richfaces.model.ListRowKey;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -38,10 +38,10 @@
import javax.faces.event.PhaseId;
import javax.servlet.http.HttpServletResponse;
-import org.ajax4jsf.dnd.event.DragEvent;
-import org.ajax4jsf.dnd.event.DragListener;
-import org.ajax4jsf.dnd.event.DropEvent;
-import org.ajax4jsf.dnd.event.DropListener;
+import org.ajax4jsf.event.DragEvent;
+import org.ajax4jsf.event.DragListener;
+import org.ajax4jsf.event.DropEvent;
+import org.ajax4jsf.event.DropListener;
import org.ajax4jsf.framework.resource.InternetResource;
import org.ajax4jsf.framework.resource.InternetResourceBuilder;
import org.ajax4jsf.framework.resource.ResourceBuilderImpl;
@@ -410,7 +410,7 @@
}
/**
- * Test method for {@link
org.richfaces.component.UITreeNode#addDropListener(org.ajax4jsf.dnd.event.DropListener)}.
+ * Test method for {@link
org.richfaces.component.UITreeNode#addDropListener(org.ajax4jsf.event.DropListener)}.
*/
public final void testAddDropListener() {
DropListener listener = new DropListener() {
@@ -439,7 +439,7 @@
}
/**
- * Test method for {@link
org.richfaces.component.UITreeNode#addDragListener(org.ajax4jsf.dnd.event.DragListener)}.
+ * Test method for {@link
org.richfaces.component.UITreeNode#addDragListener(org.ajax4jsf.event.DragListener)}.
*/
public final void testAddDragListener() {
DragListener listener = new DragListener() {
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -34,6 +34,11 @@
import org.ajax4jsf.model.DataVisitor;
import org.richfaces.component.xml.XmlNodeData;
import org.richfaces.component.xml.XmlTreeDataBuilder;
+import org.richfaces.model.AbstractTreeDataModel;
+import org.richfaces.model.LastElementAware;
+import org.richfaces.model.ListRowKey;
+import org.richfaces.model.TreeDataModel;
+import org.richfaces.model.TreeNode;
import org.xml.sax.InputSource;
/**
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -23,6 +23,9 @@
import java.util.Iterator;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+
import junit.framework.TestCase;
/**
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java
===================================================================
---
trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -26,8 +26,8 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
-import org.ajax4jsf.dnd.event.DragEvent;
-import org.ajax4jsf.dnd.event.DropEvent;
+import org.ajax4jsf.event.DragEvent;
+import org.ajax4jsf.event.DropEvent;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.ajax4jsf.tests.MockMethodBinding;
import org.ajax4jsf.tests.MockViewRoot;
Modified:
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/CollapseNodeCommandEventTest.java
===================================================================
---
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/CollapseNodeCommandEventTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/CollapseNodeCommandEventTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -28,9 +28,9 @@
import javax.faces.event.FacesListener;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.component.ListRowKey;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.ListRowKey;
+import org.richfaces.model.TreeRowKey;
import junit.framework.TestCase;
Modified:
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/ExpandNodeCommandEventTest.java
===================================================================
---
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/ExpandNodeCommandEventTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/ExpandNodeCommandEventTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -28,9 +28,9 @@
import javax.faces.event.FacesListener;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.component.ListRowKey;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.ListRowKey;
+import org.richfaces.model.TreeRowKey;
import junit.framework.TestCase;
Modified:
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/MockTreeStateCommandsListener.java
===================================================================
---
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/MockTreeStateCommandsListener.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/test/java/org/richfaces/component/state/events/MockTreeStateCommandsListener.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -23,8 +23,8 @@
import java.io.IOException;
-import org.richfaces.component.TreeRowKey;
import org.richfaces.component.UITree;
+import org.richfaces.model.TreeRowKey;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
Modified:
trunk/ui/tree/src/test/java/org/richfaces/component/xml/TreeDataBuilderTest.java
===================================================================
---
trunk/ui/tree/src/test/java/org/richfaces/component/xml/TreeDataBuilderTest.java 2007-07-03
20:13:44 UTC (rev 1450)
+++
trunk/ui/tree/src/test/java/org/richfaces/component/xml/TreeDataBuilderTest.java 2007-07-03
21:46:38 UTC (rev 1451)
@@ -26,7 +26,7 @@
import junit.framework.TestCase;
-import org.richfaces.component.TreeNode;
+import org.richfaces.model.TreeNode;
import org.xml.sax.InputSource;
/**