ch.elca.el4j.services.gui.swing
Class GUIApplication

java.lang.Object
  extended by org.jdesktop.application.AbstractBean
      extended by org.jdesktop.application.Application
          extended by org.jdesktop.application.SingleFrameApplication
              extended by ch.elca.el4j.services.gui.swing.GUIApplication
All Implemented Interfaces:
ActionsContextAware
Direct Known Subclasses:
AbstractMDIApplication, DockingApplication

public abstract class GUIApplication
extends org.jdesktop.application.SingleFrameApplication
implements ActionsContextAware

Parent class for GUI applications. (For MDI applications refer to MDIApplication) Additional features:

Author:
Stefan Wismer (SWI)
File-location:
GUIApplication
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdesktop.application.Application
org.jdesktop.application.Application.ExitListener
 
Field Summary
protected  ActionsContext actionsContext
          The Actions context for resolving action names.
protected  GenericConfig config
          The configuration.
protected  ApplicationContext springContext
          The Spring context.
 
Constructor Summary
GUIApplication()
           
 
Method Summary
 Action getAction(Object object, String actionName)
          Returns the action object for a specific object and action name.
 ActionsContext getActionsContext()
          
 GenericConfig getConfig()
           
static GUIApplication getInstance()
           
 ApplicationContext getSpringContext()
           
 String getString(String id)
          Returns the string for a specific resource id.
static
<T extends GUIApplication>
void
launch(Class<T> applicationClass, String[] args, ModuleApplicationContextConfiguration contextConfig)
          Launch the application and do some adaptations for Spring.
 void setConfig(GenericConfig config)
           
 void setSpringContext(ApplicationContext springContext)
          Sets the Spring context.
 void show(ApplicationFrame frame)
          Show a frame.
 void show(JComponent component)
          Show a nested component.
 void show(String beanName)
          Show a component which should be created by Spring.
 void showMain()
          Show the main frame.
 void showMain(JComponent component)
          Show the main frame.
 void showMain(JFrame frame)
          Show the main frame.
protected  void shutdown()
          
 
Methods inherited from class org.jdesktop.application.SingleFrameApplication
configureWindow, getMainFrame, getMainView, setMainFrame, show, show, show
 
Methods inherited from class org.jdesktop.application.Application
addExitListener, create, end, exit, exit, getContext, getExitListeners, getInstance, hide, initialize, launch, quit, ready, removeExitListener, setInstance, startup, waitForReady
 
Methods inherited from class org.jdesktop.application.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

springContext

protected ApplicationContext springContext
The Spring context.


actionsContext

protected ActionsContext actionsContext
The Actions context for resolving action names.


config

protected GenericConfig config
The configuration. This is used to set constant parameters like colors to mark values as invalid or default renderers.

Constructor Detail

GUIApplication

public GUIApplication()
Method Detail

getSpringContext

public ApplicationContext getSpringContext()
Returns:
the Spring application context

setSpringContext

public void setSpringContext(ApplicationContext springContext)
Sets the Spring context.

Parameters:
springContext - the new Spring context

getConfig

public GenericConfig getConfig()
Returns:
the current configuration

setConfig

public void setConfig(GenericConfig config)
Parameters:
config - the configuration to set

launch

public static <T extends GUIApplication> void launch(Class<T> applicationClass,
                                                     String[] args,
                                                     ModuleApplicationContextConfiguration contextConfig)
Launch the application and do some adaptations for Spring.

Parameters:
applicationClass - the application class to launch
args - command line arguments
contextConfig - spring application context configuration

getInstance

public static GUIApplication getInstance()
Returns:
the current instance

show

public void show(String beanName)
          throws NoSuchBeanDefinitionException
Show a component which should be created by Spring.

Parameters:
beanName - the Spring bean name
Throws:
NoSuchBeanDefinitionException

show

public void show(JComponent component)
Show a nested component.

Overrides:
show in class org.jdesktop.application.SingleFrameApplication
Parameters:
component - the component to show

show

public void show(ApplicationFrame frame)
Show a frame.

Parameters:
frame - the frame to show

showMain

public void showMain(JFrame frame)
Show the main frame.

Parameters:
frame - the main frame

showMain

public void showMain(JComponent component)
Show the main frame.

Parameters:
component - the component to put into the main frame

showMain

public void showMain()
Show the main frame.


getActionsContext

public ActionsContext getActionsContext()

Specified by:
getActionsContext in interface ActionsContextAware
Returns:
the Actions context.

getAction

public Action getAction(Object object,
                        String actionName)
Returns the action object for a specific object and action name.

Parameters:
object - the object containing actions
actionName - the action name as String
Returns:
the corresponding action object

getString

public String getString(String id)
Returns the string for a specific resource id.

Parameters:
id - the resource id
Returns:
the corresponding string

shutdown

protected void shutdown()

Overrides:
shutdown in class org.jdesktop.application.SingleFrameApplication


Copyright © 2005-2011 ELCA. All Rights Reserved.