org.openpermis.editor.policy.view
Class AbstractView

java.lang.Object
  extended by org.openpermis.editor.policy.view.AbstractView
All Implemented Interfaces:
ErrorReporter, View
Direct Known Subclasses:
AbstractEditor, AbstractToolView, ContextView

public abstract class AbstractView
extends Object
implements View, ErrorReporter

Abstract base class for views.

Since:
0.1.0

Constructor Summary
AbstractView(org.jdesktop.application.ApplicationContext context, AdapterTrader trader)
          Creates an abstract view that operates on an action and resource map derived from the implementation class of this view.
 
Method Summary
 void attach(ViewContext theContext)
          Attaches this view to the specified context.
 boolean canClose()
          Prompts the view to save unsaved changes before closing.
 boolean canEditPart(org.openpermis.policy.bean.PartBean part)
           
protected  boolean closeView(View view, boolean force)
           
protected  void contentPaneCreated()
          Hook called after the content pane has been created.
protected abstract  JComponent createContentPane()
          Creates the content pane of this view.
 void detach(ViewContext theContext)
          Detaches this view from the specified context.
protected  Editor editPart(org.openpermis.policy.bean.PartBean part)
           
protected  ActionMap getActionMap()
          Returns the application action map of this view class and instance.
 AdapterTrader getAdapteeTrader()
          Returns the adaptee trader of this view class.
 JComponent getContentPane()
          Returns the Swing content pane of this view.
 Icon getIcon()
          Returns the icon of this view.
protected  org.jdesktop.application.ResourceMap getResourceMap()
          Returns the context resource map of this view class.
 String getTitle()
          Returns the title of this view.
 Object[] getTitleParameters()
          Returns the parameters for the title of this view.
protected  ViewContext getViewContext()
          Returns the view context of this view.
protected  JLabel label(String name)
          Factory method to create a label with properties defined in the resource map.
protected  void openView(View view)
           
 void showStatusError(String message)
          Shows an error message.
protected  JToolBar toolBar(String name)
          Factory method to create a tool bar with properties defined in the resource map.
protected  void updateTitle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractView

public AbstractView(org.jdesktop.application.ApplicationContext context,
                    AdapterTrader trader)
Creates an abstract view that operates on an action and resource map derived from the implementation class of this view.

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

getAdapteeTrader

public AdapterTrader getAdapteeTrader()
Returns the adaptee trader of this view class.

Returns:
the adaptee trader of this view class.
Since:
0.3.0

getResourceMap

protected org.jdesktop.application.ResourceMap getResourceMap()
Returns the context resource map of this view class.

Returns:
the context resource map of this view class.
Since:
0.1.0

getActionMap

protected ActionMap getActionMap()
Returns the application action map of this view class and instance.

Returns:
the application action map of this view class and instance.
Since:
0.1.0

createContentPane

protected abstract JComponent createContentPane()
Creates the content pane of this view.

Returns:
the content pane of this view, must not be null.
Since:
0.1.0

getViewContext

protected ViewContext getViewContext()
Returns the view context of this view.

Returns:
the view context of this view, may be null.
Since:
0.1.0

openView

protected void openView(View view)
Since:
0.1.0

closeView

protected boolean closeView(View view,
                            boolean force)
Since:
0.1.0

editPart

protected Editor editPart(org.openpermis.policy.bean.PartBean part)
Since:
0.1.0

canEditPart

public boolean canEditPart(org.openpermis.policy.bean.PartBean part)
Since:
0.3.0

updateTitle

protected void updateTitle()
Since:
0.1.0

label

protected JLabel label(String name)
Factory method to create a label with properties defined in the resource map.

Parameters:
name - the name of the label as it appears in the resource map.
Returns:
the label requested.
Since:
0.1.0

toolBar

protected JToolBar toolBar(String name)
Factory method to create a tool bar with properties defined in the resource map.

Parameters:
name - the name of the toolbar as it appears in the resource map.
Returns:
the tool bar requested.
Since:
0.1.0

attach

public void attach(ViewContext theContext)
Attaches this view to the specified context.

Specified by:
attach in interface View
Notes:
Do not call this method directly, it is called by the context exclusively.
Parameters:
theContext - the context to attach this view to.
Since:
0.1.0

detach

public void detach(ViewContext theContext)
Detaches this view from the specified context.

Specified by:
detach in interface View
Notes:
Do not call this method directly, it is called by the context exclusively.
Parameters:
theContext - the context to detach this view from.
Since:
0.1.0

getTitleParameters

public Object[] getTitleParameters()
Returns the parameters for the title of this view.

The default implementations returns an empty array.

Returns:
the parameters for the title of this view, must not be null.
Since:
0.1.0

getTitle

public String getTitle()
Returns the title of this view.

Specified by:
getTitle in interface View
Returns:
the title of this view.
Since:
0.1.0

getIcon

public Icon getIcon()
Returns the icon of this view.

Specified by:
getIcon in interface View
Returns:
the icon of this view.
Since:
0.1.0

contentPaneCreated

protected void contentPaneCreated()
Hook called after the content pane has been created.

Since:
0.1.0

getContentPane

public final JComponent getContentPane()
Returns the Swing content pane of this view.

Specified by:
getContentPane in interface View
Returns:
the Swing content pane of this view.
Since:
0.1.0

canClose

public boolean canClose()
Description copied from interface: View
Prompts the view to save unsaved changes before closing.

Specified by:
canClose in interface View
Returns:
true if the view may be closed, false otherwise.
Since:
0.1.0

showStatusError

public void showStatusError(String message)
Description copied from interface: ErrorReporter
Shows an error message.

Specified by:
showStatusError in interface ErrorReporter
Parameters:
message - the message to display.
Since:
0.1.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:33
Copyright (c) 2002-2007 Ergon Informatik AG