org.esa.beam.framework.ui.application.support
Class AbstractApplicationPage

java.lang.Object
  extended by org.esa.beam.framework.ui.application.support.AbstractControlFactory
      extended by org.esa.beam.framework.ui.application.support.AbstractApplicationPage
All Implemented Interfaces:
ApplicationPage, ControlFactory, PageComponentService
Direct Known Subclasses:
VisatApplicationPage

public abstract class AbstractApplicationPage
extends AbstractControlFactory
implements ApplicationPage

Abstract "convenience" implementation of ApplicationPage.

Author:
Marco Peters (inspired by Spring RCP)

Constructor Summary
protected AbstractApplicationPage()
           
 
Method Summary
 void addPageComponentListener(PageComponentListener listener)
           
 ToolView addToolView(ToolViewDescriptor viewDescriptor)
           
 boolean close()
          Closes this ApplicationPage.
 void close(PageComponent pageComponent)
          Closes the given PageComponent.
 boolean closeAllDocViews()
           
protected  ToolView createToolView(ToolViewDescriptor descriptor)
          Creates a PageComponent for the given PageComponentDescriptor.
protected abstract  PageComponentPane createToolViewPane(ToolView toolView)
           
protected abstract  void doAddToolView(ToolView toolView)
          This method must add the given tool view in the UI.
protected abstract  void doHideToolView(ToolView toolView)
          This method must hide the given tool view in the UI.
protected abstract  void doRemoveToolView(ToolView toolView)
          This method must remove the given tool view from the UI.
protected abstract  void doShowToolView(ToolView toolView)
          This method must show the given tool view in the UI.
protected  void fireClosed(PageComponent component)
           
protected  void fireFocusGained(PageComponent component)
           
protected  void fireFocusLost(PageComponent component)
           
protected  void fireHidden(PageComponent component)
           
protected  void fireOpened(PageComponent component)
           
protected  void fireShown(PageComponent component)
           
 PageComponent getActiveComponent()
          Returns the active PageComponent, or null if none.
 PageComponent getPageComponent(String id)
           
 ToolView getToolView(String id)
           
abstract  ToolViewDescriptor getToolViewDescriptor(String id)
           
 ToolView[] getToolViews()
           
protected abstract  boolean giveFocusTo(PageComponent pageComponent)
          This method must transfer the focus to the given PageComponent.
 void hideToolView(ToolView toolView)
           
 DocView openDocView(Object editorInput)
           
protected  void pageComponentChanged(PropertyChangeEvent evt)
          Called when the PageComponent changes any of its properties (display name, caption, icon, ...).
 void removePageComponentListener(PageComponentListener listener)
           
protected abstract  void setActiveComponent()
          Set the active page component by determing it.
 void setActiveComponent(PageComponent pageComponent)
          Activates the given PageComponent.
 ToolView showToolView(String id)
           
 ToolView showToolView(ToolViewDescriptor viewDescriptor)
           
 
Methods inherited from class org.esa.beam.framework.ui.application.support.AbstractControlFactory
createControl, createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.esa.beam.framework.ui.application.ApplicationPage
getCommandManager, getSelectionManager, getWindow
 
Methods inherited from interface org.esa.beam.framework.ui.application.ControlFactory
getControl
 

Constructor Detail

AbstractApplicationPage

protected AbstractApplicationPage()
Method Detail

addPageComponentListener

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

removePageComponentListener

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

getActiveComponent

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

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

close

public void 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).

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

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

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 successfull, false otherwise.

getPageComponent

public PageComponent getPageComponent(String id)
Specified by:
getPageComponent in interface ApplicationPage

getToolViews

public ToolView[] getToolViews()
Specified by:
getToolViews in interface ApplicationPage

getToolView

public ToolView getToolView(String id)
Specified by:
getToolView in interface ApplicationPage

getToolViewDescriptor

public abstract ToolViewDescriptor getToolViewDescriptor(String id)

addToolView

public ToolView addToolView(ToolViewDescriptor viewDescriptor)
Specified by:
addToolView in interface ApplicationPage

showToolView

public ToolView showToolView(String id)
Specified by:
showToolView in interface ApplicationPage

showToolView

public ToolView showToolView(ToolViewDescriptor viewDescriptor)
Specified by:
showToolView in interface ApplicationPage

hideToolView

public void hideToolView(ToolView toolView)
Specified by:
hideToolView in interface ApplicationPage

openDocView

public DocView openDocView(Object editorInput)
Specified by:
openDocView in interface ApplicationPage

closeAllDocViews

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

createToolView

protected ToolView createToolView(ToolViewDescriptor descriptor)
Creates a PageComponent for the given PageComponentDescriptor.

Parameters:
descriptor - the descriptor
Returns:
the created PageComponent

pageComponentChanged

protected void pageComponentChanged(PropertyChangeEvent evt)
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:
evt -

fireOpened

protected void fireOpened(PageComponent component)

fireClosed

protected void fireClosed(PageComponent component)

fireShown

protected void fireShown(PageComponent component)

fireHidden

protected void fireHidden(PageComponent component)

fireFocusGained

protected void fireFocusGained(PageComponent component)

fireFocusLost

protected void fireFocusLost(PageComponent component)

setActiveComponent

protected abstract void setActiveComponent()
Set the active page component by determing it. This is usually achieved by asking the component manager used in a concrete application page for its activated component. For example, if the component manager is a JDesktopPane, the active component is determined by its active JInternalFrame.


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.

Parameters:
pageComponent - the PageComponent

doAddToolView

protected abstract void doAddToolView(ToolView toolView)
This method must add the given tool view in the UI.

Implementors may choose to add the tool view's control directly, or add the tool view's control.

Parameters:
toolView - the tool view

doRemoveToolView

protected abstract void doRemoveToolView(ToolView toolView)
This method must remove the given tool view from the UI.

Parameters:
toolView - the tool view

doShowToolView

protected abstract void doShowToolView(ToolView toolView)
This method must show the given tool view in the UI.

Parameters:
toolView - the tool view

doHideToolView

protected abstract void doHideToolView(ToolView toolView)
This method must hide the given tool view in the UI.

Parameters:
toolView - the tool view

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

createToolViewPane

protected abstract PageComponentPane createToolViewPane(ToolView toolView)


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.