View Javadoc
1   /**
2    * Copyright 2005-2015 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.element;
17  
18  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20  import org.kuali.rice.krad.datadictionary.validator.ErrorReport;
21  import org.kuali.rice.krad.datadictionary.validator.Validator;
22  import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
23  
24  import java.util.ArrayList;
25  
26  /**
27   * Content element that encloses an iframe
28   *
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   */
31  @BeanTag(name = "iFrame", parent = "Uif-Iframe")
32  public class Iframe extends ContentElementBase {
33      private static final long serialVersionUID = 5797473302619055088L;
34  
35      private String source;
36      private String height;
37      private String frameborder;
38  
39      public Iframe() {
40          super();
41      }
42  
43      /**
44       * The IFrame's source
45       *
46       * @return source
47       */
48      @BeanTagAttribute
49      public String getSource() {
50          return this.source;
51      }
52  
53      /**
54       * Setter for the IFrame's source
55       *
56       * @param source
57       */
58      public void setSource(String source) {
59          this.source = source;
60      }
61  
62      /**
63       * The IFrame's height
64       *
65       * @return height
66       */
67      @BeanTagAttribute
68      public String getHeight() {
69          return this.height;
70      }
71  
72      /**
73       * Setter for the IFrame's height
74       *
75       * @param height
76       */
77      public void setHeight(String height) {
78          this.height = height;
79      }
80  
81      /**
82       * The IFrame's frame border
83       *
84       * @return frameborder
85       */
86      @BeanTagAttribute
87      public String getFrameborder() {
88          return this.frameborder;
89      }
90  
91      /**
92       * Setter for the IFrame's frame border
93       *
94       * @param frameborder
95       */
96      public void setFrameborder(String frameborder) {
97          this.frameborder = frameborder;
98      }
99  
100     /**
101      * {@inheritDoc}
102      */
103     @Override
104     public void completeValidation(ValidationTrace tracer) {
105         tracer.addBean(this);
106 
107         // Checks that a source is set
108         if (getSource() == null) {
109             if (!Validator.checkExpressions(this, "source")) {
110                 String currentValues[] = {"source =" + getSource()};
111                 tracer.createError("Source must be set", currentValues);
112             }
113         }
114 
115         super.completeValidation(tracer.getCopy());
116     }
117 }