org.openpermis.editor.policy.view
Class AbstractToolView<P extends Presenter<?>>

java.lang.Object
  extended by org.openpermis.editor.policy.view.AbstractView
      extended by org.openpermis.editor.policy.view.AbstractToolView<P>
Type Parameters:
P - the presenter model type.
All Implemented Interfaces:
ErrorReporter, Tool, View
Direct Known Subclasses:
DecisionTool, ProblemListTool, RecentFilesTool, RoleAssignmentRuleListTool, RoleHierarchyListTool, TargetAccessRuleListTool

public abstract class AbstractToolView<P extends Presenter<?>>
extends AbstractView
implements Tool

Abstract base class for tool views.

Since:
0.1.0

Field Summary
protected static bibliothek.gui.dock.common.location.TreeLocationRoot DEFAULT_LOCATION
          The default location for tool views.
 
Constructor Summary
AbstractToolView(org.jdesktop.application.ApplicationContext context, AdapterTrader trader)
          Creates an abstract tool view for the specified application context.
 
Method Summary
protected  void attachPresenter(P presenter, org.jdesktop.beansbinding.BindingGroup bindings)
          Attaches any listeners required to the new presenter and binds components.
protected  void contentPaneCreated()
          Hook called after the content pane has been created.
protected  JToolBar createToolBar()
          Factory method to lazily create the view tool bar.
protected  void detachPresenter(P presenter)
          Unlinks any listeners from the specified old presenter.
 bibliothek.gui.dock.common.CLocation getDefaultLocation()
          Returns the desired default location relative to the working area for this tool view.
protected  P getPresenter()
          Returns the presenter rendered by this view.
 JToolBar getToolBar()
          Returns the tool bar of this tool view.
 String getToolIdentifier()
          Returns a unique identifier for this tool view.
protected  void setPresenter(P presenter)
          Sets the presenter that this view renders.
protected  void updateActions()
          Prompts the tool to update its actions according to the presenter state.
 
Methods inherited from class org.openpermis.editor.policy.view.AbstractView
attach, canClose, canEditPart, closeView, createContentPane, detach, editPart, getActionMap, getAdapteeTrader, getContentPane, getIcon, getResourceMap, getTitle, getTitleParameters, getViewContext, label, openView, showStatusError, toolBar, updateTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openpermis.editor.policy.view.Tool
refresh
 
Methods inherited from interface org.openpermis.editor.policy.view.View
attach, canClose, detach, getContentPane, getIcon, getTitle
 

Field Detail

DEFAULT_LOCATION

protected static final bibliothek.gui.dock.common.location.TreeLocationRoot DEFAULT_LOCATION
The default location for tool views.

Since:
0.1.0
Constructor Detail

AbstractToolView

public AbstractToolView(org.jdesktop.application.ApplicationContext context,
                        AdapterTrader trader)
Creates an abstract tool view for the specified application context.

Parameters:
context - the application context used to lookup the action and resource map.
Since:
0.1.0
Method Detail

updateActions

protected void updateActions()
Prompts the tool to update its actions according to the presenter state.

The default implementation does nothing.

Notes:
Super call mandatory if overwritten.
Since:
0.1.0

detachPresenter

protected void detachPresenter(P presenter)
Unlinks any listeners from the specified old presenter.

This is called before a new presenter is set.

The default implementation removes any bean bindings.

Notes:
Super call mandatory if overwritten.
Parameters:
presenter - the presenter to unlink.
See Also:
setPresenter(Presenter)
Since:
0.1.0

attachPresenter

protected void attachPresenter(P presenter,
                               org.jdesktop.beansbinding.BindingGroup bindings)
Attaches any listeners required to the new presenter and binds components.

The default implementation initializes the content pane if necessary.

Notes:
Super call mandatory if overwritten.
Parameters:
presenter - the new presenter to attach to.
bindings - the binding group to add bindings to.
Since:
0.1.0

setPresenter

protected void setPresenter(P presenter)
Sets the presenter that this view renders.

The view needs to take appropriate actions to rebind and render the presenter passed in, bindings to an old presenter are to be discarded in the process.

Parameters:
presenter - the presenter to set.
Since:
0.1.0

getPresenter

protected P getPresenter()
Returns the presenter rendered by this view.

Returns:
the presenter rendered by this view.
Since:
0.1.0

createToolBar

protected JToolBar createToolBar()
Factory method to lazily create the view tool bar.

The default implementation creates a tool bar based on the resource key View.toolbar.

Returns:
the tool bar or null if this view does not feature a tool bar.
Since:
0.1.0

getToolIdentifier

public final String getToolIdentifier()
Description copied from interface: Tool
Returns a unique identifier for this tool view.

Specified by:
getToolIdentifier in interface Tool
Returns:
a unique identifier for this tool view.
Since:
0.1.0

getDefaultLocation

public bibliothek.gui.dock.common.CLocation getDefaultLocation()
Description copied from interface: Tool
Returns the desired default location relative to the working area for this tool view.

Specified by:
getDefaultLocation in interface Tool
Returns:
the desired default location of this tool view.
Since:
0.1.0

getToolBar

public JToolBar getToolBar()
Description copied from interface: Tool
Returns the tool bar of this tool view.

Specified by:
getToolBar in interface Tool
Returns:
the tool bar of this tool view.
Since:
0.1.0

contentPaneCreated

protected void contentPaneCreated()
Description copied from class: AbstractView
Hook called after the content pane has been created.

Overrides:
contentPaneCreated in class AbstractView
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:11
Copyright (c) 2002-2007 Ergon Informatik AG