View Javadoc
1   package org.kuali.student.common.ui.client.configurable.mvc.layouts;
2   
3   import org.kuali.student.common.ui.client.configurable.mvc.LayoutController;
4   import org.kuali.student.common.ui.client.mvc.View;
5   import org.kuali.student.common.ui.client.widgets.headers.KSDocumentHeader;
6   
7   import com.google.gwt.user.client.ui.FlowPanel;
8   
9   /**
10   *  A basic implementation of a LayoutController, no navigation, all showView calls must be invoked
11   * by the app.  This implementation has a header that can be manipulated.
12   * 
13   * @author Kuali Student Team
14   *
15   */
16  public class BasicLayoutWithContentHeader extends LayoutController{
17  
18  	protected FlowPanel viewContainer = new FlowPanel();
19  	protected FlowPanel layout = new FlowPanel();
20  	protected KSDocumentHeader header = new KSDocumentHeader(false);
21  
22  	public BasicLayoutWithContentHeader(String controllerId) {
23  		super();
24  		layout.add(header);
25  		layout.add(viewContainer);
26  		this.initWidget(layout);
27  		header.addStyleName("Lum-DocumentHeader-Spacing");
28  	}
29  	
30  	public KSDocumentHeader getHeader(){
31  		return header;
32  	}
33  
34  	@Override
35  	protected void hideView(View view) {
36  		viewContainer.clear();
37  	}
38  
39  	@Override
40  	protected void renderView(View view) {
41  		viewContainer.add(view.asWidget());
42  	}
43  
44  	/** 
45  	 * This version of updateModel only updates from the currentView (since only one view is shown/accessed at a time).  
46  	 * Call updateModelFromView to update from a specific view under this controller's scope.
47  	 */
48  	@Override
49  	public void updateModel() {
50  		this.updateModelFromCurrentView();
51  	}
52  
53  }