|
org.eclipse.rse.files.ui.actions
Class SystemSelectRemoteFileAction
java.lang.Object
org.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.files.ui.actions.SystemSelectRemoteFileAction
-
All Implemented Interfaces:
-
IAction,
ISelectionChangedListener,
ISystemAction,
ISystemDialogAction
-
public class SystemSelectRemoteFileAction
- extends
SystemBaseDialogAction
The action for allowing the user to select a remote file.
To configure, call these methods:
Call these methods to configure the text on the dialog
After running, call these methods to get the output:
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
|
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,
getContextMenuGroup,
getCurrentTreeView,
getFirstSelection,
getHelpContextId,
getNextSelection,
getRemoteAdapter,
getSelection,
getSelectionProvider,
getShell,
getShell,
getSystemConnection,
getViewAdapter,
getViewer,
isDummy,
isEnabled,
isSelectionSensitive,
issueTraceMessage,
selectionChanged,
setAvailableOffline,
setBusyCursor,
setContextMenuGroup,
setDisplayCursor,
setDisplayCursor,
setHelp,
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 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
|
SystemSelectRemoteFileAction
public SystemSelectRemoteFileAction(
Shell shell)
- Constructor that uses default action label and tooltip
-
Parameters:
-
shell - The shell to hang the dialog off of
SystemSelectRemoteFileAction
public SystemSelectRemoteFileAction(
Shell shell,
String label,
String tooltip)
- Constructor when you have your own action label and tooltip
-
Parameters:
-
shell - The shell to hang the dialog off of -
label - string to display in menu or toolbar -
tooltip - string to display when user hovers mouse over action.
setHost
public void setHost(
IHost conn)
- Set the system connection to restrict the user to seeing in the tree.
-
-
Overrides:
-
setHost
in class
SystemBaseAction
-
-
See Also:
-
setRootFolder(IHost, String)
setDefaultConnection
public void setDefaultConnection(
IHost conn)
- Set the connection to default the selection to
-
setSystemTypes
public void setSystemTypes(
IRSESystemType[] systemTypes)
- Set the system types to restrict what connections the user sees,
and what types of connections they can create.
-
-
Parameters:
-
systemTypes - An array of system types, or
null to allow all registered valid system types.
A system type is valid if at least one subsystem configuration
is registered against it.
setSystemType
public void setSystemType(
IRSESystemType systemType)
- Convenience method to restrict to a single system type.
Same as setSystemTypes(new IRSESystemType[] {systemType})
-
-
Parameters:
-
systemType - The name of the system type to restrict to, or
null to allow all registered valid system types.
A system type is valid if at least one subsystem configuration
is registered against it.
setShowNewConnectionPrompt
public void setShowNewConnectionPrompt(boolean show)
- Set to true if a "New Connection..." special connection is to be shown for creating new connections
-
setRootFolder
public void setRootFolder(
IHost connection,
String folderAbsolutePath)
- Set the root folder from which to start listing files.
This version identifies the folder via a connection object and absolute path.
There is another overload that identifies the folder via a single IRemoteFile object.
-
-
Parameters:
-
connection - The connection to the remote system containing the root folder -
folderAbsolutePath - The fully qualified folder to start listing from (eg: "\folder1\folder2")
setRootFolder
public void setRootFolder(
IRemoteFile rootFolder)
- Set the root folder from which to start listing files.
This version identifies the folder via an IRemoteFile object.
There is another overload that identifies the folder via a connection and folder path.
-
-
Parameters:
-
rootFolder - The IRemoteFile object representing the remote folder to start the list from
setPreSelection
public void setPreSelection(
IRemoteFile selection)
- Set a file or folder to preselect. This will:
- Set the parent folder as the root folder
- Pre-expand the parent folder
- Pre-select the given file or folder after expansion
If there is no parent, then we were given a root. In which case we will
- Force setRestrictFolders to false
- Pre-expand the root drives (Windows) or root files (Unix)
- Pre-select the given root drive (Windows only)
-
setShowPropertySheet
public void setShowPropertySheet(boolean show)
- Show the property sheet on the right hand side, to show the properties of the
selected object.
Default is false
-
setShowPropertySheet
public void setShowPropertySheet(boolean show,
boolean initialState)
- Show the property sheet on the right hand side, to show the properties of the
selected object.
This overload shows a Details>>> button so the user can decide if they want to see the
property sheet.
-
-
Parameters:
-
show - True if to show the property sheet within the dialog -
initialState - True if the property is to be initially displayed, false if it is not
to be displayed until the user presses the Details button.
setMultipleSelectionMode
public void setMultipleSelectionMode(boolean multiple)
- Set multiple selection mode. Default is single selection mode
If you turn on multiple selection mode, you must use the getSelectedObjects()
method to retrieve the list of selected objects.
Further, if you turn this on, it has the side effect of allowing the user
to select any remote object. The assumption being if you are prompting for
files, you also want to allow the user to select a folder, with the meaning
being that all files within the folder are implicitly selected.
-
-
See Also:
-
getSelectedObjects()
setSelectionValidator
public void setSelectionValidator(
IValidatorRemoteSelection selectionValidator)
- Specify a validator to use when the user selects a remote file or folder.
This allows you to decide if OK should be enabled or not for that remote file or folder.
-
setDialogTitle
public void setDialogTitle(
String title)
- Set the title for the dialog. The default is "Browse for Folder"
-
setMessage
public void setMessage(
String message)
- Set the message shown at the top of the form
-
setSelectionTreeToolTipText
public void setSelectionTreeToolTipText(
String tip)
- Set the tooltip text for the remote systems tree from which an item is selected.
-
getSelectedFile
public
IRemoteFile getSelectedFile()
- Retrieve selected file object. If multiple files selected, returns the first.
-
getSelectedFiles
public
IRemoteFile[] getSelectedFiles()
- Retrieve selected file objects. If no files selected, returns an array of zero.
If one file selected returns an array of one.
-
getSelectedObjects
public
Object[] getSelectedObjects()
- Return all selected objects. This method will return an array of one
unless you have called setMultipleSelectionMode(true)!
-
-
See Also:
-
setMultipleSelectionMode(boolean)
getSelectedConnection
public
IHost getSelectedConnection()
- Return selected connection
-
setCustomViewerFilter
public void setCustomViewerFilter(
SystemActionViewerFilter filter)
-
-
Since:
- 3.0
createDialog
protected
Dialog createDialog(
Shell shell)
- Called by eclipse when user selects this action
-
-
Specified by:
-
createDialog
in class
SystemBaseDialogAction
-
-
See Also:
-
SystemBaseDialogAction.run()
getDialogValue
protected
Object getDialogValue(
Dialog dlg)
- Required by parent. We return the selected object
-
-
Specified by:
-
getDialogValue
in class
SystemBaseDialogAction
-
-
Parameters:
-
dlg - The dialog object, after it has returned from open.
addViewerFilter
public void addViewerFilter(
ViewerFilter filter)
- Add viewer filter.
-
-
Parameters:
-
filter - a viewer filter.
setAllowFolderSelection
public void setAllowFolderSelection(boolean allow)
- Sets whether to allow folder selection. The default selection validator will use this to
determine whether the OK button will be enabled when a folder is selected. The default
is
true .
-
-
Parameters:
-
allow - true to allow folder selection, false otherwise.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|