From a95f9e4ccc8d9439a1b86eebf8fb81490a89e481 Mon Sep 17 00:00:00 2001
From: "David H. DeWolf"
Date: Thu, 11 Jan 2007 19:20:51 +0000
Subject: [PATCH] First draft of an inputtransfer select component; Allows text
--> select; Similar to OptionTransferSelect
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@495339 13f79535-47bb-0310-9956-ffa450edef68
---
.../struts2/showcase/MoreSelectsAction.java | 115 +++++
.../src/main/resources/struts-tags-ui.xml | 11 +-
.../src/main/webapp/tags/ui/index.jsp | 1 +
.../tags/ui/lotsOfOptiontransferselect.jsp | 42 +-
.../ui/lotsOfOptiontransferselectSubmit.jsp | 33 --
.../src/main/webapp/tags/ui/moreSelects.jsp | 61 +++
.../main/webapp/tags/ui/moreSelectsSubmit.jsp | 53 +++
.../components/InputTransferSelect.java | 319 +++++++++++++
.../tags/InputTransferSelectModel.java | 24 +
.../views/freemarker/tags/StrutsModels.java | 11 +
.../views/jsp/ui/InputTransferSelectTag.java | 185 ++++++++
.../InputTransferSelectDirective.java | 23 +
.../main/resources/META-INF/struts-tags.tld | 316 ++++++++++++-
.../struts2/static/inputtransferselect.js | 108 +++++
.../resources/template/ajax/form-close.ftl | 16 +
.../css_xhtml/inputtransferselect.ftl | 4 +
.../resources/template/simple/form-close.ftl | 16 +
.../template/simple/inputtransferselect.ftl | 103 ++++
.../template/xhtml/inputtransferselect.ftl | 3 +
.../src/site/resources/tags/doubleselect.html | 2 +-
.../resources/tags/inputtransferselect.html | 442 ++++++++++++++++++
.../resources/tags/optiontransferselect.html | 2 +-
.../jsp/ui/InputTransferSelectTagTest.java | 34 ++
.../views/jsp/ui/inputtransferselect-1.txt | 23 +
24 files changed, 1868 insertions(+), 79 deletions(-)
create mode 100644 apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java
create mode 100644 apps/showcase/src/main/webapp/tags/ui/moreSelects.jsp
create mode 100644 apps/showcase/src/main/webapp/tags/ui/moreSelectsSubmit.jsp
create mode 100644 core/src/main/java/org/apache/struts2/components/InputTransferSelect.java
create mode 100644 core/src/main/java/org/apache/struts2/views/freemarker/tags/InputTransferSelectModel.java
create mode 100644 core/src/main/java/org/apache/struts2/views/jsp/ui/InputTransferSelectTag.java
create mode 100644 core/src/main/java/org/apache/struts2/views/velocity/components/InputTransferSelectDirective.java
create mode 100644 core/src/main/resources/org/apache/struts2/static/inputtransferselect.js
create mode 100644 core/src/main/resources/template/css_xhtml/inputtransferselect.ftl
create mode 100644 core/src/main/resources/template/simple/inputtransferselect.ftl
create mode 100644 core/src/main/resources/template/xhtml/inputtransferselect.ftl
create mode 100644 core/src/site/resources/tags/inputtransferselect.html
create mode 100644 core/src/test/java/org/apache/struts2/views/jsp/ui/InputTransferSelectTagTest.java
create mode 100644 core/src/test/resources/org/apache/struts2/views/jsp/ui/inputtransferselect-1.txt
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java
new file mode 100644
index 000000000..505c8bb12
--- /dev/null
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java
@@ -0,0 +1,115 @@
+package org.apache.struts2.showcase;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+import java.util.List;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import java.util.ArrayList;
+
+/**
+ */
+public class MoreSelectsAction extends ActionSupport {
+
+
+ private List _prioritisedFavouriteCartoonCharacters;
+ private List _prioritisedFavouriteCars;
+ private List _prioritisedFavouriteCountries;
+ private List favouriteNumbers;
+
+
+ // Cartoon Characters
+ public Map getDefaultFavouriteCartoonCharacters() {
+ Map m = new LinkedHashMap();
+ m.put("heMan", "He-Man");
+ m.put("popeye", "Popeye");
+ m.put("mockeyMouse", "Mickey Mouse");
+ return m;
+ }
+
+
+ // Cars
+ public Map getDefaultFavouriteCars() {
+ Map m = new LinkedHashMap();
+ m.put("alfaRomeo", "Alfa Romeo");
+ m.put("Toyota", "Toyota");
+ m.put("Mitsubitshi", "Mitsubitshi");
+ return m;
+ }
+
+
+
+ // Countries
+ public Map getDefaultFavouriteCountries() {
+ Map m = new LinkedHashMap();
+ m.put("england", "England");
+ m.put("america", "America");
+ m.put("brazil", "Brazil");
+ return m;
+ }
+
+ public List getDefaultFavouriteNumbers() {
+ List list = new ArrayList();
+ list.add("Three");
+ list.add("Seven");
+ return list;
+ }
+
+
+
+ public List getPrioritisedFavouriteCartoonCharacters() {
+ return _prioritisedFavouriteCartoonCharacters;
+ }
+ public void setPrioritisedFavouriteCartoonCharacters(List prioritisedFavouriteCartoonCharacters) {
+ _prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
+ }
+
+ public List getPrioritisedFavouriteCars() {
+ return _prioritisedFavouriteCars;
+ }
+ public void setPrioritisedFavouriteCars(List prioritisedFavouriteCars) {
+ _prioritisedFavouriteCars = prioritisedFavouriteCars;
+ }
+
+
+ public List getPrioritisedFavouriteCountries() {
+ return _prioritisedFavouriteCountries;
+ }
+ public void setPrioritisedFavouriteCountries(List prioritisedFavouriteCountries) {
+ _prioritisedFavouriteCountries = prioritisedFavouriteCountries;
+ }
+
+ public List getFavouriteNumbers() {
+ return favouriteNumbers;
+ }
+
+ public void setFavouriteNumbers(List favouriteNumbers) {
+ this.favouriteNumbers = favouriteNumbers;
+ }
+
+ public Map getAvailableCities() {
+ Map map = new LinkedHashMap();
+ map.put("boston", "Boston");
+ map.put("new york", "New York");
+ map.put("london", "London");
+ map.put("rome", "Rome");
+ return map;
+ }
+
+ public List getDefaultFavouriteCities() {
+ List list = new ArrayList();
+ list.add("boston");
+ list.add("rome");
+ return list;
+ }
+
+ // actions
+
+ public String input() throws Exception {
+ return SUCCESS;
+ }
+
+ public String submit() throws Exception {
+ return SUCCESS;
+ }
+}
diff --git a/apps/showcase/src/main/resources/struts-tags-ui.xml b/apps/showcase/src/main/resources/struts-tags-ui.xml
index 527470650..5f9568ee5 100644
--- a/apps/showcase/src/main/resources/struts-tags-ui.xml
+++ b/apps/showcase/src/main/resources/struts-tags-ui.xml
@@ -22,6 +22,7 @@
exampleSubmited.vm
example.vm
+
lotsOfOptiontransferselect.jsp
@@ -29,7 +30,15 @@
lotsOfOptiontransferselect.jsp
lotsOfOptiontransferselectSubmit.jsp
-
+
+
+ moreSelects.jsp
+
+
+ moreSelects.jsp
+ moreSelectsSubmit.jsp
+
+
diff --git a/apps/showcase/src/main/webapp/tags/ui/index.jsp b/apps/showcase/src/main/webapp/tags/ui/index.jsp
index 3c4e973f1..11a9fcd4f 100644
--- a/apps/showcase/src/main/webapp/tags/ui/index.jsp
+++ b/apps/showcase/src/main/webapp/tags/ui/index.jsp
@@ -11,6 +11,7 @@
UI Example
UI Example (Velocity)
Option Transfer Select UI Example
+ More Select Box UI Examples
Tree Example (static)
Tree Example (dynamic)
Component Tag Example
diff --git a/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselect.jsp b/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselect.jsp
index 4865854fe..d267ce583 100644
--- a/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselect.jsp
+++ b/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselect.jsp
@@ -85,48 +85,8 @@
allowSelectAll="false"
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselectSubmit.jsp b/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselectSubmit.jsp
index fb577566d..04d915b18 100644
--- a/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselectSubmit.jsp
+++ b/apps/showcase/src/main/webapp/tags/ui/lotsOfOptiontransferselectSubmit.jsp
@@ -88,39 +88,6 @@
-
-
- | Prioritised Favourite Cartoon Characters: |
-
-
- .
-
- |
-
-
- | Prioritised Favourite Cars: |
-
-
- .
-
- |
-
-
- | Prioritised Favourite Countries |
-
-
- .
-
- |
-
-
- | Favourite Cities |
-
-
- .
-
- |
-
diff --git a/apps/showcase/src/main/webapp/tags/ui/moreSelects.jsp b/apps/showcase/src/main/webapp/tags/ui/moreSelects.jsp
new file mode 100644
index 000000000..6b00b3466
--- /dev/null
+++ b/apps/showcase/src/main/webapp/tags/ui/moreSelects.jsp
@@ -0,0 +1,61 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
Show Case - Tags - UI Tags - Optiontransferselect
+
+
+
+