net.sf.doolin.gui.app
Class GUIApplication

java.lang.Object
  extended by net.sf.doolin.context.AbstractApplication
      extended by net.sf.doolin.gui.app.GUIApplication
All Implemented Interfaces:
Application, org.springframework.context.ApplicationContextAware

public class GUIApplication
extends AbstractApplication

GUI application manager.

Author:
Damien Coraboeuf

Constructor Summary
GUIApplication()
          Constructor
 
Method Summary
 void exit(int code)
          Exits the application
<T> T
getBean(Class<T> idClass)
          If the bean is not defined in the Spring configuration, searches in the predefined services.
static Class<?> getIdClass()
          Returns the class that identifies the application
 InfoService getInfoService()
          Gets the information service for the application
 Parameters getParameters()
          Gets the parameter service for this application.
 GUIPreferences getPreferences()
          Gets the preferences for the application
 GUIStartup getStartup()
          Returns the start-up policy
 void init()
          Initialises the defaults services.
protected  void initDefaultServices()
          Initialises the defaults services.
static void launchWithArgs(String[] paths, String[] args)
          Launches a GUIApplication on the Swing EDT thread.
protected
<T> void
registerService(Class<T> serviceClass, T service)
          Registers a default service for this application
 void setStartup(GUIStartup startup)
          Sets the start-up policy for this application.
 void start(String[] arguments)
          Delegates to the start-up policy.
 
Methods inherited from class net.sf.doolin.context.AbstractApplication
getBean, isDefined, isDefined, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIApplication

public GUIApplication()
Constructor

Method Detail

getIdClass

public static Class<?> getIdClass()
Returns the class that identifies the application

Returns:
Identifying class

launchWithArgs

public static void launchWithArgs(String[] paths,
                                  String[] args)
Launches a GUIApplication on the Swing EDT thread.

Parameters:
paths - Paths for the application configuration
args - Arguments for the application

exit

public void exit(int code)
Exits the application

Parameters:
code - Exit code

getBean

public <T> T getBean(Class<T> idClass)
If the bean is not defined in the Spring configuration, searches in the predefined services.

Overrides:
getBean in class AbstractApplication
Type Parameters:
T - Type of the bean
Parameters:
idClass - Class as an ID
Returns:
Bean

getInfoService

public InfoService getInfoService()
Gets the information service for the application

Returns:
Information service

getParameters

public Parameters getParameters()
Gets the parameter service for this application.

Returns:
Parameter service

getPreferences

public GUIPreferences getPreferences()
Gets the preferences for the application

Returns:
Preferences

getStartup

public GUIStartup getStartup()
Returns the start-up policy

Returns:
Startup policy

init

@PostConstruct
public void init()
Initialises the defaults services.


initDefaultServices

protected void initDefaultServices()
Initialises the defaults services.


registerService

protected <T> void registerService(Class<T> serviceClass,
                                   T service)
Registers a default service for this application

Type Parameters:
T - Type of service
Parameters:
serviceClass - Service interface
service - Service implementation

setStartup

public void setStartup(GUIStartup startup)
Sets the start-up policy for this application.

Parameters:
startup - Startup policy

start

public void start(String[] arguments)
Delegates to the start-up policy.

Parameters:
arguments - Starting arguments
See Also:
GUIStartup.start(GUIApplication, String[])


Copyright © 2011. All Rights Reserved.