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;
}
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;
}
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;
}
Aggregations