Search in sources :

Example 1 with FileChooserTextBox

use of org.rstudio.core.client.widget.FileChooserTextBox in project rstudio by rstudio.

the class ProjectTemplateWidget method fileInput.

private ProjectTemplateWidgetItem fileInput(final ProjectTemplateWidgetDescription description) {
    final FileChooserTextBox widget = new FileChooserTextBox(description.getLabel(), null);
    String defaultValue = description.getDefault();
    if (!StringUtil.isNullOrEmpty(defaultValue))
        widget.setText(defaultValue);
    return new ProjectTemplateWidgetItem(widget, new Collector() {

        @Override
        public void collectInput(JsObject receiver) {
            String value = widget.getText();
            receiver.setString(description.getParameter(), value);
        }
    });
}
Also used : JsObject(org.rstudio.core.client.js.JsObject) FileChooserTextBox(org.rstudio.core.client.widget.FileChooserTextBox) JsArrayString(com.google.gwt.core.client.JsArrayString)

Aggregations

JsArrayString (com.google.gwt.core.client.JsArrayString)1 JsObject (org.rstudio.core.client.js.JsObject)1 FileChooserTextBox (org.rstudio.core.client.widget.FileChooserTextBox)1