|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.richclient.application.config.ApplicationLifecycleAdvisor
public abstract class ApplicationLifecycleAdvisor
Advisor for the Application. This class provides the startingPageId, an exceptionHandler for uncaught exceptions, application wide window structures(menu/toolbar/statusbar) and a number of hook methods that are called in the startup/closing process.
The sequence in which the hooks are called is as follows:
Application CreationsetApplication(Application)
onPreInitialize(Application)
Application StartonPreStartup()
ApplicationWindow CreationsetOpeningWindow(ApplicationWindow)
onPreWindowOpen(ApplicationWindowConfigurer)
createWindowCommandManager()
getMenuBarCommandGroup()
getToolBarCommandGroup()
getStatusBar()
onCommandsCreated(ApplicationWindow)
ApplicationWindow Creating the JFrameonWindowCreated(ApplicationWindow)
ApplicationWindow Shows JFrame (setVisible(true))onWindowOpened(ApplicationWindow)
onPostStartup()
The remaining hook is called when the ApplicationWindow is closed:
onPreWindowClose(ApplicationWindow)
.
Constructor Summary | |
---|---|
ApplicationLifecycleAdvisor()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
After properties are set, register the exceptionHandler. |
ApplicationWindowCommandManager |
createWindowCommandManager()
Create a ApplicationWindowCommandManager for the application. |
protected Application |
getApplication()
|
protected ApplicationServices |
getApplicationServices()
|
ApplicationSessionInitializer |
getApplicationSessionInitializer()
|
CommandGroup |
getMenuBarCommandGroup()
Create the menuBar for the application. |
protected ApplicationWindow |
getOpeningWindow()
|
RegisterableExceptionHandler |
getRegisterableExceptionHandler()
|
String |
getStartingPageId()
|
StatusBar |
getStatusBar()
Create the statusBar for the application. |
CommandGroup |
getToolBarCommandGroup()
Create the toolBar for the application. |
void |
onCommandsCreated(ApplicationWindow window)
Hook called right after commands are initialized. |
void |
onPostStartup()
Hook called right after the applicationWindow is created. |
void |
onPreInitialize(Application application)
Hook called right after the application has been created. |
void |
onPreStartup()
Hook called right before the applicationWindow is created. |
boolean |
onPreWindowClose(ApplicationWindow window)
Check if the ApplicationWindow can close. |
void |
onPreWindowOpen(ApplicationWindowConfigurer configurer)
Hook called right before the application opens a window. |
void |
onShutdown()
Hook called right afther the application is closed. |
void |
onWindowCreated(ApplicationWindow window)
Hook called right after the window (JFrame) of the application is created. |
void |
onWindowOpened(ApplicationWindow window)
Hook called right after the window (JFrame) of the application is shown (setVisible(true)). |
void |
setApplication(Application application)
|
void |
setApplicationSessionInitializer(ApplicationSessionInitializer applicationSessionInitializer)
|
void |
setOpeningWindow(ApplicationWindow window)
|
void |
setRegisterableExceptionHandler(RegisterableExceptionHandler registerableExceptionHandler)
Sets the exception handler which will be registered upon initialization to handle uncaught throwables. |
void |
setStartingPageId(String pageDescriptorId)
This is used to allow the ViewDescriptor to be lazily created when the ApplicationWindow is opened. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationLifecycleAdvisor()
Method Detail |
---|
public void setStartingPageId(String pageDescriptorId)
pageDescriptorId
- id of the pageDescriptor bean to show on startup.getStartingPageId()
public void setRegisterableExceptionHandler(RegisterableExceptionHandler registerableExceptionHandler)
registerableExceptionHandler
- the exception handler which will
handle uncaught throwablespublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public String getStartingPageId()
protected Application getApplication()
protected ApplicationServices getApplicationServices()
public void onPreInitialize(Application application)
application
- the application.public void onPreStartup()
public void onPostStartup()
public void onShutdown()
public void setOpeningWindow(ApplicationWindow window)
window
- the openingWindow.public void onPreWindowOpen(ApplicationWindowConfigurer configurer)
configurer
- protected final ApplicationWindow getOpeningWindow()
public ApplicationWindowCommandManager createWindowCommandManager()
ApplicationWindowCommandManager
for the application.
public CommandGroup getMenuBarCommandGroup()
public CommandGroup getToolBarCommandGroup()
public StatusBar getStatusBar()
public void onCommandsCreated(ApplicationWindow window)
window
- applicationWindow.public void onWindowCreated(ApplicationWindow window)
window
- applicationWindow.public void onWindowOpened(ApplicationWindow window)
window
- applicationWindow.public boolean onPreWindowClose(ApplicationWindow window)
window
- the applicationWindow that should be closed.
true
if the window may close.public RegisterableExceptionHandler getRegisterableExceptionHandler()
public void setApplication(Application application)
application
- set the current application.public ApplicationSessionInitializer getApplicationSessionInitializer()
public void setApplicationSessionInitializer(ApplicationSessionInitializer applicationSessionInitializer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |