org.pentaho.di.ui.trans.step
Class BaseStepDialog

java.lang.Object
  extended by Dialog
      extended by org.pentaho.di.ui.trans.step.BaseStepDialog
Direct Known Subclasses:
AbortDialog, AccessInputDialog, AccessOutputDialog, AddSequenceDialog, AddXMLDialog, AggregateRowsDialog, AnalyticQueryDialog, AppendDialog, AutoDocDialog, BlockingStepDialog, BlockUntilStepsFinishDialog, CalculatorDialog, ChangeFileEncodingDialog, CheckSumDialog, CloneRowDialog, ClosureGeneratorDialog, ColumnExistsDialog, CombinationLookupDialog, ConcatFieldsDialog, ConstantDialog, CreditCardValidatorDialog, CsvInputDialog, CubeInputDialog, CubeOutputDialog, DatabaseJoinDialog, DatabaseLookupDialog, DataGridDialog, DBProcDialog, DelayDialog, DeleteDialog, DenormaliserDialog, DetectEmptyStreamDialog, DetectLastRowDialog, DimensionLookupDialog, DummyTransDialog, DynamicSQLRowDialog, Edi2XmlDialog, ElasticSearchBulkDialog, ExcelInputDialog, ExcelOutputDialog, ExcelWriterStepDialog, ExecProcessDialog, ExecSQLDialog, ExecSQLRowDialog, FieldsChangeSequenceDialog, FieldSplitterDialog, FileExistsDialog, FileLockedDialog, FilesFromResultDialog, FilesToResultDialog, FilterRowsDialog, FixedInputDialog, FlattenerDialog, FormulaDialog, FuzzyMatchDialog, GaInputStepDialog, GetFileNamesDialog, GetFilesRowsCountDialog, GetPreviousRowFieldDialog, GetRepositoryNamesDialog, GetSlaveSequenceDialog, GetSubFoldersDialog, GetTableNamesDialog, GetVariableDialog, GetXMLDataDialog, GPBulkLoaderDialog, GroupByDialog, HTTPDialog, HTTPPOSTDialog, IfNullDialog, InfobrightLoaderDialog, IngresVectorwiseLoaderDialog, InjectorDialog, InsertUpdateDialog, JaninoDialog, JavaFilterDialog, JoinRowsDialog, JsonInputDialog, JsonOutputDialog, LDAPInputDialog, LDAPOutputDialog, LDIFInputDialog, LoadFileInputDialog, LucidDBBulkLoaderDialog, LucidDBStreamingLoaderDialog, MailDialog, MailInputDialog, MailValidatorDialog, MappingDialog, MappingInputDialog, MappingOutputDialog, MemoryGroupByDialog, MergeJoinDialog, MergeRowsDialog, MetaInjectDialog, ModPartitionerDialog, MondrianInputDialog, MonetDBBulkLoaderDialog, MultiMergeJoinDialog, MySQLBulkLoaderDialog, NormaliserDialog, NullIfDialog, NumberRangeDialog, OlapInputDialog, OraBulkLoaderDialog, ParGzipCsvInputDialog, PentahoReportingOutputDialog, PGBulkLoaderDialog, PrioritizeStreamsDialog, ProcessFilesDialog, PropertyInputDialog, PropertyOutputDialog, RandomCCNumberGeneratorDialog, RandomValueDialog, RegexEvalDialog, ReplaceStringDialog, ReservoirSamplingDialog, RestDialog, RowGeneratorDialog, RowsFromResultDialog, RowsToResultDialog, RssInputDialog, RssOutputDialog, SalesforceDeleteDialog, SalesforceInputDialog, SalesforceInsertDialog, SalesforceUpdateDialog, SalesforceUpsertDialog, SampleRowsDialog, SapInputDialog, SasInputDialog, ScriptDialog, ScriptValuesModDialog, SecretKeyGeneratorDialog, SelectValuesDialog, SetValueConstantDialog, SetValueFieldDialog, SetVariableDialog, SingleThreaderDialog, SocketReaderDialog, SocketWriterDialog, SortedMergeDialog, SortRowsDialog, SplitFieldToRowsDialog, SQLFileOutputDialog, SSHDialog, StepMetastructureDialog, StepsMetricsDialog, StreamLookupDialog, StringCutDialog, StringOperationsDialog, SwitchCaseDialog, SymmetricCryptoTransDialog, SynchronizeAfterMergeDialog, SyslogMessageDialog, SystemDataDialog, TableAgileMartDialog, TableExistsDialog, TableInputDialog, TableOutputDialog, TeraFastDialog, TextFileInputDialog, TextFileOutputDialog, UniqueRowsByHashSetDialog, UniqueRowsDialog, UnivariateStatsDialog, UpdateDialog, UserDefinedJavaClassDialog, ValidatorDialog, ValueMapperDialog, WebServiceAvailableDialog, WebServiceDialog, WriteToLogDialog, XBaseInputDialog, XMLInputDialog, XMLInputSaxDialog, XMLInputStreamDialog, XMLJoinDialog, XMLOutputDialog, XsdValidatorDialog, XsltDialog, YamlInputDialog

public class BaseStepDialog
extends Dialog

This class provides functionality common to Step Dialogs.


Field Summary
static LoggingObjectInterface loggingObject
          The logging object interface for this dialog.
 
Constructor Summary
BaseStepDialog(Shell parent, BaseStepMeta baseStepMeta, TransMeta transMeta, String stepname)
          Instantiates a new base step dialog.
BaseStepDialog(Shell parent, int nr, BaseStepMeta in, TransMeta tr)
          Instantiates a new base step dialog.
 
Method Summary
 CCombo addConnectionLine(Composite parent, Control previous, int middle, int margin)
          Adds the connection line.
 CCombo addConnectionLine(Composite parent, Control previous, int middle, int margin, Class<? extends DatabaseInterface> databaseType)
          Adds the connection line.
 CCombo addConnectionLine(Composite parent, Control previous, int middle, int margin, Label wlConnection, Button wbnConnection, Button wbeConnection)
          Adds the connection line.
 CCombo addConnectionLine(Composite parent, Control previous, int middle, int margin, Label wlConnection, Button wbnConnection, Button wbeConnection, Class<? extends DatabaseInterface> databaseType)
          Adds the connection line.
 void addDatabases(CCombo wConnection)
          Adds the databases to the Combo Box component.
 void addDatabases(CCombo wConnection, Class<? extends DatabaseInterface> databaseType)
          Adds the databases with the specified type to the Combo Box component.
 void dispose()
          Dispose this dialog.
static void generateFieldMapping(Shell shell, RowMetaInterface sourceFields, RowMetaInterface targetFields, List<SourceToTargetMapping> fieldMapping)
          Create a new field mapping between source and target steps.
static void getFieldsFromPrevious(ComboVar comboVar, TransMeta transMeta, StepMeta stepMeta)
          Gets fields from previous steps and populate a ComboVar.
static void getFieldsFromPrevious(RowMetaInterface row, TableView tableView, int keyColumn, int[] nameColumn, int[] dataTypeColumn, int lengthColumn, int precisionColumn, TableItemInsertListener listener)
          Gets unused fields from previous steps and inserts them as rows into a table view.
static void getFieldsFromPrevious(TransMeta transMeta, StepMeta stepMeta, TableView tableView, int keyColumn, int[] nameColumn, int[] dataTypeColumn, int lengthColumn, int precisionColumn, TableItemInsertListener listener)
          Gets unused fields from previous steps and inserts them as rows into a table view.
static ModifyListener getModifyListenerTooltipText(Text textField)
          Gets the modify listener tooltip text.
 Repository getRepository()
          Gets the repository associated with this dialog.
 boolean isBasic()
          Checks if the log level is basic.
 boolean isDebug()
          Checks if the log level is debug.
 boolean isDetailed()
          Checks if the log level is detailed.
 boolean isRowLevel()
          Checks if the log level is row level.
 void logBasic(String message)
          Log the message at a basic logging level.
 void logBasic(String message, Object... arguments)
          Log the message with arguments at a basic logging level.
 void logDebug(String message)
          Log the message at a debug logging level.
 void logDebug(String message, Object... arguments)
          Log the message with arguments at a debug logging level.
 void logDetailed(String message)
          Log the message at a detailed logging level.
 void logDetailed(String message, Object... arguments)
          Log the message with arguments at a detailed logging level.
 void logError(String message)
          Log the message at a error logging level.
 void logError(String message, Object... arguments)
          Log the message with arguments at a error logging level.
 void logError(String message, Throwable e)
          Log the message with the associated Throwable object at a error logging level.
 void logMinimal(String message)
          Log the message at a minimal logging level.
 void logMinimal(String message, Object... arguments)
          Log the message with arguments at a minimal logging level.
 void logRowlevel(String message)
          Log the message at a rowlevel logging level.
 void logRowlevel(String message, Object... arguments)
          Log the message with arguments at a rowlevel logging level.
static void positionBottomButtons(Composite composite, Button[] buttons, int margin, Control lastControl)
          Position the specified buttons at the bottom of the parent composite.
 void selectDatabase(CCombo wConnection, String name)
          Selects the database with the specified name in the Combo Box component.
static void setMinimalShellHeight(Shell shell, Control[] controls, int margin, int extra)
          Sets the minimal shell height.
 void setRepository(Repository repository)
          Sets the repository associated with this dialog.
 void setShellImage(Shell shell, StepMetaInterface stepMetaInterface)
          Sets the shell image.
 void setSize()
          Set the shell size, based upon the previous time the geometry was saved in the Properties file.
static void setSize(Shell shell)
          Sets the size of this dialog with respect to the given shell.
static void setSize(Shell shell, int minWidth, int minHeight, boolean packIt)
          Sets the size of this dialog with respect to the given parameters.
static void setTraverseOrder(Control[] controls)
          Sets the traverse order for the given controls.
 void storeScreenSize()
          Store screen size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggingObject

public static final LoggingObjectInterface loggingObject
The logging object interface for this dialog.

Constructor Detail

BaseStepDialog

public BaseStepDialog(Shell parent,
                      BaseStepMeta baseStepMeta,
                      TransMeta transMeta,
                      String stepname)
Instantiates a new base step dialog.

Parameters:
parent - the parent shell
baseStepMeta - the associated base step metadata
transMeta - the associated transformation metadata
stepname - the step name

BaseStepDialog

public BaseStepDialog(Shell parent,
                      int nr,
                      BaseStepMeta in,
                      TransMeta tr)
Instantiates a new base step dialog.

Parameters:
parent - the parent shell
nr - the number of rows
in - the base step metadata
tr - the transformation metadata
Method Detail

setShellImage

public void setShellImage(Shell shell,
                          StepMetaInterface stepMetaInterface)
Sets the shell image.

Parameters:
shell - the shell
stepMetaInterface - the step meta interface

dispose

public void dispose()
Dispose this dialog.


setSize

public void setSize()
Set the shell size, based upon the previous time the geometry was saved in the Properties file.


positionBottomButtons

public static final void positionBottomButtons(Composite composite,
                                               Button[] buttons,
                                               int margin,
                                               Control lastControl)
Position the specified buttons at the bottom of the parent composite. Also, make the buttons all the same width: the width of the largest button.

The default alignment for buttons in the system will be used. This is set as an LAF property with the key Button_Position and has the valid values of left, center, right with center being the default.

Parameters:
composite - the composite
buttons - The buttons to position.
margin - The margin between the buttons in pixels
lastControl - the last control

getModifyListenerTooltipText

public static final ModifyListener getModifyListenerTooltipText(Text textField)
Gets the modify listener tooltip text.

Parameters:
textField - the text field
Returns:
the modify listener tooltip text

addDatabases

public void addDatabases(CCombo wConnection)
Adds the databases to the Combo Box component.

Parameters:
wConnection - the Combo Box component

addDatabases

public void addDatabases(CCombo wConnection,
                         Class<? extends DatabaseInterface> databaseType)
Adds the databases with the specified type to the Combo Box component.

Parameters:
wConnection - the Combo Box component
databaseType - the database type

selectDatabase

public void selectDatabase(CCombo wConnection,
                           String name)
Selects the database with the specified name in the Combo Box component.

Parameters:
wConnection - the Combo Box component
name - the name of the database to select

addConnectionLine

public CCombo addConnectionLine(Composite parent,
                                Control previous,
                                int middle,
                                int margin)
Adds the connection line.

Parameters:
parent - the parent UI component
previous - the previous UI component
middle - the middle
margin - the margin
Returns:
the the Combo Box component for the given parameters

addConnectionLine

public CCombo addConnectionLine(Composite parent,
                                Control previous,
                                int middle,
                                int margin,
                                Class<? extends DatabaseInterface> databaseType)
Adds the connection line.

Parameters:
parent - the parent UI component
previous - the previous UI component
middle - the middle
margin - the margin
databaseType - the database type
Returns:
the Combo Box component for the given parameters

addConnectionLine

public CCombo addConnectionLine(Composite parent,
                                Control previous,
                                int middle,
                                int margin,
                                Label wlConnection,
                                Button wbnConnection,
                                Button wbeConnection)
Adds the connection line.

Parameters:
parent - the parent UI component
previous - the previous UI component
middle - the middle
margin - the margin
wlConnection - the connection label
wbnConnection - the "new connection" button
wbeConnection - the "edit connection" button
Returns:
the Combo Box component for the given parameters

addConnectionLine

public CCombo addConnectionLine(Composite parent,
                                Control previous,
                                int middle,
                                int margin,
                                Label wlConnection,
                                Button wbnConnection,
                                Button wbeConnection,
                                Class<? extends DatabaseInterface> databaseType)
Adds the connection line.

Parameters:
parent - the parent UI component
previous - the previous UI component
middle - the middle
margin - the margin
wlConnection - the connection label
wbnConnection - the "new connection" button
wbeConnection - the "edit connection" button
databaseType - the database type
Returns:
the Combo Box component for the given parameters

storeScreenSize

public void storeScreenSize()
Store screen size.


getRepository

public Repository getRepository()
Gets the repository associated with this dialog.

Returns:
Returns the repository.

setRepository

public void setRepository(Repository repository)
Sets the repository associated with this dialog.

Parameters:
repository - The repository to set.

setMinimalShellHeight

public static void setMinimalShellHeight(Shell shell,
                                         Control[] controls,
                                         int margin,
                                         int extra)
Sets the minimal shell height.

Parameters:
shell - the shell
controls - the controls to measure
margin - the margin between the components
extra - the extra padding

setSize

public static void setSize(Shell shell)
Sets the size of this dialog with respect to the given shell.

Parameters:
shell - the new size

setSize

public static void setSize(Shell shell,
                           int minWidth,
                           int minHeight,
                           boolean packIt)
Sets the size of this dialog with respect to the given parameters.

Parameters:
shell - the shell
minWidth - the minimum width
minHeight - the minimum height
packIt - true to pack the dialog components, false otherwise

setTraverseOrder

public static final void setTraverseOrder(Control[] controls)
Sets the traverse order for the given controls.

Parameters:
controls - the new traverse order

getFieldsFromPrevious

public static final void getFieldsFromPrevious(TransMeta transMeta,
                                               StepMeta stepMeta,
                                               TableView tableView,
                                               int keyColumn,
                                               int[] nameColumn,
                                               int[] dataTypeColumn,
                                               int lengthColumn,
                                               int precisionColumn,
                                               TableItemInsertListener listener)
Gets unused fields from previous steps and inserts them as rows into a table view.

Parameters:
transMeta - the transformation metadata
stepMeta - the step metadata
tableView - the table view
keyColumn - the key column
nameColumn - the name column
dataTypeColumn - the data type column
lengthColumn - the length column
precisionColumn - the precision column
listener - a listener for tables insert events

getFieldsFromPrevious

public static final void getFieldsFromPrevious(RowMetaInterface row,
                                               TableView tableView,
                                               int keyColumn,
                                               int[] nameColumn,
                                               int[] dataTypeColumn,
                                               int lengthColumn,
                                               int precisionColumn,
                                               TableItemInsertListener listener)
Gets unused fields from previous steps and inserts them as rows into a table view.

Parameters:
row - the input fields
tableView - the table view to modify
keyColumn - the column in the table view to match with the names of the fields, checks for existance if >0
nameColumn - the column numbers in which the name should end up in
dataTypeColumn - the target column numbers in which the data type should end up in
lengthColumn - the length column where the length should end up in (if >0)
precisionColumn - the length column where the precision should end up in (if >0)
listener - A listener that you can use to do custom modifications to the inserted table item, based on a value from the provided row

getFieldsFromPrevious

public static final void getFieldsFromPrevious(ComboVar comboVar,
                                               TransMeta transMeta,
                                               StepMeta stepMeta)
Gets fields from previous steps and populate a ComboVar.

Parameters:
comboVar - the Combo Box (with Variables) to populate
transMeta - the transformation metadata
stepMeta - the step metadata

generateFieldMapping

public static final void generateFieldMapping(Shell shell,
                                              RowMetaInterface sourceFields,
                                              RowMetaInterface targetFields,
                                              List<SourceToTargetMapping> fieldMapping)
                                       throws KettleException
Create a new field mapping between source and target steps.

Parameters:
shell - the shell of the parent window
sourceFields - the source fields
targetFields - the target fields
fieldMapping - the list of source to target mappings to default to (can be empty but not null)
Throws:
KettleException - in case something goes wrong during the field mapping

isBasic

public boolean isBasic()
Checks if the log level is basic.

Returns:
true, if the log level is basic, false otherwise

isDetailed

public boolean isDetailed()
Checks if the log level is detailed.

Returns:
true, if the log level is detailed, false otherwise

isDebug

public boolean isDebug()
Checks if the log level is debug.

Returns:
true, if the log level is debug, false otherwise

isRowLevel

public boolean isRowLevel()
Checks if the log level is row level.

Returns:
true, if the log level is row level, false otherwise

logMinimal

public void logMinimal(String message)
Log the message at a minimal logging level.

Parameters:
message - the message to log

logMinimal

public void logMinimal(String message,
                       Object... arguments)
Log the message with arguments at a minimal logging level.

Parameters:
message - the message
arguments - the arguments

logBasic

public void logBasic(String message)
Log the message at a basic logging level.

Parameters:
message - the message

logBasic

public void logBasic(String message,
                     Object... arguments)
Log the message with arguments at a basic logging level.

Parameters:
message - the message
arguments - the arguments

logDetailed

public void logDetailed(String message)
Log the message at a detailed logging level.

Parameters:
message - the message

logDetailed

public void logDetailed(String message,
                        Object... arguments)
Log the message with arguments at a detailed logging level.

Parameters:
message - the message
arguments - the arguments

logDebug

public void logDebug(String message)
Log the message at a debug logging level.

Parameters:
message - the message

logDebug

public void logDebug(String message,
                     Object... arguments)
Log the message with arguments at a debug logging level.

Parameters:
message - the message
arguments - the arguments

logRowlevel

public void logRowlevel(String message)
Log the message at a rowlevel logging level.

Parameters:
message - the message

logRowlevel

public void logRowlevel(String message,
                        Object... arguments)
Log the message with arguments at a rowlevel logging level.

Parameters:
message - the message
arguments - the arguments

logError

public void logError(String message)
Log the message at a error logging level.

Parameters:
message - the message

logError

public void logError(String message,
                     Throwable e)
Log the message with the associated Throwable object at a error logging level.

Parameters:
message - the message
e - the e

logError

public void logError(String message,
                     Object... arguments)
Log the message with arguments at a error logging level.

Parameters:
message - the message
arguments - the arguments