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 Summary
ConstructorDescriptionSelectionAdapterFileDialog
(org.pentaho.di.core.logging.LogChannelInterface log, T textWidget, org.pentaho.di.base.AbstractMeta meta, SelectionAdapterOptions options) SelectionAdapterFileDialog
(org.pentaho.di.core.logging.LogChannelInterface log, T textWidget, org.pentaho.di.base.AbstractMeta meta, SelectionAdapterOptions options, RepositoryUtility repositoryUtility, ExtensionPointWrapper extensionPointWrapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Getter for SelectionAdapterOptionsprotected abstract String
getText()
Get text of widget.Get underlying widget that will get text assigned.protected boolean
isConnectionFile
(org.apache.commons.vfs2.FileObject fileObject) Determines if afileObject
is of type "pvfs"protected boolean
protected String
resolveFile
(org.pentaho.di.base.AbstractMeta abstractMeta, String unresolvedPath) protected void
setFilter
(FileDialogOperation fileDialogOperation, String[] filters) Helper function forFileDialogOperation.setFilter(java.lang.String)
.protected abstract void
Set text for widget.void
widgetSelected
(org.eclipse.swt.events.SelectionEvent selectionEvent) Methods inherited from class org.eclipse.swt.events.SelectionAdapter
widgetDefaultSelected
-
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 interfaceorg.eclipse.swt.events.SelectionListener
- Overrides:
widgetSelected
in classorg.eclipse.swt.events.SelectionAdapter
-
getTextWidget
Get underlying widget that will get text assigned.- Returns:
-
getText
Get text of widget.- Returns:
- text from widget.
-
setText
Set text for widget.- Parameters:
text
- text to be set
-
getSelectionOptions
Getter for SelectionAdapterOptions- Returns:
-
resolveFile
-
isConnectionFile
protected boolean isConnectionFile(org.apache.commons.vfs2.FileObject fileObject) Determines if afileObject
is of type "pvfs"- Parameters:
fileObject
-- Returns:
- if connection file type, false otherwise.
-
setFilter
Helper function forFileDialogOperation.setFilter(java.lang.String)
. Blank entries infilters
will be removed. If an "blank" array is entered, the less restrictive filters option {FilterType.ALL} will be applied.- Parameters:
fileDialogOperation
-filters
-
-
isUrl
-
concat
-