net.sf.doolin.gui.view.descriptor
Class AbstractGUIViewDescriptor<V>

java.lang.Object
  extended by net.sf.doolin.gui.view.descriptor.AbstractGUIViewDescriptor<V>
Type Parameters:
V - Type of object for the view
All Implemented Interfaces:
GUIViewDescriptor<V>, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
FormViewDescriptor

public abstract class AbstractGUIViewDescriptor<V>
extends Object
implements GUIViewDescriptor<V>, org.springframework.beans.factory.BeanNameAware

Abstract view descriptor.

Author:
Damien Coraboeuf

Constructor Summary
AbstractGUIViewDescriptor()
           
 
Method Summary
 boolean close(GUIView<V> view, boolean force)
          Closes the view
 ActionFactory getActionFactory()
          Returns the action factory
 GUIAction getCloseAction()
          Gets the close action.
 String getIconId()
          Gets the icon id
 String getID(V model)
          Gets the ID for the view (can depend on the model)
 String getParentViewId()
          Gets the ID of any parent view for this view.
 String getTitleExpression()
          Gets the title expression.
 GUIValidator<V> getValidator()
          Gets the validator.
 GUIViewDecorator getViewDecorator()
          Additional decorator for the view
 String getViewId()
          Gets the view id.
 List<ViewSubscriber<V>> getViewSubscribers()
          Gets the list of ViewSubscriber to execute for the view
 ActionPathList getViewToolBar()
          Gets the tool bar definition for this view
 ActionPathList getWindowMenuBar()
          Gets the definition of any view-specific menu bar to merge with the window's menu bar.
 ToolBar getWindowToolBar()
          Gets the definition of any view-specific tool bar to merge with the window tool bars.
protected  void initView(GUIView<V> view)
          General initialisation of the view.
protected  void onActivateView(GUIView<V> view)
          Activates the view and its tool bars.
protected
<P> void
registerParent(GUIView<V> view, GUIView<P> parentView)
          Notifies the parent view that a view has been added to it
 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 setParentViewId(String parentViewId)
          Sets the expression that designates the ID of the parent view
 void setTitleExpression(String titleExpression)
          Sets the title expression.
 void setValidator(GUIValidator<V> validator)
          Sets the validator.
 void setViewDecorator(GUIViewDecorator viewDecorator)
          Sets the view decorator.
 void setViewId(String viewId)
          Sets the expression for the view id.
 void setViewSubscribers(List<ViewSubscriber<V>> viewSubscribers)
          Sets the list of ViewSubscriber to execute for the view
 void setViewToolBar(ActionPathList viewToolBar)
          Sets the tool bar definition for this view
 void setWindowMenuBar(ActionPathList windowMenuBar)
          Sets the definition of any view-specific menu bar to merge with the window's menu bar.
 void setWindowToolBar(ToolBar windowToolBar)
          Sets the definition of any view-specific tool bar to merge with the window tool bars.
 
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.view.descriptor.GUIViewDescriptor
createView, initState
 

Constructor Detail

AbstractGUIViewDescriptor

public AbstractGUIViewDescriptor()
Method Detail

close

public boolean close(GUIView<V> view,
                     boolean force)
Closes the view

Specified by:
close in interface GUIViewDescriptor<V>
Parameters:
view - View to close
force - true if the view must be closed.
Returns:
true if the view could be closed

getActionFactory

public ActionFactory getActionFactory()
Description copied from interface: GUIViewDescriptor
Returns the action factory

Specified by:
getActionFactory in interface GUIViewDescriptor<V>
Returns:
Action factory

getCloseAction

public GUIAction getCloseAction()
Gets the close action.

Returns:
the close action

getIconId

public String getIconId()
Gets the icon id

Specified by:
getIconId in interface GUIViewDescriptor<V>
Returns:
Icon id

getID

public String getID(V model)
Gets the ID for the view (can depend on the model).

Specified by:
getID in interface GUIViewDescriptor<V>
Parameters:
model - the model
Returns:
the ID

getParentViewId

public String getParentViewId()
Gets the ID of any parent view for this view.

Returns:
ID of the parent view

getTitleExpression

public String getTitleExpression()
Gets the title expression.

Specified by:
getTitleExpression in interface GUIViewDescriptor<V>
Returns:
the title expression

getValidator

public GUIValidator<V> getValidator()
Gets the validator.

Specified by:
getValidator in interface GUIViewDescriptor<V>
Returns:
the validator

getViewDecorator

public GUIViewDecorator getViewDecorator()
Additional decorator for the view.

Specified by:
getViewDecorator in interface GUIViewDescriptor<V>
Returns:
the view decorator

getViewId

public String getViewId()
Gets the view id.

Specified by:
getViewId in interface GUIViewDescriptor<V>
Returns:
the view id

getViewSubscribers

public List<ViewSubscriber<V>> getViewSubscribers()
Gets the list of ViewSubscriber to execute for the view

Returns:
List of ViewSubscriber

getViewToolBar

public ActionPathList getViewToolBar()
Gets the tool bar definition for this view

Returns:
Tool bar definition

getWindowMenuBar

public ActionPathList getWindowMenuBar()
Gets the definition of any view-specific menu bar to merge with the window's menu bar.

Returns:
Menu bar definition

getWindowToolBar

public ToolBar getWindowToolBar()
Gets the definition of any view-specific tool bar to merge with the window tool bars.

Returns:
Tool bar definition

initView

protected void initView(GUIView<V> view)
General initialisation of the view.

Parameters:
view - View to initialise

onActivateView

protected void onActivateView(GUIView<V> view)
Activates the view and its tool bars.

Parameters:
view - View

registerParent

protected <P> void registerParent(GUIView<V> view,
                                  GUIView<P> parentView)
Notifies the parent view that a view has been added to it

Type Parameters:
P - Type of bean for the parent view
Parameters:
view - Child view
parentView - Parent view to register the child view into

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

setParentViewId

public void setParentViewId(String parentViewId)
Sets the expression that designates the ID of the parent view

Parameters:
parentViewId - Expression that designates the ID of the parent view

setTitleExpression

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

Parameters:
titleExpression - the new title expression

setValidator

public void setValidator(GUIValidator<V> validator)
Sets the validator.

Parameters:
validator - the new validator

setViewDecorator

public void setViewDecorator(GUIViewDecorator viewDecorator)
Sets the view decorator.

Parameters:
viewDecorator - the new view decorator

setViewId

public void setViewId(String viewId)
Sets the expression for the view id.

Parameters:
viewId - the new view id

setViewSubscribers

public void setViewSubscribers(List<ViewSubscriber<V>> viewSubscribers)
Sets the list of ViewSubscriber to execute for the view

Parameters:
viewSubscribers - List of ViewSubscriber

setViewToolBar

public void setViewToolBar(ActionPathList viewToolBar)
Sets the tool bar definition for this view

Parameters:
viewToolBar - Tool bar definition or null if none is needed

setWindowMenuBar

public void setWindowMenuBar(ActionPathList windowMenuBar)
Sets the definition of any view-specific menu bar to merge with the window's menu bar.

Parameters:
windowMenuBar - Menu bar definition or null if none is needed

setWindowToolBar

public void setWindowToolBar(ToolBar windowToolBar)
Sets the definition of any view-specific tool bar to merge with the window tool bars.

Parameters:
windowToolBar - Tool bar definition or null if none is needed


Copyright © 2011. All Rights Reserved.