Coverage Report - org.kuali.student.core.organization.ui.client.mvc.controller.OrgApplicationManager
 
Classes in this File Line Coverage Branch Coverage Complexity
OrgApplicationManager
0%
0/24
0%
0/2
1.125
OrgApplicationManager$1
0%
0/1
N/A
1.125
OrgApplicationManager$ORGViews
0%
0/2
N/A
1.125
 
 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.core.organization.ui.client.mvc.controller;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import org.kuali.student.common.ui.client.mvc.Callback;
 21  
 import org.kuali.student.common.ui.client.mvc.Controller;
 22  
 import org.kuali.student.common.ui.client.mvc.DelegatingViewComposite;
 23  
 import org.kuali.student.common.ui.client.mvc.View;
 24  
 
 25  
 import com.google.gwt.user.client.ui.Composite;
 26  
 import com.google.gwt.user.client.ui.SimplePanel;
 27  
 
 28  
 
 29  
 public class OrgApplicationManager extends Controller{
 30  0
     private final SimplePanel viewPanel = new SimplePanel();
 31  0
     private Controller orgProposalController = null;
 32  0
     private DelegatingViewComposite createOrgView = null;
 33  
 
 34  
     
 35  
     public OrgApplicationManager(){
 36  0
         super(OrgApplicationManager.class.getName());
 37  0
         super.initWidget(viewPanel);
 38  0
     }
 39  
 
 40  0
     public enum ORGViews {
 41  0
         CREATE_ORG
 42  
     }
 43  
     @Override
 44  
     protected <V extends Enum<?>> void getView(V viewType, Callback<View> callback) {
 45  
             
 46  0
         switch ((ORGViews) viewType) {
 47  
             case CREATE_ORG:
 48  0
                 initOrgView();
 49  0
                 callback.exec(createOrgView);
 50  0
                 break;
 51  
             default:
 52  0
                     callback.exec(null);
 53  
         }
 54  
         
 55  0
     }
 56  
     
 57  
     @Override
 58  
     public Enum<?> getViewEnumValue(String enumValue) {
 59  0
         return ORGViews.valueOf(enumValue);
 60  
     }
 61  
 
 62  
     @Override
 63  
     protected void hideView(View view) {
 64  
         
 65  0
         viewPanel.clear();
 66  0
     }
 67  
 
 68  
     @Override
 69  
     protected void renderView(View view) {
 70  0
         viewPanel.setWidget((Composite)view);
 71  
         
 72  0
     }
 73  
 
 74  
     @Override
 75  
     public void showDefaultView(final Callback<Boolean> onReadyCallback) {
 76  0
         initOrgView();
 77  0
         showView(ORGViews.CREATE_ORG, onReadyCallback);
 78  
         
 79  0
     }
 80  
     
 81  
     private View initOrgView(){
 82  0
         orgProposalController = new OrgProposalController();
 83  0
         createOrgView = new DelegatingViewComposite(OrgApplicationManager.this,orgProposalController, ORGViews.CREATE_ORG);
 84  0
         return createOrgView;
 85  
         
 86  
     }
 87  
 
 88  
         @Override
 89  
         public void collectBreadcrumbNames(List<String> names) {
 90  
                 // TODO Need to revisit for Org possibly
 91  0
         }
 92  
 
 93  
 }