Clover Coverage Report - Kuali Student 1.2-M5-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Aug 29 2011 05:04:27 EDT
../../../../../../../img/srcFileCovDistChart0.png 42% of files have more coverage
12   143   14   0.86
0   59   1.17   14
14     1  
1    
 
  ViewComposite       Line # 28 12 0% 14 26 0% 0.0
 
No Tests
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.ui.client.mvc;
17   
18    import java.util.List;
19   
20    import com.google.gwt.user.client.ui.Composite;
21    import com.google.gwt.user.client.ui.Widget;
22   
23    /**
24    * Abstract class implementing the View interface, which has a handle to it's controller.
25    *
26    * @author Kuali Student Team
27    */
 
28    public abstract class ViewComposite extends Composite implements View {
29    private final Controller controller;
30    private final String name;
31    private final Enum<?> viewType;
32   
33    /**
34    * Constructs a new view with an associated controller and view name
35    *
36    * @param controller
37    * the controller associated with the view
38    * @param name
39    * the view name
40    */
 
41  0 toggle public ViewComposite(Controller controller, String name, Enum<?> viewType) {
42  0 this.controller = controller;
43  0 this.name = name;
44  0 this.viewType = viewType;
45    }
46   
47    /**
48    * Called by controller before the view is displayed to allow lazy initialization or any other preparatory work to be
49    * done.
50    */
 
51  0 toggle @Override
52    public void beforeShow(final Callback<Boolean> onReadyCallback) {
53    // do nothing
54  0 onReadyCallback.exec(true);
55    }
56   
57    /**
58    * Called by the controller before the view is hidden to allow the view to perform cleanup or request confirmation from
59    * the user, etc. Can cancel the action by returning false.
60    *
61    * @return true if the view can be hidden, or false to cancel the action.
62    */
 
63  0 toggle @Override
64    public boolean beforeHide() {
65  0 return true;
66    }
67   
68    /**
69    * Returns the controller associated with the view
70    *
71    * @see org.kuali.student.common.ui.client.mvc.View#getController()
72    */
 
73  0 toggle @Override
74    public Controller getController() {
75  0 return controller;
76    }
77   
78    /**
79    * Returns the view's name
80    *
81    * @see org.kuali.student.common.ui.client.mvc.View#getName()
82    */
 
83  0 toggle @Override
84    public String getName() {
85  0 return name;
86    }
87   
88    /**
89    * Used to clear view - does nothing currently
90    *
91    * @see org.kuali.student.common.ui.client.mvc.View#clear()
92    */
 
93  0 toggle public void clear(){
94    //do nothing
95    }
96   
97   
98    /**
99    * Update the model that is associated with this view. This will normally be
100    * called by the controller.
101    *
102    * @see org.kuali.student.common.ui.client.mvc.View#updateModel()
103    */
 
104  0 toggle public void updateModel(){
105    }
106   
 
107  0 toggle @Override
108    public String collectHistory(String historyStack) {
109  0 return historyStack;
110    }
111   
 
112  0 toggle @Override
113    public void onHistoryEvent(String historyStack) {
114   
115    }
116   
 
117  0 toggle @Override
118    public void collectBreadcrumbNames(List<String> names) {
119  0 names.add(this.getName());
120    }
121   
 
122  0 toggle @Override
123    public Enum<?> getViewEnum() {
124  0 return viewType;
125   
126    };
127   
 
128  0 toggle @Override
129    public Widget asWidget() {
130    // TODO Auto-generated method stub
131  0 return this;
132    }
133   
 
134  0 toggle public boolean isExportButtonActive() {
135  0 return false;
136    }
137   
 
138  0 toggle @Override
139    public void showExport(boolean show) {
140    // Needs to be implemented on subclass where applicable
141    }
142   
143    }