Package org.eclipse.remote.ui.dialogs
Class RemoteResourceBrowser
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.remote.ui.dialogs.RemoteResourceBrowser
- All Implemented Interfaces:
org.eclipse.jface.operation.IRunnableContext
,org.eclipse.jface.window.IShellProvider
public class RemoteResourceBrowser
extends org.eclipse.jface.dialogs.Dialog
implements org.eclipse.jface.operation.IRunnableContext
Generic file/directory browser for remote resources.
A directory browser (DIRECTORY_BROWSER) only allows selection of directories.
A file browser (FILE_BROWSER) allows selection of files and directories, but the ok button is only enabled when a file is
selected.
A resource browser (FILE_BROWSER|DIRECTORY_BROWSER) allows selection of files and directories. This is the default.
To select multiple resources, set the style to SWT.MULTI.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
-
Field Summary
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, resizeHasOccurred
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.swt.widgets.Button
createButton
(org.eclipse.swt.widgets.Composite parent, int id, String label, boolean defaultButton) protected org.eclipse.swt.widgets.Control
createContents
(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.swt.widgets.Control
createDialogArea
(org.eclipse.swt.widgets.Composite parent) Get the connection that was selectedorg.eclipse.core.filesystem.IFileStore
Get the resources that was selected.List
<org.eclipse.core.filesystem.IFileStore> Get the resources that were selected.void
run
(boolean fork, boolean cancelable, org.eclipse.jface.operation.IRunnableWithProgress runnable) void
setConnection
(IRemoteConnection connection) Set the connection for the browser.void
setInitialPath
(String path) Set the initial path to start browsing.void
Set the fDialogTitle of the dialog.void
setType
(int type) Set the type of browser.void
showConnections
(boolean enable) Show available connections on browser if possible (default disabled).void
showHiddenCheckbox
(boolean showHidden) Enable a checkbox to show hidden files (default enabled)void
showLocalSelection
(boolean showLocalSelection) Enable selection of local filesvoid
showNewFolderButton
(boolean showNewFolderButton) Enable a button to create new folders (default enabled)Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButtonBar, createButtonsForButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, 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
-
Field Details
-
EMPTY_STRING
- See Also:
-
FILE_BROWSER
public static final int FILE_BROWSER- See Also:
-
DIRECTORY_BROWSER
public static final int DIRECTORY_BROWSER- See Also:
-
-
Constructor Details
-
RemoteResourceBrowser
public RemoteResourceBrowser(org.eclipse.swt.widgets.Shell parent, int style)
-
-
Method Details
-
createButton
protected org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent, int id, String label, boolean defaultButton) - Overrides:
createButton
in classorg.eclipse.jface.dialogs.Dialog
-
createContents
protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent) - Overrides:
createContents
in classorg.eclipse.jface.dialogs.Dialog
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent) - Overrides:
createDialogArea
in classorg.eclipse.jface.dialogs.Dialog
-
getConnection
Get the connection that was selected- Returns:
- selected connection
-
getResource
public org.eclipse.core.filesystem.IFileStore getResource()Get the resources that was selected.- Returns:
- selected resource or null if no resource is selected
-
getResources
Get the resources that were selected.- Returns:
- selected resources
-
run
public void run(boolean fork, boolean cancelable, org.eclipse.jface.operation.IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException - Specified by:
run
in interfaceorg.eclipse.jface.operation.IRunnableContext
- Throws:
InvocationTargetException
InterruptedException
-
setConnection
Set the connection for the browser. The connection must support the IRemoteFileService service or this method will have no effect.- Parameters:
connection
- connection that supports the IRemoteFileService service
-
setInitialPath
Set the initial path to start browsing. This will be set in the browser text field, and in a future version should expand the browser to this location if it exists.- Parameters:
path
- initial path
-
setTitle
Set the fDialogTitle of the dialog.- Parameters:
title
- title to display
-
setType
public void setType(int type) Set the type of browser. Can be either a file browser (allows selection of files), a directory browser (allows selection of directories), or a resource browser (allows selection of files and directories). -
showConnections
public void showConnections(boolean enable) Show available connections on browser if possible (default disabled).- Parameters:
enable
- enable connection display if true
-
showHiddenCheckbox
public void showHiddenCheckbox(boolean showHidden) Enable a checkbox to show hidden files (default enabled)- Parameters:
showHidden
- show hidden files if true
-
showLocalSelection
public void showLocalSelection(boolean showLocalSelection) Enable selection of local files- Parameters:
showLocalSelection
- show local files if true
-
showNewFolderButton
public void showNewFolderButton(boolean showNewFolderButton) Enable a button to create new folders (default enabled)- Parameters:
showNewFolderButton
- show new folder button if true
-