View Javadoc
1   /**
2    * Copyright 2005-2016 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif.control;
17  
18  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20  
21  /**
22   * Represents a HTML File control, generally rendered as an input control with
23   * type 'file'. Allows user to upload a file to the application
24   *
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  @BeanTag(name = "fileControl-bean", parent = "Uif-FileControl")
28  public class FileControl extends ControlBase implements SizedControl {
29      private static final long serialVersionUID = -5919326390841646189L;
30  
31      private int size;
32  
33      public FileControl() {
34          super();
35      }
36  
37      /**
38       * @see org.kuali.rice.krad.uif.control.SizedControl#getSize()
39       */
40      @BeanTagAttribute(name = "size")
41      public int getSize() {
42          return this.size;
43      }
44  
45      /**
46       * @see org.kuali.rice.krad.uif.control.SizedControl#setSize(int)
47       */
48      public void setSize(int size) {
49          this.size = size;
50      }
51  
52      /**
53       * @see org.kuali.rice.krad.uif.component.ComponentBase#copy()
54       */
55      @Override
56      protected <T> void copyProperties(T component) {
57          super.copyProperties(component);
58          FileControl fileControlCopy = (FileControl) component;
59          fileControlCopy.setSize(this.size);
60      }
61  }