org.viewaframework.core
Interface Application

All Superinterfaces:
ApplicationContextAware, ApplicationListenerAware, ViewControllerDispatcherAware, ViewModelManagerAware
All Known Implementing Classes:
AbstractApplication, DefaultApplication

public interface Application
extends ApplicationListenerAware, ViewControllerDispatcherAware, ViewModelManagerAware, ApplicationContextAware

This is the entry point of any application. From Application object views are loaded and unloaded through its ViewManager.

It is also responsible for connecting views to its controllers through its ControllerDispatcher.

Before the first view is shown some background work is done. The application lifecycle starts at

execute(Application)

This method launches the the viewManager in the EventDispatcherThread while it creates a new Thread for the main application code.

Since:
1.0
Author:
Mario Garcia

Method Summary
 void close()
           
 Locale getLocale()
          This method returns the current locale
 String getName()
          The name of the application is not very important, but its used as default title name if the application is frame based.
 ViewManager getViewManager()
          Returns the object responsible for arranging and ordering the views.
 boolean hideOrRestore()
          This method hides or restores the application depending on its actual state.
 void initUI()
          This method is responsible for creating and launching the application UI.
 boolean isVisible()
          Returns whether the application is visible or not
 void prepare()
          This method is called before the UI has been shown.
 void prepareUI()
          This method is right before the UI has been shown.
 void setLocale(Locale locale)
          Sets the locale for the application.
 void setName(String name)
          Establish the name of the application
 void setRootView(ViewContainerFrame rootView)
          Establish the root view of the application
 void setViewManager(ViewManager manager)
          Sets the ViewManager
 void setVisible(boolean visible)
          This method sets the visibility of the root view
 
Methods inherited from interface org.viewaframework.core.ApplicationListenerAware
addApplicationListener, fireClose, fireinitUI, firePrepare, firePrepareUI, getApplicationListeners, removeApplicationListener, setApplicationListeners
 
Methods inherited from interface org.viewaframework.controller.ViewControllerDispatcherAware
getControllerDispatcher, setControllerDispatcher
 
Methods inherited from interface org.viewaframework.model.ViewModelManagerAware
getViewModelManager, setViewModelManager
 
Methods inherited from interface org.viewaframework.core.ApplicationContextAware
getApplicationContext, setApplicationContext
 

Method Detail

close

void close()

getName

String getName()
The name of the application is not very important, but its used as default title name if the application is frame based.

Returns:
the name of the application

getLocale

Locale getLocale()
This method returns the current locale

Returns:
java.util.Locale

getViewManager

ViewManager getViewManager()
Returns the object responsible for arranging and ordering the views.

Returns:
The view manager.
See Also:
ViewManager}

hideOrRestore

boolean hideOrRestore()
This method hides or restores the application depending on its actual state.

Returns:
The state after executing the method

initUI

void initUI()
            throws ApplicationException
This method is responsible for creating and launching the application UI. It should create the UI within the EventDispatchThread.

Throws:
ApplicationException

isVisible

boolean isVisible()
Returns whether the application is visible or not

Returns:

prepare

void prepare()
             throws ApplicationException
This method is called before the UI has been shown. This method shouldn't be used for configuring the UI, use configUI() instead.

Throws:
ApplicationException

prepareUI

void prepareUI()
               throws ApplicationException
This method is right before the UI has been shown. It should be used for configuring the application UI.

Throws:
ApplicationException

setLocale

void setLocale(Locale locale)
Sets the locale for the application. All ResourceBundle messages could be i18n

Parameters:
locale -

setName

void setName(String name)
Establish the name of the application

Parameters:
name - the name to set

setRootView

void setRootView(ViewContainerFrame rootView)
Establish the root view of the application

Parameters:
rootView -
Since:
1.0.4

setViewManager

void setViewManager(ViewManager manager)
                    throws ViewManagerException
Sets the ViewManager

Parameters:
manager. - If a ViewManager has been already set then an exception should be thrown.
Throws:
ViewManagerException
See Also:
ViewManager}

setVisible

void setVisible(boolean visible)
This method sets the visibility of the root view

Parameters:
visible -
Since:
1.0.4


Copyright © 2010. All Rights Reserved.