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
    Modifier and Type
    Field
    Description
    static final int
     
    static final String
     
    static final int
     

    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

    Constructors
    Constructor
    Description
    RemoteResourceBrowser(org.eclipse.swt.widgets.Shell parent, int style)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected 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 selected
    org.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
    Set the connection for the browser.
    void
    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 files
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 class org.eclipse.jface.dialogs.Dialog
    • createContents

      protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
      Overrides:
      createContents in class org.eclipse.jface.dialogs.Dialog
    • createDialogArea

      protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
      Overrides:
      createDialogArea in class org.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:
      run in interface org.eclipse.jface.operation.IRunnableContext
      Throws:
      InvocationTargetException
      InterruptedException
    • 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