use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class VersionControlPage method onAddWidgets.
@Override
protected void onAddWidgets() {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
VerticalPanel urlPanel = new VerticalPanel();
urlPanel.addStyleName(styles.wizardMainColumn());
Label urlLabel = new Label("Repository URL:");
urlLabel.addStyleName(styles.wizardTextEntryLabel());
urlPanel.add(urlLabel);
txtRepoUrl_ = new TextBox();
txtRepoUrl_.addDomHandler(new KeyDownHandler() {
public void onKeyDown(KeyDownEvent event) {
handleAutoFillCheckoutDir();
}
}, KeyDownEvent.getType());
txtRepoUrl_.setWidth("100%");
urlPanel.add(txtRepoUrl_);
addWidget(urlPanel);
addSpacer();
txtUsername_ = new TextBox();
txtUsername_.setWidth("100%");
if (includeCredentials()) {
VerticalPanel usernamePanel = new VerticalPanel();
usernamePanel.addStyleName(styles.wizardMainColumn());
Label usernameLabel = new Label("Username (if required for this repository URL):");
usernameLabel.addStyleName(styles.wizardTextEntryLabel());
usernamePanel.add(usernameLabel);
usernamePanel.add(txtUsername_);
addWidget(usernamePanel);
addSpacer();
}
Label dirNameLabel = new Label("Project directory name:");
dirNameLabel.addStyleName(styles.wizardTextEntryLabel());
addWidget(dirNameLabel);
txtDirName_ = new TextBox();
txtDirName_.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
if (!event.getValue().equals(guessRepoDir()))
suppressDirNameDetection_ = true;
}
});
txtDirName_.addStyleName(styles.wizardMainColumn());
addWidget(txtDirName_);
addSpacer();
existingRepoDestDir_ = new DirectoryChooserTextBox("Create project as subdirectory of:", txtRepoUrl_);
addWidget(existingRepoDestDir_);
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class ProjectCompilePdfPreferencesPane method addHeader.
private void addHeader(String caption) {
PreferencesDialogBaseResources baseRes = PreferencesDialogBaseResources.INSTANCE;
Label pdfCompilationLabel = new Label(caption);
pdfCompilationLabel.addStyleName(baseRes.styles().headerLabel());
nudgeRight(pdfCompilationLabel);
add(pdfCompilationLabel);
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class ProjectPackratPreferencesPane method initialize.
@Override
protected void initialize(RProjectOptions options) {
Styles styles = RES.styles();
Label label = new Label("Packrat is a dependency management tool that makes your " + "R code more isolated, portable, and reproducible by " + "giving your project its own privately managed package " + "library.");
spaced(label);
add(label);
PackratContext context = options.getPackratContext();
RProjectPackratOptions packratOptions = options.getPackratOptions();
chkUsePackrat_ = new CheckBox("Use packrat with this project");
chkUsePackrat_.setValue(context.isPackified());
chkUsePackrat_.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
if (event.getValue())
verifyPrerequisites();
else
manageUI(false);
}
});
spaced(chkUsePackrat_);
add(chkUsePackrat_);
chkAutoSnapshot_ = new CheckBox("Automatically snapshot local changes");
chkAutoSnapshot_.setValue(packratOptions.getAutoSnapshot());
lessSpaced(chkAutoSnapshot_);
add(chkAutoSnapshot_);
String vcsName = session_.getSessionInfo().getVcsName();
chkVcsIgnoreLib_ = new CheckBox(vcsName + " ignore packrat library");
chkVcsIgnoreLib_.setValue(packratOptions.getVcsIgnoreLib());
lessSpaced(chkVcsIgnoreLib_);
add(chkVcsIgnoreLib_);
chkVcsIgnoreSrc_ = new CheckBox(vcsName + " ignore packrat sources");
chkVcsIgnoreSrc_.setValue(packratOptions.getVcsIgnoreSrc());
lessSpaced(chkVcsIgnoreSrc_);
add(chkVcsIgnoreSrc_);
chkUseCache_ = new CheckBox("Use global cache for installed packages");
chkUseCache_.setValue(packratOptions.getUseCache());
spaced(chkUseCache_);
add(chkUseCache_);
panelExternalPackages_ = new VerticalPanel();
panelExternalPackages_.add(new LabelWithHelp("External packages (comma separated):", "packrat_external_packages", false));
taExternalPackages_ = new FixedTextArea(3);
taExternalPackages_.addStyleName(styles.externalPackages());
taExternalPackages_.setText(StringUtil.join(Arrays.asList(JsUtil.toStringArray(packratOptions.getExternalPackages())), ", "));
taExternalPackages_.getElement().getStyle().setMarginBottom(8, Unit.PX);
panelExternalPackages_.add(taExternalPackages_);
add(panelExternalPackages_);
widgetLocalRepos_ = new LocalRepositoriesWidget();
String[] localRepos = JsUtil.toStringArray(packratOptions.getLocalRepos());
for (int i = 0; i < localRepos.length; ++i) {
widgetLocalRepos_.addItem(localRepos[i]);
}
add(widgetLocalRepos_);
manageUI(context.isPackified());
HelpLink helpLink = new HelpLink("Learn more about Packrat", "packrat", false);
helpLink.getElement().getStyle().setMarginTop(15, Unit.PX);
nudgeRight(helpLink);
add(helpLink);
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class PresentationPane method zoom.
@Override
public void zoom(String title, String url, final Command onClosed) {
// create the titlebar (no title for now)
HorizontalPanel titlePanel = new HorizontalPanel();
ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
Label titleLabel = new Label(title);
titleLabel.addStyleName(styles.fullscreenCaptionLabel());
titlePanel.add(titleLabel);
// create the frame
AnchorableFrame frame = new PresentationFrame(true);
frame.setSize("100%", "100%");
// create the popup panel & add close handler
activeZoomPanel_ = new FullscreenPopupPanel(titlePanel, frame, false);
activeZoomPanel_.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
activeZoomPanel_ = null;
onClosed.execute();
}
});
// load the frame and show the zoom panel
frame.navigate(url);
activeZoomPanel_.center();
}
use of com.google.gwt.user.client.ui.Label in project rstudio by rstudio.
the class RPubsUploadDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
Styles styles = RESOURCES.styles();
SimplePanel mainPanel = new SimplePanel();
mainPanel.addStyleName(styles.mainWidget());
VerticalPanel verticalPanel = new VerticalPanel();
HorizontalPanel headerPanel = new HorizontalPanel();
headerPanel.addStyleName(styles.headerPanel());
headerPanel.add(new Image(new ImageResource2x(RESOURCES.publishLarge2x())));
Label headerLabel = new Label("Publish to RPubs");
headerLabel.addStyleName(styles.headerLabel());
headerPanel.add(headerLabel);
headerPanel.setCellVerticalAlignment(headerLabel, HasVerticalAlignment.ALIGN_MIDDLE);
verticalPanel.add(headerPanel);
String msg;
if (!isPublished_ && uploadId_.isEmpty()) {
msg = "RPubs is a free service from RStudio for sharing " + "documents on the web. Click Publish to get " + "started.";
} else {
msg = "This document has already been published on RPubs. You can " + "choose to either update the existing RPubs document, or " + "create a new one.";
}
Label descLabel = new Label(msg);
descLabel.addStyleName(styles.descLabel());
verticalPanel.add(descLabel);
// if we have a generator then show title and comment UI
if (htmlGenerator_ != null) {
Label titleLabel = new Label("Title (optional):");
titleLabel.addStyleName(styles.fieldLabel());
verticalPanel.add(titleLabel);
titleTextBox_ = new TextBox();
titleTextBox_.addStyleName(styles.titleTextBox());
titleTextBox_.getElement().setAttribute("spellcheck", "false");
verticalPanel.add(titleTextBox_);
Label commentLabel = new Label("Comment (optional):");
commentLabel.addStyleName(styles.fieldLabel());
verticalPanel.add(commentLabel);
commentTextArea_ = new FixedTextArea(6);
commentTextArea_.addStyleName(styles.commentTextArea());
verticalPanel.add(commentTextArea_);
// not using either for now
titleLabel.setVisible(false);
titleTextBox_.setVisible(false);
commentLabel.setVisible(false);
commentTextArea_.setVisible(false);
previewButton_ = new ThemedButton("Preview");
previewButton_.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
htmlGenerator_.generateStaticHtml(titleTextBox_.getText().trim(), commentTextArea_.getText().trim(), new CommandWithArg<String>() {
@Override
public void execute(String rpubsFile) {
globalDisplay_.showHtmlFile(rpubsFile);
}
});
}
});
addLeftButton(previewButton_);
}
HTML warningLabel = new HTML("<strong>IMPORTANT: All documents published to RPubs are " + "publicly visible.</strong> You should " + "only publish documents that you wish to share publicly.");
warningLabel.addStyleName(styles.warningLabel());
verticalPanel.add(warningLabel);
ThemedButton cancelButton = createCancelButton(new Operation() {
@Override
public void execute() {
// if an upload is in progress then terminate it
if (uploader_.isUploadInProgress()) {
uploader_.terminateUpload();
}
}
});
continueButton_ = new ThemedButton("Publish", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
performUpload(false);
}
});
updateButton_ = new ThemedButton("Update Existing", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
performUpload(true);
}
});
createButton_ = new ThemedButton("Create New", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
performUpload(false);
}
});
if (!isPublished_ && uploadId_.isEmpty()) {
addOkButton(continueButton_);
addCancelButton(cancelButton);
} else {
addOkButton(updateButton_);
addButton(createButton_);
addCancelButton(cancelButton);
}
mainPanel.setWidget(verticalPanel);
return mainPanel;
}
Aggregations