use of org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta in project pentaho-kettle by pentaho.
the class GetSubFoldersDialog method preview.
// Preview the data
private void preview() {
// Create the XML input step
GetSubFoldersMeta oneMeta = new GetSubFoldersMeta();
getInfo(oneMeta);
TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "GetSubFoldersDialog.PreviewSize.DialogTitle"), BaseMessages.getString(PKG, "GetSubFoldersDialog.PreviewSize.DialogMessage"));
int previewSize = numberDialog.open();
if (previewSize > 0) {
TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize });
progressDialog.open();
if (!progressDialog.isCancelled()) {
Trans trans = progressDialog.getTrans();
String loggingText = progressDialog.getLoggingText();
if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "GetSubFoldersDialog.ErrorInPreview.DialogMessage"), loggingText, true);
etd.setReadOnly();
etd.open();
}
PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog.getPreviewRows(wStepname.getText()), loggingText);
prd.open();
}
}
}
use of org.pentaho.di.trans.steps.getsubfolders.GetSubFoldersMeta in project pentaho-kettle by pentaho.
the class GetSubFoldersDialog method getData.
/**
* Read the data from the TextFileInputMeta object and show it in this dialog.
*
* @param meta
* The TextFileInputMeta object to obtain the data from.
*/
public void getData(GetSubFoldersMeta meta) {
final GetSubFoldersMeta in = meta;
if (in.getFolderName() != null) {
wFoldernameList.removeAll();
for (int i = 0; i < in.getFolderName().length; i++) {
wFoldernameList.add(new String[] { in.getFolderName()[i], in.getRequiredFilesDesc(in.getFolderRequired()[i]) });
}
wFoldernameList.removeEmptyRows();
wFoldernameList.setRowNums();
wFoldernameList.optWidth(true);
wInclRownum.setSelection(in.includeRowNumber());
wFolderField.setSelection(in.isFoldernameDynamic());
if (in.getRowNumberField() != null) {
wInclRownumField.setText(in.getRowNumberField());
}
if (in.getDynamicFoldernameField() != null) {
wFoldernameField.setText(in.getDynamicFoldernameField());
}
wLimit.setText("" + in.getRowLimit());
}
wStepname.selectAll();
wStepname.setFocus();
}
Aggregations