use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class ProjectTemplateWidget method textInput.
private ProjectTemplateWidgetItem textInput(final ProjectTemplateWidgetDescription description) {
final TextBox primaryWidget = new TextBox();
primaryWidget.setWidth("180px");
String defaultValue = description.getDefault();
if (!StringUtil.isNullOrEmpty(defaultValue))
primaryWidget.setText(defaultValue);
Grid grid = new Grid(1, 2);
primaryWidget.getElement().setAttribute("spellcheck", "false");
grid.setWidget(0, 0, new Label(ensureEndsWithColon(description.getLabel())));
grid.setWidget(0, 1, primaryWidget);
return new ProjectTemplateWidgetItem(grid, new Collector() {
@Override
public void collectInput(JsObject receiver) {
String value = primaryWidget.getValue();
receiver.setString(description.getParameter(), value);
}
});
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class NewDirectoryPage method onAddWidgets.
@Override
protected void onAddWidgets() {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
HorizontalPanel panel = new HorizontalPanel();
panel.addStyleName(styles.wizardMainColumn());
// create the dir name label
dirNameLabel_ = new Label("Directory name:");
dirNameLabel_.addStyleName(styles.wizardTextEntryLabel());
// top panel widgets
onAddTopPanelWidgets(panel);
// dir name
VerticalPanel namePanel = new VerticalPanel();
namePanel.addStyleName(styles.newProjectDirectoryName());
namePanel.add(dirNameLabel_);
txtProjectName_ = new TextBox();
txtProjectName_.setWidth("100%");
txtProjectName_.getElement().setAttribute("spellcheck", "false");
namePanel.add(txtProjectName_);
panel.add(namePanel);
addWidget(panel);
onAddBodyWidgets();
addSpacer();
// project dir
newProjectParent_ = new DirectoryChooserTextBox("Create project as subdirectory of:", txtProjectName_);
addWidget(newProjectParent_);
// if git is available then add git init
UIPrefs uiPrefs = RStudioGinjector.INSTANCE.getUIPrefs();
SessionInfo sessionInfo = RStudioGinjector.INSTANCE.getSession().getSessionInfo();
HorizontalPanel optionsPanel = null;
if (getOptionsSideBySide())
optionsPanel = new HorizontalPanel();
chkGitInit_ = new CheckBox("Create a git repository");
chkGitInit_.addStyleName(styles.wizardCheckbox());
if (sessionInfo.isVcsAvailable(VCSConstants.GIT_ID)) {
chkGitInit_.setValue(uiPrefs.newProjGitInit().getValue());
chkGitInit_.getElement().getStyle().setMarginRight(7, Unit.PX);
if (optionsPanel != null) {
optionsPanel.add(chkGitInit_);
} else {
addSpacer();
addWidget(chkGitInit_);
}
}
// Initialize project with packrat
chkPackratInit_ = new CheckBox("Use packrat with this project");
chkPackratInit_.setValue(uiPrefs.newProjUsePackrat().getValue());
if (!sessionInfo.getPackratAvailable()) {
chkPackratInit_.setValue(false);
chkPackratInit_.setVisible(false);
}
if (optionsPanel != null) {
optionsPanel.add(chkPackratInit_);
} else {
addSpacer();
addWidget(chkPackratInit_);
}
if (optionsPanel != null) {
addSpacer();
addWidget(optionsPanel);
}
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class CreateKeyDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
Styles styles = RESOURCES.styles();
VerticalPanel panel = new VerticalPanel();
panel.addStyleName(styles.mainWidget());
VerticalPanel namePanel = new VerticalPanel();
namePanel.setWidth("100%");
// path
CaptionWithHelp pathCaption = new CaptionWithHelp("The RSA key will be created at:", "SSH/RSA key management", "rsa_key_help");
pathCaption.setIncludeVersionInfo(false);
pathCaption.setWidth("100%");
namePanel.add(pathCaption);
TextBox txtKeyPath = new TextBox();
txtKeyPath.addStyleName(styles.keyPathTextBox());
txtKeyPath.setReadOnly(true);
txtKeyPath.setText(rsaSshKeyPath_.getPath());
txtKeyPath.setWidth("100%");
namePanel.add(txtKeyPath);
panel.add(namePanel);
HorizontalPanel passphrasePanel = new HorizontalPanel();
passphrasePanel.addStyleName(styles.newSection());
VerticalPanel passphrasePanel1 = new VerticalPanel();
Label passphraseLabel1 = new Label("Passphrase (optional):");
passphraseLabel1.addStyleName(styles.entryLabel());
passphrasePanel1.add(passphraseLabel1);
txtPassphrase_ = new PasswordTextBox();
txtPassphrase_.addStyleName(styles.passphrase());
passphrasePanel1.add(txtPassphrase_);
passphrasePanel.add(passphrasePanel1);
VerticalPanel passphrasePanel2 = new VerticalPanel();
passphrasePanel2.addStyleName(styles.lastSection());
Label passphraseLabel2 = new Label("Confirm:");
passphraseLabel2.addStyleName(styles.entryLabel());
passphrasePanel2.add(passphraseLabel2);
txtConfirmPassphrase_ = new PasswordTextBox();
txtConfirmPassphrase_.addStyleName(styles.passphraseConfirm());
passphrasePanel2.add(txtConfirmPassphrase_);
passphrasePanel.add(passphrasePanel2);
panel.add(passphrasePanel);
return panel;
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class RmdTemplateOptionsWidget method addFormatOptions.
private void addFormatOptions(RmdTemplateFormat format) {
if (format.getNotes().length() > 0 && allowFormatChange_) {
labelFormatNotes_.setText(format.getNotes());
labelFormatNotes_.setVisible(true);
} else {
labelFormatNotes_.setVisible(false);
}
optionWidgets_ = new ArrayList<RmdFormatOption>();
JsArrayString options = format.getOptions();
for (int i = 0; i < options.length(); i++) {
RmdFormatOption optionWidget;
RmdTemplateFormatOption option = findOption(format.getName(), options.get(i));
if (option == null)
continue;
String initialValue = option.getDefaultValue();
// check to see whether a value for this format and option were
// specified in the front matter
String frontMatterValue = getFrontMatterDefault(format.getName(), option.getName());
if (frontMatterValue != null)
initialValue = frontMatterValue;
optionWidget = createWidgetForOption(option, initialValue);
if (optionWidget == null)
continue;
optionWidget.asWidget().addStyleName(style.optionWidget());
FlowPanel panel = null;
String category = option.getCategory();
if (tabs_.containsKey(category)) {
panel = tabs_.get(category);
} else {
ScrollPanel scrollPanel = new ScrollPanel();
panel = new FlowPanel();
scrollPanel.add(panel);
optionsTabs_.add(scrollPanel, new Label(category));
tabs_.put(category, panel);
}
panel.add(optionWidget);
optionWidgets_.add(optionWidget);
}
// we need to center the tabs and overlay them on the top edge of the
// content; to do this, it is necessary to nuke a couple of the inline
// styles used by the default GWT tab panel.
Element tabOuter = (Element) optionsTabs_.getElement().getChild(1);
tabOuter.getStyle().setOverflow(Overflow.VISIBLE);
Element tabInner = (Element) tabOuter.getFirstChild();
tabInner.getStyle().clearWidth();
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class BrowseAddinsDialog method emptyTableLabel.
private Label emptyTableLabel(String caption) {
Label label = new Label(caption);
label.getElement().getStyle().setMarginTop(20, Unit.PX);
label.getElement().getStyle().setColor("#888");
return label;
}
Aggregations