View Javadoc

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