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
Constructors Constructor Description SelectionAdapterFileDialog(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
concat(String path, String name)
protected abstract String
getText()
Get text of widget.T
getTextWidget()
Get underlying widget that will get text assigned.protected boolean
isUrl(String path)
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
setText(String text)
Set text for widget.void
widgetSelected(org.eclipse.swt.events.SelectionEvent selectionEvent)
-
-
-
Constructor Detail
-
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 Detail
-
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
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
-
resolveFile
protected String resolveFile(org.pentaho.di.base.AbstractMeta abstractMeta, String unresolvedPath)
-
setFilter
protected void setFilter(FileDialogOperation fileDialogOperation, String[] filters)
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
protected boolean isUrl(String path)
-
-