Class TextFileInputDialog
- java.lang.Object
-
- org.eclipse.swt.widgets.Dialog
-
- org.pentaho.di.ui.trans.step.BaseStepDialog
-
- org.pentaho.di.ui.trans.steps.fileinput.text.TextFileInputDialog
-
- All Implemented Interfaces:
org.pentaho.di.trans.step.StepDialogInterface
,CsvInputAwareStepDialog
,GetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
public class TextFileInputDialog extends BaseStepDialog implements org.pentaho.di.trans.step.StepDialogInterface, GetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>, CsvInputAwareStepDialog
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.pentaho.di.ui.trans.step.BaseStepDialog
BaseStepDialog.AddConnectionListener, BaseStepDialog.EditConnectionListener, BaseStepDialog.FieldsChoiceDialogProvider
-
-
Field Summary
Fields Modifier and Type Field Description static int[]
dateLengths
protected boolean
firstClickOnDateLocale
-
Fields inherited from class org.pentaho.di.ui.trans.step.BaseStepDialog
backupChanged, baseStepMeta, BUTTON_ALIGNMENT_CENTER, BUTTON_ALIGNMENT_LEFT, BUTTON_ALIGNMENT_RIGHT, buttonAlignment, changed, databaseDialog, fdCancel, fdCreate, fdGet, fdlStepname, fdOK, fdPreview, fdSQL, fdStepname, log, loggingObject, lsCancel, lsCreate, lsDef, lsGet, lsOK, lsPreview, lsResize, lsSQL, metaStore, props, repository, shell, stepMeta, stepname, transMeta, variables, wCancel, wCreate, wGet, wlStepname, wOK, wPreview, wSQL, wStepname
-
Fields inherited from interface org.pentaho.di.ui.trans.step.common.GetFieldsCapableStepDialog
logger
-
-
Constructor Summary
Constructors Constructor Description TextFileInputDialog(org.eclipse.swt.widgets.Shell parent, Object in, org.pentaho.di.trans.TransMeta transMeta, String sname)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CsvInputAwareImportProgressDialog
getCsvImportProgressDialog(org.pentaho.di.trans.steps.common.CsvInputAwareMeta meta, int samples, InputStreamReader reader)
void
getData(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta)
Read the data from the TextFileInputMeta object and show it in this dialog.void
getData(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta, boolean copyStepname, boolean reloadAllFields, Set<String> newFieldNames)
String[]
getFieldNames(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta)
Returns an array of incoming field names, or an empty array, if fields cannot be fetched, for some reason.TableView
getFieldsTable()
InputStream
getInputStream(org.pentaho.di.trans.steps.common.CsvInputAwareMeta meta)
Returns theInputStream
corresponding to the csv file, or null if the file cannot be read.org.pentaho.di.core.logging.LogChannel
getLogChannel()
org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta
getNewMetaInstance()
org.eclipse.swt.widgets.Shell
getShell()
Returns theShell
of this dialog.org.pentaho.di.trans.TransMeta
getTransMeta()
static int
guessIntLength(double d)
static int
guessPrecision(double d)
String
loadFieldsImpl(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta, int samples)
String
massageFieldName(String fieldName)
Custom handling of each field can be implemented here.String
open()
void
populateMeta(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta inputMeta)
void
setFlags()
protected void
setLocales()
void
setMinimalWidth()
Sets the input width to minimal width...void
setMinimalWidth(TableView wFields)
Overloading setMinimalWidth() in order to test trim functionality-
Methods inherited from class org.pentaho.di.ui.trans.step.BaseStepDialog
addConnectionLine, addConnectionLine, addConnectionLine, addConnectionLine, addDatabases, addDatabases, centerButtons, createHelpButton, dispose, generateFieldMapping, getButtonAlignment, getDatabaseDialog, getFieldsFromPrevious, getFieldsFromPrevious, getFieldsFromPrevious, getFieldsFromPrevious, getFieldsFromPrevious, getMetaStore, getModifyListenerTooltipText, getPathOf, getRepository, isBasic, isDebug, isDetailed, isRowLevel, leftAlignButtons, logBasic, logBasic, logDebug, logDebug, logDetailed, logDetailed, logError, logError, logError, logMinimal, logMinimal, logRowlevel, logRowlevel, positionBottomButtons, positionBottomButtons, positionBottomLeftButtons, positionBottomRightButtons, reinitConnectionDropDown, rightAlignButtons, selectDatabase, setButtonPositions, setMetaStore, setMinimalShellHeight, setRepository, setShellImage, setSize, setSize, setSize, setSize, setTraverseOrder, showDbDialogUnlessCancelledOrValid, showDbExistsDialog, storeScreenSize, toString
-
Methods inherited from class org.eclipse.swt.widgets.Dialog
checkSubclass, getParent, getStyle, getText, setText
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pentaho.di.ui.trans.step.common.CsvInputAwareStepDialog
getBufferedReader, getFieldNames, getFieldNamesImpl, getReader, loadFieldsImpl, logError, logError
-
Methods inherited from interface org.pentaho.di.ui.trans.step.common.GetFieldsCapableStepDialog
findTableItem, getFields, getFields, getFieldValues, getNewFieldNames, getParent, getPopulatedMeta, getTableItem, getTableItem, loadFields, loadRemainingFields, openGetFieldsSampleDataDialog, repopulateFields
-
-
-
-
Method Detail
-
open
public String open()
- Specified by:
open
in interfaceorg.pentaho.di.trans.step.StepDialogInterface
-
setLocales
protected void setLocales()
-
setFlags
public void setFlags()
-
getData
public void getData(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta)
Read the data from the TextFileInputMeta object and show it in this dialog.- Parameters:
meta
- The TextFileInputMeta object to obtain the data from.
-
getData
public void getData(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta, boolean copyStepname, boolean reloadAllFields, Set<String> newFieldNames)
- Specified by:
getData
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
-
loadFieldsImpl
public String loadFieldsImpl(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta, int samples)
- Specified by:
loadFieldsImpl
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
-
massageFieldName
public String massageFieldName(String fieldName)
Description copied from interface:CsvInputAwareStepDialog
Custom handling of each field can be implemented here.- Specified by:
massageFieldName
in interfaceCsvInputAwareStepDialog
-
getFieldNames
public String[] getFieldNames(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta meta)
Description copied from interface:GetFieldsCapableStepDialog
Returns an array of incoming field names, or an empty array, if fields cannot be fetched, for some reason.- Specified by:
getFieldNames
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
- Parameters:
meta
- theGetFieldsCapableStepDialog
- Returns:
- an array of incoming field names, or an empty array, if fields cannot be fetched, for some reason.
-
guessPrecision
public static int guessPrecision(double d)
-
guessIntLength
public static int guessIntLength(double d)
-
setMinimalWidth
public void setMinimalWidth()
Sets the input width to minimal width...
-
setMinimalWidth
public void setMinimalWidth(TableView wFields)
Overloading setMinimalWidth() in order to test trim functionality- Parameters:
wFields
- mocked TableView to avoid wFields.nrNonEmpty() from throwing NullPointerException
-
getFieldsTable
public TableView getFieldsTable()
- Specified by:
getFieldsTable
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
- Returns:
- the
TableView
containing step fields
-
getShell
public org.eclipse.swt.widgets.Shell getShell()
Description copied from interface:GetFieldsCapableStepDialog
Returns theShell
of this dialog.- Specified by:
getShell
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
- Returns:
- the
Shell
of this dialog
-
getNewMetaInstance
public org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta getNewMetaInstance()
- Specified by:
getNewMetaInstance
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
-
populateMeta
public void populateMeta(org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta inputMeta)
- Specified by:
populateMeta
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
-
getCsvImportProgressDialog
public CsvInputAwareImportProgressDialog getCsvImportProgressDialog(org.pentaho.di.trans.steps.common.CsvInputAwareMeta meta, int samples, InputStreamReader reader)
- Specified by:
getCsvImportProgressDialog
in interfaceCsvInputAwareStepDialog
-
getLogChannel
public org.pentaho.di.core.logging.LogChannel getLogChannel()
- Specified by:
getLogChannel
in interfaceCsvInputAwareStepDialog
-
getTransMeta
public org.pentaho.di.trans.TransMeta getTransMeta()
- Specified by:
getTransMeta
in interfaceCsvInputAwareStepDialog
- Specified by:
getTransMeta
in interfaceGetFieldsCapableStepDialog<org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta>
-
getInputStream
public InputStream getInputStream(org.pentaho.di.trans.steps.common.CsvInputAwareMeta meta)
Description copied from interface:CsvInputAwareStepDialog
Returns theInputStream
corresponding to the csv file, or null if the file cannot be read.- Specified by:
getInputStream
in interfaceCsvInputAwareStepDialog
- Returns:
- the
InputStream
corresponding to the csv file, or null if the file cannot be read
-
-