Class SelectionAdapterFileDialog<T>

java.lang.Object
org.eclipse.swt.events.SelectionAdapter
org.pentaho.di.ui.core.events.dialog.SelectionAdapterFileDialog<T>
All Implemented Interfaces:
EventListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener
Direct Known Subclasses:
SelectionAdapterFileDialogText, SelectionAdapterFileDialogTextVar

public abstract class SelectionAdapterFileDialog<T> extends org.eclipse.swt.events.SelectionAdapter
This adapter class opens up the VFS file dialog, where the primary goal is to select a file. This adapter class provides default implementations for the methods described by the SelectionListener interface. Classes that wish to deal with SelectionEvents can extend this class and override only the methods which they are interested in. example use: Dialog.java wbFilename.addSelectionListener( new SelectionAdapterFileDialogTextVar( log, wFilename, transMeta, new SelectionAdapterOptions( SelectionOperation.FILE, new FilterType[] { FilterType.TXT, FilterType.CSV, FilterType.ALL }, FilterType.TXT ) ) ); Side effect: wFilename#setText() will be called with chosen file.
  • Constructor Details

    • SelectionAdapterFileDialog

      public SelectionAdapterFileDialog(org.pentaho.di.core.logging.LogChannelInterface log, T textWidget, org.pentaho.di.base.AbstractMeta meta, SelectionAdapterOptions options, RepositoryUtility repositoryUtility, ExtensionPointWrapper extensionPointWrapper)
    • SelectionAdapterFileDialog

      public SelectionAdapterFileDialog(org.pentaho.di.core.logging.LogChannelInterface log, T textWidget, org.pentaho.di.base.AbstractMeta meta, SelectionAdapterOptions options)
  • Method Details

    • widgetSelected

      public void widgetSelected(org.eclipse.swt.events.SelectionEvent selectionEvent)
      Specified by:
      widgetSelected in interface org.eclipse.swt.events.SelectionListener
      Overrides:
      widgetSelected in class org.eclipse.swt.events.SelectionAdapter
    • getTextWidget

      public T getTextWidget()
      Get underlying widget that will get text assigned.
      Returns:
    • getText

      protected abstract String getText()
      Get text of widget.
      Returns:
      text from widget.
    • setText

      protected abstract void setText(String text)
      Set text for widget.
      Parameters:
      text - text to be set
    • getSelectionOptions

      public SelectionAdapterOptions getSelectionOptions()
      Getter for SelectionAdapterOptions
      Returns:
    • resolveFile

      protected String resolveFile(org.pentaho.di.base.AbstractMeta abstractMeta, String unresolvedPath)
    • isConnectionFile

      protected boolean isConnectionFile(org.apache.commons.vfs2.FileObject fileObject)
      Determines if a fileObject is of type "pvfs"
      Parameters:
      fileObject -
      Returns:
      if connection file type, false otherwise.
    • setFilter

      protected void setFilter(FileDialogOperation fileDialogOperation, String[] filters)
      Helper function for FileDialogOperation.setFilter(java.lang.String) . Blank entries in filters will be removed. If an "blank" array is entered, the less restrictive filters option {FilterType.ALL} will be applied.
      Parameters:
      fileDialogOperation -
      filters -
    • isUrl

      protected boolean isUrl(String path)
    • concat

      protected String concat(String path, String name)