Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.elexis.actions
Class RestrictedAction

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.jface.action.AbstractAction
          extended by org.eclipse.jface.action.Action
              extended by ch.elexis.actions.RestrictedAction
All Implemented Interfaces:
org.eclipse.jface.action.IAction

public abstract class RestrictedAction
extends org.eclipse.jface.action.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.
 
Field Summary
protected  ACE necessaryRight
           
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
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 org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

necessaryRight

protected ACE necessaryRight
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().

Specified by:
run in interface org.eclipse.jface.action.IAction
Overrides:
run in class org.eclipse.jface.action.Action

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: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013