org.springframework.richclient.application.support
Class AbstractApplicationWindow

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.application.support.AbstractApplicationWindow
All Implemented Interfaces:
WindowFocusListener, EventListener, ApplicationWindow
Direct Known Subclasses:
DefaultApplicationWindow

public abstract class AbstractApplicationWindow
extends Object
implements ApplicationWindow, WindowFocusListener

Abstract helper implementation for ApplicationWindow.


Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractApplicationWindow()
           
AbstractApplicationWindow(int number)
           
 
Method Summary
 void addPageListener(PageListener listener)
           
protected  void applyStandardLayout(JFrame windowControl, ApplicationWindowConfigurer configurer)
           
 boolean close()
          Close this window.
protected  JMenuBar createMenuBarControl()
           
protected  JFrame createNewWindowControl()
           
protected  ApplicationPage createPage(ApplicationWindow window, String pageDescriptorId)
           
protected  ApplicationPage createPage(PageDescriptor descriptor)
          Factory method for creating the page area managed by this window.
protected  JComponent createStatusBarControl()
           
protected  JComponent createToolBarControl()
           
protected abstract  JComponent createWindowContentPane()
          Implementors create the component that contains the contents of this window.
protected  ApplicationLifecycleAdvisor getAdvisor()
           
 CommandManager getCommandManager()
           
 JFrame getControl()
           
 CommandGroup getMenuBar()
           
 int getNumber()
           
 ApplicationPage getPage()
           
protected  PageDescriptor getPageDescriptor(String pageDescriptorId)
           
protected  ApplicationServices getServices()
           
 Iterator getSharedCommands()
           
 StatusBar getStatusBar()
           
 CommandGroup getToolBar()
           
protected  ApplicationWindowConfigurer getWindowConfigurer()
           
protected  void init()
           
protected  ApplicationWindowConfigurer initWindowConfigurer()
           
protected  void initWindowControl(JFrame windowControl)
           
 boolean isControlCreated()
           
protected  void prepareWindowForView(JFrame windowControl, ApplicationWindowConfigurer configurer)
           
 void removePageListener(PageListener listener)
           
protected abstract  void setActivePage(ApplicationPage page)
          Set the given ApplicationPage active (visible + selected if applicable)
 void setWindowManager(WindowManager windowManager)
           
 void showPage(ApplicationPage page)
          Show the given page in this window.
 void showPage(PageDescriptor pageDescriptor)
           
 void showPage(String pageId)
          Show the given page in this window.
 void windowGainedFocus(WindowEvent e)
          When gaining focus, set this window as the active one on it's manager.
 void windowLostFocus(WindowEvent e)
          When losing focus no action is done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.apache.commons.logging.Log logger
Constructor Detail

AbstractApplicationWindow

public AbstractApplicationWindow()

AbstractApplicationWindow

public AbstractApplicationWindow(int number)
Method Detail

init

protected void init()

getNumber

public int getNumber()
Specified by:
getNumber in interface ApplicationWindow

getPage

public ApplicationPage getPage()
Specified by:
getPage in interface ApplicationWindow

getAdvisor

protected ApplicationLifecycleAdvisor getAdvisor()

getServices

protected ApplicationServices getServices()

getWindowConfigurer

protected ApplicationWindowConfigurer getWindowConfigurer()

initWindowConfigurer

protected ApplicationWindowConfigurer initWindowConfigurer()

getCommandManager

public CommandManager getCommandManager()
Specified by:
getCommandManager in interface ApplicationWindow

getSharedCommands

public Iterator getSharedCommands()
Specified by:
getSharedCommands in interface ApplicationWindow

getMenuBar

public CommandGroup getMenuBar()
Specified by:
getMenuBar in interface ApplicationWindow

getToolBar

public CommandGroup getToolBar()
Specified by:
getToolBar in interface ApplicationWindow

getStatusBar

public StatusBar getStatusBar()
Specified by:
getStatusBar in interface ApplicationWindow

setWindowManager

public void setWindowManager(WindowManager windowManager)
Specified by:
setWindowManager in interface ApplicationWindow

showPage

public void showPage(String pageId)
Show the given page in this window.

Specified by:
showPage in interface ApplicationWindow
Parameters:
pageId - the page to show, identified by id
Throws:
IllegalArgumentException - if pageId == null

showPage

public void showPage(PageDescriptor pageDescriptor)
Specified by:
showPage in interface ApplicationWindow

showPage

public void showPage(ApplicationPage page)
Show the given page in this window.

Specified by:
showPage in interface ApplicationWindow
Parameters:
page - the page to show
Throws:
IllegalArgumentException - if page == null

createPage

protected final ApplicationPage createPage(ApplicationWindow window,
                                           String pageDescriptorId)

createPage

protected ApplicationPage createPage(PageDescriptor descriptor)
Factory method for creating the page area managed by this window. Subclasses may override to return a custom page implementation.

Parameters:
descriptor - The page descriptor
Returns:
The window's page

getPageDescriptor

protected PageDescriptor getPageDescriptor(String pageDescriptorId)

initWindowControl

protected void initWindowControl(JFrame windowControl)

applyStandardLayout

protected void applyStandardLayout(JFrame windowControl,
                                   ApplicationWindowConfigurer configurer)

setActivePage

protected abstract void setActivePage(ApplicationPage page)
Set the given ApplicationPage active (visible + selected if applicable)

Parameters:
page - the ApplicationPage

prepareWindowForView

protected void prepareWindowForView(JFrame windowControl,
                                    ApplicationWindowConfigurer configurer)

createNewWindowControl

protected JFrame createNewWindowControl()

getControl

public JFrame getControl()
Specified by:
getControl in interface ApplicationWindow

isControlCreated

public boolean isControlCreated()

createMenuBarControl

protected JMenuBar createMenuBarControl()

createToolBarControl

protected JComponent createToolBarControl()

createStatusBarControl

protected JComponent createStatusBarControl()

addPageListener

public void addPageListener(PageListener listener)
Specified by:
addPageListener in interface ApplicationWindow

removePageListener

public void removePageListener(PageListener listener)
Specified by:
removePageListener in interface ApplicationWindow

close

public boolean close()
Close this window. First checks with the advisor by calling the ApplicationLifecycleAdvisor.onPreWindowClose(ApplicationWindow) method. Then tries to close it's currentPage. If both are successfull, the window will be disposed and removed from the WindowManager.

Specified by:
close in interface ApplicationWindow
Returns:
boolean true if both, the advisor and the currentPage allow the closing action.

windowGainedFocus

public void windowGainedFocus(WindowEvent e)
When gaining focus, set this window as the active one on it's manager.

Specified by:
windowGainedFocus in interface WindowFocusListener

windowLostFocus

public void windowLostFocus(WindowEvent e)
When losing focus no action is done. This way the last focussed window will stay listed as the activeWindow.

Specified by:
windowLostFocus in interface WindowFocusListener

createWindowContentPane

protected abstract JComponent createWindowContentPane()
Implementors create the component that contains the contents of this window.

Returns:
the content pane


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.