org.openpermis.editor.policy.view
Class AbstractEditor<P extends PartPresenter<?>>

java.lang.Object
  extended by org.openpermis.editor.policy.view.AbstractView
      extended by org.openpermis.editor.policy.view.AbstractEditor<P>
Type Parameters:
P - the type of presenter bound to this view.
All Implemented Interfaces:
ErrorReporter, Editor, View
Direct Known Subclasses:
ActionEditor, AuthorityEditor, DomainEditor, ObligationEditor, RoleAssignmentRuleEditor, RoleHierarchyEditor, TargetAccessRuleEditor, TargetEditor

public abstract class AbstractEditor<P extends PartPresenter<?>>
extends AbstractView
implements Editor

Abstract base class for editors of part presenters.

Since:
0.1.0

Field Summary
private  org.jdesktop.beansbinding.BindingGroup bindingGroup
          The binding group used to bind the presenter to view components.
private  P presenter
          The presenter of this view.
private  PropertyChangeDispatcher propertyChangeDispatcher
          Dispatcher attached to the presenter to update the title parameters.
 
Constructor Summary
protected AbstractEditor(org.jdesktop.application.ApplicationContext context, AdapterTrader trader, P presenter)
          Creates an editor for the specified presenter.
 
Method Summary
 void adjustTitleParameters()
          Instructs the view to update its title once the parameters change.
protected abstract  void bind(org.jdesktop.beansbinding.BindingGroup bindings)
          Binds all components to the presenter.
 boolean canClose()
          Prompts the view to save unsaved changes before closing.
protected  void contentPaneCreated()
          Hook called after the content pane has been created.
protected  JComponent createContentPane()
          Creates the content pane of this view.
 void dispose()
          Disposes the editor which should remove all listeners it has added.
(package private) abstract  void fillContentPane(JPanel panel)
           
 org.openpermis.policy.bean.SerialNumber getModelSerialNumber()
          Returns the serial number of the model this editor is editing.
protected  P getPresenter()
          Returns the presenter of this view.
 Object[] getTitleParameters()
          Returns the parameters for the title of this view.
 boolean showYesNoDialog(String title, String body, int expectedValue)
          Show yes-no-dialog.
 
Methods inherited from class org.openpermis.editor.policy.view.AbstractView
attach, canEditPart, closeView, detach, editPart, getActionMap, getAdapteeTrader, getContentPane, getIcon, getResourceMap, getTitle, 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.View
attach, detach, getContentPane, getIcon, getTitle
 

Field Detail

presenter

private final P extends PartPresenter<?> presenter
The presenter of this view.

Since:
0.1.0

propertyChangeDispatcher

private final PropertyChangeDispatcher propertyChangeDispatcher
Dispatcher attached to the presenter to update the title parameters.

Since:
0.1.0

bindingGroup

private final org.jdesktop.beansbinding.BindingGroup bindingGroup
The binding group used to bind the presenter to view components.

Since:
0.1.0
Constructor Detail

AbstractEditor

protected AbstractEditor(org.jdesktop.application.ApplicationContext context,
                         AdapterTrader trader,
                         P presenter)
Creates an editor for the specified presenter.

Parameters:
context - the application context.
presenter - the presenter for this editor.
Since:
0.1.0
Method Detail

getPresenter

protected final P getPresenter()
Returns the presenter of this view.

Returns:
the presenter of this view.
Since:
0.1.0

adjustTitleParameters

public void adjustTitleParameters()
Instructs the view to update its title once the parameters change.

Since:
0.1.0

bind

protected abstract void bind(org.jdesktop.beansbinding.BindingGroup bindings)
Binds all components to the presenter.

This method is called after creation of the content pane.

Parameters:
bindings - the binding group to add bindings to.
Since:
0.1.0

showYesNoDialog

public boolean showYesNoDialog(String title,
                               String body,
                               int expectedValue)
Show yes-no-dialog.

Parameters:
title - title-text
body - body-text
Since:
0.1.0

getModelSerialNumber

public final org.openpermis.policy.bean.SerialNumber getModelSerialNumber()
Description copied from interface: Editor
Returns the serial number of the model this editor is editing.

Specified by:
getModelSerialNumber in interface Editor
Returns:
the serial number requested, must not be null.
Since:
0.1.0

dispose

public void dispose()
Description copied from interface: Editor
Disposes the editor which should remove all listeners it has added.

Specified by:
dispose in interface Editor
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

getTitleParameters

public Object[] getTitleParameters()
Description copied from class: AbstractView
Returns the parameters for the title of this view.

The default implementations returns an empty array.

Overrides:
getTitleParameters in class AbstractView
Returns:
the parameters for the title of this view, must not be null.
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
Overrides:
canClose in class AbstractView
Returns:
true if the view may be closed, false otherwise.
Since:
0.1.0

fillContentPane

abstract void fillContentPane(JPanel panel)
Since:
0.1.0

createContentPane

protected JComponent createContentPane()
Description copied from class: AbstractView
Creates the content pane of this view.

Specified by:
createContentPane in class AbstractView
Returns:
the content pane of this view, must not be null.
Since:
0.1.0


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