|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm
public class SystemSelectRemoteFileOrFolderForm
A reusable form for prompting for a remote file system folder or file.
This form may be used to populate a dialog or a wizard page.
To configure the functionality, call these methods:
setShowNewConnectionPrompt(boolean)
or #setDefaultConnection(SystemConnection)
setSystemTypes(IRSESystemType[])
setRootFolder(IHost, String)
or setRootFolder(IRemoteFile)
setPreSelection(IRemoteFile)
setFileTypes(String[])
or setFileTypes(String)
setAutoExpandDepth(int)
setShowPropertySheet(boolean)
enableAddMode(org.eclipse.rse.files.ui.ISystemAddFileListener)
setMultipleSelectionMode(boolean)
To configure the text on the dialog, call these methods:
After running, call these methods to get the output:
Constructor Summary | |
---|---|
SystemSelectRemoteFileOrFolderForm(ISystemMessageLine msgLine,
Object caller,
boolean fileMode)
Constructor |
Method Summary | |
---|---|
void |
addSelectionChangedListener(ISelectionChangedListener l)
Add a listener to selection change events in the tree |
void |
addViewerFilter(ViewerFilter filter)
Add viewer filter. |
protected void |
clearErrorMessage()
|
Control |
createContents(Shell shell,
Composite parent)
In this method, we populate the given SWT container with widgets and return the container to the caller. |
void |
dispose()
|
void |
enableAddMode(ISystemAddFileListener caller)
Enable Add mode. |
protected Object |
getFirstSelection(ISelection selection)
Return first item currently selected. |
Control |
getInitialFocusControl()
Return control to recieve initial focus |
protected ISystemSelectRemoteObjectAPIProvider |
getInputProvider()
Returns the input provider that drives the contents of the tree Subclasses can override to provide custom tree contents |
boolean |
getMultipleSelectionMode()
Return the multiple selection mode current setting |
protected ISystemRemoteElementAdapter[] |
getRemoteAdapters(ISelection selection)
|
IHost |
getSelectedConnection()
Return selected connection |
Object |
getSelectedObject()
Return first selected object |
Object[] |
getSelectedObjects()
Return all selected objects. |
Object |
getSelectedParent()
|
protected Object[] |
getSelections(ISelection selection)
Return all items currently selected. |
protected Shell |
getShell()
Return shell of parent dialog or wizard |
ISystemTree |
getSystemTree()
Returns the system tree |
protected IHost |
internalGetConnection()
Return the current connection |
boolean |
isPageComplete()
This method can be called by the dialog or wizard page host, to decide whether to enable or disable the next, final or ok buttons. |
void |
removeSelectionChangedListener(ISelectionChangedListener l)
Remove a listener for selection change events |
void |
selectionChanged(SelectionChangedEvent e)
User selected something in the tree. |
void |
setAllowFolderSelection(boolean allow)
Sets whether to allow folder selection. |
void |
setAllowForMultipleParents(boolean flag)
Indicate whether the form should allow selection of objects from different parents |
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 |
protected void |
setErrorMessage(String msg)
|
protected void |
setErrorMessage(SystemMessage msg)
|
void |
setFileTypes(String fileTypes)
For files mode, restrict the files list by a comman-delimited array of file types. |
void |
setFileTypes(String[] fileTypes)
For files mode, restrict the files list by an array of file types This must be called BEFORE setRootFolder! |
void |
setLocationPrompt(String prompt)
|
void |
setMessage(String message)
Set the message shown as the text at the top of the form. |
void |
setMessageLine(ISystemMessageLine msgLine)
Often the message line is null at the time of instantiation, so we have to call this after it is created. |
void |
setMultipleSelectionMode(boolean multiple)
Set multiple selection mode. |
protected void |
setNameText(String text)
|
void |
setPageComplete()
Inform caller of page-complete status of this form |
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 folders or 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 |
setShowLocationPrompt(boolean show)
|
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 |
setSystemConnection(IHost conn)
Set the connection to restrict the user to seeing |
void |
setSystemTypes(IRSESystemType[] systemTypes)
Set the system types to restrict what connections the user sees, and what types of connections they can create. |
boolean |
toggleShowPropertySheet(Shell shell,
Control contents)
Show or hide the property sheet. |
boolean |
verify()
Completes processing of the wizard page or dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int PROMPT_WIDTH
protected Label verbiageLabel
protected Label spacer1
protected Label spacer2
protected Text nameEntryValue
protected ISystemMessageLine msgLine
protected Composite outerParent
protected Composite ps_composite
protected ISystemRegistry sr
protected String verbiage
protected String treeTip
protected String locationPrompt
protected String fileTypes
protected boolean fileMode
protected boolean valid
protected boolean filesOnlyMode
protected boolean showRootFilter
protected boolean alwaysEnableOK
protected boolean multipleSelectionMode
protected boolean allowForMultipleParents
protected boolean showPropertySheet
protected boolean showLocationPrompt
protected boolean allowFolderSelection
protected SystemRemoteObjectMatcher objectMatcher
protected ISystemAddFileListener addButtonCallback
protected Vector listeners
protected IValidatorRemoteSelection selectionValidator
protected Object[] outputObjects
protected IHost outputConnection
protected ISystemSelectRemoteObjectAPIProvider inputProvider
protected ISystemFilter preSelectFilter
protected String preSelectFilterChild
protected boolean preSelectRoot
protected boolean initDone
protected boolean contentsCreated
protected Object caller
protected boolean callerInstanceOfWizardPage
protected boolean callerInstanceOfSystemPromptDialog
protected int autoExpandDepth
protected Object previousSelection
protected List viewerFilters
Constructor Detail |
---|
public SystemSelectRemoteFileOrFolderForm(ISystemMessageLine msgLine, Object caller, boolean fileMode)
msgLine
- A GUI widget capable of writing error messages to.caller
- The wizardpage or dialog hosting this form.fileMode
- true if in select-file mode, false if in select-folder modesetSystemConnection(IHost)
,
setShowNewConnectionPrompt(boolean)
,
setSystemTypes(IRSESystemType[])
,
setSelectionTreeToolTipText(String)
Method Detail |
---|
protected ISystemSelectRemoteObjectAPIProvider getInputProvider()
public void setAllowForMultipleParents(boolean flag)
public void setSystemConnection(IHost conn)
public void setDefaultConnection(IHost conn)
public void setShowNewConnectionPrompt(boolean show)
public void setSystemTypes(IRSESystemType[] systemTypes)
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.public void setMessage(String message)
public void setSelectionTreeToolTipText(String tip)
public void setRootFolder(IHost connection, String folderAbsolutePath)
connection
- The connection to the remote system containing the root folderfolderAbsolutePath
- The fully qualified folder to start listing from (eg: "\folder1\folder2")RemoteFileFilterString
public void setRootFolder(IRemoteFile rootFolder)
rootFolder
- The IRemoteFile object representing the remote folder to start the list fromRemoteFileFilterString
public void setPreSelection(IRemoteFile selection)
public void setFileTypes(String[] fileTypes)
This must be called BEFORE setRootFolder!
public void setFileTypes(String fileTypes)
This must be called BEFORE setRootFolder!
public void setAutoExpandDepth(int depth)
public void setRestrictFolders(boolean restrict)
public void enableAddMode(ISystemAddFileListener caller)
When a library is selected, the caller is called back to decide to enable the Add button or not.
public void setShowPropertySheet(boolean show)
Default is false
public void setMultipleSelectionMode(boolean multiple)
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.
getSelectedObjects()
public void addSelectionChangedListener(ISelectionChangedListener l)
public void removeSelectionChangedListener(ISelectionChangedListener l)
public void setSelectionValidator(IValidatorRemoteSelection selectionValidator)
public Object getSelectedObject()
public Object[] getSelectedObjects()
setMultipleSelectionMode(boolean)
public IHost getSelectedConnection()
public boolean getMultipleSelectionMode()
public void setMessageLine(ISystemMessageLine msgLine)
public Control getInitialFocusControl()
public boolean toggleShowPropertySheet(Shell shell, Control contents)
shell
- Use getShell() in your dialog or wizard pagecontents
- Use getContents() in your dialog or wizard page
public void dispose()
public Control createContents(Shell shell, Composite parent)
parent
- The parent compositepublic boolean verify()
protected IHost internalGetConnection()
protected void setNameText(String text)
public void selectionChanged(SelectionChangedEvent e)
selectionChanged
in interface ISelectionChangedListener
protected ISystemRemoteElementAdapter[] getRemoteAdapters(ISelection selection)
protected Object getFirstSelection(ISelection selection)
protected Object[] getSelections(ISelection selection)
public boolean isPageComplete()
public void setPageComplete()
protected void clearErrorMessage()
protected void setErrorMessage(String msg)
protected void setErrorMessage(SystemMessage msg)
protected Shell getShell()
public void setShowLocationPrompt(boolean show)
public void setLocationPrompt(String prompt)
public void addViewerFilter(ViewerFilter filter)
filter
- a viewer filter.public void setAllowFolderSelection(boolean allow)
true
. This call only makes sense if the form is in file selection mode.
allow
- true
to allow folder selection, false
otherwise.public ISystemTree getSystemTree()
public Object getSelectedParent()
|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |