public CompileNotebookOptionsDialog(
      String docId,
      String defaultTitle,
      String defaultAuthor,
      String defaultType,
      final OperationWithInput<CompileNotebookOptions> operation) {
    super("Compile Notebook from R Script", operation);
    docId_ = docId;
    RStudioGinjector.INSTANCE.injectMembers(this);

    widget_ = GWT.<Binder>create(Binder.class).createAndBindUi(this);
    txtTitle_.setText(defaultTitle);
    txtAuthor_.setText(defaultAuthor);

    if (showTypes_) {
      setType(defaultType);

      typeLabelPanel_.setCellVerticalAlignment(lblType_, HasVerticalAlignment.ALIGN_MIDDLE);

      HelpButton helpButton = HelpButton.createHelpButton("notebook_types");
      typeLabelPanel_.add(helpButton);
      typeLabelPanel_.setCellVerticalAlignment(helpButton, HasVerticalAlignment.ALIGN_MIDDLE);

      divTypeSelector_.getStyle().setPaddingBottom(10, Unit.PX);
    } else {
      setType(CompileNotebookOptions.TYPE_DEFAULT);
      divTypeSelector_.getStyle().setDisplay(Style.Display.NONE);
    }

    setOkButtonCaption("Compile");
  }
Ejemplo n.º 2
0
    public RVersionSelectWidget(JsArray<RVersionSpec> rVersions) {
      super(
          "R version for new sessions:",
          rVersionChoices(rVersions),
          rVersionValues(rVersions),
          false,
          true,
          false);

      HelpButton.addHelpButton(this, "multiple_r_versions");
    }