org.viewaframework.controller
Class DefaultViewControllerDispatcher

java.lang.Object
  extended by org.viewaframework.controller.DefaultViewControllerDispatcher
All Implemented Interfaces:
ViewControllerDispatcher

public class DefaultViewControllerDispatcher
extends Object
implements ViewControllerDispatcher

This is the class which is responsible for matching all the declared listeners to the components that are going to use them. This class is going to collect all the listeners and inject them in the components of a given view depending on the name of the view and the component.

Probably this class is going to be moved from the application context to the view context in order to make the framework more modular.

Since:
1.0
Author:
Mario Garcia

Constructor Summary
DefaultViewControllerDispatcher()
           
 
Method Summary
 void addController(String pathExpression, ViewController<? extends EventListener,? extends EventObject> controller)
           
 Map<String,ViewController<? extends EventListener,? extends EventObject>> getControllers()
          This method holds a map with the controllers sorted by viewId
 Map<String,List<ViewController<? extends EventListener,? extends EventObject>>> getViewControllers(ViewContainer view)
          This method loops all the components inserted in the controllers general list and only takes those from the view given as parameter.
 void removeController(String pathExpression)
           
 void setControllers(Map<String,ViewController<? extends EventListener,? extends EventObject>> controllers)
          This method receives all the listeners of the application sorted by view id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultViewControllerDispatcher

public DefaultViewControllerDispatcher()
Method Detail

addController

public void addController(String pathExpression,
                          ViewController<? extends EventListener,? extends EventObject> controller)
Specified by:
addController in interface ViewControllerDispatcher

getControllers

public Map<String,ViewController<? extends EventListener,? extends EventObject>> getControllers()
Description copied from interface: ViewControllerDispatcher
This method holds a map with the controllers sorted by viewId

Specified by:
getControllers in interface ViewControllerDispatcher
Returns:
The map sorted by view id

getViewControllers

public Map<String,List<ViewController<? extends EventListener,? extends EventObject>>> getViewControllers(ViewContainer view)
This method loops all the components inserted in the controllers general list and only takes those from the view given as parameter.

Specified by:
getViewControllers in interface ViewControllerDispatcher
Parameters:
view - The view whose listeners we want to collect
Returns:
The listeners that belongs to the view

removeController

public void removeController(String pathExpression)
Specified by:
removeController in interface ViewControllerDispatcher

setControllers

public void setControllers(Map<String,ViewController<? extends EventListener,? extends EventObject>> controllers)
Description copied from interface: ViewControllerDispatcher
This method receives all the listeners of the application sorted by view id.

Specified by:
setControllers in interface ViewControllerDispatcher


Copyright © 2010. All Rights Reserved.