Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.core
Interface Controller  view Controller download Controller.java


public interface Controller

Controllers arranged in a hierarchy of chains of command provide the structure of an application's logic, mirroring independent contexts of discrete Views and their bound model objects. Each context can be treated as an independent component. Application logic invoked by sending Controls into the chain executes in the context of a Controller that specifically recognises and responds to the Control by its ID.

For example, a Controller might manage a search panel (eg CustomerSearchView and bound CustomerSearchModel) that can be embedded within other arbitrary views. The search panel context has certain Controls that are recognised by the Controller which has no knowledge of anything outside the immediate context. Controls that the Controller doesn't explicitly recognise are simply passed to the parent Controller.

A Controller responds to Controls issued to it via the handleControl method from one of two places:

To implement a Controller see the basic implementation provided in BasicController

Version:
$Revision: 1.2 $ $Date: 2002/01/12 09:35:40 $

Method Summary
 java.lang.Object getModel()
           
 Controller getParent()
           
 Controller getTopParent()
          Find the top-most parent Controller at the head of the chain of command.
 View getView()
           
 void handleControl(Control inControl)
           Respond to a Control (from either a View or a child Controller) or pass up to the parent Controller in the chain of command if the Control is not recognised in this context.
 void setModel(java.lang.Object inModel)
           
 void setView(View inView)
           
 

Method Detail

getParent

public Controller getParent()

setModel

public void setModel(java.lang.Object inModel)

getModel

public java.lang.Object getModel()

setView

public void setView(View inView)

getView

public View getView()

handleControl

public void handleControl(Control inControl)

Respond to a Control (from either a View or a child Controller) or pass up to the parent Controller in the chain of command if the Control is not recognised in this context.


getTopParent

public Controller getTopParent()
Find the top-most parent Controller at the head of the chain of command. This is the application Controller that initialises the rest of the Controllers as children to handle specific areas of functionality.