Author: julien(a)jboss.com
Date: 2008-07-09 09:46:18 -0400 (Wed, 09 Jul 2008)
New Revision: 11367
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
Log:
make draggable callback to update the visual style of a dragged element
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-09
13:23:00 UTC (rev 11366)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/DnDPanel.java 2008-07-09
13:46:18 UTC (rev 11367)
@@ -100,6 +100,7 @@
"," + y + "), delta=(" + deltaX + ","
+ deltaY + ") with draggable " + draggable);
//
+ draggable.startDragging();
DOM.setStyleAttribute(containerElement, "position",
"fixed");
DOM.setIntStyleAttribute(containerElement, "left", left);
DOM.setIntStyleAttribute(containerElement, "top", top);
@@ -172,6 +173,7 @@
log.debug("Stopping drag with draggable " + drag.draggable);
// DOM.releaseCapture(drag.element);
Element containerElement = drag.draggable.getContainer();
+ drag.draggable.stopDragging();
DOM.setStyleAttribute(containerElement, "position", null);
drag = null;
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-09
13:23:00 UTC (rev 11366)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/dnd/Draggable.java 2008-07-09
13:46:18 UTC (rev 11367)
@@ -38,8 +38,16 @@
*/
Element getContainer();
- // void enter(Droppable droppable);
+ void startDragging();
- // void leave(Droppable droppable);
+ void stopDragging();
+ void enter(Droppable droppable);
+
+ void leave(Droppable droppable);
+
+ void accepted(Droppable droppable);
+
+ void rejected(Droppable droppable);
+
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-09
13:23:00 UTC (rev 11366)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-07-09
13:46:18 UTC (rev 11367)
@@ -37,6 +37,7 @@
import org.jboss.portal.presentation.ajax.client.PresentationClientRemoteAsync;
import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
import org.jboss.portal.presentation.ajax.client.dnd.Draggable;
+import org.jboss.portal.presentation.ajax.client.dnd.Droppable;
import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
import org.jboss.portal.presentation.ajax.client.protocol.DestroyObjectAction;
import org.jboss.portal.presentation.ajax.client.util.Tools;
@@ -81,6 +82,32 @@
{
return widget.getElement();
}
+
+ public void startDragging()
+ {
+ widget.addStyleName("dragged");
+ }
+
+ public void stopDragging()
+ {
+ widget.removeStyleName("dragged");
+ }
+
+ public void enter(Droppable droppable)
+ {
+ }
+
+ public void leave(Droppable droppable)
+ {
+ }
+
+ public void accepted(Droppable droppable)
+ {
+ }
+
+ public void rejected(Droppable droppable)
+ {
+ }
};
}
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-07-09
13:23:00 UTC (rev 11366)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/style.css 2008-07-09
13:46:18 UTC (rev 11367)
@@ -31,6 +31,10 @@
padding: 1px;
}
+.pf-Window.dragged {
+background-color: blue;
+}
+
.pf-Title {
cursor:default;
border: 1px solid black;