use of org.rstudio.core.client.widget.SelectWidget in project rstudio by rstudio.
the class NewPackagePage method onAddTopPanelWidgets.
@Override
protected void onAddTopPanelWidgets(HorizontalPanel panel) {
dirNameLabel_.setText("Package name:");
String[] labels = { "Package" };
String[] values = { "package" };
listProjectType_ = new SelectWidget("Type:", labels, values, false);
listProjectType_.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
txtProjectName_.setFocus(true);
}
});
panel.add(listProjectType_);
}
use of org.rstudio.core.client.widget.SelectWidget in project rstudio by rstudio.
the class ProjectTemplateWidget method selectBoxInput.
private ProjectTemplateWidgetItem selectBoxInput(final ProjectTemplateWidgetDescription description) {
String[] fields = readSelectBoxFields(description);
String label = ensureEndsWithColon(description.getLabel());
final SelectWidget widget = new SelectWidget(label, fields);
String defaultValue = description.getDefault();
if (!StringUtil.isNullOrEmpty(defaultValue))
widget.setValue(defaultValue);
return new ProjectTemplateWidgetItem(widget, new Collector() {
@Override
public void collectInput(JsObject receiver) {
String value = widget.getValue();
receiver.setString(description.getParameter(), value);
}
});
}
Aggregations