public <S extends InputRedirectAware> SettingsEditorFragment<S, ?> createRedirectFragment() {
    TextFieldWithBrowseButton inputFile = new TextFieldWithBrowseButton();
    inputFile.addActionListener(new ComponentWithBrowseButton.BrowseFolderActionListener<>(null, null, inputFile, null,
                                                                                           FileChooserDescriptorFactory
                                                                                             .createSingleFileDescriptor(),
                                                                                           TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
      @Override
      protected @Nullable VirtualFile getInitialFile() {
        VirtualFile initialFile = super.getInitialFile();
        if (initialFile != null) {
          return initialFile;
        }
        String text = myWorkingDirectory.component().getComponent().getText();
        return LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(text));
      }
    });

    MacrosDialog.addMacroSupport((ExtendableTextField)inputFile.getTextField(), MacrosDialog.Filters.ALL, () -> myHasModule.compute() != null);
    LabeledComponent<TextFieldWithBrowseButton> labeledComponent =
      LabeledComponent.create(inputFile, ExecutionBundle.message("redirect.input.from"));
    labeledComponent.setLabelLocation(BorderLayout.WEST);
    SettingsEditorFragment<S, LabeledComponent<TextFieldWithBrowseButton>> redirectInput =
      new SettingsEditorFragment<>("redirectInput", ExecutionBundle.message("redirect.input.from.name"),
                                   ExecutionBundle.message("group.operating.system"), labeledComponent,
                                   (settings, component) -> component.getComponent().setText(
                                     FileUtil.toSystemDependentName(notNullize(settings.getInputRedirectOptions().getRedirectInputPath()))),
                                   (settings, component) -> {
                                     String filePath = component.getComponent().getText();
                                     settings.getInputRedirectOptions().setRedirectInput(component.isVisible() && isNotEmpty(filePath));
                                     settings.getInputRedirectOptions().setRedirectInputPath(
                                       isEmpty(filePath) ? null : FileUtil.toSystemIndependentName(filePath));
                                   },
                                   settings -> isNotEmpty(settings.getInputRedirectOptions().getRedirectInputPath()));
    redirectInput.setActionHint(ExecutionBundle.message("read.input.from.the.specified.file"));
    return redirectInput;
  }
public <S extends InputRedirectAware> SettingsEditorFragment<S, ?> createRedirectFragment()