|
org.eclipse.rse.files.ui.actions
Class SystemSelectRemoteFolderAction
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.SystemSelectRemoteFolderAction
-
All Implemented Interfaces:
-
IAction,
ISelectionChangedListener,
ISystemAction,
ISystemDialogAction
-
public class SystemSelectRemoteFolderAction
- extends
SystemBaseDialogAction
The action for allowing the user to select a remote folder.
To configure the functionality, call these methods:
To configure the text on the dialog, call these methods:
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
|
SystemSelectRemoteFolderAction
public SystemSelectRemoteFolderAction(
Shell shell)
- Constructor that uses default action label and tooltip
-
Parameters:
-
shell - The shell to hang the dialog off of
SystemSelectRemoteFolderAction
public SystemSelectRemoteFolderAction(
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.
setDialogTitle
public void setDialogTitle(
String title)
- Set the title for the dialog. The default is "Browse for Folder"
-
setFoldersOnly
public void setFoldersOnly(boolean flag)
-
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.
-
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 type names -
See Also:
-
IRSESystemType
setSystemType
public void setSystemType(
IRSESystemType systemType)
- Convenience method to restrict to a single system type.
Same as setSystemTypes(new String[] {systemType})
-
-
Parameters:
-
systemType - The name of the system type to restrict to,
or null to allow all 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.
This call effectively transforms the select dialog by:
- Preventing the user from selecting other connections
- Preventing the user from selecting other filter strings
-
-
Parameters:
-
connection - The connection to the remote system containing the root folder -
folderAbsolutePath - The fully qualified folder to start listing from (eg: "\folder1\folder2") -
See Also:
-
RemoteFileFilterString
setRootFolder
public void setRootFolder(
IRemoteFile rootFolder)
- Set the root folder from which to start listing folders.
This version identifies the folder via an IRemoteFile object.
There is another overload that identifies the folder via a connection and folder path.
This call effectively transforms the select dialog by:
- Preventing the user from selecting other connections
- Preventing the user from selecting other filter strings
-
-
Parameters:
-
rootFolder - The IRemoteFile object representing the remote folder to start the list from -
See Also:
-
RemoteFileFilterString
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.
-
-
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.
-
getSelectedFolder
public
IRemoteFile getSelectedFolder()
- Retrieve selected folder object. If multiple folders selected, returns the first.
-
getSelectedFolders
public
IRemoteFile[] getSelectedFolders()
- Retrieve selected folder objects. If no folders selected, returns an array of zero.
If one folder 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)!
It will always return null if the user cancelled the dialog.
-
-
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.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|