RSE
Release 1.0

org.eclipse.rse.files.ui.actions
Class SystemSelectRemoteFolderAction

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.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:


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
SystemSelectRemoteFolderAction(Shell shell)
          Constructor that uses default action label and tooltip
SystemSelectRemoteFolderAction(Shell shell, String label, String tooltip)
          Constructor when you have your own action label and tooltip
 
Method Summary
protected  Dialog createDialog(Shell shell)
          Called by eclipse when user selects this action
 void enableAddMode(ISystemAddFileListener caller)
          Enable Add mode.
 void enableAddMode(ISystemAddFileListener caller, String addLabel, String addToolTipText)
          Overloaded method that allows setting the label and tooltip text of the Add button.
protected  Object getDialogValue(Dialog dlg)
          Required by parent.
 IHost getSelectedConnection()
          Return selected connection
 IRemoteFile getSelectedFolder()
          Retrieve selected folder object.
 IRemoteFile[] getSelectedFolders()
          Retrieve selected folder objects.
 Object[] getSelectedObjects()
          Return all selected objects.
 void setAllowForMultipleParents(boolean multiple)
           
 void setAutoExpandDepth(int depth)
          Specify the zero-based auto-expand level for the tree.
 void setDefaultConnection(IHost conn)
          Set the connection to default the selection to
 void setDialogTitle(String title)
          Set the title for the dialog.
 void setHost(IHost conn)
          Set the system connection to restrict the user to seeing in the tree.
 void setMessage(String message)
          Set the message shown at the top of the form
 void setMultipleSelectionMode(boolean multiple)
          Set multiple selection mode.
 void setPreSelection(IRemoteFile selection)
          Set a file or folder to preselect.
 void setRestrictFolders(boolean restrict)
          Specify whether setRootFolder should prevent the user from being able to see or select any other folder.
 void setRootFolder(IHost connection, String folderAbsolutePath)
          Set the root folder from which to start listing files.
 void setRootFolder(IRemoteFile rootFolder)
          Set the root folder from which to start listing folders.
 void setSelectionTreeToolTipText(String tip)
          Set the tooltip text for the remote systems tree from which an item is selected.
 void setSelectionValidator(IValidatorRemoteSelection selectionValidator)
          Specify a validator to use when the user selects a remote file or folder.
 void setShowNewConnectionPrompt(boolean show)
          Set to true if a "New Connection..." special connection is to be shown for creating new connections
 void setShowPropertySheet(boolean show)
          Show the property sheet on the right hand side, to show the properties of the selected object.
 void setShowPropertySheet(boolean show, boolean initialState)
          Show the property sheet on the right hand side, to show the properties of the selected object.
 void setSystemType(String systemType)
          Convenience method to restrict to a single system type.
 void setSystemTypes(String[] systemTypes)
          Set the system types to restrict what connections the user sees, and what types of connections they can create.
 
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, 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

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 -
tooltip -
Method Detail

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.


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(String[] 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(String 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
See Also:
IRSESystemType

setShowNewConnectionPrompt

public void setShowNewConnectionPrompt(boolean show)
Set to true if a "New Connection..." special connection is to be shown for creating new connections


setAutoExpandDepth

public void setAutoExpandDepth(int depth)
Specify the zero-based auto-expand level for the tree. The default is zero, meaning only show the 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:

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:

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: If there is no parent, then we were given a root. In which case we will


setRestrictFolders

public void setRestrictFolders(boolean restrict)
Specify whether setRootFolder should prevent the user from being able to see or select any other folder. This causes this effect:
  1. The special filter for root/drives is not shown


enableAddMode

public void enableAddMode(ISystemAddFileListener caller)
Enable Add mode. This means the OK button is replaced with an Add button, and the Cancel with a Close button. When Add is pressed, the caller is called back. The dialog is not exited until Close is pressed.

When a library is selected, the caller is called back to decide to enable the Add button or not.


enableAddMode

public void enableAddMode(ISystemAddFileListener caller,
                          String addLabel,
                          String addToolTipText)
Overloaded method that allows setting the label and tooltip text of the Add button. If you pass null for the label, the default is used ("Add").


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()

setAllowForMultipleParents

public void setAllowForMultipleParents(boolean multiple)

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


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.

RSE
Release 1.0

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