org.openpermis.editor.policy.view
Class TargetAccessRuleEditor

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

public class TargetAccessRuleEditor
extends AbstractEditor<TargetAccessRulePresenter>
implements AncestorListener

Tool view that displays all target access rules in a policy.

Since:
0.1.0

Field Summary
private static Object[] BOOLEAN_TERM_TYPES
           
private static Object[] CONDITION_TERM_TYPES
           
private  JTree conditionTree
          The tree representing the condition.
private static org.slf4j.Logger LOGGER
          The logger object of this class.
private  CheckList<org.openpermis.policy.bean.ObligationBean> obligationList
          The list of obligations in the target access rule.
private  PropertyChangeListener propertyChangeListener
           
private static Class<?>[] RELATION_SUPPORTED_TYPES
          An array of parameter types allowed in the relations.
private  CheckList<org.openpermis.policy.Role> roleList
          The list of actions in the target access rule.
private static Class<?>[] SUPPORTED_TYPES
          An array of allowed parameter types.
private  CheckList<org.openpermis.policy.bean.TargetBean> targetList
          The list of targets in the target access rule.
 
Constructor Summary
TargetAccessRuleEditor(org.jdesktop.application.ApplicationContext context, AdapterTrader trader, TargetAccessRulePresenter presenter)
          Creates an target access rules tool view.
 
Method Summary
 void add()
          Adds a new term to the condition.
private  Object add(Object subTreeRoot, Object parentOfAdded)
           
 void addObligation()
           
 void addTarget()
           
 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  org.openpermis.policy.Predicate createAFalse()
           
private  org.openpermis.policy.Predicate createATrue()
           
private  void createNewTerm(Object[] newTerm)
           
 void edit()
          Edits a term from the condition.
private  Object edit(Object root, Object toBeEdited)
           
 void editObligation()
           
 void editTarget()
           
 void fillContentPane(JPanel panel)
           
private  String getFromMap(String key)
           
private  String[] getNamesOfArgumentsOfGivenType(Class<?> givenType)
           
private  DefaultTableModel makeASetTableModel(List<org.openpermis.policy.predicate.Value<?>> firstSetValuesList)
           
private  JComponent obligationList()
           
private  JComponent predicateTree()
           
private  JComponent predicateXml()
           
private  Object recreatePredicate(Object root, Object[] operands)
           
 void remove()
          Remove a term from the condition.
private  Object remove(Object root, Object toBeDeleted)
           
 void removeObligation()
           
 void removeTarget()
           
private  JComponent roleList()
           
private  void showAValueDialog(org.openpermis.policy.predicate.Value[] newValue, JComboBox typeCombo, boolean argumentOnly)
           
private  JComponent targetList()
           
 void updateState()
          Updater for changes of the presenter.
 
Methods inherited from class org.openpermis.editor.policy.view.AbstractEditor
adjustTitleParameters, canClose, contentPaneCreated, createContentPane, dispose, getModelSerialNumber, getPresenter, getTitleParameters, 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.1.0

SUPPORTED_TYPES

private static final Class<?>[] SUPPORTED_TYPES
An array of allowed parameter types.

Since:
0.3.0

RELATION_SUPPORTED_TYPES

private static final Class<?>[] RELATION_SUPPORTED_TYPES
An array of parameter types allowed in the relations.

Since:
0.3.0

CONDITION_TERM_TYPES

private static final Object[] CONDITION_TERM_TYPES
Since:
0.3.0

BOOLEAN_TERM_TYPES

private static final Object[] BOOLEAN_TERM_TYPES
Since:
0.3.0

targetList

private CheckList<org.openpermis.policy.bean.TargetBean> targetList
The list of targets in the target access rule.

Since:
0.1.0

roleList

private CheckList<org.openpermis.policy.Role> roleList
The list of actions in the target access rule.

Since:
0.1.0

obligationList

private CheckList<org.openpermis.policy.bean.ObligationBean> obligationList
The list of obligations in the target access rule.

Since:
0.3.0

conditionTree

private JTree conditionTree
The tree representing the condition.

Since:
0.3.0

propertyChangeListener

private PropertyChangeListener propertyChangeListener
Since:
0.3.0
Constructor Detail

TargetAccessRuleEditor

public TargetAccessRuleEditor(org.jdesktop.application.ApplicationContext context,
                              AdapterTrader trader,
                              TargetAccessRulePresenter presenter)
Creates an target access rules tool view.

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

add

private Object add(Object subTreeRoot,
                   Object parentOfAdded)
Since:
0.3.0

remove

private Object remove(Object root,
                      Object toBeDeleted)
Since:
0.3.0

edit

private Object edit(Object root,
                    Object toBeEdited)
Since:
0.3.0

recreatePredicate

private Object recreatePredicate(Object root,
                                 Object[] operands)
Since:
0.3.0

createNewTerm

private void createNewTerm(Object[] newTerm)
Since:
0.3.0

getNamesOfArgumentsOfGivenType

private String[] getNamesOfArgumentsOfGivenType(Class<?> givenType)
Since:
0.3.0

makeASetTableModel

private DefaultTableModel makeASetTableModel(List<org.openpermis.policy.predicate.Value<?>> firstSetValuesList)

showAValueDialog

private void showAValueDialog(org.openpermis.policy.predicate.Value[] newValue,
                              JComboBox typeCombo,
                              boolean argumentOnly)

getFromMap

private String getFromMap(String key)
Since:
0.3.0

createATrue

private org.openpermis.policy.Predicate createATrue()
Since:
0.3.0

createAFalse

private org.openpermis.policy.Predicate createAFalse()
Since:
0.3.0

addTarget

@Action
public void addTarget()
Since:
0.1.0

removeTarget

@Action
public void removeTarget()
Since:
0.1.0

editTarget

@Action
public void editTarget()
Since:
0.1.0

addObligation

@Action
public void addObligation()
Since:
0.3.0

removeObligation

@Action
public void removeObligation()
Since:
0.3.0

editObligation

@Action
public void editObligation()
Since:
0.3.0

add

@Action
public void add()
Adds a new term to the condition.

Since:
0.3.0

remove

@Action
public void remove()
Remove a term from the condition.

Since:
0.3.0

edit

@Action
public void edit()
Edits a term from the condition.

Since:
0.3.0

updateState

public void updateState()
Updater for changes of the presenter.

Since:
0.1.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<TargetAccessRulePresenter>
Parameters:
bindings - the binding group to add bindings to.
Since:
0.1.0

roleList

private JComponent roleList()
Since:
0.1.0

targetList

private JComponent targetList()
Since:
0.1.0

obligationList

private JComponent obligationList()
Since:
0.3.0

predicateXml

private JComponent predicateXml()
Since:
0.3.0

predicateTree

private JComponent predicateTree()
Since:
0.3.0

fillContentPane

public void fillContentPane(JPanel panel)
Specified by:
fillContentPane in class AbstractEditor<TargetAccessRulePresenter>
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.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG