net.sf.doolin.gui.window.descriptor
Class AbstractGUIWindowDescriptor<B>

java.lang.Object
  extended by net.sf.doolin.gui.window.descriptor.AbstractGUIWindowDescriptor<B>
Type Parameters:
B - Type of data for the window
All Implemented Interfaces:
GUIWindowDescriptor<B>, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
AbstractCompositeGUIWindowDescriptor, SimpleGUIWindowDescriptor, WizardDescriptor

public abstract class AbstractGUIWindowDescriptor<B>
extends Object
implements GUIWindowDescriptor<B>, org.springframework.beans.factory.BeanNameAware

Window descriptor that provides common attributes and methods.

Author:
Damien Coraboeuf

Constructor Summary
AbstractGUIWindowDescriptor()
           
 
Method Summary
 void activateView(GUIWindow<B> window, GUIView<?> view)
          Does nothing.
protected  void arrange(GUIWindow<B> window)
          Arranges the content of the window.
protected  void arrangeActionBars(GUIWindow<B> window)
          Creates and setup the action bars (menu bars, tool bars, action bars).
protected abstract  void arrangeViews(GUIWindow<B> window)
          Arranges the views inside the window.
protected abstract  void arrangeWindow(GUIWindow<B> window)
          Arranges the window.
 GUIWindow<B> createWindow(GUIApplication application, B windowData)
          Creates a new window.
 ActionFactory getActionFactory()
          Gets the action factory.
 GUIAction getCloseAction()
          Returns the action to call when the window is about to be closed
 String getIconId()
          Gets the icon id.
 IconService getIconService()
          Gets the icon service.
 ActionPathList getMenuBar()
          Gets the ActionPathList that defines the menu bar for this window.
 WindowSize getSize()
          Gets the size.
 String getTitleExpression()
          Gets the title expression.
 List<ToolBar> getToolBars()
          Returns the list of tool bars for this window.
 GUIWindow<B> getWindow(GUIApplication application, B windowData)
          Gets an already opened window for the given model.
 String getWindowId()
          Gets the id.
 String getWindowId(B windowData)
          Gets the ID of a window model.
 List<GUIWindowListener<B>> getWindowListeners()
           
 void hideView(GUIWindow<B> window, GUIView<?> view)
          Does nothing.
protected
<V> JComponent
initViewComponent(GUIWindow<B> window, GUIView<V> view, GUIViewDecorator additionalViewDecorator, DecorationStyle decorationStyle)
          Initialises a view before its usage in this window.
 void onCloseWindow(GUIWindow<B> window)
          Action to execute when a window is closed.
 void onClosingWindow(GUIWindow<B> window)
          Does nothing y default
 void onOpenedWindow(GUIWindow<B> window)
          Does nothing
 void setActionFactory(ActionFactory actionFactory)
          Sets the action factory.
 void setBeanName(String name)
           
 void setCloseAction(GUIAction closeAction)
          Sets the close action.
 void setIconId(String iconId)
          Sets the icon id.
 void setIconService(IconService iconService)
          Sets the icon service.
 void setMenuBar(ActionPathList menuBar)
          Sets the ActionPathList that defines the menu bar for this window.
 void setSize(WindowSize size)
          Sets the size.
 void setTitleExpression(String titleExpression)
          Sets the title expression.
 void setToolBars(List<ToolBar> toolBars)
          Sets the list of tool bars for this window
 void setWindowFactory(GUIWindowFactory windowFactory)
          Sets the factory for the window implementation.
 void setWindowId(String id)
          Sets the id.
 void setWindowListeners(List<GUIWindowListener<B>> windowListeners)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.doolin.gui.window.descriptor.GUIWindowDescriptor
openView
 

Constructor Detail

AbstractGUIWindowDescriptor

public AbstractGUIWindowDescriptor()
Method Detail

activateView

public void activateView(GUIWindow<B> window,
                         GUIView<?> view)
Does nothing.

Specified by:
activateView in interface GUIWindowDescriptor<B>
Parameters:
window - the window
view - the view
See Also:
GUIView.show()

arrange

protected void arrange(GUIWindow<B> window)
Arranges the content of the window.

Parameters:
window - Window to arrange

arrangeActionBars

protected void arrangeActionBars(GUIWindow<B> window)
Creates and setup the action bars (menu bars, tool bars, action bars).

Parameters:
window - Window

arrangeViews

protected abstract void arrangeViews(GUIWindow<B> window)
Arranges the views inside the window.

Parameters:
window - Window to arrange

arrangeWindow

protected abstract void arrangeWindow(GUIWindow<B> window)
Arranges the window.

Parameters:
window - Window

createWindow

public GUIWindow<B> createWindow(GUIApplication application,
                                 B windowData)
Description copied from interface: GUIWindowDescriptor
Creates a new window.

Specified by:
createWindow in interface GUIWindowDescriptor<B>
Parameters:
application - Application owner
windowData - Data for the window
Returns:
Opened window (not displayed yet)

getActionFactory

public ActionFactory getActionFactory()
Gets the action factory.

Specified by:
getActionFactory in interface GUIWindowDescriptor<B>
Returns:
the action factory

getCloseAction

public GUIAction getCloseAction()
Returns the action to call when the window is about to be closed.

Specified by:
getCloseAction in interface GUIWindowDescriptor<B>
Returns:
the close action

getIconId

public String getIconId()
Gets the icon id.

Returns:
the icon id

getIconService

public IconService getIconService()
Gets the icon service.

Returns:
the icon service

getMenuBar

public ActionPathList getMenuBar()
Gets the ActionPathList that defines the menu bar for this window.

Returns:
List of action paths or null if no menu bar is needed

getSize

public WindowSize getSize()
Gets the size.

Specified by:
getSize in interface GUIWindowDescriptor<B>
Returns:
the size

getTitleExpression

public String getTitleExpression()
Gets the title expression.

Returns:
the title expression

getToolBars

public List<ToolBar> getToolBars()
Returns the list of tool bars for this window.

Returns:
List of tool bars

getWindow

public GUIWindow<B> getWindow(GUIApplication application,
                              B windowData)
Description copied from interface: GUIWindowDescriptor
Gets an already opened window for the given model. The window is identified among the other ones using an ID generated using the id expression of the window descriptor.

Specified by:
getWindow in interface GUIWindowDescriptor<B>
Parameters:
application - Application owner
windowData - Data for the window
Returns:
Opened window if existing, null otherwise.

getWindowId

public String getWindowId()
Gets the id.

Returns:
the id

getWindowId

public String getWindowId(B windowData)
Gets the ID of a window model.

Specified by:
getWindowId in interface GUIWindowDescriptor<B>
Parameters:
windowData - Window model
Returns:
ID

getWindowListeners

public List<GUIWindowListener<B>> getWindowListeners()
Specified by:
getWindowListeners in interface GUIWindowDescriptor<B>

hideView

public void hideView(GUIWindow<B> window,
                     GUIView<?> view)
Does nothing.

Specified by:
hideView in interface GUIWindowDescriptor<B>
Parameters:
window - the window
view - the view

initViewComponent

protected <V> JComponent initViewComponent(GUIWindow<B> window,
                                           GUIView<V> view,
                                           GUIViewDecorator additionalViewDecorator,
                                           DecorationStyle decorationStyle)
Initialises a view before its usage in this window.

Type Parameters:
V - Type of bean for the view
Parameters:
window - Hosting window
view - View to initialise
additionalViewDecorator - Decorator for the view
decorationStyle - Style for the decoration
Returns:
Decorated view component for the window

onCloseWindow

public void onCloseWindow(GUIWindow<B> window)
Description copied from interface: GUIWindowDescriptor
Action to execute when a window is closed.

Specified by:
onCloseWindow in interface GUIWindowDescriptor<B>
Parameters:
window - Closed window

onClosingWindow

public void onClosingWindow(GUIWindow<B> window)
Does nothing y default

Specified by:
onClosingWindow in interface GUIWindowDescriptor<B>
Parameters:
window - Window to close

onOpenedWindow

public void onOpenedWindow(GUIWindow<B> window)
Does nothing

Specified by:
onOpenedWindow in interface GUIWindowDescriptor<B>
Parameters:
window - Window which is opened for the very first time

setActionFactory

public void setActionFactory(ActionFactory actionFactory)
Sets the action factory.

Parameters:
actionFactory - the new action factory

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

setCloseAction

public void setCloseAction(GUIAction closeAction)
Sets the close action.

Parameters:
closeAction - the new close action

setIconId

public void setIconId(String iconId)
Sets the icon id.

Parameters:
iconId - the new icon id

setIconService

public void setIconService(IconService iconService)
Sets the icon service.

Parameters:
iconService - the new icon service

setMenuBar

public void setMenuBar(ActionPathList menuBar)
Sets the ActionPathList that defines the menu bar for this window. It is set to null by default.

Parameters:
menuBar - List of action paths

setSize

public void setSize(WindowSize size)
Sets the size.

Parameters:
size - the new size

setTitleExpression

public void setTitleExpression(String titleExpression)
Sets the title expression.

Parameters:
titleExpression - the new title expression

setToolBars

public void setToolBars(List<ToolBar> toolBars)
Sets the list of tool bars for this window

Parameters:
toolBars - List of tool bars

setWindowFactory

public void setWindowFactory(GUIWindowFactory windowFactory)
Sets the factory for the window implementation. It is set by default to FrameWindowFactory.

Parameters:
windowFactory - Factory for the window implementation

setWindowId

public void setWindowId(String id)
Sets the id.

Parameters:
id - the new id

setWindowListeners

public void setWindowListeners(List<GUIWindowListener<B>> windowListeners)


Copyright © 2011. All Rights Reserved.