use of org.rstudio.studio.client.common.HelpLink in project rstudio by rstudio.
the class RMarkdownNoParamsDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
VerticalPanel panel = new VerticalPanel();
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
// add image
MessageDialogImages images = MessageDialogImages.INSTANCE;
Image image = new Image(new ImageResource2x(images.dialog_warning2x()));
horizontalPanel.add(image);
// add message widget
VerticalPanel messagePanel = new VerticalPanel();
Label label = new MultiLineLabel("There are no parameters defined for the current " + "R Markdown document.");
label.setStylePrimaryName(ThemeResources.INSTANCE.themeStyles().dialogMessage());
messagePanel.add(label);
HelpLink helpLink = new HelpLink("Using R Markdown Parameters", "parameterized_reports", false);
Style style = helpLink.getElement().getStyle();
style.setMarginTop(4, Unit.PX);
style.setMarginBottom(12, Unit.PX);
messagePanel.add(helpLink);
horizontalPanel.add(messagePanel);
panel.add(horizontalPanel);
return panel;
}
use of org.rstudio.studio.client.common.HelpLink in project rstudio by rstudio.
the class VersionControlPage method acceptNavigation.
@Override
protected boolean acceptNavigation() {
SessionInfo sessionInfo = RStudioGinjector.INSTANCE.getSession().getSessionInfo();
if (!sessionInfo.isVcsAvailable(getVcsId())) {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.addStyleName(styles.vcsNotInstalledWidget());
if (Desktop.isDesktop()) {
HTML msg = new HTML("<p>" + getTitle() + " was not detected " + "on the system path.</p>" + "<p>To create projects from " + getTitle() + " " + "repositories you should install " + getTitle() + " " + "and then restart RStudio.</p>" + "<p>Note that if " + getTitle() + " is installed " + "and not on the path, then you can specify its location using " + "the " + (BrowseCap.isMacintosh() ? "Preferences" : "Options") + " dialog.</p>");
msg.setWidth("100%");
verticalPanel.add(msg);
HelpLink vcsHelpLink = new VcsHelpLink();
vcsHelpLink.setCaption("Using " + getTitle() + " with RStudio");
vcsHelpLink.addStyleName(styles.vcsHelpLink());
verticalPanel.add(vcsHelpLink);
} else {
HTML msg = new HTML("<p>An installation of " + getTitle() + " was not detected " + "on this system.</p>" + "<p>To create projects from " + getTitle() + " " + "repositories you should request that your server " + "administrator install the " + getTitle() + " package.</p>");
msg.setWidth("100%");
verticalPanel.add(msg);
}
MessageDialog dlg = new MessageDialog(MessageDialog.INFO, getTitle() + " Not Found", verticalPanel);
dlg.addButton("OK", (Operation) null, true, false);
dlg.showModal();
return false;
} else {
return true;
}
}
use of org.rstudio.studio.client.common.HelpLink 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 org.rstudio.studio.client.common.HelpLink in project rstudio by rstudio.
the class Wizard method updateHelpLink.
public void updateHelpLink(HelpLink helpLink) {
if (helpLink == null) {
if (helpLink_ != null)
removeLeftWidget(helpLink_);
helpLink_ = null;
return;
}
if (helpLink_ == null) {
WizardResources.Styles styles = WizardResources.INSTANCE.styles();
helpLink_ = new HelpLink("", "", false);
helpLink_.addStyleName(styles.helpLink());
addLeftWidget(helpLink_);
}
helpLink_.setCaption(helpLink.getCaption());
helpLink_.setLink(helpLink.getLink(), helpLink.isRStudioLink());
}
use of org.rstudio.studio.client.common.HelpLink in project rstudio by rstudio.
the class NewConnectionSnippetDialog method onDialogShown.
@Override
protected void onDialogShown() {
super.onDialogShown();
setOkButtonCaption("Configure");
if (newConnectionInfo_.getHelp() != null) {
HelpLink helpLink = new HelpLink("Using " + newConnectionInfo_.getName(), newConnectionInfo_.getHelp(), false, false);
addLeftWidget(helpLink);
}
}
Aggregations