View Javadoc

    1   /*
    2    * $Id: InputTransferSelectTag.java 502296 2007-02-01 17:33:39Z niallp $
    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 org.apache.struts2.components.Component;
    24  import org.apache.struts2.components.InputTransferSelect;
    25  import com.opensymphony.xwork2.util.ValueStack;
    26
    27  import javax.servlet.http.HttpServletRequest;
    28  import javax.servlet.http.HttpServletResponse;
    29
    30  /***
    31   * InputTransferSelect jsp tag.
    32   */
    33  public class InputTransferSelectTag extends AbstractListTag {
    34
    35      private static final long serialVersionUID = 250474334495763536L;
    36
    37      protected String size;
    38      protected String multiple;
    39
    40      protected String allowRemoveAll;
    41      protected String allowUpDown;
    42
    43      protected String leftTitle;
    44      protected String rightTitle;
    45
    46      protected String buttonCssClass;
    47      protected String buttonCssStyle;
    48
    49      protected String addLabel;
    50      protected String removeLabel;
    51      protected String removeAllLabel;
    52      protected String upLabel;
    53      protected String downLabel;
    54
    55      protected String headerKey;
    56      protected String headerValue;
    57
    58      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
    59          return new InputTransferSelect(stack, req, res);
    60      }
    61
    62      protected void populateParams() {
    63          super.populateParams();
    64
    65          InputTransferSelect inputTransferSelect = (InputTransferSelect) component;
    66          inputTransferSelect.setSize(size);
    67          inputTransferSelect.setMultiple(multiple);
    68          inputTransferSelect.setAllowRemoveAll(allowRemoveAll);
    69          inputTransferSelect.setAllowUpDown(allowUpDown);
    70          inputTransferSelect.setLeftTitle(leftTitle);
    71          inputTransferSelect.setRightTitle(rightTitle);
    72
    73          inputTransferSelect.setButtonCssClass(buttonCssClass);
    74          inputTransferSelect.setButtonCssStyle(buttonCssStyle);
    75
    76          inputTransferSelect.setAddLabel(addLabel);
    77          inputTransferSelect.setRemoveLabel(removeLabel);
    78          inputTransferSelect.setRemoveAllLabel(removeAllLabel);
    79          inputTransferSelect.setUpLabel(upLabel);
    80          inputTransferSelect.setDownLabel(downLabel);
    81          inputTransferSelect.setHeaderKey(headerKey);
    82          inputTransferSelect.setHeaderValue(headerValue);
    83      }
    84
    85
    86      public String getSize() {
    87          return size;
    88      }
    89
    90      public void setSize(String size) {
    91          this.size = size;
    92      }
    93
    94      public String getMultiple() {
    95          return multiple;
    96      }
    97
    98      public void setMultiple(String multiple) {
    99          this.multiple = multiple;
    100     }
    101
    102     public String getAllowRemoveAll() {
    103         return allowRemoveAll;
    104     }
    105
    106     public void setAllowRemoveAll(String allowRemoveAll) {
    107         this.allowRemoveAll = allowRemoveAll;
    108     }
    109
    110     public String getAllowUpDown() {
    111         return allowUpDown;
    112     }
    113
    114     public void setAllowUpDown(String allowUpDown) {
    115         this.allowUpDown = allowUpDown;
    116     }
    117
    118     public String getLeftTitle() {
    119         return leftTitle;
    120     }
    121
    122     public void setLeftTitle(String leftTitle) {
    123         this.leftTitle = leftTitle;
    124     }
    125
    126     public String getRightTitle() {
    127         return rightTitle;
    128     }
    129
    130     public void setRightTitle(String rightTitle) {
    131         this.rightTitle = rightTitle;
    132     }
    133
    134     public String getButtonCssClass() {
    135         return buttonCssClass;
    136     }
    137
    138     public void setButtonCssClass(String buttonCssClass) {
    139         this.buttonCssClass = buttonCssClass;
    140     }
    141
    142     public String getButtonCssStyle() {
    143         return buttonCssStyle;
    144     }
    145
    146     public void setButtonCssStyle(String buttonCssStyle) {
    147         this.buttonCssStyle = buttonCssStyle;
    148     }
    149
    150     public String getAddLabel() {
    151         return addLabel;
    152     }
    153
    154     public void setAddLabel(String addLabel) {
    155         this.addLabel = addLabel;
    156     }
    157
    158     public String getRemoveLabel() {
    159         return removeLabel;
    160     }
    161
    162     public void setRemoveLabel(String removeLabel) {
    163         this.removeLabel = removeLabel;
    164     }
    165
    166     public String getRemoveAllLabel() {
    167         return removeAllLabel;
    168     }
    169
    170     public void setRemoveAllLabel(String removeAllLabel) {
    171         this.removeAllLabel = removeAllLabel;
    172     }
    173
    174     public String getUpLabel() {
    175         return upLabel;
    176     }
    177
    178     public void setUpLabel(String upLabel) {
    179         this.upLabel = upLabel;
    180     }
    181
    182     public String getDownLabel() {
    183         return downLabel;
    184     }
    185
    186     public void setDownLabel(String downLabel) {
    187         this.downLabel = downLabel;
    188     }
    189
    190     public String getHeaderKey() {
    191         return headerKey;
    192     }
    193
    194     public void setHeaderKey(String headerKey) {
    195         this.headerKey = headerKey;
    196     }
    197
    198     public String getHeaderValue() {
    199         return headerValue;
    200     }
    201
    202     public void setHeaderValue(String headerValue) {
    203         this.headerValue = headerValue;
    204     }
    205 }