public String open()

in plugins/tech/avro/src/main/java/org/apache/hop/avro/transforms/avrooutput/AvroOutputDialog.java [124:831]


  public String open() {
    Shell parent = getParent();

    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    PropsUi.setLook(shell);
    setShellImage(shell, input);

    changed = input.hasChanged();

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = PropsUi.getFormMargin();
    formLayout.marginHeight = PropsUi.getFormMargin();

    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "AvroOutputDialog.DialogTitle"));

    int middle = props.getMiddlePct();
    int margin = PropsUi.getMargin();

    // Add the buttons at the bottom
    //
    wOk = new Button(shell, SWT.PUSH);
    wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wOk.addListener(SWT.Selection, e -> ok());
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    wCancel.addListener(SWT.Selection, e -> cancel());
    setButtonPositions(new Button[] {wOk, wCancel}, margin, null);

    // TransformName line
    wlTransformName = new Label(shell, SWT.RIGHT);
    wlTransformName.setText(BaseMessages.getString(PKG, "System.TransformName.Label"));
    wlTransformName.setToolTipText(BaseMessages.getString(PKG, "System.TransformName.Tooltip"));
    PropsUi.setLook(wlTransformName);
    fdlTransformName = new FormData();
    fdlTransformName.left = new FormAttachment(0, 0);
    fdlTransformName.top = new FormAttachment(0, margin);
    fdlTransformName.right = new FormAttachment(middle, -margin);
    wlTransformName.setLayoutData(fdlTransformName);
    wTransformName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wTransformName.setText(transformName);
    PropsUi.setLook(wTransformName);
    fdTransformName = new FormData();
    fdTransformName.left = new FormAttachment(middle, 0);
    fdTransformName.top = new FormAttachment(0, margin);
    fdTransformName.right = new FormAttachment(100, 0);
    wTransformName.setLayoutData(fdTransformName);

    CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
    PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);

    // ////////////////////////
    // START OF FILE TAB///
    // /
    CTabItem wFileTab = new CTabItem(wTabFolder, SWT.NONE);
    wFileTab.setFont(GuiResource.getInstance().getFontDefault());
    wFileTab.setText(BaseMessages.getString(PKG, "AvroOutputDialog.FileTab.TabTitle"));

    Composite wFileComp = new Composite(wTabFolder, SWT.NONE);
    PropsUi.setLook(wFileComp);

    FormLayout fileLayout = new FormLayout();
    fileLayout.marginWidth = 3;
    fileLayout.marginHeight = 3;
    wFileComp.setLayout(fileLayout);

    //
    // Output type
    Label wlOutputType = new Label(wFileComp, SWT.RIGHT);
    wlOutputType.setText(BaseMessages.getString(PKG, "AvroOutputDialog.OutputType.Label"));
    PropsUi.setLook(wlOutputType);
    FormData fdlOutputType = new FormData();
    fdlOutputType.left = new FormAttachment(0, 0);
    fdlOutputType.top = new FormAttachment(0, margin);
    fdlOutputType.right = new FormAttachment(middle, -margin);
    wlOutputType.setLayoutData(fdlOutputType);

    wOutputType = new CCombo(wFileComp, SWT.BORDER | SWT.READ_ONLY);
    wOutputType.setEditable(false);
    PropsUi.setLook(wOutputType);
    wOutputType.addListener(SWT.Selection, e -> enableFields());
    FormData fdOutputType = new FormData();
    fdOutputType.left = new FormAttachment(middle, 0);
    fdOutputType.top = new FormAttachment(0, margin);
    fdOutputType.right = new FormAttachment(75, 0);
    wOutputType.setLayoutData(fdOutputType);
    for (String outputTypeDesc : OUTPUT_TYPE_DESC) {
      wOutputType.add(outputTypeDesc);
    }

    // Filename line
    Label wlFilename = new Label(wFileComp, SWT.RIGHT);
    wlFilename.setText(BaseMessages.getString(PKG, "AvroOutputDialog.Filename.Label"));
    PropsUi.setLook(wlFilename);
    FormData fdlFilename = new FormData();
    fdlFilename.left = new FormAttachment(0, 0);
    fdlFilename.top = new FormAttachment(wOutputType, margin);
    fdlFilename.right = new FormAttachment(middle, -margin);
    wlFilename.setLayoutData(fdlFilename);

    Button wbFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    PropsUi.setLook(wbFilename);
    wbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    FormData fdbFilename = new FormData();
    fdbFilename.right = new FormAttachment(100, 0);
    fdbFilename.top = new FormAttachment(wOutputType, margin);
    wbFilename.setLayoutData(fdbFilename);

    wFilename = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    PropsUi.setLook(wFilename);
    FormData fdFilename = new FormData();
    fdFilename.left = new FormAttachment(middle, 0);
    fdFilename.top = new FormAttachment(wOutputType, margin);
    fdFilename.right = new FormAttachment(wbFilename, -margin);
    wFilename.setLayoutData(fdFilename);

    // Whenever something changes, set the tooltip to the expanded version:
    wFilename.addModifyListener(
        e -> wFilename.setToolTipText(variables.resolve(wFilename.getText())));

    wbFilename.addListener(
        SWT.Selection,
        e ->
            BaseDialog.presentFileDialog(
                true,
                shell,
                wFilename,
                variables,
                new String[] {"*.avro", "*"},
                new String[] {
                  BaseMessages.getString(PKG, "AvroOutputDialog.AvroFiles"),
                  BaseMessages.getString(PKG, "System.FileType.AllFiles")
                },
                true));

    // Fieldname line
    Label wlOutputField = new Label(wFileComp, SWT.RIGHT);
    wlOutputField.setText(BaseMessages.getString(PKG, "AvroOutputDialog.OutputField.Label"));
    PropsUi.setLook(wlOutputField);
    FormData fdlOutputField = new FormData();
    fdlOutputField.left = new FormAttachment(0, 0);
    fdlOutputField.top = new FormAttachment(wFilename, margin);
    fdlOutputField.right = new FormAttachment(middle, -margin);
    wlOutputField.setLayoutData(fdlOutputField);

    wOutputField = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    PropsUi.setLook(wOutputField);
    FormData fdOutputField = new FormData();
    fdOutputField.left = new FormAttachment(middle, 0);
    fdOutputField.top = new FormAttachment(wFilename, margin);
    fdOutputField.right = new FormAttachment(100, -margin);
    wOutputField.setLayoutData(fdOutputField);

    // Automatically create schema?
    //
    Label wlCreateSchemaFile = new Label(wFileComp, SWT.RIGHT);
    wlCreateSchemaFile.setText(
        BaseMessages.getString(PKG, "AvroOutputDialog.CreateSchemaFile.Label"));
    PropsUi.setLook(wlCreateSchemaFile);
    FormData fdlCreateSchemaFile = new FormData();
    fdlCreateSchemaFile.left = new FormAttachment(0, 0);
    fdlCreateSchemaFile.top = new FormAttachment(wOutputField, margin);
    fdlCreateSchemaFile.right = new FormAttachment(middle, -margin);
    wlCreateSchemaFile.setLayoutData(fdlCreateSchemaFile);
    wCreateSchemaFile = new Button(wFileComp, SWT.CHECK);
    wCreateSchemaFile.setToolTipText(
        BaseMessages.getString(PKG, "AvroOutputDialog.CreateSchemaFile.Tooltip"));
    PropsUi.setLook(wCreateSchemaFile);
    FormData fdCreateSchemaFile = new FormData();
    fdCreateSchemaFile.left = new FormAttachment(middle, 0);
    fdCreateSchemaFile.top = new FormAttachment(wlCreateSchemaFile, 0, SWT.CENTER);
    fdCreateSchemaFile.right = new FormAttachment(100, 0);
    wCreateSchemaFile.setLayoutData(fdCreateSchemaFile);
    wCreateSchemaFile.addListener(SWT.Selection, e -> enableFields());

    // Write Schema File
    //
    wlWriteSchemaFile = new Label(wFileComp, SWT.RIGHT);
    wlWriteSchemaFile.setText(
        BaseMessages.getString(PKG, "AvroOutputDialog.WriteSchemaFile.Label"));
    PropsUi.setLook(wlWriteSchemaFile);
    FormData fdlWriteSchemaFile = new FormData();
    fdlWriteSchemaFile.left = new FormAttachment(0, 0);
    fdlWriteSchemaFile.top = new FormAttachment(wlCreateSchemaFile, 2 * margin);
    fdlWriteSchemaFile.right = new FormAttachment(middle, -margin);
    wlWriteSchemaFile.setLayoutData(fdlWriteSchemaFile);
    wWriteSchemaFile = new Button(wFileComp, SWT.CHECK);
    wWriteSchemaFile.setToolTipText(
        BaseMessages.getString(PKG, "AvroOutputDialog.WriteSchemaFile.Tooltip"));
    PropsUi.setLook(wWriteSchemaFile);
    FormData fdWriteSchemaFile = new FormData();
    fdWriteSchemaFile.left = new FormAttachment(middle, 0);
    fdWriteSchemaFile.top = new FormAttachment(wlWriteSchemaFile, 0, SWT.CENTER);
    fdWriteSchemaFile.right = new FormAttachment(100, 0);
    wWriteSchemaFile.setLayoutData(fdWriteSchemaFile);
    wWriteSchemaFile.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
            enableFields();
          }
        });

    // Namespace
    //
    wlNamespace = new Label(wFileComp, SWT.RIGHT);
    wlNamespace.setText(BaseMessages.getString(PKG, "AvroOutputDialog.Namespace.Label"));
    PropsUi.setLook(wlNamespace);
    FormData fdlNamespace = new FormData();
    fdlNamespace.left = new FormAttachment(0, 0);
    fdlNamespace.top = new FormAttachment(wlWriteSchemaFile, 2 * margin);
    fdlNamespace.right = new FormAttachment(middle, -margin);
    wlNamespace.setLayoutData(fdlNamespace);
    wNamespace = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    PropsUi.setLook(wNamespace);
    FormData fdNamespace = new FormData();
    fdNamespace.left = new FormAttachment(middle, 0);
    fdNamespace.top = new FormAttachment(wlNamespace, 0, SWT.CENTER);
    fdNamespace.right = new FormAttachment(100, 0);
    wNamespace.setLayoutData(fdNamespace);
    wNamespace.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Record Name
    //
    wlRecordName = new Label(wFileComp, SWT.RIGHT);
    wlRecordName.setText(BaseMessages.getString(PKG, "AvroOutputDialog.RecordName.Label"));
    PropsUi.setLook(wlRecordName);
    FormData fdlRecordName = new FormData();
    fdlRecordName.left = new FormAttachment(0, 0);
    fdlRecordName.top = new FormAttachment(wNamespace, margin);
    fdlRecordName.right = new FormAttachment(middle, -margin);
    wlRecordName.setLayoutData(fdlRecordName);
    wRecordName = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    PropsUi.setLook(wRecordName);
    FormData fdRecordName = new FormData();
    fdRecordName.left = new FormAttachment(middle, 0);
    fdRecordName.top = new FormAttachment(wNamespace, margin);
    fdRecordName.right = new FormAttachment(100, 0);
    wRecordName.setLayoutData(fdRecordName);
    wRecordName.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Doc
    //
    wlDoc = new Label(wFileComp, SWT.RIGHT);
    wlDoc.setText(BaseMessages.getString(PKG, "AvroOutputDialog.Doc.Label"));
    PropsUi.setLook(wlDoc);
    FormData fdlDoc = new FormData();
    fdlDoc.left = new FormAttachment(0, 0);
    fdlDoc.top = new FormAttachment(wRecordName, margin);
    fdlDoc.right = new FormAttachment(middle, -margin);
    wlDoc.setLayoutData(fdlDoc);
    wDoc = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    PropsUi.setLook(wDoc);
    FormData fdDoc = new FormData();
    fdDoc.left = new FormAttachment(middle, 0);
    fdDoc.top = new FormAttachment(wRecordName, margin);
    fdDoc.right = new FormAttachment(100, 0);
    wDoc.setLayoutData(fdDoc);
    wDoc.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Schema Filename line

    ModifyListener lsSchema = e -> updateSchema();

    wlSchema = new Label(wFileComp, SWT.RIGHT);
    wlSchema.setText(BaseMessages.getString(PKG, "AvroOutputDialog.Schema.Label"));
    PropsUi.setLook(wlSchema);
    FormData fdlSchema = new FormData();
    fdlSchema.left = new FormAttachment(0, 0);
    fdlSchema.top = new FormAttachment(wDoc, margin);
    fdlSchema.right = new FormAttachment(middle, -margin);
    wlSchema.setLayoutData(fdlSchema);

    wbSchema = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
    PropsUi.setLook(wbSchema);
    wbSchema.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
    FormData fdbSchema = new FormData();
    fdbSchema.right = new FormAttachment(100, 0);
    fdbSchema.top = new FormAttachment(wDoc, 0);
    wbSchema.setLayoutData(fdbSchema);

    wSchema = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    PropsUi.setLook(wSchema);
    wSchema.addModifyListener(lsSchema);
    FormData fdSchema = new FormData();
    fdSchema.left = new FormAttachment(middle, 0);
    fdSchema.top = new FormAttachment(wDoc, margin);
    fdSchema.right = new FormAttachment(wbSchema, -margin);
    wSchema.setLayoutData(fdSchema);

    wbSchema.addListener(
        SWT.Selection,
        e ->
            BaseDialog.presentFileDialog(
                true,
                shell,
                wSchema,
                variables,
                new String[] {"*.avsc", "*.json", "*"},
                new String[] {
                  BaseMessages.getString(PKG, "AvroOutputDialog.AvroFilesSchema"),
                  BaseMessages.getString(PKG, "AvroOutputDialog.AvroFilesSchemaJson"),
                  BaseMessages.getString(PKG, "System.FileType.AllFiles")
                },
                true));

    // Create Parent Folder?
    //
    Label wlCreateParentFolder = new Label(wFileComp, SWT.RIGHT);
    wlCreateParentFolder.setText(
        BaseMessages.getString(PKG, "AvroOutputDialog.CreateParentFolder.Label"));
    PropsUi.setLook(wlCreateParentFolder);
    FormData fdlCreateParentFolder = new FormData();
    fdlCreateParentFolder.left = new FormAttachment(0, 0);
    fdlCreateParentFolder.top = new FormAttachment(wSchema, margin);
    fdlCreateParentFolder.right = new FormAttachment(middle, -margin);
    wlCreateParentFolder.setLayoutData(fdlCreateParentFolder);
    wCreateParentFolder = new Button(wFileComp, SWT.CHECK);
    wCreateParentFolder.setToolTipText(
        BaseMessages.getString(PKG, "AvroOutputDialog.CreateParentFolder.Tooltip"));
    PropsUi.setLook(wCreateParentFolder);
    FormData fdCreateParentFolder = new FormData();
    fdCreateParentFolder.left = new FormAttachment(middle, 0);
    fdCreateParentFolder.top = new FormAttachment(wlCreateParentFolder, 0, SWT.CENTER);
    fdCreateParentFolder.right = new FormAttachment(100, 0);
    wCreateParentFolder.setLayoutData(fdCreateParentFolder);
    wCreateParentFolder.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Compression
    //
    Label wlCompression = new Label(wFileComp, SWT.RIGHT);
    wlCompression.setText(BaseMessages.getString(PKG, "AvroOutputDialog.Compression.Label"));
    PropsUi.setLook(wlCompression);
    FormData fdlCompression = new FormData();
    fdlCompression.left = new FormAttachment(0, 0);
    fdlCompression.top = new FormAttachment(wlCreateParentFolder, 2 * margin);
    fdlCompression.right = new FormAttachment(middle, -margin);
    wlCompression.setLayoutData(fdlCompression);
    wCompression = new CCombo(wFileComp, SWT.BORDER | SWT.READ_ONLY);
    wCompression.setEditable(true);
    PropsUi.setLook(wCompression);
    FormData fdCompression = new FormData();
    fdCompression.left = new FormAttachment(middle, 0);
    fdCompression.top = new FormAttachment(wlCompression, 0, SWT.CENTER);
    fdCompression.right = new FormAttachment(75, 0);
    wCompression.setLayoutData(fdCompression);
    String[] compressions = AvroOutputMeta.compressionTypes;
    for (String compression : compressions) {
      wCompression.add(compression);
    }

    // Add transform number?
    //
    Label wlAddTransformNr = new Label(wFileComp, SWT.RIGHT);
    wlAddTransformNr.setText(BaseMessages.getString(PKG, "AvroOutputDialog.AddTransformNr.Label"));
    PropsUi.setLook(wlAddTransformNr);
    FormData fdlAddTransformNr = new FormData();
    fdlAddTransformNr.left = new FormAttachment(0, 0);
    fdlAddTransformNr.top = new FormAttachment(wCompression, margin);
    fdlAddTransformNr.right = new FormAttachment(middle, -margin);
    wlAddTransformNr.setLayoutData(fdlAddTransformNr);
    wAddTransformNr = new Button(wFileComp, SWT.CHECK);
    PropsUi.setLook(wAddTransformNr);
    FormData fdAddTransformNr = new FormData();
    fdAddTransformNr.left = new FormAttachment(middle, 0);
    fdAddTransformNr.top = new FormAttachment(wlAddTransformNr, 0, SWT.CENTER);
    fdAddTransformNr.right = new FormAttachment(100, 0);
    wAddTransformNr.setLayoutData(fdAddTransformNr);
    wAddTransformNr.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Add part number to filename?
    //
    Label wlAddPartNr = new Label(wFileComp, SWT.RIGHT);
    wlAddPartNr.setText(BaseMessages.getString(PKG, "AvroOutputDialog.AddPartNr.Label"));
    PropsUi.setLook(wlAddPartNr);
    FormData fdlAddPartNr = new FormData();
    fdlAddPartNr.left = new FormAttachment(0, 0);
    fdlAddPartNr.top = new FormAttachment(wlAddTransformNr, 2 * margin);
    fdlAddPartNr.right = new FormAttachment(middle, -margin);
    wlAddPartNr.setLayoutData(fdlAddPartNr);
    wAddPartNr = new Button(wFileComp, SWT.CHECK);
    PropsUi.setLook(wAddPartNr);
    FormData fdAddPartNr = new FormData();
    fdAddPartNr.left = new FormAttachment(middle, 0);
    fdAddPartNr.top = new FormAttachment(wlAddPartNr, 0, SWT.CENTER);
    fdAddPartNr.right = new FormAttachment(100, 0);
    wAddPartNr.setLayoutData(fdAddPartNr);
    wAddPartNr.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Add date to filename?
    //
    wlAddDate = new Label(wFileComp, SWT.RIGHT);
    wlAddDate.setText(BaseMessages.getString(PKG, "AvroOutputDialog.AddDate.Label"));
    PropsUi.setLook(wlAddDate);
    FormData fdlAddDate = new FormData();
    fdlAddDate.left = new FormAttachment(0, 0);
    fdlAddDate.top = new FormAttachment(wlAddPartNr, 2 * margin);
    fdlAddDate.right = new FormAttachment(middle, -margin);
    wlAddDate.setLayoutData(fdlAddDate);
    wAddDate = new Button(wFileComp, SWT.CHECK);
    PropsUi.setLook(wAddDate);
    FormData fdAddDate = new FormData();
    fdAddDate.left = new FormAttachment(middle, 0);
    fdAddDate.top = new FormAttachment(wlAddDate, 0, SWT.CENTER);
    fdAddDate.right = new FormAttachment(100, 0);
    wAddDate.setLayoutData(fdAddDate);
    wAddDate.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Add time to the filename?
    //
    wlAddTime = new Label(wFileComp, SWT.RIGHT);
    wlAddTime.setText(BaseMessages.getString(PKG, "AvroOutputDialog.AddTime.Label"));
    PropsUi.setLook(wlAddTime);
    FormData fdlAddTime = new FormData();
    fdlAddTime.left = new FormAttachment(0, 0);
    fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
    fdlAddTime.right = new FormAttachment(middle, -margin);
    wlAddTime.setLayoutData(fdlAddTime);
    wAddTime = new Button(wFileComp, SWT.CHECK);
    PropsUi.setLook(wAddTime);
    FormData fdAddTime = new FormData();
    fdAddTime.left = new FormAttachment(middle, 0);
    fdAddTime.top = new FormAttachment(wlAddTime, 0, SWT.CENTER);
    fdAddTime.right = new FormAttachment(100, 0);
    wAddTime.setLayoutData(fdAddTime);
    wAddTime.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // Specify a date time format?
    //
    Label wlSpecifyFormat = new Label(wFileComp, SWT.RIGHT);
    wlSpecifyFormat.setText(BaseMessages.getString(PKG, "AvroOutputDialog.SpecifyFormat.Label"));
    PropsUi.setLook(wlSpecifyFormat);
    FormData fdlSpecifyFormat = new FormData();
    fdlSpecifyFormat.left = new FormAttachment(0, 0);
    fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
    fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
    wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
    wSpecifyFormat = new Button(wFileComp, SWT.CHECK);
    PropsUi.setLook(wSpecifyFormat);
    wSpecifyFormat.setToolTipText(
        BaseMessages.getString(PKG, "AvroOutputDialog.SpecifyFormat.Tooltip"));
    FormData fdSpecifyFormat = new FormData();
    fdSpecifyFormat.left = new FormAttachment(middle, 0);
    fdSpecifyFormat.top = new FormAttachment(wlSpecifyFormat, 0, SWT.CENTER);
    fdSpecifyFormat.right = new FormAttachment(100, 0);
    wSpecifyFormat.setLayoutData(fdSpecifyFormat);
    wSpecifyFormat.addListener(SWT.Selection, e -> enableFields());

    // The date-time format
    //
    wlDateTimeFormat = new Label(wFileComp, SWT.RIGHT);
    wlDateTimeFormat.setText(BaseMessages.getString(PKG, "AvroOutputDialog.DateTimeFormat.Label"));
    PropsUi.setLook(wlDateTimeFormat);
    FormData fdlDateTimeFormat = new FormData();
    fdlDateTimeFormat.left = new FormAttachment(0, 0);
    fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
    fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
    wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
    wDateTimeFormat = new CCombo(wFileComp, SWT.BORDER | SWT.READ_ONLY);
    wDateTimeFormat.setEditable(true);
    PropsUi.setLook(wDateTimeFormat);
    FormData fdDateTimeFormat = new FormData();
    fdDateTimeFormat.left = new FormAttachment(middle, 0);
    fdDateTimeFormat.top = new FormAttachment(wlDateTimeFormat, 0, SWT.CENTER);
    fdDateTimeFormat.right = new FormAttachment(75, 0);
    wDateTimeFormat.setLayoutData(fdDateTimeFormat);
    String[] dats = Const.getDateFormats();
    for (String dat : dats) {
      wDateTimeFormat.add(dat);
    }

    // Add filename to the result files name
    //
    Label wlAddToResult = new Label(wFileComp, SWT.RIGHT);
    wlAddToResult.setText(BaseMessages.getString(PKG, "AvroOutputDialog.AddFileToResult.Label"));
    PropsUi.setLook(wlAddToResult);
    FormData fdlAddToResult = new FormData();
    fdlAddToResult.left = new FormAttachment(0, 0);
    fdlAddToResult.top = new FormAttachment(wDateTimeFormat, 2 * margin);
    fdlAddToResult.right = new FormAttachment(middle, -margin);
    wlAddToResult.setLayoutData(fdlAddToResult);
    wAddToResult = new Button(wFileComp, SWT.CHECK);
    wAddToResult.setToolTipText(
        BaseMessages.getString(PKG, "AvroOutputDialog.AddFileToResult.Tooltip"));
    PropsUi.setLook(wAddToResult);
    FormData fdAddToResult = new FormData();
    fdAddToResult.left = new FormAttachment(middle, 0);
    fdAddToResult.top = new FormAttachment(wlAddToResult, 0, SWT.CENTER);
    fdAddToResult.right = new FormAttachment(100, 0);
    wAddToResult.setLayoutData(fdAddToResult);
    SelectionAdapter lsSelR =
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent arg0) {
            input.setChanged();
          }
        };
    wAddToResult.addSelectionListener(lsSelR);

    FormData fdFileComp = new FormData();
    fdFileComp.left = new FormAttachment(0, 0);
    fdFileComp.top = new FormAttachment(0, 0);
    fdFileComp.right = new FormAttachment(100, 0);
    fdFileComp.bottom = new FormAttachment(100, 0);
    wFileComp.setLayoutData(fdFileComp);

    wFileComp.layout();
    wFileTab.setControl(wFileComp);

    // ///////////////////////////////////////////////////////////
    // / END OF FILE TAB
    // ///////////////////////////////////////////////////////////

    // Fields tab...
    //
    CTabItem wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
    wFieldsTab.setFont(GuiResource.getInstance().getFontDefault());
    wFieldsTab.setText(BaseMessages.getString(PKG, "AvroOutputDialog.FieldsTab.TabTitle"));

    FormLayout fieldsLayout = new FormLayout();
    fieldsLayout.marginWidth = PropsUi.getFormMargin();
    fieldsLayout.marginHeight = PropsUi.getFormMargin();

    Composite wFieldsComp = new Composite(wTabFolder, SWT.NONE);
    wFieldsComp.setLayout(fieldsLayout);
    PropsUi.setLook(wFieldsComp);

    wGet = new Button(wFieldsComp, SWT.PUSH);
    wGet.setText(BaseMessages.getString(PKG, "System.Button.GetFields"));
    wGet.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.GetFields"));
    wGet.addListener(SWT.Selection, e -> get());
    fdGet = new FormData();
    fdGet.right = new FormAttachment(50, -margin);
    fdGet.bottom = new FormAttachment(100, 0);
    wGet.setLayoutData(fdGet);

    Button wUpdateTypes = new Button(wFieldsComp, SWT.PUSH);
    wUpdateTypes.setText(BaseMessages.getString(PKG, "AvroOutputDialog.Button.UpdateTypes"));
    wUpdateTypes.setToolTipText(
        BaseMessages.getString(PKG, "AvroOutputDialog.Tooltip.UpdateTypes"));
    wUpdateTypes.addListener(SWT.Selection, e -> updateTypes());
    FormData fdUpdateTypes = new FormData();
    fdUpdateTypes.left = new FormAttachment(wGet, margin * 2);
    fdUpdateTypes.bottom = new FormAttachment(100, 0);
    wUpdateTypes.setLayoutData(fdUpdateTypes);

    final int nrFieldsCols = 4;
    final int nrFieldsRows = input.getOutputFields().size();

    colinf = new ColumnInfo[nrFieldsCols];
    colinf[0] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "AvroOutputDialog.StreamColumn.Column"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            new String[] {""},
            false);
    colinf[1] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "AvroOutputDialog.AvroColumn.Column"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            getSchemaFields(),
            false);
    colinf[2] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "AvroOutputDialog.AvroType.Column"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            AvroOutputField.getAvroTypeArraySorted(),
            false);
    colinf[3] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "AvroOutputDialog.Nullable.Column"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            YES_NO_COMBO,
            false);

    colinf[2].setComboValuesSelectionListener(
        (tableItem, rowNr, colNr) -> {
          String[] comboValues;
          if (!(wCreateSchemaFile.getSelection()) && validSchema) {
            String avroColumn = tableItem.getText(colNr - 1);
            String streamColumn = tableItem.getText(colNr - 2);
            avroColumn = (avroColumn != null ? avroColumn : streamColumn);

            Schema fieldSchema = getFieldSchema(avroColumn);
            if (fieldSchema != null) {
              String[] combo = AvroOutputField.mapAvroType(fieldSchema, fieldSchema.getType());
              comboValues = combo;
            } else {
              comboValues = AvroOutputField.getAvroTypeArraySorted();
            }
          } else {
            comboValues = AvroOutputField.getAvroTypeArraySorted();
          }
          return comboValues;
        });

    wFields =
        new TableView(
            variables,
            wFieldsComp,
            SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI,
            colinf,
            nrFieldsRows,
            null,
            props);

    FormData fdFields = new FormData();
    fdFields.left = new FormAttachment(0, 0);
    fdFields.top = new FormAttachment(0, 0);
    fdFields.right = new FormAttachment(100, 0);
    fdFields.bottom = new FormAttachment(wGet, -margin);
    wFields.setLayoutData(fdFields);

    //
    // Search the fields in the background

    final Runnable runnable =
        () -> {
          TransformMeta transformMeta = pipelineMeta.findTransform(transformName);
          if (transformMeta != null) {
            try {
              IRowMeta row = pipelineMeta.getPrevTransformFields(variables, transformMeta);

              // Remember these fields...
              for (int i = 0; i < row.size(); i++) {
                inputFields.add(row.getValueMeta(i).getName());
              }
              setComboBoxes();
            } catch (HopException e) {
              logError(BaseMessages.getString(PKG, CONST_SYSTEM_DIALOG_GET_FIELDS_FAILED_MESSAGE));
            }
          }
        };
    new Thread(runnable).start();

    FormData fdFieldsComp = new FormData();
    fdFieldsComp.left = new FormAttachment(0, 0);
    fdFieldsComp.top = new FormAttachment(0, 0);
    fdFieldsComp.right = new FormAttachment(100, 0);
    fdFieldsComp.bottom = new FormAttachment(100, 0);
    wFieldsComp.setLayoutData(fdFieldsComp);

    wFieldsComp.layout();
    wFieldsTab.setControl(wFieldsComp);

    FormData fdTabFolder = new FormData();
    fdTabFolder.left = new FormAttachment(0, 0);
    fdTabFolder.top = new FormAttachment(wTransformName, margin);
    fdTabFolder.right = new FormAttachment(100, 0);
    fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
    wTabFolder.setLayoutData(fdTabFolder);

    getData();
    input.setChanged(changed);
    wTabFolder.setSelection(0);

    BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
    return transformName;
  }