Elexis API documentation as of September 4 2011

ch.elexis.actions
Class RestrictedAction

java.lang.Object
  extended by Action
      extended by ch.elexis.actions.RestrictedAction

public abstract class RestrictedAction
extends Action

Special class for actiosn requiring special access rights. The run() method of this class checks the required access rights and runs doRun() if access is granted. Classes extending this class must implement the method doRun() instead of run(). Users of this class may register a listener to get informed about missing rights during execution of the action. (Usually, this is not required, because the action is disabled if the user has not the required rights. See setEnabled())


Nested Class Summary
static class RestrictedAction.RestrictionEvent
          Event containing the required right.
static interface RestrictedAction.RestrictionListener
          Users of this class can register a RestrictionListener to get informed about missing rights during execution of the action.
 
Constructor Summary
RestrictedAction(ACE necessaryRight)
           
RestrictedAction(ACE necessaryRight, java.lang.String text)
           
RestrictedAction(ACE necessaryRight, java.lang.String text, int style)
           
 
Method Summary
 void addRestrictionListener(RestrictedAction.RestrictionListener listener)
          Register a listener to get informed about missing rights.
 void disableAutoAdapt()
          Remove this RestrcitedAction from the AutoAdapt queue
abstract  void doRun()
          Called by RestrictedAction.run() after access rights check.
 void enableAutoAdapt()
          If AutoAdapt is enabled, the Action will reflect is visual representation according to the current user's rights automatically.
 void reflectRight()
          Sets the enabled status of this action according to the required right.
 void removeRestrictionListener(RestrictedAction.RestrictionListener listener)
          Remove a previously registered listener.
 void run()
          Checks the required access rights and then calls doRun().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestrictedAction

public RestrictedAction(ACE necessaryRight)

RestrictedAction

public RestrictedAction(ACE necessaryRight,
                        java.lang.String text,
                        int style)

RestrictedAction

public RestrictedAction(ACE necessaryRight,
                        java.lang.String text)
Method Detail

enableAutoAdapt

public void enableAutoAdapt()
If AutoAdapt is enabled, the Action will reflect is visual representation according to the current user's rights automatically. If AutoAdapt is enabled, then disableAutoAdapt MUST be called on Disposal


disableAutoAdapt

public void disableAutoAdapt()
Remove this RestrcitedAction from the AutoAdapt queue


reflectRight

public void reflectRight()
Sets the enabled status of this action according to the required right. Unchecks the action if the required right is not available.


run

public void run()
Checks the required access rights and then calls doRun().


doRun

public abstract void doRun()
Called by RestrictedAction.run() after access rights check. Classes extending RestrictedAction must implement this method instead of run().


addRestrictionListener

public void addRestrictionListener(RestrictedAction.RestrictionListener listener)
Register a listener to get informed about missing rights.

Parameters:
listener - the listener to register.

removeRestrictionListener

public void removeRestrictionListener(RestrictedAction.RestrictionListener listener)
Remove a previously registered listener.

Parameters:
listener - the listener to remove.

Elexis API documentation as of September 4 2011

Copyright 2005-2010 by Gerry Weirich, Elexis