Author: lfryc(a)redhat.com
Date: 2011-01-26 11:19:34 -0500 (Wed, 26 Jan 2011)
New Revision: 21240
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
Log:
drag-n-drop: pre-automation activities (RFPL-992)
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-26
16:19:34 UTC (rev 21240)
@@ -67,9 +67,9 @@
attributes = Attributes.getComponentAttributesFromFacesConfig(UIDropTarget.class,
getClass());
attributes.setAttribute("acceptedTypes", "drg1, drg2");
- attributes.setAttribute("render", "droppedValues");
+ attributes.setAttribute("render", "droppable");
+ attributes.setAttribute("rendered", true);
- attributes.remove("event");
attributes.remove("actionExpression");
attributes.remove("action");
attributes.remove("actionListener");
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2011-01-26
16:19:34 UTC (rev 21240)
@@ -35,6 +35,10 @@
public DragValue(int number) {
this.number = number;
}
+
+ public int getNumber() {
+ return number;
+ }
@Override
public String toString() {
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2011-01-26
16:19:34 UTC (rev 21240)
@@ -35,6 +35,10 @@
public DropValue(int number) {
this.number = number;
}
+
+ public int getNumber() {
+ return number;
+ }
@Override
public String toString() {
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-26
16:19:34 UTC (rev 21240)
@@ -60,39 +60,58 @@
<tr>
<td>
<a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
- <rich:dragSource event="mouseover"
+ <h:outputText value="#1:
type=#{richDragSourceBean.attributes['type'].value}" />
+ <rich:dragSource
dragValue="#{richDragSourceBean.dragValues[0]}"
type="drg1" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
- <rich:dragSource event="mouseover" type="drg2"
dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[1]}" />
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
- <rich:dragSource event="mouseover" type="drg3"
dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
<a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
- <rich:dropTarget event="mouseover"
+ <rich:dropTarget
+ id="richDropTarget"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
acceptedTypes="drg1, drg2"
- render="droppedValues"
+ render="droppable"
/>
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+
+ <h:outputText id="dropNumber" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
<h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropTargetBean.droppedEntries}">
<h:column>
- <h:outputText value="#{droppedValue}" />
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
</h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
</h:dataTable>
</a4j:outputPanel>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-26
16:19:34 UTC (rev 21240)
@@ -54,45 +54,61 @@
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
- <rich:dragSource event="mouseover"
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable" style="border: 3px solid red">
+ <h:outputText value="#1:
type=#{richDragSourceBean.attributes['type'].value}" />
+ <rich:dragSource
dragValue="#{richDragSourceBean.dragValues[0]}"
-
dragIndicator="#{richDragSourceBean.attributes['dragIndicator'].value}"
type="#{richDragSourceBean.attributes['type'].value}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
- <rich:dragSource event="mouseover" type="drg2"
dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[1]}" />
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
- <rich:dragSource event="mouseover" type="drg3"
dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
<a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
- <rich:dropTarget event="mouseover"
- dropValue="#{richDropTargetBean.dropValue}"
- dropListener="#{richDropListenerBean.processDragging}"
- acceptedTypes="drg1, drg2"
- render="droppedValues"
- />
+
+ <rich:dropTarget
+ id="richDropTarget"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppable"
+ />
+
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+ <h:outputText id="dropNumber" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
<h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropTargetBean.droppedEntries}">
<h:column>
- <h:outputText value="#{droppedValue.key}" />
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
</h:column>
<h:column>
- <h:outputText value="#{droppedValue.value}" />
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
</h:column>
+
</h:dataTable>
</a4j:outputPanel>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-26
16:19:34 UTC (rev 21240)
@@ -55,29 +55,31 @@
<tr>
<td>
<a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
- <rich:dragSource event="mouseover"
+ <h:outputText value="#1:
type=#{richDragSourceBean.attributes['type'].value}" />
+ <rich:dragSource
+ dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[0]}"
type="drg1" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
- <rich:dragSource event="mouseover" type="drg2"
dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[1]}" />
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block"
styleClass="draggable">
- <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
- <rich:dragSource event="mouseover" type="drg3"
dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
- <rich:dropTarget event="mouseover"
+ <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable" style="border: 3px solid red">
+ <rich:dropTarget
+ id="richDropTarget"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
action="#{richBean.dummyAction}"
@@ -90,11 +92,27 @@
rendered="#{richDragSourceBean.attributes['rendered'].value}"
value="#{richDragSourceBean.attributes['value'].value}"
/>
+
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+ <h:outputText id="dropNumber" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <br />
+
<h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropTargetBean.droppedEntries}">
<h:column>
- <h:outputText value="#{droppedValue}" />
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
</h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
</h:dataTable>
</a4j:outputPanel>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-26
16:18:40 UTC (rev 21239)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-26
16:19:34 UTC (rev 21240)
@@ -1,22 +1,23 @@
.droppable {
border: 1px solid blue;
- margin: 4px;
- height: 300px;
- width: 350px;
+ margin: 1em;
+ padding: 1em;
+ height: 15em;
+ width: 15em;
background-color: yellow;
overflow: auto;
}
.draggable {
border: 1px solid #000000;
- background-color: grey;
- opacity: 0.3;
+ background-color: silver;
margin: 2px;
- height: 50px;
- width: 100px;
+ width: 8em;
+ padding: 1em;
}
.rf-ind {
+ opacity: 0.5;
height: 20px;
width: 20px;
border: 1px dotted red;
@@ -24,15 +25,9 @@
}
.rf-ind-acpt {
- height: 20px;
- width: 20px;
- border: 1px dotted red;
background-color: green;
}
.rf-ind-rejt {
- height: 20px;
- width: 20px;
- border: 1px dotted green;
background-color: red;
}
\ No newline at end of file
Show replies by date