Author: lfryc(a)redhat.com
Date: 2010-12-17 03:51:42 -0500 (Fri, 17 Dec 2010)
New Revision: 20634
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java
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/model/drag/
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/richDragBehavior/
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
drag-and-drop - added basic sample (RF-9769)
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-17
07:18:43 UTC (rev 20633)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -128,6 +128,9 @@
components.put("richDataGrid", "Rich Data Grid");
components.put("richDataScroller", "Rich Data Scroller");
components.put("richDataTable", "Rich Data Table");
+ components.put("richDragBehavior", "Rich Drag Behavior");
+ components.put("richDragIndicator", "Rich Drag Indicator");
+ components.put("richDropBehavior", "Rich Drop Behavior");
components.put("richDropDownMenu", "Rich Drop Down Menu");
components.put("richExtendedDataTable", "Rich Extended Data
Table");
components.put("richFileUpload", "Rich File Upload");
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tests.metamer.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.behavior.DragBehavior;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDragBehaviorBean")
+@ViewScoped
+public class RichDragBehaviorBean implements Serializable {
+
+ private static final int DRAG_VALUES = 3;
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private List<DragValue> dragValues = new ArrayList<DragValue>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getBehaviorAttributes(DragBehavior.class, getClass());
+
+ attributes.setAttribute("event", "mouseover");
+ attributes.setAttribute("type", "drg1");
+
+ for (int i = 0; i < DRAG_VALUES; i++) {
+ dragValues.add(new DragValue(i + 1));
+ }
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<DragValue> getDragValues() {
+ return dragValues;
+ }
+
+ public void setDragValues(List<DragValue> dragValues) {
+ this.dragValues = dragValues;
+ }
+}
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDragIndicator;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDragIndicatorBean")
+@ViewScoped
+public class RichDragIndicatorBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UIDragIndicator.class,
getClass(), true);
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tests.metamer.bean;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.behavior.DropBehavior;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.richfaces.tests.metamer.model.drag.DropValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDropBehaviorBean")
+@ViewScoped
+public class RichDropBehaviorBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private Map<DropValue, DragValue> droppedValues = new
LinkedHashMap<DropValue, DragValue>();
+ private DropValue dropValue;
+ private int dropValueCounter = 1;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getBehaviorAttributes(DropBehavior.class, getClass());
+
+ attributes.setAttribute("event", "mouseover");
+ attributes.setAttribute("acceptedTypes", "drg1, drg2");
+ attributes.setAttribute("render", "droppedValues");
+
+ increaseDropValue();
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Map<DropValue, DragValue> getDroppedValues() {
+ return droppedValues;
+ }
+
+ public void increaseDropValue() {
+ dropValue = new DropValue(dropValueCounter++);
+ }
+
+ public DropValue getDropValue() {
+ return dropValue;
+ }
+
+ public List<Entry<DropValue, DragValue>> getDroppedEntries() {
+ List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues.entrySet());
+ Collections.reverse(list);
+ return list;
+ }
+}
Added:
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
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tests.metamer.bean;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.RequestScoped;
+
+import org.richfaces.event.DropEvent;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.richfaces.tests.metamer.model.drag.DropValue;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@RequestScoped
+@ManagedBean(name = "richDropListenerBean")
+public class RichDropListenerBean {
+
+ private DropEvent dropEvent;
+
+ @ManagedProperty("#{richDropBehaviorBean}")
+ private RichDropBehaviorBean richDropBehaviorBean;
+
+ public void processDragging(DropEvent dropEvent) {
+ DragValue dragValue = (DragValue) dropEvent.getDragValue();
+ DropValue dropValue = (DropValue) dropEvent.getDropValue();
+
+ this.dropEvent = dropEvent;
+ richDropBehaviorBean.increaseDropValue();
+ richDropBehaviorBean.getDroppedValues().put(dropValue, dragValue);
+ }
+
+ public DropEvent getDropEvent() {
+ return dropEvent;
+ }
+
+ public RichDropBehaviorBean getRichDropBehaviorBean() {
+ return richDropBehaviorBean;
+ }
+
+ public void setRichDropBehaviorBean(RichDropBehaviorBean richDropBehaviorBean) {
+ this.richDropBehaviorBean = richDropBehaviorBean;
+ }
+}
Added:
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
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tests.metamer.model.drag;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class DragValue {
+ int number;
+
+ public DragValue(int number) {
+ this.number = number;
+ }
+
+ @Override
+ public String toString() {
+ return "DragValue [number=" + number + "]";
+ }
+}
\ No newline at end of file
Added:
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
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.tests.metamer.model.drag;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class DropValue {
+ int number;
+
+ public DropValue(int number) {
+ this.number = number;
+ }
+
+ @Override
+ public String toString() {
+ return "DropValue [number=" + number + "]";
+ }
+}
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Drag Behavior</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView"
+ listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ <h:outputStylesheet library="css" name="richDragBehavior.css"
/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dragIndicator id="indicator" />
+
+ <table>
+ <tr>
+ <td>
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[0]}" />
+ <rich:dragBehavior event="mouseover"
+ dragValue="#{richDragBehaviorBean.dragValues[0]}"
+
+ dragIndicator="#{richDragBehaviorBean.attributes['dragIndicator'].value}"
+ type="#{richDragBehaviorBean.attributes['type'].value}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[1]}" />
+ <rich:dragBehavior event="mouseover" type="drg2"
dragIndicator="indicator"
dragValue="#{richDragBehaviorBean.dragValues[1]}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable3" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[2]}" />
+ <rich:dragBehavior event="mouseover" type="drg3"
dragIndicator="indicator"
dragValue="#{richDragBehaviorBean.dragValues[2]}" />
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
+ <rich:dropBehavior event="mouseover"
+ dropValue="#{richDropBehaviorBean.dropValue}"
+ listener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppedValues"
+ />
+
+ <h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropBehaviorBean.droppedEntries}">
+ <h:column>
+ <h:outputText value="#{droppedValue.key}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{droppedValue.value}" />
+ </h:column>
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Drop Event:" rendered="#{not empty
richDropListenerBean.dropEvent}" />
+ <h:panelGroup rendered="#{not empty
richDropListenerBean.dropEvent}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="clientId:" />
+ <h:outputText
value="#{richDropListenerBean.dropEvent.component.clientId}" />
+
+ <h:outputLabel value="Drag Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}"
/>
+
+ <h:outputLabel value="Drop Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}"
/>
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <metamer:attributes value="#{richDragBehaviorBean.attributes}"
id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Drag Behavior</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView"
+ listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ <h:outputStylesheet library="css" name="richDragBehavior.css"
/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dragIndicator id="indicator"
+ acceptClass="#{richDragIndicatorBean.attributes['acceptClass'].value}"
+ draggingClass="#{richDragIndicatorBean.attributes['draggingClass'].value}"
+ rejectClass="#{richDragIndicatorBean.attributes['rejectClass'].value}"
+ rendered="#{richDragIndicatorBean.attributes['rendered'].value}"
+ />
+
+ <table>
+ <tr>
+ <td>
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[0]}" />
+ <rich:dragBehavior event="mouseover"
+ dragValue="#{richDragBehaviorBean.dragValues[0]}"
+ type="drg1" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[1]}" />
+ <rich:dragBehavior event="mouseover" type="drg2"
dragIndicator="indicator"
dragValue="#{richDragBehaviorBean.dragValues[1]}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable3" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[2]}" />
+ <rich:dragBehavior event="mouseover" type="drg3"
dragIndicator="indicator"
dragValue="#{richDragBehaviorBean.dragValues[2]}" />
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
+ <rich:dropBehavior event="mouseover"
+ dropValue="#{richDropBehaviorBean.dropValue}"
+ listener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppedValues"
+ />
+
+ <h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropBehaviorBean.droppedEntries}">
+ <h:column>
+ <h:outputText value="#{droppedValue}" />
+ </h:column>
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Drop Event:" rendered="#{not empty
richDropListenerBean.dropEvent}" />
+ <h:panelGroup rendered="#{not empty
richDropListenerBean.dropEvent}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="clientId:" />
+ <h:outputText
value="#{richDropListenerBean.dropEvent.component.clientId}" />
+
+ <h:outputLabel value="Drag Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}"
/>
+
+ <h:outputLabel value="Drop Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}"
/>
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <metamer:attributes value="#{richDragIndicatorBean.attributes}"
id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Drag Behavior</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, 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.
+ -->
+
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView"
+ listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ <h:outputStylesheet library="css" name="richDragBehavior.css"
/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dragIndicator id="indicator" />
+
+ <table>
+ <tr>
+ <td>
+ <a4j:outputPanel id="draggable1" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[0]}" />
+ <rich:dragBehavior event="mouseover"
+ dragValue="#{richDragBehaviorBean.dragValues[0]}"
+ type="drg1" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable2" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[1]}" />
+ <rich:dragBehavior event="mouseover" type="drg2"
dragIndicator="indicator"
dragValue="#{richDragBehaviorBean.dragValues[1]}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable3" layout="block"
styleClass="draggable">
+ <h:outputText value="#{richDragBehaviorBean.dragValues[2]}" />
+ <rich:dragBehavior event="mouseover" type="drg3"
dragIndicator="indicator"
dragValue="#{richDragBehaviorBean.dragValues[2]}" />
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="droppable" layout="block"
styleClass="droppable">
+ <rich:dropBehavior event="mouseover"
+ dropValue="#{richDropBehaviorBean.dropValue}"
+ listener="#{richDropListenerBean.processDragging}"
+
+ acceptedTypes="#{richDragBehaviorBean.attributes['acceptedTypes'].value}"
+ bypassUpdates="#{richDragBehaviorBean.attributes['bypassUpdates'].value}"
+ data="#{richDragBehaviorBean.attributes['data'].value}"
+ disabled="#{richDragBehaviorBean.attributes['disabled'].value}"
+ execute="#{richDragBehaviorBean.attributes['execute'].value}"
+ immediate="#{richDragBehaviorBean.attributes['immediate'].value}"
+ limitRender="#{richDragBehaviorBean.attributes['limitRender'].value}"
+ onbeforedomupdate="#{richDragBehaviorBean.attributes['onbeforedomupdate'].value}"
+ onbegin="#{richDragBehaviorBean.attributes['onbegin'].value}"
+ oncomplete="#{richDragBehaviorBean.attributes['oncomplete'].value}"
+ onerror="#{richDragBehaviorBean.attributes['onerror'].value}"
+ queueId="#{richDragBehaviorBean.attributes['queueId'].value}"
+ render="#{richDragBehaviorBean.attributes['render'].value}"
+ status="#{richDragBehaviorBean.attributes['status'].value}"
+ />
+
+ <h:dataTable id="droppedValues" var="droppedValue"
value="#{richDropBehaviorBean.droppedEntries}">
+ <h:column>
+ <h:outputText value="#{droppedValue}" />
+ </h:column>
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Drop Event:" rendered="#{not empty
richDropListenerBean.dropEvent}" />
+ <h:panelGroup rendered="#{not empty
richDropListenerBean.dropEvent}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Value:" />
+ <h:outputText
value="#{richDropListenerBean.dropEvent.dragBehavior.dragValue}" />
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <metamer:attributes value="#{richDropBehaviorBean.attributes}"
id="dropBehaviorAttributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Added:
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2010-12-17
08:51:42 UTC (rev 20634)
@@ -0,0 +1,38 @@
+.droppable {
+ border: 1px solid blue;
+ margin: 4px;
+ height: 300px;
+ width: 350px;
+ background-color: yellow;
+ overflow: auto;
+}
+
+.draggable {
+ border: 1px solid #000000;
+ background-color: grey;
+ opacity: 0.3;
+ margin: 2px;
+ height: 50px;
+ width: 100px;
+}
+
+.rf-ind {
+ height: 20px;
+ width: 20px;
+ border: 1px dotted red;
+ background-color: blue
+}
+
+.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