Home » struts-2.1.8.1-src » org.apache » struts2 » showcase » [javadoc | source]

    1   /*
    2    * $Id: LotsOfOptiontransferselectAction.java 492030 2007-01-03 02:55:43Z ddewolf $
    3    *
    4    * Licensed to the Apache Software Foundation (ASF) under one
    5    * or more contributor license agreements.  See the NOTICE file
    6    * distributed with this work for additional information
    7    * regarding copyright ownership.  The ASF licenses this file
    8    * to you under the Apache License, Version 2.0 (the
    9    * "License"); you may not use this file except in compliance
   10    * with the License.  You may obtain a copy of the License at
   11    *
   12    *  http://www.apache.org/licenses/LICENSE-2.0
   13    *
   14    * Unless required by applicable law or agreed to in writing,
   15    * software distributed under the License is distributed on an
   16    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   17    * KIND, either express or implied.  See the License for the
   18    * specific language governing permissions and limitations
   19    * under the License.
   20    */
   21   package org.apache.struts2.showcase;
   22   
   23   import java.util.LinkedHashMap;
   24   import java.util.List;
   25   import java.util.Map;
   26   import java.util.ArrayList;
   27   
   28   import com.opensymphony.xwork2.ActionSupport;
   29   
   30   /**
   31    */
   32   public class LotsOfOptiontransferselectAction extends ActionSupport {
   33   
   34       private List _favouriteCartoonCharactersKeys;
   35       private List _notFavouriteCartoonCharactersKeys;
   36   
   37       private List _favouriteCarsKeys;
   38       private List _notFavouriteCarsKeys;
   39   
   40       private List _favouriteMotorcyclesKeys;
   41       private List _notFavouriteMotorcyclesKeys;
   42   
   43       private List _favouriteCountriesKeys;
   44       private List _notFavouriteCountriesKeys;
   45   
   46       private List _favouriteSportsKeys;
   47       private List _nonFavouriteSportsKeys;
   48   
   49       private List _favouriteCities;
   50   
   51       private List _prioritisedFavouriteCartoonCharacters;
   52       private List _prioritisedFavouriteCars;
   53       private List _prioritisedFavouriteCountries;
   54   
   55   
   56   
   57       // Cartoon Characters
   58       public Map getDefaultFavouriteCartoonCharacters() {
   59           Map m = new LinkedHashMap();
   60           m.put("heMan", "He-Man");
   61           m.put("popeye", "Popeye");
   62           m.put("mockeyMouse", "Mickey Mouse");
   63           return m;
   64       }
   65   
   66       public Map getDefaultNotFavouriteCartoonCharacters() {
   67           Map m = new LinkedHashMap();
   68           m.put("donaldDuck", "Donald Duck");
   69           m.put("atomicAnt", "Atomic Ant");
   70           m.put("pinkPainter", "Pink Painter");
   71           return m;
   72       }
   73   
   74       public List getFavouriteCartoonCharacters() {
   75           return _favouriteCartoonCharactersKeys;
   76       }
   77   
   78       public void setFavouriteCartoonCharacters(List favouriteCartoonCharacters) {
   79           _favouriteCartoonCharactersKeys = favouriteCartoonCharacters;
   80       }
   81   
   82       public List getNotFavouriteCartoonCharacters() {
   83           return _notFavouriteCartoonCharactersKeys;
   84       }
   85   
   86       public void setNotFavouriteCartoonCharacters(List notFavouriteCartoonCharacters) {
   87           _notFavouriteCartoonCharactersKeys = notFavouriteCartoonCharacters;
   88       }
   89   
   90   
   91   
   92   
   93   
   94       // Cars
   95       public Map getDefaultFavouriteCars() {
   96           Map m = new LinkedHashMap();
   97           m.put("alfaRomeo", "Alfa Romeo");
   98           m.put("Toyota", "Toyota");
   99           m.put("Mitsubitshi", "Mitsubitshi");
  100           return m;
  101       }
  102   
  103       public Map getDefaultNotFavouriteCars() {
  104           Map m = new LinkedHashMap();
  105           m.put("ford", "Ford");
  106           m.put("landRover", "Land Rover");
  107           m.put("mercedes", "Mercedes");
  108           return m;
  109       }
  110   
  111       public List getFavouriteCars() {
  112           return _favouriteCarsKeys;
  113       }
  114   
  115       public void setFavouriteCars(List favouriteCars) {
  116           _favouriteCarsKeys = favouriteCars;
  117       }
  118   
  119       public List getNotFavouriteCars() {
  120           return _notFavouriteCarsKeys;
  121       }
  122   
  123       public void setNotFavouriteCars(List notFavouriteCars) {
  124           _notFavouriteCarsKeys = notFavouriteCars;
  125       }
  126   
  127   
  128   
  129       // Motorcycles
  130       public Map getDefaultFavouriteMotorcycles() {
  131           Map m = new LinkedHashMap();
  132           m.put("honda", "Honda");
  133           m.put("yamaha", "Yamaha");
  134           m.put("Aprillia", "Aprillia");
  135           return m;
  136       }
  137   
  138       public Map getDefaultNotFavouriteMotorcycles() {
  139           Map m = new LinkedHashMap();
  140           m.put("cagiva", "Cagiva");
  141           m.put("harleyDavidson", "Harley Davidson");
  142           m.put("suzuki", "Suzuki");
  143           return m;
  144       }
  145   
  146       public List getFavouriteMotorcycles() {
  147           return _favouriteMotorcyclesKeys;
  148       }
  149   
  150       public void setFavouriteMotorcycles(List favouriteMotorcycles) {
  151           _favouriteMotorcyclesKeys = favouriteMotorcycles;
  152       }
  153   
  154       public List getNotFavouriteMotorcycles() {
  155           return _notFavouriteMotorcyclesKeys;
  156       }
  157   
  158       public void setNotFavouriteMotorcycles(List notFavouriteMotorcycles) {
  159           _notFavouriteMotorcyclesKeys = notFavouriteMotorcycles;
  160       }
  161   
  162   
  163   
  164       // Countries
  165       public Map getDefaultFavouriteCountries() {
  166           Map m = new LinkedHashMap();
  167           m.put("england", "England");
  168           m.put("america", "America");
  169           m.put("brazil", "Brazil");
  170           return m;
  171       }
  172   
  173       public Map getDefaultNotFavouriteCountries() {
  174           Map m = new LinkedHashMap();
  175           m.put("germany", "Germany");
  176           m.put("china", "China");
  177           m.put("russia", "Russia");
  178           return m;
  179       }
  180   
  181       public List getFavouriteCountries() {
  182           return _favouriteCountriesKeys;
  183       }
  184   
  185       public void setFavouriteCountries(List favouriteCountries) {
  186           _favouriteCountriesKeys = favouriteCountries;
  187       }
  188   
  189       public List getNotFavouriteCountries() {
  190           return _notFavouriteCountriesKeys;
  191       }
  192   
  193       public void setNotFavouriteCountries(List notFavouriteCountries) {
  194           _notFavouriteCountriesKeys = notFavouriteCountries;
  195       }
  196   
  197       // Sports
  198       public Map getDefaultNonFavoriteSports() {
  199           Map m = new LinkedHashMap();
  200           m.put("basketball", "Basketball");
  201           m.put("football", "Football");
  202           m.put("baseball", "Baseball");
  203           return m;
  204       }
  205   
  206       public Map getDefaultFavoriteSports() {
  207           return new LinkedHashMap();
  208       }
  209   
  210       public List getFavouriteSports() {
  211           return _favouriteSportsKeys;
  212       }
  213   
  214       public void setFavouriteSports(List favouriteSportsKeys) {
  215           this._favouriteSportsKeys = favouriteSportsKeys;
  216       }
  217   
  218       public List getNonFavouriteSports() {
  219           return _nonFavouriteSportsKeys;
  220       }
  221   
  222       public void setNonFavouriteSports(List notFavouriteSportsKeys) {
  223           this._nonFavouriteSportsKeys = notFavouriteSportsKeys;
  224       }
  225   
  226   
  227       
  228   
  229       public List getPrioritisedFavouriteCartoonCharacters() {
  230           return _prioritisedFavouriteCartoonCharacters;
  231       }
  232       public void setPrioritisedFavouriteCartoonCharacters(List prioritisedFavouriteCartoonCharacters) {
  233           _prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
  234       }
  235   
  236       public List getPrioritisedFavouriteCars() {
  237           return _prioritisedFavouriteCars;
  238       }
  239       public void setPrioritisedFavouriteCars(List prioritisedFavouriteCars) {
  240           _prioritisedFavouriteCars = prioritisedFavouriteCars;
  241       }
  242   
  243   
  244       public List getPrioritisedFavouriteCountries() {
  245           return _prioritisedFavouriteCountries;
  246       }
  247       public void setPrioritisedFavouriteCountries(List prioritisedFavouriteCountries) {
  248           _prioritisedFavouriteCountries = prioritisedFavouriteCountries;
  249       }
  250   
  251   
  252   
  253       public Map getAvailableCities() {
  254           Map map = new LinkedHashMap();
  255           map.put("boston", "Boston");
  256           map.put("new york", "New York");
  257           map.put("london", "London");
  258           map.put("rome", "Rome");
  259           return map;
  260       }
  261   
  262       public List getDefaultFavouriteCities() {
  263           List list = new ArrayList();
  264           list.add("boston");
  265           list.add("rome");
  266           return list;
  267       }
  268   
  269       public List getFavouriteCities() {
  270           return _favouriteCities;
  271       }
  272   
  273       public void setFavouriteCities(List favouriteCities) {
  274           this._favouriteCities = favouriteCities;
  275       }
  276   
  277       // actions
  278   
  279       public String input() throws Exception {
  280           return SUCCESS;
  281       }
  282   
  283       public String submit() throws Exception {
  284           return SUCCESS;
  285       }
  286   }

Home » struts-2.1.8.1-src » org.apache » struts2 » showcase » [javadoc | source]