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

Constructor Summary
protected AbstractEditor(ApplicationContext context, Adapter adapter, 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.
 void close()
           
protected  void contentPaneCreated()
          Hook called after the content pane has been created.
 void dispose()
          Disposes the editor which should remove all listeners it has added.
 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, createContentPane, createEditor, createFormBuilder, createTranslationConverter, detach, editPart, getAction, getActionMap, getAdapteeTrader, getApplicationContext, getContentPane, getControlFactory, getDefaultFocusComponent, getIcon, getParentView, getResourceMap, getTitle, getViewContext, isEmbedded, openView, setEnabled, setParentView, showStatusError, 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, getDefaultFocusComponent, getIcon, getParentView, getTitle, isEmbedded, setParentView
 

Constructor Detail

AbstractEditor

protected AbstractEditor(ApplicationContext context,
                         Adapter adapter,
                         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

close

public void close()
Since:
0.9.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


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG