org.viewaframework.controller
Interface ViewController<EL extends EventListener,EO extends EventObject>

All Superinterfaces:
InvocationHandler, ListenerProxy<EL,EO>
All Known Implementing Classes:
AboutActionController, AbstractActionController, AbstractMouseClickController, AbstractOpenerController, AbstractViewController, AbstractViewControllerWorker, DefaultWindowController, DetailViewController, EditActionController, ExitActionController, LoginViewController, MasterViewController, MasterViewTableController

public interface ViewController<EL extends EventListener,EO extends EventObject>
extends ListenerProxy<EL,EO>

Controller that handles the action performed from a given view. The original controller represented by the

Class getSupportedClass()

Redirects its call to this listener. It implements ListenerProxy because proxys created during the viewInit method should implement getTargetController method. This method allows the proxy to give some information about the listener it's proxying. Without it proxys can't be removed from the view.

Since:
1.0
Author:
Mario Garcia

Method Summary
 void executeHandler(ViewContainer view, EO eventObject)
          Its the callback method.
 Class<EL> getSupportedClass()
          This method tells the controller the source listener to be proxied.
 ViewManager getViewManager()
          Returns the application's current view manager
 void handleView(ViewContainer view, EO eventObject)
          This is the method where the logical handling of the data should be called.
 void postHandlingView(ViewContainer view, EO eventObject)
          Used for some UI updating before the logical code has been called.
 void preHandlingView(ViewContainer view, EO eventObject)
          Used for some UI updating once the logical code has been called.
 
Methods inherited from interface org.viewaframework.controller.ListenerProxy
getTargetController
 
Methods inherited from interface java.lang.reflect.InvocationHandler
invoke
 

Method Detail

executeHandler

void executeHandler(ViewContainer view,
                    EO eventObject)
Its the callback method. It is called from a given component of the view in order to perform some action. It should call first to preHandlingView() for cleaning up some information data then it calls to handleView(..) and finally calls to postHandlingView(...).

Notice that depending on the listener proxied the EventObject should be casted in order to get the desired information from it.

Parameters:
view - The view where this listener belongs
eventObject - The event fired by the proxied listener.

getSupportedClass

Class<EL> getSupportedClass()
This method tells the controller the source listener to be proxied.

Returns:
The type of the proxied listener

getViewManager

ViewManager getViewManager()
Returns the application's current view manager

Returns:
The current view manager

handleView

void handleView(ViewContainer view,
                EO eventObject)
This is the method where the logical handling of the data should be called. Any UI call should be done in post/pre-handling methods. It is important to notice that the code executed within this method should be running in other thread than EventDispathThread.

Parameters:
view -
eventObject -

postHandlingView

void postHandlingView(ViewContainer view,
                      EO eventObject)
                      throws ViewException
Used for some UI updating before the logical code has been called.

Parameters:
view -
eventObject -
Throws:
ViewException

preHandlingView

void preHandlingView(ViewContainer view,
                     EO eventObject)
Used for some UI updating once the logical code has been called.

Parameters:
view -
eventObject -


Copyright © 2010. All Rights Reserved.