org.springframework.richclient.application.support
Class AbstractApplicationPage

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.factory.AbstractControlFactory
          extended by org.springframework.richclient.application.support.AbstractApplicationPage
All Implemented Interfaces:
ApplicationPage, ControlFactory
Direct Known Subclasses:
DefaultApplicationPage, DesktopApplicationPage, FlexDockApplicationPage, TabbedApplicationPage, VLDockingApplicationPage

public abstract class AbstractApplicationPage
extends AbstractControlFactory
implements ApplicationPage

Abstract "convenience" implementation of ApplicationPage.

Author:
Peter De Bruycker

Field Summary
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Constructor Summary
AbstractApplicationPage()
           
AbstractApplicationPage(ApplicationWindow window, PageDescriptor pageDescriptor)
           
 
Method Summary
protected  void addPageComponent(PageComponent pageComponent)
          Adds the pageComponent to the components list while registering listeners and firing appropriate events.
 void addPageComponentListener(PageComponentListener listener)
           
 boolean close()
          Closes this ApplicationPage.
 boolean close(PageComponent pageComponent)
          Closes the given PageComponent.
 boolean closeAllEditors()
           
protected  PageComponent createPageComponent(PageComponentDescriptor descriptor)
          Creates a PageComponent for the given PageComponentDescriptor.
protected  PageComponentPane createPageComponentPane(PageComponent pageComponent)
           
protected abstract  void doAddPageComponent(PageComponent pageComponent)
          This method must add the given PageComponent in the ui.
protected abstract  void doRemovePageComponent(PageComponent pageComponent)
          This method must remove the given PageComponent from the ui.
protected  PageComponent findPageComponent(String viewDescriptorId)
           
protected  void fireClosed(PageComponent component)
           
protected  void fireFocusGained(PageComponent component)
           
protected  void fireFocusLost(PageComponent component)
           
protected  void fireOpened(PageComponent component)
           
 PageComponent getActiveComponent()
          Returns the active PageComponent, or null if none.
 ApplicationEventMulticaster getApplicationEventMulticaster()
           
 String getId()
           
 Set getPageComponents()
           
protected  PageDescriptor getPageDescriptor()
           
protected  ViewDescriptor getViewDescriptor(String viewDescriptorId)
           
 ApplicationWindow getWindow()
           
protected abstract  boolean giveFocusTo(PageComponent pageComponent)
          This method must transfer the focus to the given PageComponent.
 void openEditor(Object editorInput)
           
 void removePageComponentListener(PageComponentListener listener)
           
protected  void setActiveComponent()
           
 void setActiveComponent(PageComponent pageComponent)
          Activates the given PageComponent.
 void setApplicationWindow(ApplicationWindow window)
           
 void setDescriptor(PageDescriptor descriptor)
           
 void showView(String viewDescriptorId)
           
 void showView(ViewDescriptor viewDescriptor)
           
protected  void updatePageComponentProperties(PageComponent pageComponent)
          Called when the PageComponent changes any of its properties (display name, caption, icon, ...).
 
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory
createControl, createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.factory.ControlFactory
getControl
 

Constructor Detail

AbstractApplicationPage

public AbstractApplicationPage()

AbstractApplicationPage

public AbstractApplicationPage(ApplicationWindow window,
                               PageDescriptor pageDescriptor)
Method Detail

updatePageComponentProperties

protected void updatePageComponentProperties(PageComponent pageComponent)
Called when the PageComponent changes any of its properties (display name, caption, icon, ...).

This method should be overridden when these changes must be reflected in the ui.

Parameters:
pageComponent - the PageComponent that has changed

findPageComponent

protected PageComponent findPageComponent(String viewDescriptorId)

addPageComponentListener

public void addPageComponentListener(PageComponentListener listener)
Specified by:
addPageComponentListener in interface ApplicationPage

removePageComponentListener

public void removePageComponentListener(PageComponentListener listener)
Specified by:
removePageComponentListener in interface ApplicationPage

fireOpened

protected void fireOpened(PageComponent component)

fireFocusGained

protected void fireFocusGained(PageComponent component)

setActiveComponent

protected void setActiveComponent()

getViewDescriptor

protected ViewDescriptor getViewDescriptor(String viewDescriptorId)

getActiveComponent

public PageComponent getActiveComponent()
Returns the active PageComponent, or null if none.

Specified by:
getActiveComponent in interface ApplicationPage
Returns:
the active PageComponent

setActiveComponent

public void setActiveComponent(PageComponent pageComponent)
Activates the given PageComponent. Does nothing if it is already the active one.

Does nothing if this ApplicationPage doesn't contain the given PageComponent.

Specified by:
setActiveComponent in interface ApplicationPage
Parameters:
pageComponent - the PageComponent

fireFocusLost

protected void fireFocusLost(PageComponent component)

doAddPageComponent

protected abstract void doAddPageComponent(PageComponent pageComponent)
This method must add the given PageComponent in the ui.

Implementors may choose to add the PageComponent's control directly, or add the PageComponentPane's control.

Parameters:
pageComponent - the PageComponent to add

doRemovePageComponent

protected abstract void doRemovePageComponent(PageComponent pageComponent)
This method must remove the given PageComponent from the ui.

Parameters:
pageComponent - the PageComponent to remove

giveFocusTo

protected abstract boolean giveFocusTo(PageComponent pageComponent)
This method must transfer the focus to the given PageComponent. This could involve making an internal frame visible, selecting a tab in a tabbed pane, ...

Parameters:
pageComponent - the PageComponent
Returns:
true if the operation was successful, false otherwise

createPageComponentPane

protected PageComponentPane createPageComponentPane(PageComponent pageComponent)

fireClosed

protected void fireClosed(PageComponent component)

getId

public String getId()
Specified by:
getId in interface ApplicationPage

getWindow

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

close

public boolean close(PageComponent pageComponent)
Closes the given PageComponent. This method disposes the PageComponent, triggers all necessary events ("focus lost" and "closed"), and will activate another PageComponent (if there is one).

Returns false if this ApplicationPage doesn't contain the given PageComponent.

Specified by:
close in interface ApplicationPage
Parameters:
pageComponent - the PageComponent
Returns:
boolean true if pageComponent was successfully closed.

close

public boolean close()
Closes this ApplicationPage. This method calls close(PageComponent) for each open PageComponent.

Specified by:
close in interface ApplicationPage
Returns:
true if the operation was successful, false otherwise.

showView

public void showView(String viewDescriptorId)
Specified by:
showView in interface ApplicationPage

showView

public void showView(ViewDescriptor viewDescriptor)
Specified by:
showView in interface ApplicationPage

openEditor

public void openEditor(Object editorInput)
Specified by:
openEditor in interface ApplicationPage

closeAllEditors

public boolean closeAllEditors()
Specified by:
closeAllEditors in interface ApplicationPage

addPageComponent

protected void addPageComponent(PageComponent pageComponent)
Adds the pageComponent to the components list while registering listeners and firing appropriate events. (not yet setting the component as the active one)

Parameters:
pageComponent - the pageComponent to add.

createPageComponent

protected PageComponent createPageComponent(PageComponentDescriptor descriptor)
Creates a PageComponent for the given PageComponentDescriptor.

Parameters:
descriptor - the descriptor
Returns:
the created PageComponent

getPageComponents

public Set getPageComponents()

setApplicationWindow

public final void setApplicationWindow(ApplicationWindow window)

setDescriptor

public final void setDescriptor(PageDescriptor descriptor)

getPageDescriptor

protected PageDescriptor getPageDescriptor()

getApplicationEventMulticaster

public ApplicationEventMulticaster getApplicationEventMulticaster()


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