001: /*
002: * $Id: LotsOfOptiontransferselectAction.java 492030 2007-01-03 02:55:43Z ddewolf $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2.showcase;
022:
023: import java.util.LinkedHashMap;
024: import java.util.List;
025: import java.util.Map;
026: import java.util.ArrayList;
027:
028: import com.opensymphony.xwork2.ActionSupport;
029:
030: /**
031: */
032: public class LotsOfOptiontransferselectAction extends ActionSupport {
033:
034: private List _favouriteCartoonCharactersKeys;
035: private List _notFavouriteCartoonCharactersKeys;
036:
037: private List _favouriteCarsKeys;
038: private List _notFavouriteCarsKeys;
039:
040: private List _favouriteMotorcyclesKeys;
041: private List _notFavouriteMotorcyclesKeys;
042:
043: private List _favouriteCountriesKeys;
044: private List _notFavouriteCountriesKeys;
045:
046: private List _favouriteSportsKeys;
047: private List _nonFavouriteSportsKeys;
048:
049: private List _favouriteCities;
050:
051: private List _prioritisedFavouriteCartoonCharacters;
052: private List _prioritisedFavouriteCars;
053: private List _prioritisedFavouriteCountries;
054:
055: // Cartoon Characters
056: public Map getDefaultFavouriteCartoonCharacters() {
057: Map m = new LinkedHashMap();
058: m.put("heMan", "He-Man");
059: m.put("popeye", "Popeye");
060: m.put("mockeyMouse", "Mickey Mouse");
061: return m;
062: }
063:
064: public Map getDefaultNotFavouriteCartoonCharacters() {
065: Map m = new LinkedHashMap();
066: m.put("donaldDuck", "Donald Duck");
067: m.put("atomicAnt", "Atomic Ant");
068: m.put("pinkPainter", "Pink Painter");
069: return m;
070: }
071:
072: public List getFavouriteCartoonCharacters() {
073: return _favouriteCartoonCharactersKeys;
074: }
075:
076: public void setFavouriteCartoonCharacters(
077: List favouriteCartoonCharacters) {
078: _favouriteCartoonCharactersKeys = favouriteCartoonCharacters;
079: }
080:
081: public List getNotFavouriteCartoonCharacters() {
082: return _notFavouriteCartoonCharactersKeys;
083: }
084:
085: public void setNotFavouriteCartoonCharacters(
086: List notFavouriteCartoonCharacters) {
087: _notFavouriteCartoonCharactersKeys = notFavouriteCartoonCharacters;
088: }
089:
090: // Cars
091: public Map getDefaultFavouriteCars() {
092: Map m = new LinkedHashMap();
093: m.put("alfaRomeo", "Alfa Romeo");
094: m.put("Toyota", "Toyota");
095: m.put("Mitsubitshi", "Mitsubitshi");
096: return m;
097: }
098:
099: public Map getDefaultNotFavouriteCars() {
100: Map m = new LinkedHashMap();
101: m.put("ford", "Ford");
102: m.put("landRover", "Land Rover");
103: m.put("mercedes", "Mercedes");
104: return m;
105: }
106:
107: public List getFavouriteCars() {
108: return _favouriteCarsKeys;
109: }
110:
111: public void setFavouriteCars(List favouriteCars) {
112: _favouriteCarsKeys = favouriteCars;
113: }
114:
115: public List getNotFavouriteCars() {
116: return _notFavouriteCarsKeys;
117: }
118:
119: public void setNotFavouriteCars(List notFavouriteCars) {
120: _notFavouriteCarsKeys = notFavouriteCars;
121: }
122:
123: // Motorcycles
124: public Map getDefaultFavouriteMotorcycles() {
125: Map m = new LinkedHashMap();
126: m.put("honda", "Honda");
127: m.put("yamaha", "Yamaha");
128: m.put("Aprillia", "Aprillia");
129: return m;
130: }
131:
132: public Map getDefaultNotFavouriteMotorcycles() {
133: Map m = new LinkedHashMap();
134: m.put("cagiva", "Cagiva");
135: m.put("harleyDavidson", "Harley Davidson");
136: m.put("suzuki", "Suzuki");
137: return m;
138: }
139:
140: public List getFavouriteMotorcycles() {
141: return _favouriteMotorcyclesKeys;
142: }
143:
144: public void setFavouriteMotorcycles(List favouriteMotorcycles) {
145: _favouriteMotorcyclesKeys = favouriteMotorcycles;
146: }
147:
148: public List getNotFavouriteMotorcycles() {
149: return _notFavouriteMotorcyclesKeys;
150: }
151:
152: public void setNotFavouriteMotorcycles(List notFavouriteMotorcycles) {
153: _notFavouriteMotorcyclesKeys = notFavouriteMotorcycles;
154: }
155:
156: // Countries
157: public Map getDefaultFavouriteCountries() {
158: Map m = new LinkedHashMap();
159: m.put("england", "England");
160: m.put("america", "America");
161: m.put("brazil", "Brazil");
162: return m;
163: }
164:
165: public Map getDefaultNotFavouriteCountries() {
166: Map m = new LinkedHashMap();
167: m.put("germany", "Germany");
168: m.put("china", "China");
169: m.put("russia", "Russia");
170: return m;
171: }
172:
173: public List getFavouriteCountries() {
174: return _favouriteCountriesKeys;
175: }
176:
177: public void setFavouriteCountries(List favouriteCountries) {
178: _favouriteCountriesKeys = favouriteCountries;
179: }
180:
181: public List getNotFavouriteCountries() {
182: return _notFavouriteCountriesKeys;
183: }
184:
185: public void setNotFavouriteCountries(List notFavouriteCountries) {
186: _notFavouriteCountriesKeys = notFavouriteCountries;
187: }
188:
189: // Sports
190: public Map getDefaultNonFavoriteSports() {
191: Map m = new LinkedHashMap();
192: m.put("basketball", "Basketball");
193: m.put("football", "Football");
194: m.put("baseball", "Baseball");
195: return m;
196: }
197:
198: public Map getDefaultFavoriteSports() {
199: return new LinkedHashMap();
200: }
201:
202: public List getFavouriteSports() {
203: return _favouriteSportsKeys;
204: }
205:
206: public void setFavouriteSports(List favouriteSportsKeys) {
207: this ._favouriteSportsKeys = favouriteSportsKeys;
208: }
209:
210: public List getNonFavouriteSports() {
211: return _nonFavouriteSportsKeys;
212: }
213:
214: public void setNonFavouriteSports(List notFavouriteSportsKeys) {
215: this ._nonFavouriteSportsKeys = notFavouriteSportsKeys;
216: }
217:
218: public List getPrioritisedFavouriteCartoonCharacters() {
219: return _prioritisedFavouriteCartoonCharacters;
220: }
221:
222: public void setPrioritisedFavouriteCartoonCharacters(
223: List prioritisedFavouriteCartoonCharacters) {
224: _prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
225: }
226:
227: public List getPrioritisedFavouriteCars() {
228: return _prioritisedFavouriteCars;
229: }
230:
231: public void setPrioritisedFavouriteCars(
232: List prioritisedFavouriteCars) {
233: _prioritisedFavouriteCars = prioritisedFavouriteCars;
234: }
235:
236: public List getPrioritisedFavouriteCountries() {
237: return _prioritisedFavouriteCountries;
238: }
239:
240: public void setPrioritisedFavouriteCountries(
241: List prioritisedFavouriteCountries) {
242: _prioritisedFavouriteCountries = prioritisedFavouriteCountries;
243: }
244:
245: public Map getAvailableCities() {
246: Map map = new LinkedHashMap();
247: map.put("boston", "Boston");
248: map.put("new york", "New York");
249: map.put("london", "London");
250: map.put("rome", "Rome");
251: return map;
252: }
253:
254: public List getDefaultFavouriteCities() {
255: List list = new ArrayList();
256: list.add("boston");
257: list.add("rome");
258: return list;
259: }
260:
261: public List getFavouriteCities() {
262: return _favouriteCities;
263: }
264:
265: public void setFavouriteCities(List favouriteCities) {
266: this ._favouriteCities = favouriteCities;
267: }
268:
269: // actions
270:
271: public String input() throws Exception {
272: return SUCCESS;
273: }
274:
275: public String submit() throws Exception {
276: return SUCCESS;
277: }
278: }
|