View Javadoc

1   /**
2    * Copyright 2005-2013 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.view;
17  
18  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19  import org.kuali.rice.krad.uif.container.CollectionGroup;
20  import org.kuali.rice.krad.uif.container.Group;
21  import org.kuali.rice.krad.uif.element.Action;
22  import org.kuali.rice.krad.uif.field.Field;
23  import org.kuali.rice.krad.uif.widget.Widget;
24  import org.kuali.rice.krad.web.form.UifFormBase;
25  
26  import java.io.Serializable;
27  import java.util.HashSet;
28  import java.util.Set;
29  
30  /**
31   * Implementation of {@link ViewPresentationController} that implements no logic by default
32   *
33   * @author Kuali Rice Team (rice.collab@kuali.org)
34   */
35  @BeanTag(name = "viewPresentationController-bean")
36  public class ViewPresentationControllerBase implements ViewPresentationController, Serializable {
37      private static final long serialVersionUID = -3199587372204398503L;
38  
39      /**
40       * @see ViewPresentationController#getActionFlags(org.kuali.rice.krad.uif.view.View,
41       * org.kuali.rice.krad.web.form.UifFormBase)
42       */
43      public Set<String> getActionFlags(View view, UifFormBase model) {
44          return new HashSet<String>();
45      }
46  
47      /**
48       * @see ViewPresentationController#getEditModes(org.kuali.rice.krad.uif.view.View,
49       * org.kuali.rice.krad.web.form.UifFormBase)
50       */
51      public Set<String> getEditModes(View view, UifFormBase model) {
52          return new HashSet<String>();
53      }
54  
55      /**
56       * @see ViewPresentationController#canEditView(org.kuali.rice.krad.uif.view.View, org.kuali.rice.krad.uif.view.ViewModel)
57       */
58      public boolean canEditView(View view, ViewModel model) {
59          return true;
60      }
61  
62      /**
63       * @see ViewPresentationController#canEditField(org.kuali.rice.krad.uif.view.View,
64       * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.Field, java.lang.String)
65       */
66      public boolean canEditField(View view, ViewModel model, Field field, String propertyName) {
67          return true;
68      }
69  
70      /**
71       * @see ViewPresentationController#canViewField(org.kuali.rice.krad.uif.view.View,
72       * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.Field, java.lang.String)
73       */
74      public boolean canViewField(View view, ViewModel model, Field field, String propertyName) {
75          return true;
76      }
77  
78      /**
79       * @see ViewPresentationController#fieldIsRequired(org.kuali.rice.krad.uif.view.View,
80       * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.Field, java.lang.String)
81       */
82      public boolean fieldIsRequired(View view, ViewModel model, Field field, String propertyName) {
83          return false;
84      }
85  
86      /**
87       * @see ViewPresentationController#canEditGroup(org.kuali.rice.krad.uif.view.View,
88       * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.Group, java.lang.String)
89       */
90      public boolean canEditGroup(View view, ViewModel model, Group group, String groupId) {
91          return true;
92      }
93  
94      /**
95       * @see ViewPresentationController#canViewGroup(org.kuali.rice.krad.uif.view.View,
96       * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.Group, java.lang.String)
97       */
98      public boolean canViewGroup(View view, ViewModel model, Group group, String groupId) {
99          return true;
100     }
101 
102     /**
103      * @see ViewPresentationController#canEditWidget(org.kuali.rice.krad.uif.view.View,
104      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.widget.Widget, java.lang.String)
105      */
106     public boolean canEditWidget(View view, ViewModel model, Widget widget, String widgetId) {
107         return true;
108     }
109 
110     /**
111      * @see ViewPresentationController#canViewWidget(org.kuali.rice.krad.uif.view.View,
112      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.widget.Widget, java.lang.String)
113      */
114     public boolean canViewWidget(View view, ViewModel model, Widget widget, String widgetId) {
115         return true;
116     }
117 
118     /**
119      * @see ViewPresentationController#canPerformAction(org.kuali.rice.krad.uif.view.View,
120      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.element.Action, java.lang.String,
121      * java.lang.String)
122      */
123     public boolean canPerformAction(View view, ViewModel model, Action action, String actionEvent,
124             String actionId) {
125         return true;
126     }
127 
128     /**
129      * @see ViewPresentationController#canEditLine(org.kuali.rice.krad.uif.view.View,
130      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
131      * java.lang.String, java.lang.Object)
132      */
133     public boolean canEditLine(View view, ViewModel model, CollectionGroup collectionGroup,
134             String collectionPropertyName, Object line) {
135         return true;
136     }
137 
138     /**
139      * @see ViewPresentationController#canViewLine(org.kuali.rice.krad.uif.view.View,
140      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
141      * java.lang.String, java.lang.Object)
142      */
143     public boolean canViewLine(View view, ViewModel model, CollectionGroup collectionGroup,
144             String collectionPropertyName, Object line) {
145         return true;
146     }
147 
148     /**
149      * @see ViewPresentationController#canEditLineField(org.kuali.rice.krad.uif.view.View,
150      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
151      * java.lang.String, java.lang.Object, org.kuali.rice.krad.uif.field.Field, java.lang.String)
152      */
153     public boolean canEditLineField(View view, ViewModel model, CollectionGroup collectionGroup,
154             String collectionPropertyName, Object line, Field field, String propertyName) {
155         return true;
156     }
157 
158     /**
159      * @see ViewPresentationController#canViewLineField(org.kuali.rice.krad.uif.view.View,
160      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
161      * java.lang.String, java.lang.Object, org.kuali.rice.krad.uif.field.Field, java.lang.String)
162      */
163     public boolean canViewLineField(View view, ViewModel model, CollectionGroup collectionGroup,
164             String collectionPropertyName, Object line, Field field, String propertyName) {
165         return true;
166     }
167 
168     /**
169      * @see ViewPresentationController#canPerformLineAction(org.kuali.rice.krad.uif.view.View,
170      * org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.container.CollectionGroup,
171      * java.lang.String, java.lang.Object, org.kuali.rice.krad.uif.element.Action, java.lang.String,
172      * java.lang.String)
173      */
174     public boolean canPerformLineAction(View view, ViewModel model, CollectionGroup collectionGroup,
175             String collectionPropertyName, Object line, Action action, String actionEvent, String actionId) {
176         return true;
177     }
178 
179 }