Search in sources :

Example 1 with HelpLink

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;
}
Also used : MessageDialogImages(org.rstudio.core.client.widget.images.MessageDialogImages) MultiLineLabel(org.rstudio.core.client.widget.MultiLineLabel) HelpLink(org.rstudio.studio.client.common.HelpLink) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Style(com.google.gwt.dom.client.Style) MultiLineLabel(org.rstudio.core.client.widget.MultiLineLabel)

Example 2 with HelpLink

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;
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) HelpLink(org.rstudio.studio.client.common.HelpLink) VcsHelpLink(org.rstudio.studio.client.common.vcs.VcsHelpLink) SessionInfo(org.rstudio.studio.client.workbench.model.SessionInfo) HTML(com.google.gwt.user.client.ui.HTML) MessageDialog(org.rstudio.core.client.widget.MessageDialog) VcsHelpLink(org.rstudio.studio.client.common.vcs.VcsHelpLink)

Example 3 with HelpLink

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);
}
Also used : RProjectPackratOptions(org.rstudio.studio.client.projects.model.RProjectPackratOptions) LabelWithHelp(org.rstudio.core.client.widget.LabelWithHelp) Label(com.google.gwt.user.client.ui.Label) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) CheckBox(com.google.gwt.user.client.ui.CheckBox) FixedTextArea(org.rstudio.core.client.widget.FixedTextArea) LocalRepositoriesWidget(org.rstudio.core.client.widget.LocalRepositoriesWidget) HelpLink(org.rstudio.studio.client.common.HelpLink) PackratContext(org.rstudio.studio.client.packrat.model.PackratContext)

Example 4 with 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());
}
Also used : HelpLink(org.rstudio.studio.client.common.HelpLink)

Example 5 with HelpLink

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);
    }
}
Also used : HelpLink(org.rstudio.studio.client.common.HelpLink)

Aggregations

HelpLink (org.rstudio.studio.client.common.HelpLink)7 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)3 Label (com.google.gwt.user.client.ui.Label)2 Element (com.google.gwt.dom.client.Element)1 Style (com.google.gwt.dom.client.Style)1 TableRowElement (com.google.gwt.dom.client.TableRowElement)1 AttachEvent (com.google.gwt.event.logical.shared.AttachEvent)1 NativePreviewEvent (com.google.gwt.user.client.Event.NativePreviewEvent)1 NativePreviewHandler (com.google.gwt.user.client.Event.NativePreviewHandler)1 CheckBox (com.google.gwt.user.client.ui.CheckBox)1 DockPanel (com.google.gwt.user.client.ui.DockPanel)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 HTML (com.google.gwt.user.client.ui.HTML)1 ElementPredicate (org.rstudio.core.client.dom.DomUtils.ElementPredicate)1 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)1 FixedTextArea (org.rstudio.core.client.widget.FixedTextArea)1 LabelWithHelp (org.rstudio.core.client.widget.LabelWithHelp)1 LocalRepositoriesWidget (org.rstudio.core.client.widget.LocalRepositoriesWidget)1 MessageDialog (org.rstudio.core.client.widget.MessageDialog)1 MultiLineLabel (org.rstudio.core.client.widget.MultiLineLabel)1