Author: abelevich
Date: 2010-11-25 11:11:55 -0500 (Thu, 25 Nov 2010)
New Revision: 20172
Added:
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDragBehavior.java
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDropBehavior.java
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropBehaviorEvent.java
Modified:
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropEvent.java
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropListener.java
Log:
add dnd behaviors interfaces
Added:
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDragBehavior.java
===================================================================
---
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDragBehavior.java
(rev 0)
+++
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDragBehavior.java 2010-11-25
16:11:55 UTC (rev 20172)
@@ -0,0 +1,15 @@
+package org.richfaces.component.behavior;
+
+import javax.faces.component.behavior.ClientBehavior;
+
+
+public interface ClientDragBehavior extends ClientBehavior {
+
+ public String getType();
+
+ public String getIndicator();
+
+ public Object getDragValue();
+
+}
+
Added:
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDropBehavior.java
===================================================================
---
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDropBehavior.java
(rev 0)
+++
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/component/behavior/ClientDropBehavior.java 2010-11-25
16:11:55 UTC (rev 20172)
@@ -0,0 +1,14 @@
+package org.richfaces.component.behavior;
+
+import java.util.Set;
+
+import javax.faces.component.behavior.ClientBehavior;
+
+
+public interface ClientDropBehavior extends ClientBehavior{
+
+ public Set<String> getAcceptType();
+
+ public Object getDropValue();
+
+}
Added:
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropBehaviorEvent.java
===================================================================
---
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropBehaviorEvent.java
(rev 0)
+++
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropBehaviorEvent.java 2010-11-25
16:11:55 UTC (rev 20172)
@@ -0,0 +1,56 @@
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.Behavior;
+import javax.faces.event.BehaviorEvent;
+import javax.faces.event.FacesListener;
+
+public class DropBehaviorEvent extends BehaviorEvent {
+
+ private static final long serialVersionUID = 3717071628237886288L;
+
+ private Object dropValue;
+
+ private Object dragValue;
+
+ private UIComponent dragSource;
+
+ public Object getDropValue() {
+ return dropValue;
+ }
+
+ public void setDropValue(Object dropValue) {
+ this.dropValue = dropValue;
+ }
+
+ public Object getDragValue() {
+ return dragValue;
+ }
+
+ public void setDragValue(Object dragValue) {
+ this.dragValue = dragValue;
+ }
+
+ public UIComponent getDragSource() {
+ return dragSource;
+ }
+
+ public void setDragSource(UIComponent dragSource) {
+ this.dragSource = dragSource;
+ }
+
+ public DropBehaviorEvent(UIComponent component, Behavior behavior) {
+ super(component, behavior);
+ }
+
+ @Override
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof DropListener);
+ }
+
+ @Override
+ public void processListener(FacesListener listener) {
+ ((DropListener) listener).processDrop(this);
+ }
+
+}
Modified: sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
---
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropEvent.java 2010-11-25
15:28:35 UTC (rev 20171)
+++
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropEvent.java 2010-11-25
16:11:55 UTC (rev 20172)
@@ -65,7 +65,7 @@
* )
*/
public void processListener(FacesListener listener) {
- ((DropListener) listener).processDrop(this);
+ //((DropListener) listener).processDrop(this);
}
/**
Modified:
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropListener.java
===================================================================
---
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropListener.java 2010-11-25
15:28:35 UTC (rev 20171)
+++
sandbox/trunk/ui/drag-drop/api/src/main/java/org/richfaces/event/DropListener.java 2010-11-25
16:11:55 UTC (rev 20172)
@@ -21,21 +21,11 @@
package org.richfaces.event;
-import javax.faces.event.FacesListener;
+import javax.faces.event.BehaviorListener;
-/**
- * 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);
+public interface DropListener extends BehaviorListener {
+
+ public void processDrop(DropBehaviorEvent event);
}