Author: abelevich
Date: 2010-12-17 14:58:01 -0500 (Fri, 17 Dec 2010)
New Revision: 20670
Removed:
trunk/ui/dnd/api/src/main/java/org/richfaces/component/
trunk/ui/dnd/api/src/main/java/org/richfaces/event/MethodExpressionDropListener.java
Modified:
trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java
trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropListener.java
Log:
redesign dnd behavior to dnd component
Modified: trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
--- trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java 2010-12-17 19:57:18
UTC (rev 20669)
+++ trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropEvent.java 2010-12-17 19:58:01
UTC (rev 20670)
@@ -23,53 +23,43 @@
package org.richfaces.event;
import javax.faces.component.UIComponent;
-import javax.faces.event.BehaviorEvent;
+import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
-import org.richfaces.component.behavior.ClientDragBehavior;
-import org.richfaces.component.behavior.ClientDropBehavior;
-
/**
* @author abelevich
*
*/
-public class DropEvent extends BehaviorEvent {
+public class DropEvent extends FacesEvent {
+
+ private static final long serialVersionUID = -8093828320587434589L;
- private static final long serialVersionUID = 3717071628237886288L;
+ private UIComponent dragSource;
- private ClientDragBehavior dragBehavior;
+ private UIComponent dropTarget;
- private UIComponent dragComponent;
-
- private ClientDropBehavior dropBehavior;
-
- private UIComponent dropComponent;
-
private Object dropValue;
private Object dragValue;
-
- public DropEvent(UIComponent component, ClientDropBehavior behavior) {
- super(component, behavior);
- this.dropComponent = component;
- this.dropBehavior = behavior;
+
+ public DropEvent(UIComponent dragSource, UIComponent dropTarget) {
+ super(dropTarget);
}
-
-
- public void setDropBehavior(ClientDropBehavior dropBehavior) {
- this.dropBehavior = dropBehavior;
+
+ public UIComponent getDragSource() {
+ return dragSource;
}
-
- public ClientDropBehavior getDropBehavior() {
- return this.dropBehavior;
+
+ public void setDragSource(UIComponent dragSource) {
+ this.dragSource = dragSource;
}
-
- public void setDropComponent(UIComponent dropComponent) {
- this.dropComponent = dropComponent;
+
+ public UIComponent getDropTarget() {
+ return dropTarget;
}
-
- public UIComponent getDropComponent() {
- return this.dropComponent;
+
+ public void setDropTarget(UIComponent dropTarget) {
+ this.dropTarget = dropTarget;
}
public Object getDropValue() {
@@ -88,22 +78,6 @@
this.dragValue = dragValue;
}
- public ClientDragBehavior getDragBehavior() {
- return dragBehavior;
- }
-
- public void setDragBehavior(ClientDragBehavior dragBehavior) {
- this.dragBehavior = dragBehavior;
- }
-
- public UIComponent getDragComponent() {
- return dragComponent;
- }
-
- public void setDragComponent(UIComponent dragComponent) {
- this.dragComponent = dragComponent;
- }
-
@Override
public boolean isAppropriateListener(FacesListener listener) {
return (listener instanceof DropListener);
Modified: trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropListener.java
===================================================================
--- trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropListener.java 2010-12-17
19:57:18 UTC (rev 20669)
+++ trunk/ui/dnd/api/src/main/java/org/richfaces/event/DropListener.java 2010-12-17
19:58:01 UTC (rev 20670)
@@ -22,14 +22,14 @@
package org.richfaces.event;
-import javax.faces.event.BehaviorListener;
+import javax.faces.event.FacesListener;
/**
* @author abelevich
*
*/
-public interface DropListener extends BehaviorListener {
+public interface DropListener extends FacesListener {
public void processDrop(DropEvent event);
Deleted:
trunk/ui/dnd/api/src/main/java/org/richfaces/event/MethodExpressionDropListener.java
===================================================================
---
trunk/ui/dnd/api/src/main/java/org/richfaces/event/MethodExpressionDropListener.java 2010-12-17
19:57:18 UTC (rev 20669)
+++
trunk/ui/dnd/api/src/main/java/org/richfaces/event/MethodExpressionDropListener.java 2010-12-17
19:58:01 UTC (rev 20670)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.event;
-
-import javax.el.MethodExpression;
-import javax.faces.context.FacesContext;
-
-
-/**
- * @author abelevich
- *
- */
-public class MethodExpressionDropListener implements DropListener {
- private MethodExpression methodExpression;
-
- public MethodExpressionDropListener() {
- super();
- }
-
- public MethodExpressionDropListener(MethodExpression methodExpression) {
- super();
- this.methodExpression = methodExpression;
- }
-
- public void processDrop(DropEvent event) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- methodExpression.invoke(facesContext.getELContext(), new Object[] { event });
- }
-}