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

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

Introduction

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

Prototype

public void setMarginTop(double value, Unit unit) 

Source Link

Usage

From source file:org.rstudio.studio.client.workbench.views.connections.ui.ConnectionExplorer.java

License:Open Source License

public ConnectionExplorer() {
    RStudioGinjector.INSTANCE.injectMembers(this);

    // code/connection panel
    int codePanelHeight = 80;
    disconnectedUI_ = new VerticalPanel();
    disconnectedUI_.setWidth("100%");
    disconnectedUI_.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    codePanel_ = new ConnectionCodePanel(false);
    codePanel_.addStyleName(ThemeStyles.INSTANCE.secondaryToolbarPanel());
    codePanel_.getElement().getStyle().setPadding(8, Unit.PX);
    codePanel_.setHeight((codePanelHeight - 5) + "px");
    codePanel_.setWidth("100%");
    disconnectedUI_.add(codePanel_);//from   w w  w.j  a  va  2  s  . c  o  m
    Label label = new Label("(Not connected)");
    Style labelStyle = label.getElement().getStyle();
    labelStyle.setColor("#888");
    labelStyle.setMarginTop(25, Unit.PX);
    labelStyle.setTextAlign(TextAlign.CENTER);
    disconnectedUI_.add(label);
    disconnectedUI_.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    // object browser panel
    objectBrowser_ = new ObjectBrowser();

    // container panel to enable switching between connected/disconnected
    ProgressSpinner spin = new ProgressSpinner(ProgressSpinner.COLOR_BLACK);
    spin.getElement().getStyle().setWidth(32, Unit.PX);
    spin.getElement().getStyle().setHeight(32, Unit.PX);
    containerPanel_ = new SimplePanelWithProgress(spin, 50);

    setConnected(false);

    initWidget(containerPanel_);

    eventBus_.addHandler(ConsoleBusyEvent.TYPE, new ConsoleBusyEvent.Handler() {
        @Override
        public void onConsoleBusy(ConsoleBusyEvent event) {
            // clear progress on console becoming unblocked
            if (!event.isBusy() && containerPanel_.isProgressShowing()) {
                showActivePanel();
                updateObjectBrowser();
            }
        }
    });
}

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  ww w.j a  v  a2s .c om
    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.uberfire.ext.wires.core.grids.client.widget.dom.impl.CheckBoxDOMElement.java

License:Apache License

public CheckBoxDOMElement(final CheckBox widget, final GridLayer gridLayer, final GridWidget gridWidget) {
    super(widget, gridLayer, gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setMarginTop(0, Style.Unit.PX);
    style.setMarginLeft(2, Style.Unit.PX);
    style.setWidth(SIZE, Style.Unit.PX);
    style.setHeight(SIZE, Style.Unit.PX);

    // --- Workaround for BS2 ---
    style.setPosition(Style.Position.RELATIVE);
    style.setPaddingTop(0, Style.Unit.PX);
    style.setPaddingBottom(0, Style.Unit.PX);
    style.setProperty("WebkitBoxSizing", "border-box");
    style.setProperty("MozBoxSizing", "border-box");
    style.setProperty("boxSizing", "border-box");
    style.setProperty("lineHeight", "normal");
    // --- End workaround ---

    getContainer().setWidget(widget);/*from w w  w  .j  a  v a 2s . c  o  m*/
}

From source file:scrum.client.collaboration.EmoticonSelectorWidget.java

License:Open Source License

private Widget createEmoticonWidget(String emotion, boolean selected) {
    Image img = new Image(getEmotionImage(emotion), 0, 0, 16, 16);
    Style imgStyle = img.getElement().getStyle();
    imgStyle.setMarginLeft(1, Unit.PX);/* www . j a  v  a  2  s. c o  m*/
    imgStyle.setMarginTop(1, Unit.PX);

    FocusPanel panel = new FocusPanel(img);
    panel.setStyleName("EmoticonSelectorWidget-emoticon");
    if (selected) {
        panel.addStyleName("EmoticonSelectorWidget-emoticon-selected");
    } else {
        panel.addClickHandler(new SelectEmotionClickHandler(emotion));
    }
    return panel;
}

From source file:scrum.client.collaboration.EmoticonsWidget.java

License:Open Source License

private Widget createEmoticonWidget(Emoticon emoticon) {
    Image img = new Image(getEmotionImage(emoticon.getEmotion()), 0, 0, 16, 16);
    img.setTitle(emoticon.getTooltip());
    Style imgStyle = img.getElement().getStyle();
    imgStyle.setMarginLeft(1, Unit.PX);//from  w  w  w.j  a v  a2s .  c o  m
    imgStyle.setMarginTop(1, Unit.PX);
    return img;
}

From source file:se.softhouse.garden.orchid.vaadin.widgetset.client.ui.VOrchidScrollTable.java

License:Open Source License

private void announceScrollPosition() {
    if (this.scrollPositionElement == null) {
        this.scrollPositionElement = DOM.createDiv();
        this.scrollPositionElement.setClassName(CLASSNAME + "-scrollposition");
        this.scrollPositionElement.getStyle().setPosition(Position.ABSOLUTE);
        this.scrollPositionElement.getStyle().setDisplay(Display.NONE);
        getElement().appendChild(this.scrollPositionElement);
    }/*from www.j  ava 2s. c o m*/

    Style style = this.scrollPositionElement.getStyle();
    style.setMarginLeft(getElement().getOffsetWidth() / 2 - 80, Unit.PX);
    style.setMarginTop(-this.scrollBodyPanel.getOffsetHeight(), Unit.PX);

    // indexes go from 1-totalRows, as rowheaders in index-mode indicate
    int last = (this.firstRowInViewPort + this.pageLength);
    if (last > this.totalRows) {
        last = this.totalRows;
    }
    this.scrollPositionElement
            .setInnerHTML("<span>" + (this.firstRowInViewPort + 1) + " &ndash; " + (last) + "..." + "</span>");
    style.setDisplay(Display.BLOCK);
}