public class CopyResourceAction extends SelectionListenerAction implements ISelectionValidator
This class may be instantiated; it is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
static String |
ID
The id of this action.
|
protected CopyFilesAndFoldersOperation |
operation
The operation to run.
|
protected IShellProvider |
shellProvider
The IShellProvider in which to show any dialogs.
|
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 and Description |
---|
CopyResourceAction(IShellProvider provider)
Creates a new action
|
CopyResourceAction(Shell shell)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected CopyFilesAndFoldersOperation |
createOperation()
Returns the operation to perform when this action runs.
|
String[] |
getModelProviderIds()
Returns the model provider ids that are known to the client
that instantiated this operation.
|
static IPath |
getNewNameFor(IPath originalName,
IWorkspace workspace)
Returns a new name for a copy of the resource at the given path in the given
workspace.
|
protected IResource[] |
getResources(List resourceList)
Returns an array of resources to use for the operation from
the provided list.
|
String |
isValid(Object destination)
The
CopyResourceAction implementation of this
ISelectionValidator method checks whether the given path
is a good place to copy the selected resources. |
void |
run()
The default implementation of this
IAction method does
nothing. |
protected void |
runOperation(IResource[] resources,
IContainer destination)
Runs the operation created in
createOperation |
void |
setModelProviderIds(String[] modelProviderIds)
Sets the model provider ids that are known to the client
that instantiated this operation.
|
protected boolean |
updateSelection(IStructuredSelection selection)
The
CopyResourceAction implementation of this
SelectionListenerAction method enables this action only if
all of the one or more selections are sibling resources which are
local (depth infinity). |
clearCache, getSelectedNonResources, getSelectedResources, resourceIsType, selectionIsOfType
getStructuredSelection, runWithEvent, selectionChanged, selectionChanged
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
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public static final String ID
protected IShellProvider shellProvider
protected CopyFilesAndFoldersOperation operation
public CopyResourceAction(Shell shell)
CopyResourceAction(IShellProvider)
shell
- the shell for any dialogspublic CopyResourceAction(IShellProvider provider)
provider
- the shell for any dialogspublic static IPath getNewNameFor(IPath originalName, IWorkspace workspace)
Note this method is for internal use only.
originalName
- the full path of the resourceworkspace
- the workspacenull
if the resource
should not be copiedprotected CopyFilesAndFoldersOperation createOperation()
protected IResource[] getResources(List resourceList)
resourceList
- The list of resources to converted into an array.public String isValid(Object destination)
CopyResourceAction
implementation of this
ISelectionValidator
method checks whether the given path
is a good place to copy the selected resources.isValid
in interface ISelectionValidator
destination
- the selection to be validatednull
indicating
that the value is validpublic void run()
Action
IAction
method does
nothing. Subclasses should override this method if they do not need
information from the triggering event, or override
runWithEvent(Event)
if they do.run
in interface IAction
run
in class Action
How radio buttons are handled
,
How check boxes are handled
protected void runOperation(IResource[] resources, IContainer destination)
createOperation
resources
- source resources to pass to the operationdestination
- destination container to pass to the operationprotected boolean updateSelection(IStructuredSelection selection)
CopyResourceAction
implementation of this
SelectionListenerAction
method enables this action only if
all of the one or more selections are sibling resources which are
local (depth infinity).updateSelection
in class BaseSelectionListenerAction
selection
- the new selectiontrue
if the action should be enabled for this selection,
and false
otherwisepublic String[] getModelProviderIds()
public void setModelProviderIds(String[] modelProviderIds)
modelProviderIds
- the model providers known to the client
who is using this operation.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.