Example usage for com.google.gwt.dom.client Style setMarginBottom

List of usage examples for com.google.gwt.dom.client Style setMarginBottom

Introduction

In this page you can find the example usage for com.google.gwt.dom.client Style setMarginBottom.

Prototype

public void setMarginBottom(double value, Unit unit) 

Source Link

Usage

From source file:org.opencms.gwt.client.seo.CmsAliasList.java

License:Open Source License

/**
 * Creates a label for this widget.<p>
 *
 * @param text the text to display in the label
 *
 * @return the created label/*w w  w .ja  va  2  s  . c o  m*/
 */
protected Label createLabel(String text) {

    Label label = new Label(text);
    Style style = label.getElement().getStyle();
    style.setMarginTop(10, Unit.PX);
    style.setMarginBottom(4, Unit.PX);
    style.setFontWeight(FontWeight.BOLD);
    return label;
}

From source file:org.rstudio.studio.client.workbench.views.environment.ClearAllDialog.java

License:Open Source License

@Override
protected Widget createMainWidget() {
    progress_ = addProgressIndicator();//from ww  w.  jav  a  2s.  c  o m

    VerticalPanel panel = new VerticalPanel();

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);

    // add image
    MessageDialogImages images = MessageDialogImages.INSTANCE;
    Image image = new Image(images.dialog_warning());
    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;
}

From source file:org.rstudio.studio.client.workbench.views.source.editors.text.ui.RMarkdownNoParamsDialog.java

License:Open Source License

@Override
protected Widget createMainWidget() {
    VerticalPanel panel = new VerticalPanel();

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);

    // add image/*from www  . ja v a2 s .c  o  m*/
    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;
}

From source file:org.rstudio.studio.client.workbench.views.source.editors.text.ui.TemplateMenuItem.java

License:Open Source License

public void addIcon(ImageResource icon) {
    Image iconImage = new Image(icon);
    wrapper_.insert(iconImage, 0);// w ww. j ava  2s . co  m
    Style imageStyle = iconImage.getElement().getStyle();
    imageStyle.setVerticalAlign(VerticalAlign.MIDDLE);
    imageStyle.setMarginRight(5, Unit.PX);
    imageStyle.setMarginBottom(2, Unit.PX);
}

From source file:org.rstudio.studio.client.workbench.views.vcs.ConsoleProgressDialog.java

License:Open Source License

public ConsoleProgressDialog(String title, ConsoleProcess consoleProcess) {
    consoleProcess_ = consoleProcess;/*from  w  w w  .j a v  a  2s .co  m*/

    setText(title);

    registrations_ = new HandlerRegistrations();
    registrations_.add(consoleProcess.addConsoleOutputHandler(this));
    registrations_.add(consoleProcess.addProcessExitHandler(this));

    output_ = new PreWidget();
    output_.getElement().getStyle().setMargin(0, Unit.PX);
    output_.getElement().getStyle().setFontSize(11, Unit.PX);

    scrollPanel_ = new BottomScrollPanel(output_);
    scrollPanel_.setSize("640px", "200px");

    Style style = scrollPanel_.getElement().getStyle();
    style.setBackgroundColor("white");
    style.setBorderStyle(BorderStyle.SOLID);
    style.setBorderColor("#BBB");
    style.setBorderWidth(1, Style.Unit.PX);
    style.setMargin(0, Unit.PX);
    style.setMarginBottom(3, Unit.PX);
    style.setPadding(4, Unit.PX);

    status_ = new Label("The process is executing...");

    button_ = new ThemedButton("Stop", this);
    addOkButton(button_);

    consoleProcess.start(new SimpleRequestCallback<Void>() {
        @Override
        public void onError(ServerError error) {
            // Show error and stop
            super.onError(error);
            closeDialog();
        }
    });
}

From source file:org.rstudio.studio.client.workbench.views.workspace.ClearAllDialog.java

License:Open Source License

@Override
protected Widget createMainWidget() {
    progress_ = addProgressIndicator();//from  w ww.  ja  v a2s. c  om

    VerticalPanel panel = new VerticalPanel();

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);

    // add image
    MessageDialogImages images = MessageDialogImages.INSTANCE;
    Image image = new Image(images.dialog_warning());
    horizontalPanel.add(image);

    // add message widget
    Label label = new MultiLineLabel("Are you sure you want to remove all objects from the workspace?");
    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());
    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;
}