RSE
Release 1.0

org.eclipse.rse.ui.actions
Class SystemCommonDeleteAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended byorg.eclipse.rse.ui.actions.SystemBaseAction
                  extended byorg.eclipse.rse.ui.actions.SystemBaseDialogAction
                      extended byorg.eclipse.rse.ui.actions.SystemCommonDeleteAction
All Implemented Interfaces:
IAction, ISelectionChangedListener, ISystemAction, ISystemDialogAction, ISystemIconConstants

public class SystemCommonDeleteAction
extends SystemBaseDialogAction
implements ISystemIconConstants

The action that displays the Delete confirmation dialog.There are two ways to use this action:

  1. When invoking from a class that implements ISystemDeleteTarget. In this case, that class will be called back to determine if this action is to be enabled or not, and to do the actual delete for each selected object, after the dialog is dismissed.
  2. When used without an ISystemDeleteTarget, in which case you need to call wasCancelled() after running the action, and then do your own delete.

If the input objects do not adapt to ISystemRemoteElementAdapter or ISystemViewElementAdapter, then you should call #setNameValidator(org.eclipse.rse.core.ui.validators.ISystemValidator) to specify a validator that is called to verify the typed new name is valid. Further, to show the type value of the input objects, they should implement ISystemTypedObject.

See Also:
SystemDeleteDialog

Nested Class Summary
 class SystemCommonDeleteAction.DeleteRunnable
           
 
Field Summary
 
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseDialogAction
cancelled, dlgHelpId, needsProgressMonitor, needsProgressMonitorSet, processAll, value
 
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
 
Fields inherited from interface org.eclipse.rse.ui.ISystemIconConstants
ICON_ACTIONS_DIR, ICON_BANNER_SUFFIX, ICON_EXT, ICON_IDE_COLLAPSEALL_ID, ICON_IDE_FILTER_ID, ICON_IDE_LINKTOEDITOR_ID, ICON_IDE_REFRESH_ID, ICON_MODEL_DIR, ICON_NEWACTIONS_DIR, ICON_OBJS_DIR, ICON_SEARCH_CLEAR_HISTORY, ICON_SEARCH_CLEAR_HISTORY_ID, ICON_SEARCH_CLEAR_HISTORY_ROOT, ICON_SEARCH_REMOVE_ALL_MATCHES, ICON_SEARCH_REMOVE_ALL_MATCHES_ID, ICON_SEARCH_REMOVE_ALL_MATCHES_ROOT, ICON_SEARCH_REMOVE_SELECTED_MATCHES, ICON_SEARCH_REMOVE_SELECTED_MATCHES_ID, ICON_SEARCH_REMOVE_SELECTED_MATCHES_ROOT, ICON_SUFFIX, ICON_SYSTEM_ARROW_DOWN, ICON_SYSTEM_ARROW_DOWN_ID, ICON_SYSTEM_ARROW_DOWN_ROOT, ICON_SYSTEM_ARROW_UP, ICON_SYSTEM_ARROW_UP_ID, ICON_SYSTEM_ARROW_UP_ROOT, ICON_SYSTEM_BLANK, ICON_SYSTEM_BLANK_ID, ICON_SYSTEM_BLANK_ROOT, ICON_SYSTEM_CANCEL, ICON_SYSTEM_CANCEL_ID, ICON_SYSTEM_CANCEL_ROOT, ICON_SYSTEM_CANCEL_SHELL, ICON_SYSTEM_CANCEL_SHELL_ID, ICON_SYSTEM_CANCEL_SHELL_ROOT, ICON_SYSTEM_CHANGEFILTER, ICON_SYSTEM_CHANGEFILTER_ID, ICON_SYSTEM_CHANGEFILTER_ROOT, ICON_SYSTEM_CLEAR, ICON_SYSTEM_CLEAR_ALL, ICON_SYSTEM_CLEAR_ALL_ID, ICON_SYSTEM_CLEAR_ALL_ROOT, ICON_SYSTEM_CLEAR_ID, ICON_SYSTEM_CLEAR_ROOT, ICON_SYSTEM_CLEAR_SELECTED, ICON_SYSTEM_CLEAR_SELECTED_ID, ICON_SYSTEM_CLEAR_SELECTED_ROOT, ICON_SYSTEM_COMBINE, ICON_SYSTEM_COMBINE_ID, ICON_SYSTEM_COMBINE_ROOT, ICON_SYSTEM_COMPILE, ICON_SYSTEM_COMPILE_ID, ICON_SYSTEM_COMPILE_ROOT, ICON_SYSTEM_CONNECTION, ICON_SYSTEM_CONNECTION_ID, ICON_SYSTEM_CONNECTION_ROOT, ICON_SYSTEM_CONNECTIONLIVE, ICON_SYSTEM_CONNECTIONLIVE_ID, ICON_SYSTEM_CONNECTIONLIVE_ROOT, ICON_SYSTEM_CONNECTOR_SERVICE, ICON_SYSTEM_CONNECTOR_SERVICE_ID, ICON_SYSTEM_CONNECTOR_SERVICE_ROOT, ICON_SYSTEM_CONVERT, ICON_SYSTEM_CONVERT_ID, ICON_SYSTEM_CONVERT_ROOT, ICON_SYSTEM_DELETEREF, ICON_SYSTEM_DELETEREF_ID, ICON_SYSTEM_DELETEREF_ROOT, ICON_SYSTEM_EMPTY, ICON_SYSTEM_EMPTY_ID, ICON_SYSTEM_EMPTY_ROOT, ICON_SYSTEM_ENVVAR, ICON_SYSTEM_ENVVAR_ID, ICON_SYSTEM_ENVVAR_LIBPATH, ICON_SYSTEM_ENVVAR_LIBPATH_ID, ICON_SYSTEM_ENVVAR_LIBPATH_ROOT, ICON_SYSTEM_ENVVAR_PATH, ICON_SYSTEM_ENVVAR_PATH_ID, ICON_SYSTEM_ENVVAR_PATH_ROOT, ICON_SYSTEM_ENVVAR_ROOT, ICON_SYSTEM_ERROR, ICON_SYSTEM_ERROR_ID, ICON_SYSTEM_ERROR_ROOT, ICON_SYSTEM_EXPORT_SHELL_HISTORY, ICON_SYSTEM_EXPORT_SHELL_HISTORY_ID, ICON_SYSTEM_EXPORT_SHELL_HISTORY_ROOT, ICON_SYSTEM_EXPORT_SHELL_OUTPUT, ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ID, ICON_SYSTEM_EXPORT_SHELL_OUTPUT_ROOT, ICON_SYSTEM_EXTRACT, ICON_SYSTEM_EXTRACT_ID, ICON_SYSTEM_EXTRACT_ROOT, ICON_SYSTEM_EXTRACTTO, ICON_SYSTEM_EXTRACTTO_ID, ICON_SYSTEM_EXTRACTTO_ROOT, ICON_SYSTEM_FAILED, ICON_SYSTEM_FAILED_ID, ICON_SYSTEM_FAILED_ROOT, ICON_SYSTEM_FILTER, ICON_SYSTEM_FILTER_ID, ICON_SYSTEM_FILTER_ROOT, ICON_SYSTEM_FILTERPOOL, ICON_SYSTEM_FILTERPOOL_ID, ICON_SYSTEM_FILTERPOOL_ROOT, ICON_SYSTEM_FILTERSTRING, ICON_SYSTEM_FILTERSTRING_ID, ICON_SYSTEM_FILTERSTRING_ROOT, ICON_SYSTEM_FOLDER, ICON_SYSTEM_FOLDER_ID, ICON_SYSTEM_FOLDER_ROOT, ICON_SYSTEM_HELP, ICON_SYSTEM_HELP_ID, ICON_SYSTEM_HELP_ROOT, ICON_SYSTEM_INFO, ICON_SYSTEM_INFO_ID, ICON_SYSTEM_INFO_ROOT, ICON_SYSTEM_INFO_TREE, ICON_SYSTEM_INFO_TREE_ID, ICON_SYSTEM_INFO_TREE_ROOT, ICON_SYSTEM_LAUNCHER_CONFIGURATION, ICON_SYSTEM_LAUNCHER_CONFIGURATION_ID, ICON_SYSTEM_LAUNCHER_CONFIGURATION_ROOT, ICON_SYSTEM_LOCK, ICON_SYSTEM_LOCK_ID, ICON_SYSTEM_LOCK_ROOT, ICON_SYSTEM_MAKEPROFILEACTIVE, ICON_SYSTEM_MAKEPROFILEACTIVE_ID, ICON_SYSTEM_MAKEPROFILEACTIVE_ROOT, ICON_SYSTEM_MAKEPROFILEINACTIVE, ICON_SYSTEM_MAKEPROFILEINACTIVE_ID, ICON_SYSTEM_MAKEPROFILEINACTIVE_ROOT, ICON_SYSTEM_MOVE, ICON_SYSTEM_MOVE_ID, ICON_SYSTEM_MOVE_ROOT, ICON_SYSTEM_MOVEDOWN, ICON_SYSTEM_MOVEDOWN_ID, ICON_SYSTEM_MOVEDOWN_ROOT, ICON_SYSTEM_MOVEUP, ICON_SYSTEM_MOVEUP_ID, ICON_SYSTEM_MOVEUP_ROOT, ICON_SYSTEM_NEW, ICON_SYSTEM_NEW_ID, ICON_SYSTEM_NEW_ROOT, ICON_SYSTEM_NEWCONNECTION, ICON_SYSTEM_NEWCONNECTION_ID, ICON_SYSTEM_NEWCONNECTION_ROOT, ICON_SYSTEM_NEWCONNECTIONWIZARD, ICON_SYSTEM_NEWCONNECTIONWIZARD_ID, ICON_SYSTEM_NEWCONNECTIONWIZARD_ROOT, ICON_SYSTEM_NEWFILE, ICON_SYSTEM_NEWFILE_ID, ICON_SYSTEM_NEWFILE_ROOT, ICON_SYSTEM_NEWFILEWIZARD, ICON_SYSTEM_NEWFILEWIZARD_ID, ICON_SYSTEM_NEWFILEWIZARD_ROOT, ICON_SYSTEM_NEWFILTER, ICON_SYSTEM_NEWFILTER_ID, ICON_SYSTEM_NEWFILTER_ROOT, ICON_SYSTEM_NEWFILTERPOOL, ICON_SYSTEM_NEWFILTERPOOL_ID, ICON_SYSTEM_NEWFILTERPOOL_ROOT, ICON_SYSTEM_NEWFILTERPOOLREF, ICON_SYSTEM_NEWFILTERPOOLREF_ID, ICON_SYSTEM_NEWFILTERPOOLREF_ROOT, ICON_SYSTEM_NEWFILTERPOOLWIZARD, ICON_SYSTEM_NEWFILTERPOOLWIZARD_ID, ICON_SYSTEM_NEWFILTERPOOLWIZARD_ROOT, ICON_SYSTEM_NEWFILTERWIZARD, ICON_SYSTEM_NEWFILTERWIZARD_ID, ICON_SYSTEM_NEWFILTERWIZARD_ROOT, ICON_SYSTEM_NEWFOLDER, ICON_SYSTEM_NEWFOLDER_ID, ICON_SYSTEM_NEWFOLDER_ROOT, ICON_SYSTEM_NEWFOLDERWIZARD, ICON_SYSTEM_NEWFOLDERWIZARD_ID, ICON_SYSTEM_NEWFOLDERWIZARD_ROOT, ICON_SYSTEM_NEWPROFILE, ICON_SYSTEM_NEWPROFILE_ID, ICON_SYSTEM_NEWPROFILE_ROOT, ICON_SYSTEM_NEWPROFILEWIZARD, ICON_SYSTEM_NEWPROFILEWIZARD_ID, ICON_SYSTEM_NEWPROFILEWIZARD_ROOT, ICON_SYSTEM_OK, ICON_SYSTEM_OK_ID, ICON_SYSTEM_OK_ROOT, ICON_SYSTEM_PERSPECTIVE, ICON_SYSTEM_PERSPECTIVE_ID, ICON_SYSTEM_PERSPECTIVE_ROOT, ICON_SYSTEM_PROCESS, ICON_SYSTEM_PROCESS_ID, ICON_SYSTEM_PROCESS_ROOT, ICON_SYSTEM_PROFILE, ICON_SYSTEM_PROFILE_ACTIVE, ICON_SYSTEM_PROFILE_ACTIVE_ID, ICON_SYSTEM_PROFILE_ACTIVE_ROOT, ICON_SYSTEM_PROFILE_ID, ICON_SYSTEM_PROFILE_ROOT, ICON_SYSTEM_PROPERTIES, ICON_SYSTEM_PROPERTIES_ID, ICON_SYSTEM_PROPERTIES_ROOT, ICON_SYSTEM_REFRESH, ICON_SYSTEM_REFRESH_ID, ICON_SYSTEM_REFRESH_ROOT, ICON_SYSTEM_REMOVE_SHELL, ICON_SYSTEM_REMOVE_SHELL_ID, ICON_SYSTEM_REMOVE_SHELL_ROOT, ICON_SYSTEM_RENAME, ICON_SYSTEM_RENAME_ID, ICON_SYSTEM_RENAME_ROOT, ICON_SYSTEM_ROOTDRIVE, ICON_SYSTEM_ROOTDRIVE_ID, ICON_SYSTEM_ROOTDRIVE_ROOT, ICON_SYSTEM_ROOTDRIVEOPEN, ICON_SYSTEM_ROOTDRIVEOPEN_ID, ICON_SYSTEM_ROOTDRIVEOPEN_ROOT, ICON_SYSTEM_RUN, ICON_SYSTEM_RUN_ID, ICON_SYSTEM_RUN_ROOT, ICON_SYSTEM_SEARCH, ICON_SYSTEM_SEARCH_ID, ICON_SYSTEM_SEARCH_RESULT, ICON_SYSTEM_SEARCH_RESULT_ID, ICON_SYSTEM_SEARCH_RESULT_ROOT, ICON_SYSTEM_SEARCH_ROOT, ICON_SYSTEM_SELECTFILTERPOOLS, ICON_SYSTEM_SELECTFILTERPOOLS_ID, ICON_SYSTEM_SELECTFILTERPOOLS_ROOT, ICON_SYSTEM_SELECTPROFILE, ICON_SYSTEM_SELECTPROFILE_ID, ICON_SYSTEM_SELECTPROFILE_ROOT, ICON_SYSTEM_SERVICE, ICON_SYSTEM_SERVICE_ID, ICON_SYSTEM_SERVICE_ROOT, ICON_SYSTEM_SHELL, ICON_SYSTEM_SHELL_ID, ICON_SYSTEM_SHELL_ROOT, ICON_SYSTEM_SHELLLIVE, ICON_SYSTEM_SHELLLIVE_ID, ICON_SYSTEM_SHELLLIVE_ROOT, ICON_SYSTEM_SHOW_MONITOR, ICON_SYSTEM_SHOW_MONITOR_ID, ICON_SYSTEM_SHOW_MONITOR_ROOT, ICON_SYSTEM_SHOW_SHELL, ICON_SYSTEM_SHOW_SHELL_ID, ICON_SYSTEM_SHOW_SHELL_ROOT, ICON_SYSTEM_SHOW_TABLE, ICON_SYSTEM_SHOW_TABLE_ID, ICON_SYSTEM_SHOW_TABLE_ROOT, ICON_SYSTEM_STOP, ICON_SYSTEM_STOP_ID, ICON_SYSTEM_STOP_ROOT, ICON_SYSTEM_TARGET, ICON_SYSTEM_TARGET_ID, ICON_SYSTEM_TARGET_ROOT, ICON_SYSTEM_WARNING, ICON_SYSTEM_WARNING_ID, ICON_SYSTEM_WARNING_ROOT, ICON_SYSTEM_WORKWITHCOMPILECMDS, ICON_SYSTEM_WORKWITHCOMPILECMDS_ID, ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT, ICON_SYSTEM_WORKWITHFILTERPOOLS, ICON_SYSTEM_WORKWITHFILTERPOOLS_ID, ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT, ICON_SYSTEM_WORKWITHNAMEDTYPES, ICON_SYSTEM_WORKWITHNAMEDTYPES_ID, ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT, ICON_SYSTEM_WORKWITHUSERACTIONS, ICON_SYSTEM_WORKWITHUSERACTIONS_ID, ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT, ICON_WIZARD_DIR, PLUGIN_ID, PREFIX
 
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
SystemCommonDeleteAction(Shell parent)
          Constructor for SystemDeleteAction when not using a delete target
SystemCommonDeleteAction(Shell parent, ISystemDeleteTarget deleteTarget)
          Constructor for SystemDeleteAction when using a delete target
 
Method Summary
protected  Dialog createDialog(Shell shell)
          If you decide to use the supplied run method as is, then you must override this method to create and return the dialog that is displayed by the default run method implementation.
protected  Object getDialogValue(Dialog dlg)
          Required by parent.
protected  ISystemRemoteElementAdapter getRemoteAdapter(Object o)
          Returns the implementation of ISystemRemoteElement for the given object.
protected  IRunnableContext getRunnableContext(Shell shell)
           
 void setPromptLabel(String text)
          Specify the text to show for the label prompt.
 boolean updateSelection(IStructuredSelection selection)
          Called by SystemBaseAction when selection is set.
 
Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseDialogAction
getDialogHelpContextId, getNeedsProgressMonitor, getProcessAllSelections, getValue, run, setDialogHelp, setNeedsProgressMonitor, setProcessAllSelections, setValue, wasCancelled, wasNeedsProgressMonitorSet
 
Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getFirstSelection, getHelpContextId, getNextSelection, getSelection, getSelectionProvider, getShell, getShell, getSystemConnection, getViewer, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setHost, setInputs, setSelection, setSelectionProvider, setSelectionSensitive, setShell, setTracing, setTracing, setViewer
 
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, 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.rse.ui.actions.ISystemAction
allowOnMultipleSelection, getContextMenuGroup, getHelpContextId, getSelection, getShell, getViewer, isDummy, isSelectionSensitive, setContextMenuGroup, setHelp, setInputs, setSelection, setSelectionSensitive, setShell, setViewer
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from interface org.eclipse.jface.viewers.ISelectionChangedListener
selectionChanged
 

Constructor Detail

SystemCommonDeleteAction

public SystemCommonDeleteAction(Shell parent,
                                ISystemDeleteTarget deleteTarget)
Constructor for SystemDeleteAction when using a delete target

Parameters:
parent - The Shell of the parent UI for this dialog
deleteTarget - The UI part that has selectable and deletable parts.

SystemCommonDeleteAction

public SystemCommonDeleteAction(Shell parent)
Constructor for SystemDeleteAction when not using a delete target

Parameters:
parent - The Shell of the parent UI for this dialog
Method Detail

setPromptLabel

public void setPromptLabel(String text)
Specify the text to show for the label prompt. The default is "Delete selected resources?"


updateSelection

public boolean updateSelection(IStructuredSelection selection)
Called by SystemBaseAction when selection is set. Our opportunity to verify we are allowed for this selected type.

Overrides:
updateSelection in class SystemBaseAction

createDialog

protected Dialog createDialog(Shell shell)
If you decide to use the supplied run method as is, then you must override this method to create and return the dialog that is displayed by the default run method implementation.

If you override run with your own, then simply implement this to return null as it won't be used.

Specified by:
createDialog in class SystemBaseDialogAction
See Also:
SystemBaseDialogAction.run()

getDialogValue

protected Object getDialogValue(Dialog dlg)
Required by parent. In our case, we overload it to also perform the deletion, but only if using a delete target, else it is up to the caller to call wasCancelled() and if not true, do their own deletion.

Specified by:
getDialogValue in class SystemBaseDialogAction
Parameters:
dlg - The dialog object, after it has returned from open.

getRunnableContext

protected IRunnableContext getRunnableContext(Shell shell)

getRemoteAdapter

protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
Returns the implementation of ISystemRemoteElement for the given object. Returns null if this object does not adaptable to this.

Overrides:
getRemoteAdapter in class SystemBaseAction

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.