Author: lfryc(a)redhat.com
Date: 2011-01-27 10:20:58 -0500 (Thu, 27 Jan 2011)
New Revision: 21281
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.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/RichDropListenerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2011-01-27
15:04:13 UTC (rev 21280)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2011-01-27
15:20:58 UTC (rev 21281)
@@ -47,8 +47,13 @@
DropValue dropValue = (DropValue) dropEvent.getDropValue();
this.dropEvent = dropEvent;
+
richDropTargetBean.increaseDropValue();
- richDropTargetBean.getDroppedValues().put(dropValue, dragValue);
+ if (dropEvent.getComponent().getClientId().endsWith("1")) {
+ richDropTargetBean.getDroppedValues1().put(dropValue, dragValue);
+ } else {
+ richDropTargetBean.getDroppedValues2().put(dropValue, dragValue);
+ }
}
public DropEvent getDropEvent() {
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-27
15:04:13 UTC (rev 21280)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-27
15:20:58 UTC (rev 21281)
@@ -52,7 +52,8 @@
private static Logger logger;
private Attributes attributes;
- private Map<DropValue, DragValue> droppedValues = new
LinkedHashMap<DropValue, DragValue>();
+ private Map<DropValue, DragValue> droppedValues1 = new
LinkedHashMap<DropValue, DragValue>();
+ private Map<DropValue, DragValue> droppedValues2 = new
LinkedHashMap<DropValue, DragValue>();
private DropValue dropValue;
private int dropValueCounter = 1;
@@ -67,7 +68,7 @@
attributes = Attributes.getComponentAttributesFromFacesConfig(UIDropTarget.class,
getClass());
attributes.setAttribute("acceptedTypes", "drg1, drg2");
- attributes.setAttribute("render", "droppable");
+ attributes.setAttribute("render", "droppable1 droppable2");
attributes.setAttribute("rendered", true);
attributes.remove("actionExpression");
@@ -87,10 +88,14 @@
this.attributes = attributes;
}
- public Map<DropValue, DragValue> getDroppedValues() {
- return droppedValues;
+ public Map<DropValue, DragValue> getDroppedValues1() {
+ return droppedValues1;
}
+ public Map<DropValue, DragValue> getDroppedValues2() {
+ return droppedValues2;
+ }
+
public void increaseDropValue() {
dropValue = new DropValue(dropValueCounter++);
}
@@ -99,9 +104,15 @@
return dropValue;
}
- public List<Entry<DropValue, DragValue>> getDroppedEntries() {
- List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues.entrySet());
+ public List<Entry<DropValue, DragValue>> getDroppedEntries1() {
+ List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues1.entrySet());
Collections.reverse(list);
return list;
}
+
+ public List<Entry<DropValue, DragValue>> getDroppedEntries2() {
+ List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues2.entrySet());
+ Collections.reverse(list);
+ return list;
+ }
}
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-27
15:04:13 UTC (rev 21280)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-27
15:20:58 UTC (rev 21281)
@@ -59,7 +59,7 @@
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="metamer-draggable">
<h:outputText value="#1:
type=#{richDragSourceBean.attributes['type'].value}" />
<rich:dragSource
dragIndicator="indicator"
@@ -68,13 +68,13 @@
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
+ <a4j:outputPanel id="draggable2" layout="block"
styleClass="metamer-draggable">
<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">
+ <a4j:outputPanel id="draggable3" layout="block"
styleClass="metamer-draggable">
<h:outputText value="#3: type=drg3" />
<rich:dragSource type="drg3" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
@@ -82,24 +82,24 @@
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
+ <a4j:outputPanel id="droppable1" layout="block"
styleClass="metamer-droppable" style="float: left">
<rich:dropTarget
- id="richDropTarget"
+ id="richDropTarget1"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
acceptedTypes="drg1, drg2"
- render="droppable"
+ render="droppable1 droppable2"
/>
<h:outputText value="Accepts: drg1, drg2" />
<br />
- <h:outputText id="dropNumber" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <h:outputText id="dropNumber1" value="Drops:
#{richDropTargetBean.dropValue.number}" />
<br />
- <h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropTargetBean.droppedEntries}">
+ <h:dataTable id="droppedValues1" var="droppedValue"
value="#{richDropTargetBean.droppedEntries1}">
<h:column>
<f:facet name="header">
Dragged
@@ -115,6 +115,40 @@
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block"
styleClass="metamer-droppable">
+ <rich:dropTarget
+ id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3"
+ render="droppable1 droppable2"
+ />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue"
value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <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>
</ui:define>
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-27
15:04:13 UTC (rev 21280)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-27
15:20:58 UTC (rev 21281)
@@ -50,11 +50,15 @@
<ui:define name="component">
<rich:dragIndicator id="indicator" />
-
+
+ <rich:dragIndicator id="indicator2" acceptClass="acceptClass"
rejectClass="rejectClass" draggingClass="draggingClass" />
+ <p>Use @indicator=indicator2 to switch to usage of second defined indicator with
custom styling</p>
+
+
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable" style="border: 3px solid red">
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="metamer-draggable" style="border: 3px solid red">
<h:outputText value="#1:
type=#{richDragSourceBean.attributes['type'].value}" />
<rich:dragSource
dragValue="#{richDragSourceBean.dragValues[0]}"
@@ -64,13 +68,13 @@
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
+ <a4j:outputPanel id="draggable2" layout="block"
styleClass="metamer-draggable">
<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">
+ <a4j:outputPanel id="draggable3" layout="block"
styleClass="metamer-draggable">
<h:outputText value="#3: type=drg3" />
<rich:dragSource type="drg3" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
@@ -78,25 +82,24 @@
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
-
+ <a4j:outputPanel id="droppable1" layout="block"
styleClass="metamer-droppable" style="float: left">
<rich:dropTarget
- id="richDropTarget"
- dropValue="#{richDropTargetBean.dropValue}"
- dropListener="#{richDropListenerBean.processDragging}"
- acceptedTypes="drg1, drg2"
- render="droppable"
- />
-
+ id="richDropTarget1"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppable1 droppable2"
+ />
+
<h:outputText value="Accepts: drg1, drg2" />
<br />
- <h:outputText id="dropNumber" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <h:outputText id="dropNumber1" value="Drops:
#{richDropTargetBean.dropValue.number}" />
<br />
- <h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropTargetBean.droppedEntries}">
+ <h:dataTable id="droppedValues1" var="droppedValue"
value="#{richDropTargetBean.droppedEntries1}">
<h:column>
<f:facet name="header">
Dragged
@@ -112,6 +115,40 @@
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block"
styleClass="metamer-droppable">
+ <rich:dropTarget
+ id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3"
+ render="droppable1 droppable2"
+ />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue"
value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <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>
</ui:define>
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-27
15:04:13 UTC (rev 21280)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-27
15:20:58 UTC (rev 21281)
@@ -54,7 +54,7 @@
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="metamer-draggable">
<h:outputText value="#1:
type=#{richDragSourceBean.attributes['type'].value}" />
<rich:dragSource
dragIndicator="indicator"
@@ -63,13 +63,13 @@
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
+ <a4j:outputPanel id="draggable2" layout="block"
styleClass="metamer-draggable">
<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">
+ <a4j:outputPanel id="draggable3" layout="block"
styleClass="metamer-draggable">
<h:outputText value="#3: type=drg3" />
<rich:dragSource type="drg3" dragIndicator="indicator"
dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
@@ -77,7 +77,7 @@
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable" style="border: 3px solid red">
+ <a4j:outputPanel id="droppable1" layout="block"
styleClass="metamer-droppable" style="border: 3px solid red; float:
left">
<rich:dropTarget
id="richDropTarget"
dropValue="#{richDropTargetBean.dropValue}"
@@ -85,21 +85,21 @@
action="#{richBean.dummyAction}"
actionListener="#{richBean.dummyActionListener}"
- acceptedTypes="#{richDragSourceBean.attributes['acceptedTypes'].value}"
- bypassUpdates="#{richDragSourceBean.attributes['bypassUpdates'].value}"
- immediate="#{richDragSourceBean.attributes['immediate'].value}"
- render="#{richDragSourceBean.attributes['render'].value}"
- rendered="#{richDragSourceBean.attributes['rendered'].value}"
- value="#{richDragSourceBean.attributes['value'].value}"
+ acceptedTypes="#{richDropTargetBean.attributes['acceptedTypes'].value}"
+ bypassUpdates="#{richDropTargetBean.attributes['bypassUpdates'].value}"
+ immediate="#{richDropTargetBean.attributes['immediate'].value}"
+ render="#{richDropTargetBean.attributes['render'].value}"
+ rendered="#{richDropTargetBean.attributes['rendered'].value}"
+ value="#{richDropTargetBean.attributes['value'].value}"
/>
- <h:outputText value="Accepts: drg1, drg2" />
+ <h:outputText value="Accepts:
#{richDragSourceBean.attributes['acceptedTypes'].value}" />
<br />
- <h:outputText id="dropNumber" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <h:outputText id="dropNumber1" value="Drops:
#{richDropTargetBean.dropValue.number}" />
<br />
- <h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropTargetBean.droppedEntries}">
+ <h:dataTable id="droppedValues1" var="droppedValue"
value="#{richDropTargetBean.droppedEntries1}">
<h:column>
<f:facet name="header">
Dragged
@@ -115,6 +115,40 @@
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block"
styleClass="metamer-droppable">
+ <rich:dropTarget
+ id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3"
+ render="droppable1 droppable2"
+ />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2" value="Drops:
#{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue"
value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <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>
</ui:define>
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-27
15:04:13 UTC (rev 21280)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-27
15:20:58 UTC (rev 21281)
@@ -1,4 +1,4 @@
-.droppable {
+.metamer-droppable {
border: 1px solid blue;
margin: 1em;
padding: 1em;
@@ -8,7 +8,7 @@
overflow: auto;
}
-.draggable {
+.metamer-draggable {
border: 1px solid #000000;
background-color: silver;
margin: 2px;