RSE
Release 1.0

org.eclipse.rse.ui.actions
Class SystemProfileNameCopyAction

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.SystemProfileNameCopyAction
All Implemented Interfaces:
IAction, IRunnableWithProgress, ISelectionChangedListener, ISystemAction, ISystemDialogAction

public class SystemProfileNameCopyAction
extends SystemBaseDialogAction
implements IRunnableWithProgress

A copy profile action. Will copy the profile, and all connections for the profile. We must first prompt user for a new name for the copied profile.


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.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
SystemProfileNameCopyAction(Shell shell)
          Constructor for selection-sensitive popup menu for profiles in Team view.
 
Method Summary
protected  Dialog createDialog(Shell parent)
          Override of parent
static String getCopyingMessage(String oldName, String newName)
          Helper method to return the message "Copying &1 to &2..."
protected  Object getDialogValue(Dialog dlg)
          Required by parent.
protected  IRunnableContext getRunnableContext()
          Get an IRunnable context to show progress in.
 void run(IProgressMonitor monitor)
          Method required by IRunnableWithProgress interface.
 void setProfile(ISystemProfile profile)
          Set the profile
protected  void showOperationCancelledMessage(Shell shell)
          Show an error message when the user cancels the operation.
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.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getFirstSelection, getHelpContextId, getNextSelection, getRemoteAdapter, 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, updateSelection
 
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

SystemProfileNameCopyAction

public SystemProfileNameCopyAction(Shell shell)
Constructor for selection-sensitive popup menu for profiles in Team view.

Method Detail

setProfile

public void setProfile(ISystemProfile profile)
Set the profile


createDialog

protected Dialog createDialog(Shell parent)
Override of parent

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

getDialogValue

protected Object getDialogValue(Dialog dlg)
Required by parent. We use it to return the new name

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

getRunnableContext

protected IRunnableContext getRunnableContext()
Get an IRunnable context to show progress in. If there is currently a dialog or wizard up with a progress monitor in it, we will use this, else we will create a progress monitor dialog.


run

public void run(IProgressMonitor monitor)
         throws InvocationTargetException,
                InterruptedException
Method required by IRunnableWithProgress interface. Allows execution of a long-running operation modally by via a thread. In our case, it runs the copy operation with a visible progress monitor

Specified by:
run in interface IRunnableWithProgress
Throws:
InvocationTargetException
InterruptedException

getCopyingMessage

public static String getCopyingMessage(String oldName,
                                       String newName)
Helper method to return the message "Copying &1 to &2..."


showOperationMessage

protected void showOperationMessage(Exception exc,
                                    Shell shell)
Helper method to show an error message resulting from the attempted operation.


showOperationErrorMessage

protected void showOperationErrorMessage(Shell shell,
                                         Throwable exc)
Show an error message when the operation fails. Shows a common message by default. Overridable.


showOperationCancelledMessage

protected void showOperationCancelledMessage(Shell shell)
Show an error message when the user cancels the operation. Shows a common message by default. Overridable.


RSE
Release 1.0

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