Search in sources :

Example 1 with MessageDialogImages

use of org.rstudio.core.client.widget.images.MessageDialogImages 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 MessageDialogImages

use of org.rstudio.core.client.widget.images.MessageDialogImages in project rstudio by rstudio.

the class MessageDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    // add image
    MessageDialogImages images = MessageDialogImages.INSTANCE;
    Image image = null;
    switch(type_) {
        case INFO:
            image = new Image(new ImageResource2x(images.dialog_info2x()));
            break;
        case WARNING:
            image = new Image(new ImageResource2x(images.dialog_warning2x()));
            break;
        case ERROR:
            image = new Image(new ImageResource2x(images.dialog_error2x()));
            break;
        case QUESTION:
            image = new Image(new ImageResource2x(images.dialog_question2x()));
            break;
        case POPUP_BLOCKED:
            image = new Image(new ImageResource2x(images.dialog_popup_blocked2x()));
            break;
    }
    horizontalPanel.add(image);
    // add message widget
    horizontalPanel.add(messageWidget_);
    return horizontalPanel;
}
Also used : MessageDialogImages(org.rstudio.core.client.widget.images.MessageDialogImages) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 3 with MessageDialogImages

use of org.rstudio.core.client.widget.images.MessageDialogImages in project rstudio by rstudio.

the class ClearAllDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    progress_ = addProgressIndicator();
    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
    String objects;
    if (numObjects_ == 0)
        objects = "all objects";
    else if (numObjects_ == 1)
        objects = "1 object";
    else
        objects = numObjects_ + " objects";
    Label label = new MultiLineLabel("Are you sure you want to remove " + objects + " from the " + "environment? This operation cannot be undone.");
    label.setStylePrimaryName(ThemeResources.INSTANCE.themeStyles().dialogMessage());
    horizontalPanel.add(label);
    panel.add(horizontalPanel);
    // add include hidden option
    HorizontalPanel optionPanel = new HorizontalPanel();
    Style optionStyle = optionPanel.getElement().getStyle();
    optionStyle.setMarginLeft(image.getWidth(), Unit.PX);
    optionStyle.setMarginBottom(10, Unit.PX);
    chkIncludeHidden_ = new CheckBox("Include hidden objects");
    chkIncludeHidden_.setValue(prefs_.clearHidden().getValue());
    if (numObjects_ == 0) {
        chkIncludeHidden_.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            @Override
            public void onValueChange(ValueChangeEvent<Boolean> event) {
                prefs_.clearHidden().setGlobalValue(event.getValue());
                prefs_.writeUIPrefs();
            }
        });
        optionPanel.add(chkIncludeHidden_);
    }
    panel.add(optionPanel);
    return panel;
}
Also used : MessageDialogImages(org.rstudio.core.client.widget.images.MessageDialogImages) MultiLineLabel(org.rstudio.core.client.widget.MultiLineLabel) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x) Style(com.google.gwt.dom.client.Style) MultiLineLabel(org.rstudio.core.client.widget.MultiLineLabel)

Aggregations

ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)3 MessageDialogImages (org.rstudio.core.client.widget.images.MessageDialogImages)3 Style (com.google.gwt.dom.client.Style)2 MultiLineLabel (org.rstudio.core.client.widget.MultiLineLabel)2 HelpLink (org.rstudio.studio.client.common.HelpLink)1