use of org.apache.hop.ui.core.dialog.EnterNumberDialog in project hop by apache.
the class DataGridDialog method preview.
/**
* Preview the data generated by this transform. This generates a pipeline using this transform &
* a dummy and previews it.
*/
private void preview() {
// Create the table input reader transform...
DataGridMeta oneMeta = new DataGridMeta();
getInfo(oneMeta);
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "DataGridDialog.EnterPreviewSize.Title"), BaseMessages.getString(PKG, "DataGridDialog.EnterPreviewSize.Message"));
int previewSize = numberDialog.open();
if (previewSize > 0) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (!progressDialog.isCancelled() && pipeline.getResult() != null && pipeline.getResult().getNrErrors() > 0) {
EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
etd.setReadOnly();
etd.open();
}
PreviewRowsDialog prd = new PreviewRowsDialog(shell, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
use of org.apache.hop.ui.core.dialog.EnterNumberDialog in project hop by apache.
the class TableInputDialog method preview.
/**
* Preview the data generated by this transform. This generates a pipeline using this transform &
* a dummy and previews it.
*/
private void preview() {
// Create the table input reader transform...
TableInputMeta oneMeta = new TableInputMeta();
getInfo(oneMeta, true);
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.getText());
EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "TableInputDialog.EnterPreviewSize"), BaseMessages.getString(PKG, "TableInputDialog.NumberOfRowsToPreview"));
int previewSize = numberDialog.open();
if (previewSize > 0) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (!progressDialog.isCancelled()) {
if (pipeline.getResult() != null && pipeline.getResult().getNrErrors() > 0) {
EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"), BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true);
etd.setReadOnly();
etd.open();
} else {
PreviewRowsDialog prd = new PreviewRowsDialog(shell, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
}
}
use of org.apache.hop.ui.core.dialog.EnterNumberDialog in project hop by apache.
the class GetSubFoldersDialog method preview.
// Preview the data
private void preview() {
// Create the XML input transform
GetSubFoldersMeta oneMeta = new GetSubFoldersMeta();
getInfo(oneMeta);
PipelineMeta previewMeta = PipelinePreviewFactory.generatePreviewPipeline(pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.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) {
PipelinePreviewProgressDialog progressDialog = new PipelinePreviewProgressDialog(shell, variables, previewMeta, new String[] { wTransformName.getText() }, new int[] { previewSize });
progressDialog.open();
if (!progressDialog.isCancelled()) {
Pipeline pipeline = progressDialog.getPipeline();
String loggingText = progressDialog.getLoggingText();
if (pipeline.getResult() != null && pipeline.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, variables, SWT.NONE, wTransformName.getText(), progressDialog.getPreviewRowsMeta(wTransformName.getText()), progressDialog.getPreviewRows(wTransformName.getText()), loggingText);
prd.open();
}
}
}
Aggregations