|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.rse.ui.actions.SystemBaseAction
org.eclipse.rse.ui.actions.SystemBaseDialogAction
org.eclipse.rse.ui.actions.SystemBaseCopyAction
public abstract class SystemBaseCopyAction
An abstract base class for all copy actions. Defers minimal requirements to child classes.
Field Summary | |
---|---|
protected boolean |
copiedOk
|
protected ISystemProfileManager |
mgr
|
protected int |
mode
|
static int |
MODE_COPY
|
static int |
MODE_MOVE
|
protected String[] |
newNames
|
protected String[] |
oldNames
|
protected Object[] |
oldObjects
|
protected int |
runCount
|
protected Exception |
runException
|
protected ISystemRegistry |
sr
|
protected Object |
targetContainer
|
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.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 | |
---|---|
SystemBaseCopyAction(Shell parent,
int mode)
Constructor when using default action ID |
|
SystemBaseCopyAction(Shell parent,
String label,
int mode)
Constructor |
Method Summary | |
---|---|
protected abstract String |
checkForCollision(Shell shell,
IProgressMonitor monitor,
Object targetContainer,
Object oldObject,
String oldName)
|
void |
copyComplete(String operation)
Called after all the copy/move operations end, be it successfully or not. |
protected Dialog |
createDialog(Shell parent)
Override of parent. |
protected abstract boolean |
doCopy(Object targetContainer,
Object oldObject,
String newName,
IProgressMonitor monitor)
DO THE ACTUAL COPY OR MOVE. |
SystemMessage |
getCompletionMessage(Object targetContainer,
String[] oldNames,
String[] newNames)
Return complete message. |
protected SystemMessage |
getCopyingMessage()
Get the generic "Copying..." or "Moving..." message |
protected SystemMessage |
getCopyingMessage(String oldName)
Get the specific "Copying %1..." or "Moving %1..." message |
protected Object |
getDialogValue(Dialog dlg)
Required by parent. |
protected abstract String[] |
getOldNames()
|
protected abstract Object[] |
getOldObjects()
|
protected String |
getPromptString()
Get the verbiage prompt to show on line one of the copy dialog |
protected IRunnableContext |
getRunnableContext()
Get an IRunnable context to show progress in. |
protected Object |
getTargetContainer(Dialog dlg)
Override this method if you supply your own copy/move target dialog. |
protected abstract SystemSimpleContentElement |
getTreeInitialSelection()
|
protected abstract SystemSimpleContentElement |
getTreeModel()
|
boolean |
isValidTargetParent(SystemSimpleContentElement selectedElement)
This method is a callback from the select-target-parent dialog, allowing us to decide whether the current selected object is a valid parent object. |
protected boolean |
preCheckForCollision()
Do a pre-check for a collision situation. |
protected boolean |
preCheckForCollision(Shell shell,
Object targetContainer,
Object oldObject,
String oldName)
Overridable entry point when you want to prevent any copies/moves if any of the selected objects have a name collision. |
protected void |
reset()
Reset. |
void |
run(IProgressMonitor monitor)
Method required by IRunnableWithProgress interface. |
protected void |
showOperationCancelledMessage(Shell shell)
Show an error message when the user cancels the operation. |
protected void |
showOperationErrorMessage(Shell shell,
SystemMessageException exc)
Show an error message when the operation fails. |
protected void |
showOperationErrorMessage(Shell shell,
Throwable exc)
Show an error message when the operation fails. |
protected void |
showOperationMessage(Exception exc,
Shell shell)
Helper method to show an error message resulting from the attempted operation. |
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.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 |
Field Detail |
---|
protected ISystemProfileManager mgr
protected ISystemRegistry sr
protected String[] oldNames
protected String[] newNames
protected Object[] oldObjects
protected Object targetContainer
protected boolean copiedOk
protected Exception runException
protected int mode
protected int runCount
public static final int MODE_COPY
public static final int MODE_MOVE
Constructor Detail |
---|
public SystemBaseCopyAction(Shell parent, int mode)
parent
- Owning shellmode
- Either MODE_COPY or MODE_MOVE from this classpublic SystemBaseCopyAction(Shell parent, String label, int mode)
parent
- Owning shelllabel
- mode
- Either MODE_COPY or MODE_MOVE from this classMethod Detail |
---|
protected void reset()
protected Dialog createDialog(Shell parent)
createDialog
in class SystemBaseDialogAction
SystemBaseDialogAction.run()
protected abstract String[] getOldNames()
protected abstract Object[] getOldObjects()
protected String getPromptString()
protected abstract SystemSimpleContentElement getTreeModel()
protected abstract SystemSimpleContentElement getTreeInitialSelection()
public boolean isValidTargetParent(SystemSimpleContentElement selectedElement)
The default is to return true if the selected element has no children. This is sufficient for most cases. However, in some cases it is not, such as for filter strings where we want to only enable OK if a filter is selected. It is possible that filter pools have no filters, so the default algorithm is not sufficient. In these cases the child class can override this method.
isValidTargetParent
in interface ISystemCopyTargetSelectionCallback
protected Object getDialogValue(Dialog dlg)
getDialogValue
in class SystemBaseDialogAction
dlg
- The dialog object, after it has returned from open.protected IRunnableContext getRunnableContext()
protected Object getTargetContainer(Dialog dlg)
protected boolean preCheckForCollision()
protected boolean preCheckForCollision(Shell shell, Object targetContainer, Object oldObject, String oldName)
If you decide to override this, it is your responsibility to issue the error message to the user and return false here.
public void copyComplete(String operation)
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
run
in interface IRunnableWithProgress
InvocationTargetException
InterruptedException
protected abstract String checkForCollision(Shell shell, IProgressMonitor monitor, Object targetContainer, Object oldObject, String oldName)
protected SystemMessage getCopyingMessage()
protected SystemMessage getCopyingMessage(String oldName)
protected abstract boolean doCopy(Object targetContainer, Object oldObject, String newName, IProgressMonitor monitor) throws Exception
Exception
public SystemMessage getCompletionMessage(Object targetContainer, String[] oldNames, String[] newNames)
protected void showOperationMessage(Exception exc, Shell shell)
protected void showOperationErrorMessage(Shell shell, Throwable exc)
protected void showOperationErrorMessage(Shell shell, SystemMessageException exc)
protected void showOperationCancelledMessage(Shell shell)
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |