org.scopemvc.view.servlet
Class ServletView

java.lang.Object
  |
  +--org.scopemvc.view.servlet.ServletView
All Implemented Interfaces:
View

public class ServletView
extends java.lang.Object
implements View

A container View to aggregate a set of Pages the allows the currently visible Page to be set.

In a servlet application, a Controller's View must 'contain' all the possible pages that the user could be interacting with because the user is free to hit the browser's forward and back buttons, use history or bookmarks etc. This "View" therefore acts as a simple container for other Views (Pages) that represent the actual interfaces that the user interacts with. It forwards any setController(org.scopemvc.core.Controller) and setBoundModel(java.lang.Object) calls to all children.

A Controller in a web application must create an instance of ServletView to put all its possible Pages into using addPage(org.scopemvc.view.servlet.Page). The Controller then setView() establishes the container as the Controller's View. To determine the Page that is shown to the user on showView, call setVisible(java.lang.String) with the Page ID.

Version:
$Revision: 1.9 $ $Date: 2002/09/05 15:41:50 $
Author:
Steve Meyfroidt

Field Summary
protected  java.util.List pages
          The child Pages this ServletView contains.
 
Constructor Summary
ServletView()
          Create a container for the Pages that a Controller manages.
 
Method Summary
 void addPage(Page inPage)
          Adds an element to the Page attribute of the ServletView object
 Page findPageByID(java.lang.String inViewID)
          TODO: document the method
 java.lang.Object getBoundModel()
          Gets the bound model
 Controller getController()
          Gets the controller
 Page getFirstPage()
          Used by ScopeServlet.findDefaultPage .
 Page getVisible()
          Gets the visible
 void issueControl(Control inControl)
          Note that ServletViews inherit their parent's Controller.
 void setBoundModel(java.lang.Object inModel)
          The passed model is bound to this view and to all children ServletViews as well.
 void setController(Controller inController)
          The parent Controller must register itself with the ServletView via this method in order to receive Controls from it.
 void setVisible(java.lang.String inViewID)
          Sets the visible
 java.lang.String toString()
          For debug.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pages

protected java.util.List pages
The child Pages this ServletView contains.

Constructor Detail

ServletView

public ServletView()
Create a container for the Pages that a Controller manages.

Method Detail

getBoundModel

public final java.lang.Object getBoundModel()
Gets the bound model

Specified by:
getBoundModel in interface View
Returns:
The boundModel value

getController

public final Controller getController()
Gets the controller

Specified by:
getController in interface View
Returns:
The controller value

issueControl

public final void issueControl(Control inControl)
Note that ServletViews inherit their parent's Controller.

Specified by:
issueControl in interface View
Parameters:
inControl - TODO: Describe the Parameter

getFirstPage

public final Page getFirstPage()
Used by ScopeServlet.findDefaultPage .

Returns:
The firstPage value

getVisible

public final Page getVisible()
Gets the visible

Returns:
The visible value

setBoundModel

public final void setBoundModel(java.lang.Object inModel)
The passed model is bound to this view and to all children ServletViews as well.

Specified by:
setBoundModel in interface View
Parameters:
inModel - The new boundModel value

setController

public final void setController(Controller inController)
The parent Controller must register itself with the ServletView via this method in order to receive Controls from it.

Specified by:
setController in interface View
Parameters:
inController - the parent Controller.

setVisible

public final void setVisible(java.lang.String inViewID)
Sets the visible

Parameters:
inViewID - The new visible value

addPage

public final void addPage(Page inPage)
Adds an element to the Page attribute of the ServletView object

Parameters:
inPage - The element to be added to the Page attribute

findPageByID

public final Page findPageByID(java.lang.String inViewID)
TODO: document the method

Parameters:
inViewID - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

toString

public java.lang.String toString()
For debug.

Overrides:
toString in class java.lang.Object
Returns:
TODO: Describe the Return Value


Copyright © 2000-2002 The Scope Team. All Rights Reserved.