RSE
Release 2.0

org.eclipse.rse.files.ui.dialogs
Class SystemSelectRemoteFileOrFolderDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.rse.ui.dialogs.SystemPromptDialog
              extended by org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog
All Implemented Interfaces:
Runnable, IDialogConstants, IDialogPage, IRunnableContext, IShellProvider, ISystemPromptDialog, ISystemMessageLine, Listener
Direct Known Subclasses:
SaveAsDialog

Deprecated. should be using SystemRemoteResourceDialog now

public class SystemSelectRemoteFileOrFolderDialog
extends SystemPromptDialog

Dialog for allowing users to select a remote file or folder. This is a thin dialog wrapper on top of the SystemSelectRemoteFileOrFolderForm widget, which you could optionally imbed directly into your own dialog or wizard page.

Call these methods to configure the functionality of the dialog

Call these methods to configure the text on the dialog

After running, call these methods to get the output:

See Also:
SystemSelectRemoteFileAction, SystemSelectRemoteFolderAction, SystemRemoteFileDialog, SystemRemoteFolderDialog

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
static boolean FILE_MODE
          Deprecated.  
static boolean FOLDER_MODE
          Deprecated.  
protected  SystemSelectRemoteFileOrFolderForm form
          Deprecated.  
protected  IHost outputConnection
          Deprecated.  
 
Fields inherited from class org.eclipse.rse.ui.dialogs.SystemPromptDialog
activeRunningOperations, ADD_BUTTON_NO, ADD_BUTTON_YES, ADD_ID, addButton, arrowCursor, BROWSE_BUTTON_NO, BROWSE_BUTTON_YES, BROWSE_ID, browseButton, buttonsComposite, CANCEL_ALL_ID, cancelAllButton, cancelAllPressed, cancelButton, cancelListener, DETAILS_BUTTON_NO, DETAILS_BUTTON_YES, DETAILS_ID, detailsButton, detailsButtonHideMode, detailsHideLabel, detailsShowLabel, dialogAreaComposite, dialogMnemonics, fMessageLine, helpId, horizontalSpacing, initialAddButtonEnabledState, initialDetailsButtonEnabledState, initialOKButtonEnabledState, inputObject, labelAdd, labelBrowse, labelCancel, labelCancelAll, labelDetailsHide, labelDetailsShow, labelOk, labelTest, marginHeight, marginWidth, minHeight, minWidth, needsProgressMonitor, noShowAgainButton, noShowAgainOption, okButton, okPressed, operationCancelableState, outputObject, outputObjectValidator, overallShell, pack, parentComposite, pendingErrorMessage, pendingMessage, prefId, prefStore, prefValAsSelected, progressMonitorPart, showAddButton, showBrowseButton, showCancelAllButton, showDetailsButton, showOkButton, showTestButton, TEST_BUTTON_NO, TEST_BUTTON_YES, TEST_ID, testButton, tipAdd, tipBrowse, tipCancel, tipCancelAll, tipDetailsHide, tipDetailsShow, tipOk, tipTest, title, titleImage, verticalSpacing, waitCursor, windowClosingDialog
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Fields inherited from interface org.eclipse.jface.dialogs.IDialogConstants
ABORT_ID, ABORT_LABEL, BACK_ID, BACK_LABEL, BUTTON_BAR_HEIGHT, BUTTON_HEIGHT, BUTTON_MARGIN, BUTTON_WIDTH, CANCEL_ID, CANCEL_LABEL, CLIENT_ID, CLOSE_ID, CLOSE_LABEL, DESELECT_ALL_ID, ENTRY_FIELD_WIDTH, FINISH_ID, FINISH_LABEL, HELP_ID, HELP_LABEL, HIDE_DETAILS_LABEL, HORIZONTAL_MARGIN, HORIZONTAL_SPACING, IGNORE_ID, IGNORE_LABEL, INDENT, INTERNAL_ID, LEFT_MARGIN, MINIMUM_MESSAGE_AREA_WIDTH, NEXT_ID, NEXT_LABEL, NO_ID, NO_LABEL, NO_TO_ALL_ID, NO_TO_ALL_LABEL, OK_ID, OK_LABEL, OPEN_ID, OPEN_LABEL, PROCEED_ID, PROCEED_LABEL, RETRY_ID, RETRY_LABEL, SELECT_ALL_ID, SELECT_TYPES_ID, SHOW_DETAILS_LABEL, SKIP_ID, SKIP_LABEL, SMALL_INDENT, STOP_ID, STOP_LABEL, VERTICAL_MARGIN, VERTICAL_SPACING, YES_ID, YES_LABEL, YES_TO_ALL_ID, YES_TO_ALL_LABEL
 
Constructor Summary
SystemSelectRemoteFileOrFolderDialog(Shell shell, boolean fileMode)
          Deprecated. Constructor
SystemSelectRemoteFileOrFolderDialog(Shell shell, String title, boolean fileMode)
          Deprecated. Constructor when you want to supply your own title.
 
Method Summary
 void addViewerFilter(ViewerFilter filter)
          Deprecated. Add viewer filter.
 boolean close()
          Deprecated. We have to override close to ensure that we reset the form to null
protected  Control createContents(Composite parent)
          Deprecated. Private method.
protected  Control createInner(Composite parent)
          Deprecated. Private method.
protected  ISystemMessageLine createMessageLine(Composite c)
          Deprecated. Create message line.
 void enableAddMode(ISystemAddFileListener caller)
          Deprecated. Enable Add mode.
 void enableAddMode(ISystemAddFileListener caller, String addLabel, String addToolTipText)
          Deprecated. Overloaded method that allows setting the label and tooltip text of the Add button.
protected  SystemSelectRemoteFileOrFolderForm getForm(boolean fileMode)
          Deprecated. Private method.
protected  Control getInitialFocusControl()
          Deprecated. Private method.
 boolean getMultipleSelectionMode()
          Deprecated. Return the multiple selection mode as set by setMultipleSelectionMode(boolean)
 IHost getSelectedConnection()
          Deprecated. Return selected connection
 Object getSelectedObject()
          Deprecated. Return selected file or folder
 Object[] getSelectedObjects()
          Deprecated. Return all selected objects.
 org.eclipse.rse.internal.ui.view.SystemViewForm getSystemViewForm()
          Deprecated. Return the embedded System Tree object.
protected  void handleDoubleClick(DoubleClickEvent event)
          Deprecated. Handles double clicks in viewer.
protected  boolean processAdd()
          Deprecated. Private method.
protected  boolean processDetails(boolean hideMode)
          Deprecated. Private method.
protected  boolean processOK()
          Deprecated. Private method.
 void setAllowFolderSelection(boolean allow)
          Deprecated. Sets whether to allow folder selection.
 void setAllowForMultipleParents(boolean flag)
          Deprecated. indicate whether selections from different parents are allowed
 void setAutoExpandDepth(int depth)
          Deprecated. Specify the zero-based auto-expand level for the tree.
 void setDefaultConnection(IHost conn)
          Deprecated. Set the connection to default the selection to
 void setFileTypes(String fileTypes)
          Deprecated. For files mode, restrict the files list by a comman-delimited array of file types.
 void setFileTypes(String[] fileTypes)
          Deprecated. For files mode, restrict the files list by an array of file types This must be called BEFORE setRootFolder!
 void setMessage(String message)
          Deprecated. Set the message shown at the top of the form
 void setMultipleSelectionMode(boolean multiple)
          Deprecated. Set multiple selection mode.
 void setPageComplete(boolean complete)
          Deprecated. Call this to disable the Apply button if the input is not complete or not valid.
 void setPreSelection(IRemoteFile selection)
          Deprecated. Set a file or folder to preselect.
 void setRestrictFolders(boolean restrict)
          Deprecated. Specify whether setRootFolder should prevent the user from being able to see or select any other folder.
 void setRootFolder(IHost connection, String folderAbsolutePath)
          Deprecated. Set the root folder from which to start listing folders or files.
 void setRootFolder(IRemoteFile rootFolder)
          Deprecated. Set the root folder from which to start listing folders.
 void setSelectionTreeToolTipText(String tip)
          Deprecated. Set the tooltip text for the remote systems tree from which an item is selected.
 void setSelectionValidator(IValidatorRemoteSelection selectionValidator)
          Deprecated. Specify a validator to use when the user selects a remote file or folder.
 void setShowNewConnectionPrompt(boolean show)
          Deprecated. Set to true if a "New Connection..." special connection is to be shown for creating new connections
 void setShowPropertySheet(boolean show)
          Deprecated. Show the property sheet on the right hand side, to show the properties of the selected object.
 void setShowPropertySheet(boolean show, boolean initialState)
          Deprecated. Show the property sheet on the right hand side, to show the properties of the selected object.
 void setSystemConnection(IHost conn)
          Deprecated. Set the system connection to restrict the user to selecting files or folders from
 void setSystemTypes(IRSESystemType[] systemTypes)
          Deprecated. 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.dialogs.SystemPromptDialog
aboutToStart, addFillerLine, addGrowableFillerLine, addSeparatorLine, adjustButtonWidth, applyMnemonics, buttonPressed, clearErrorMessage, clearMessage, configureShell, createButtonBar, createButtonsForButtonBar, createControl, createDialogArea, createNoShowAgainButton, createWizardClosingDialog, dispose, enableAddButton, enableBrowseButton, enableCancelAllButton, enableCancelButton, enableDetailsButton, enableOkButton, enableTestButton, getAddButton, getBrowseButton, getCancelAllButton, getCancelOrCloseButton, getControl, getDescription, getDetailsButton, getDialogMnemonics, getErrorMessage, getHelpContextId, getImage, getInputObject, getMessage, getMessageLine, getOkButton, getOutputObject, getOutputObjectValidator, getProgressMonitor, getSystemErrorMessage, getTestButton, getTitle, handleEvent, hardClose, okToClose, pack, performHelp, processBrowse, processCancel, processCancelAll, processTest, publicConvertHeightInCharsToPixels, publicConvertWidthInCharsToPixels, restoreEnableState, restoreUIState, run, run, saveEnableStateAndSet, saveUIState, setAddButtonLabel, setAddButtonToolTipText, setBrowseButtonLabel, setBrowseButtonToolTipText, setBusyCursor, setCancelAllButtonLabel, setCancelAllButtonToolTipText, setCancelButtonLabel, setCancelButtonToolTipText, setControl, setDescription, setDetailsButtonLabel, setDetailsButtonToolTipText, setDisplayCursor, setDisplayCursor, setErrorMessage, setErrorMessage, setErrorMessage, setHelp, setHelp, setImageDescriptor, setInitialOKButtonEnabledState, setInputObject, setMessage, setMinimumSize, setNeedsProgressMonitor, setNoShowAgainOption, setOkButtonLabel, setOkButtonToolTipText, setOutputObject, setOutputObjectValidator, setShowAddButton, setShowBrowseButton, setShowCancelAllButton, setShowDetailsButton, setShowOkButton, setShowTestButton, setTestButtonLabel, setTestButtonToolTipText, setTitle, setVisible, wasCancelled, wasCancelledAll
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_MODE

public static final boolean FILE_MODE
Deprecated. 
See Also:
Constant Field Values

FOLDER_MODE

public static final boolean FOLDER_MODE
Deprecated. 
See Also:
Constant Field Values

form

protected SystemSelectRemoteFileOrFolderForm form
Deprecated. 

outputConnection

protected IHost outputConnection
Deprecated. 
Constructor Detail

SystemSelectRemoteFileOrFolderDialog

public SystemSelectRemoteFileOrFolderDialog(Shell shell,
                                            boolean fileMode)
Deprecated. 
Constructor

Parameters:
shell - The shell to hang the dialog off of
fileMode - True if selecting files, false if selecting folders

SystemSelectRemoteFileOrFolderDialog

public SystemSelectRemoteFileOrFolderDialog(Shell shell,
                                            String title,
                                            boolean fileMode)
Deprecated. 
Constructor when you want to supply your own title.

Parameters:
shell - The shell to hang the dialog off of
title - The title to give the dialog
fileMode - True if selecting files, false if selecting folders
Method Detail

setAllowForMultipleParents

public void setAllowForMultipleParents(boolean flag)
Deprecated. 
indicate whether selections from different parents are allowed


setSystemConnection

public void setSystemConnection(IHost conn)
Deprecated. 
Set the system connection to restrict the user to selecting files or folders from


setDefaultConnection

public void setDefaultConnection(IHost conn)
Deprecated. 
Set the connection to default the selection to


setSystemTypes

public void setSystemTypes(IRSESystemType[] systemTypes)
Deprecated. 
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.

setShowNewConnectionPrompt

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


setMessage

public void setMessage(String message)
Deprecated. 
Set the message shown at the top of the form

Specified by:
setMessage in interface ISystemMessageLine
Overrides:
setMessage in class SystemPromptDialog

setSelectionTreeToolTipText

public void setSelectionTreeToolTipText(String tip)
Deprecated. 
Set the tooltip text for the remote systems tree from which an item is selected.


setAutoExpandDepth

public void setAutoExpandDepth(int depth)
Deprecated. 
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)
Deprecated. 
Set the root folder from which to start listing folders or 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")
See Also:
RemoteFileFilterString

setRootFolder

public void setRootFolder(IRemoteFile rootFolder)
Deprecated. 
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)
Deprecated. 
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


setFileTypes

public void setFileTypes(String[] fileTypes)
Deprecated. 
For files mode, restrict the files list by an array of file types

This must be called BEFORE setRootFolder!


setFileTypes

public void setFileTypes(String fileTypes)
Deprecated. 
For files mode, restrict the files list by a comman-delimited array of file types. The last type must also end in a comma. Eg "java, class," or "class,".

This must be called BEFORE setRootFolder!


setRestrictFolders

public void setRestrictFolders(boolean restrict)
Deprecated. 
Specify whether setRootFolder should prevent the user from being able to see or select any other folder. This causes two effects:
  1. The special filter for root/drives is not shown
  2. No subfolders are listed in the target folder, if we are listing files. Of course, they are shown if we are listing folders, else it would be an empty list!


enableAddMode

public void enableAddMode(ISystemAddFileListener caller)
Deprecated. 
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)
Deprecated. 
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)
Deprecated. 
Show the property sheet on the right hand side, to show the properties of the selected object.

This overload always shows the property sheet

Default is false


setShowPropertySheet

public void setShowPropertySheet(boolean show,
                                 boolean initialState)
Deprecated. 
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 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)
Deprecated. 
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)
Deprecated. 
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.


getSelectedObject

public Object getSelectedObject()
Deprecated. 
Return selected file or folder


getSelectedObjects

public Object[] getSelectedObjects()
Deprecated. 
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()
Deprecated. 
Return selected connection


getMultipleSelectionMode

public boolean getMultipleSelectionMode()
Deprecated. 
Return the multiple selection mode as set by setMultipleSelectionMode(boolean)


getSystemViewForm

public org.eclipse.rse.internal.ui.view.SystemViewForm getSystemViewForm()
Deprecated. 
Return the embedded System Tree object. Will be null until createContents is called.


createContents

protected Control createContents(Composite parent)
Deprecated. 
Private method.

Overrides:
createContents in class SystemPromptDialog
See Also:
SystemPromptDialog.createContents(Composite)

handleDoubleClick

protected void handleDoubleClick(DoubleClickEvent event)
Deprecated. 
Handles double clicks in viewer. Closes the dialog if a file is double clicked


getInitialFocusControl

protected Control getInitialFocusControl()
Deprecated. 
Private method.

Specified by:
getInitialFocusControl in class SystemPromptDialog
See Also:
SystemPromptDialog.getInitialFocusControl()

createInner

protected Control createInner(Composite parent)
Deprecated. 
Private method.

Specified by:
createInner in class SystemPromptDialog
See Also:
SystemPromptDialog.createInner(Composite)

getForm

protected SystemSelectRemoteFileOrFolderForm getForm(boolean fileMode)
Deprecated. 
Private method. Get the contents.


createMessageLine

protected ISystemMessageLine createMessageLine(Composite c)
Deprecated. 
Create message line. Intercept so we can set msg line of form.

Overrides:
createMessageLine in class SystemPromptDialog

processOK

protected boolean processOK()
Deprecated. 
Private method.

Called when user presses OK button. Return true to close dialog. Return false to not close dialog.

Overrides:
processOK in class SystemPromptDialog

processAdd

protected boolean processAdd()
Deprecated. 
Private method.

Called when user presses Add button.

Overrides:
processAdd in class SystemPromptDialog

processDetails

protected boolean processDetails(boolean hideMode)
Deprecated. 
Private method.

Called when user presses DETAILS button.

Note the text is automatically toggled for us! We need only do whatever the functionality is that we desire

Overrides:
processDetails in class SystemPromptDialog
Parameters:
hideMode - the current state of the details toggle, prior to this request. If we return true from this method, this state and the button text will be toggled.
Returns:
true if the details state toggle was successful, false if it failed.

setPageComplete

public void setPageComplete(boolean complete)
Deprecated. 
Description copied from class: SystemPromptDialog
Call this to disable the Apply button if the input is not complete or not valid.

Overrides:
setPageComplete in class SystemPromptDialog

close

public boolean close()
Deprecated. 
We have to override close to ensure that we reset the form to null

Overrides:
close in class SystemPromptDialog

addViewerFilter

public void addViewerFilter(ViewerFilter filter)
Deprecated. 
Add viewer filter.

Parameters:
filter - a viewer filter.

setAllowFolderSelection

public void setAllowFolderSelection(boolean allow)
Deprecated. 
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. This call only makes sense if the dialog is in file selection mode.

Parameters:
allow - true to allow folder selection, false otherwise.

RSE
Release 2.0

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