Package org.eclipse.net4j.util.ui.actions

# Class SafeAction

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.net4j.util.ui.actions.SafeAction

All Implemented Interfaces:
  `IAction`

Direct Known Subclasses:
  `LongRunningAction`, `MasterDetailsView.RefreshAction`, `SashLayoutAction`, `ToggleAction`

public abstract class SafeAction extends Action

Author:
  Eike Stepper

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`INTERACTIVE`

### 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

Constructors
Constructor
Description
`SafeAction()`
`SafeAction(String text)`
`SafeAction(String text, int style)`
`SafeAction(String text, String toolTipText)`
`SafeAction(String text, String toolTipText, ImageDescriptor image)`
`SafeAction(String text, ImageDescriptor image)`

## Method Summary

Modifier and Type
Method
Description
`protected final Event`
`getEvent()`
`Shell`
`getShell()`
`final void`
`run()`
`final void`
`runWithEvent(Event event)`
`protected abstract void`
`safeRun()`

### 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, 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`

## Field Details

### INTERACTIVE

public static final String INTERACTIVE

## Constructor Details

### SafeAction

public SafeAction()

### SafeAction

public SafeAction(String text, String toolTipText, ImageDescriptor image)

### SafeAction

public SafeAction(String text, String toolTipText)

### SafeAction

public SafeAction(String text, ImageDescriptor image)

### SafeAction

public SafeAction(String text, int style)

### SafeAction

public SafeAction(String text)

## Method Details

### getShell

public Shell getShell()

Since:
  3.5

### run

public final void run()

Specified by:
  `run` in interface `IAction`
Overrides:
  `run` in class `Action`

### runWithEvent

public final void runWithEvent(Event event)

Specified by:
  `runWithEvent` in interface `IAction`
Overrides:
  `runWithEvent` in class `Action`

### getEvent

protected final Event getEvent()

Since:
  3.21

### safeRun

protected abstract void safeRun() throws Exception

Throws:
  `Exception`