View Javadoc

    1   /*
    2    * $Id: OptionTransferSelectTag.java 494210 2007-01-08 21:55:49Z 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.views.jsp.ui;
    22
    23  import javax.servlet.http.HttpServletRequest;
    24  import javax.servlet.http.HttpServletResponse;
    25
    26  import org.apache.struts2.components.Component;
    27  import org.apache.struts2.components.OptionTransferSelect;
    28
    29  import com.opensymphony.xwork2.util.ValueStack;
    30
    31  /***
    32   * OptionTransferSelect jsp tag.
    33   */
    34  public class OptionTransferSelectTag extends AbstractDoubleListTag {
    35
    36      private static final long serialVersionUID = 250474334495763536L;
    37
    38      protected String allowAddToLeft;
    39      protected String allowAddToRight;
    40      protected String allowAddAllToLeft;
    41      protected String allowAddAllToRight;
    42      protected String allowSelectAll;
    43      protected String allowUpDownOnLeft;
    44      protected String allowUpDownOnRight;
    45
    46      protected String leftTitle;
    47      protected String rightTitle;
    48
    49      protected String buttonCssClass;
    50      protected String buttonCssStyle;
    51
    52      protected String addToLeftLabel;
    53      protected String addToRightLabel;
    54      protected String addAllToLeftLabel;
    55      protected String addAllToRightLabel;
    56      protected String selectAllLabel;
    57      protected String leftUpLabel;
    58      protected String leftDownLabel;
    59      protected String rightUpLabel;
    60      protected String rightDownLabel;
    61
    62
    63      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
    64          return new OptionTransferSelect(stack, req, res);
    65      }
    66
    67      protected void populateParams() {
    68          super.populateParams();
    69
    70          OptionTransferSelect optionTransferSelect = (OptionTransferSelect) component;
    71          optionTransferSelect.setAllowAddToLeft(allowAddToLeft);
    72          optionTransferSelect.setAllowAddToRight(allowAddToRight);
    73          optionTransferSelect.setAllowAddAllToLeft(allowAddAllToLeft);
    74          optionTransferSelect.setAllowAddAllToRight(allowAddAllToRight);
    75          optionTransferSelect.setAllowSelectAll(allowSelectAll);
    76          optionTransferSelect.setAllowUpDownOnLeft(allowUpDownOnLeft);
    77          optionTransferSelect.setAllowUpDownOnRight(allowUpDownOnRight);
    78
    79          optionTransferSelect.setAddToLeftLabel(addToLeftLabel);
    80          optionTransferSelect.setAddToRightLabel(addToRightLabel);
    81          optionTransferSelect.setAddAllToLeftLabel(addAllToLeftLabel);
    82          optionTransferSelect.setAddAllToRightLabel(addAllToRightLabel);
    83          optionTransferSelect.setSelectAllLabel(selectAllLabel);
    84          optionTransferSelect.setLeftUpLabel(leftUpLabel);
    85          optionTransferSelect.setLeftDownLabel(leftDownLabel);
    86          optionTransferSelect.setRightUpLabel(rightUpLabel);
    87          optionTransferSelect.setRightDownLabel(rightDownLabel);
    88
    89          optionTransferSelect.setButtonCssClass(buttonCssClass);
    90          optionTransferSelect.setButtonCssStyle(buttonCssStyle);
    91
    92          optionTransferSelect.setLeftTitle(leftTitle);
    93          optionTransferSelect.setRightTitle(rightTitle);
    94      }
    95
    96
    97      public String getAddAllToLeftLabel() {
    98          return addAllToLeftLabel;
    99      }
    100
    101
    102     public void setAddAllToLeftLabel(String addAllToLeftLabel) {
    103         this.addAllToLeftLabel = addAllToLeftLabel;
    104     }
    105
    106
    107     public String getAddAllToRightLabel() {
    108         return addAllToRightLabel;
    109     }
    110
    111
    112     public void setAddAllToRightLabel(String addAllToRightLabel) {
    113         this.addAllToRightLabel = addAllToRightLabel;
    114     }
    115
    116
    117     public String getAddToLeftLabel() {
    118         return addToLeftLabel;
    119     }
    120
    121
    122     public void setAddToLeftLabel(String addToLeftLabel) {
    123         this.addToLeftLabel = addToLeftLabel;
    124     }
    125
    126
    127     public String getAddToRightLabel() {
    128         return addToRightLabel;
    129     }
    130
    131
    132     public void setAddToRightLabel(String addToRightLabel) {
    133         this.addToRightLabel = addToRightLabel;
    134     }
    135
    136
    137     public String getAllowAddAllToLeft() {
    138         return allowAddAllToLeft;
    139     }
    140
    141
    142     public void setAllowAddAllToLeft(String allowAddAllToLeft) {
    143         this.allowAddAllToLeft = allowAddAllToLeft;
    144     }
    145
    146
    147     public String getAllowAddAllToRight() {
    148         return allowAddAllToRight;
    149     }
    150
    151
    152     public void setAllowAddAllToRight(String allowAddAllToRight) {
    153         this.allowAddAllToRight = allowAddAllToRight;
    154     }
    155
    156
    157     public String getAllowAddToLeft() {
    158         return allowAddToLeft;
    159     }
    160
    161
    162     public void setAllowAddToLeft(String allowAddToLeft) {
    163         this.allowAddToLeft = allowAddToLeft;
    164     }
    165
    166
    167     public String getAllowAddToRight() {
    168         return allowAddToRight;
    169     }
    170
    171
    172     public void setAllowAddToRight(String allowAddToRight) {
    173         this.allowAddToRight = allowAddToRight;
    174     }
    175
    176     public String getAllowUpDownOnLeft() {
    177         return allowUpDownOnLeft;
    178     }
    179
    180     public void setAllowUpDownOnLeft(String allowUpDownOnLeft) {
    181         this.allowUpDownOnLeft = allowUpDownOnLeft;
    182     }
    183
    184     public String getAllowUpDownOnRight() {
    185         return allowUpDownOnRight;
    186     }
    187
    188     public void setAllowUpDownOnRight(String allowUpDownOnRight) {
    189         this.allowUpDownOnRight = allowUpDownOnRight;
    190     }
    191
    192     public String getLeftUpLabel() {
    193         return leftUpLabel;
    194     }
    195
    196     public void setLeftUpLabel(String leftUpLabel) {
    197         this.leftUpLabel = leftUpLabel;
    198     }
    199
    200     public String getLeftDownLabel() {
    201         return leftDownLabel;
    202     }
    203
    204     public void setLeftDownLabel(String leftDownLabel) {
    205         this.leftDownLabel = leftDownLabel;
    206     }
    207
    208     public String getRightUpLabel() {
    209         return rightUpLabel;
    210     }
    211
    212     public void setRightUpLabel(String rightUpLabel) {
    213         this.rightUpLabel = rightUpLabel;
    214     }
    215
    216     public String getRightDownLabel() {
    217         return rightDownLabel;
    218     }
    219
    220     public void setRightDownLabel(String rightDownLabel) {
    221         this.rightDownLabel = rightDownLabel;
    222     }
    223
    224     public String getLeftTitle() {
    225         return leftTitle;
    226     }
    227
    228
    229     public void setLeftTitle(String leftTitle) {
    230         this.leftTitle = leftTitle;
    231     }
    232
    233
    234     public String getRightTitle() {
    235         return rightTitle;
    236     }
    237
    238
    239     public void setRightTitle(String rightTitle) {
    240         this.rightTitle = rightTitle;
    241     }
    242
    243
    244     public void setAllowSelectAll(String allowSelectAll) {
    245         this.allowSelectAll = allowSelectAll;
    246     }
    247
    248     public String getAllowSelectAll() {
    249         return this.allowSelectAll;
    250     }
    251
    252     public void setSelectAllLabel(String selectAllLabel) {
    253         this.selectAllLabel = selectAllLabel;
    254     }
    255
    256     public String getSelectAllLabel() {
    257         return this.selectAllLabel;
    258     }
    259
    260     public void setButtonCssClass(String buttonCssId) {
    261         this.buttonCssClass = buttonCssId;
    262     }
    263
    264     public String getButtonCssClass() {
    265         return buttonCssClass;
    266     }
    267
    268     public void setButtonCssStyle(String buttonCssStyle) {
    269         this.buttonCssStyle = buttonCssStyle;
    270     }
    271
    272     public String getButtonCssStyle() {
    273         return this.buttonCssStyle;
    274     }
    275 }