org.openpermis.editor.policy.view
Class RoleHierarchyEditor

java.lang.Object
  extended by org.openpermis.editor.policy.view.AbstractView
      extended by org.openpermis.editor.policy.view.AbstractEditor<RoleHierarchyPresenter>
          extended by org.openpermis.editor.policy.view.RoleHierarchyEditor
All Implemented Interfaces:
EventListener, AncestorListener, ErrorReporter, Editor, View

public class RoleHierarchyEditor
extends AbstractEditor<RoleHierarchyPresenter>
implements AncestorListener

Editor for a RoleHierarchyPresenter.

Since:
0.3.0

Field Summary
private static org.slf4j.Logger LOGGER
          The logger object of this class.
private  PropertyChangeListener propertyChangeListener
           
private  RoleBrowser roleBrowser
           
private  JTree tree
           
 
Constructor Summary
RoleHierarchyEditor(org.jdesktop.application.ApplicationContext context, AdapterTrader trader, RoleHierarchyPresenter presenter)
          Creates a RoleHierarchyEditor.
 
Method Summary
 void addNewRole()
          Adds a new role in the hierarchy.
 void ancestorAdded(AncestorEvent event)
           
 void ancestorMoved(AncestorEvent event)
           
 void ancestorRemoved(AncestorEvent event)
           
protected  void bind(org.jdesktop.beansbinding.BindingGroup bindings)
          Binds all components to the presenter.
private  boolean checkReferences(String operation, String role)
           
 void detachRole()
          Detaches a role from its parent.
 void fillContentPane(JPanel panel)
           
 void getParents(RoleNode roleNode, List<RoleNode> result)
          Returns the parents of a role.
 Object[] getTitleParameters()
          Returns the parameters for the title of this view.
 void includeRole()
          Given a parent role, include a role among its children.
private  TreePath recreatePath(RoleNode node)
           
 void removeRole()
          Removes a role from the hierarchy.
 void renameRole()
          Renames a role.
private  void searchParents(RoleNode thisNode, RoleNode childNode, List<RoleNode> result)
           
 void setSelectionPath(RoleNode node)
          Sets the tree selection path.
 void updateTree()
           
 
Methods inherited from class org.openpermis.editor.policy.view.AbstractEditor
adjustTitleParameters, canClose, contentPaneCreated, createContentPane, dispose, getModelSerialNumber, getPresenter, showYesNoDialog
 
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

LOGGER

private static final org.slf4j.Logger LOGGER
The logger object of this class.

Since:
0.3.0

tree

private JTree tree
Since:
0.3.0

roleBrowser

private RoleBrowser roleBrowser
Since:
0.3.0

propertyChangeListener

private PropertyChangeListener propertyChangeListener
Since:
0.3.0
Constructor Detail

RoleHierarchyEditor

public RoleHierarchyEditor(org.jdesktop.application.ApplicationContext context,
                           AdapterTrader trader,
                           RoleHierarchyPresenter presenter)
Creates a RoleHierarchyEditor.

Since:
0.3.0
Method Detail

includeRole

@Action
public void includeRole()
Given a parent role, include a role among its children.

Since:
0.3.0

detachRole

@Action
public void detachRole()
Detaches a role from its parent.

Since:
0.3.0

addNewRole

@Action
public void addNewRole()
Adds a new role in the hierarchy.

Since:
0.3.0

checkReferences

private boolean checkReferences(String operation,
                                String role)
Since:
0.3.0

removeRole

@Action
public void removeRole()
Removes a role from the hierarchy.

Since:
0.3.0

renameRole

@Action
public void renameRole()
Renames a role.

Since:
0.3.0

updateTree

public void updateTree()
Since:
0.3.0

getParents

public void getParents(RoleNode roleNode,
                       List<RoleNode> result)
Returns the parents of a role.

Parameters:
roleNode - the role whose parents we get.
result - the result.
Since:
0.3.0

setSelectionPath

public void setSelectionPath(RoleNode node)
Sets the tree selection path.

Parameters:
node - whose path is going to be selected.
Since:
0.3.0

bind

protected void bind(org.jdesktop.beansbinding.BindingGroup bindings)
Description copied from class: AbstractEditor
Binds all components to the presenter.

This method is called after creation of the content pane.

Specified by:
bind in class AbstractEditor<RoleHierarchyPresenter>
Parameters:
bindings - the binding group to add bindings to.
Since:
0.3.0

recreatePath

private TreePath recreatePath(RoleNode node)
Since:
0.3.0

searchParents

private void searchParents(RoleNode thisNode,
                           RoleNode childNode,
                           List<RoleNode> result)
Since:
0.3.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 AbstractEditor<RoleHierarchyPresenter>
Returns:
the parameters for the title of this view, must not be null.
Since:
0.3.0

fillContentPane

public void fillContentPane(JPanel panel)
Specified by:
fillContentPane in class AbstractEditor<RoleHierarchyPresenter>
Since:
0.3.0

ancestorAdded

public void ancestorAdded(AncestorEvent event)
Specified by:
ancestorAdded in interface AncestorListener
Since:
0.3.0

ancestorMoved

public void ancestorMoved(AncestorEvent event)
Specified by:
ancestorMoved in interface AncestorListener
Since:
0.3.0

ancestorRemoved

public void ancestorRemoved(AncestorEvent event)
Specified by:
ancestorRemoved in interface AncestorListener
Since:
0.3.0


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