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.IRunnableContextGeneric 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.
-
-
Field Summary
Fields Modifier and Type Field Description static intDIRECTORY_BROWSERstatic StringEMPTY_STRINGstatic intFILE_BROWSER-
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
-
-
Constructor Summary
Constructors Constructor Description RemoteResourceBrowser(org.eclipse.swt.widgets.Shell parent, int style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.swt.widgets.ButtoncreateButton(org.eclipse.swt.widgets.Composite parent, int id, String label, boolean defaultButton)protected org.eclipse.swt.widgets.ControlcreateContents(org.eclipse.swt.widgets.Composite parent)protected org.eclipse.swt.widgets.ControlcreateDialogArea(org.eclipse.swt.widgets.Composite parent)IRemoteConnectiongetConnection()Get the connection that was selectedorg.eclipse.core.filesystem.IFileStoregetResource()Get the resources that was selected.List<org.eclipse.core.filesystem.IFileStore>getResources()Get the resources that were selected.voidrun(boolean fork, boolean cancelable, org.eclipse.jface.operation.IRunnableWithProgress runnable)voidsetConnection(IRemoteConnection connection)Set the connection for the browser.voidsetInitialPath(String path)Set the initial path to start browsing.voidsetTitle(String title)Set the fDialogTitle of the dialog.voidsetType(int type)Set the type of browser.voidshowConnections(boolean enable)Show available connections on browser if possible (default disabled).voidshowHiddenCheckbox(boolean showHidden)Enable a checkbox to show hidden files (default enabled)voidshowLocalSelection(boolean showLocalSelection)Enable selection of local filesvoidshowNewFolderButton(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 Detail
-
EMPTY_STRING
public static final String EMPTY_STRING
- See Also:
- Constant Field Values
-
FILE_BROWSER
public static final int FILE_BROWSER
- See Also:
- Constant Field Values
-
DIRECTORY_BROWSER
public static final int DIRECTORY_BROWSER
- See Also:
- Constant Field Values
-
-
Method Detail
-
createButton
protected org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent, int id, String label, boolean defaultButton)- Overrides:
createButtonin classorg.eclipse.jface.dialogs.Dialog
-
createContents
protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createContentsin classorg.eclipse.jface.dialogs.Dialog
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createDialogAreain classorg.eclipse.jface.dialogs.Dialog
-
getConnection
public IRemoteConnection 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
public List<org.eclipse.core.filesystem.IFileStore> 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:
runin interfaceorg.eclipse.jface.operation.IRunnableContext- Throws:
InvocationTargetExceptionInterruptedException
-
setConnection
public void setConnection(IRemoteConnection connection)
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
public void setInitialPath(String path)
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
public void setTitle(String title)
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
-
-