Search in sources :

Example 11 with Style

use of com.google.gwt.dom.client.Style 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 12 with Style

use of com.google.gwt.dom.client.Style in project rstudio by rstudio.

the class HelpButton method createHelpButton.

public static HelpButton createHelpButton(String rstudioLinkName) {
    HelpButton helpButton = new HelpButton(rstudioLinkName);
    Style style = helpButton.getElement().getStyle();
    style.setMarginTop(3, Unit.PX);
    style.setMarginLeft(4, Unit.PX);
    return helpButton;
}
Also used : Style(com.google.gwt.dom.client.Style)

Example 13 with Style

use of com.google.gwt.dom.client.Style in project rstudio by rstudio.

the class ImagePreviewPopup method showWithDimensions.

private void showWithDimensions(String width, String height) {
    setVisible(true);
    ImageElementEx el = image_.getElement().cast();
    Style style = el.getStyle();
    boolean isWide = el.naturalWidth() > el.naturalHeight();
    if (isWide)
        style.setProperty("maxWidth", width);
    else
        style.setProperty("maxHeight", height);
}
Also used : Style(com.google.gwt.dom.client.Style) ImageElementEx(org.rstudio.core.client.dom.ImageElementEx)

Example 14 with Style

use of com.google.gwt.dom.client.Style in project GwtMobile by dennisjzh.

the class ScrollPanel method getStyleTop.

private int getStyleTop() {
    Style style = getWidget().getElement().getStyle();
    String top = style.getTop();
    if (top.isEmpty()) {
        return 0;
    } else {
        return Integer.parseInt(top.replace("px", ""));
    }
}
Also used : Style(com.google.gwt.dom.client.Style)

Example 15 with Style

use of com.google.gwt.dom.client.Style in project blogwt by billy1380.

the class MapHelper method showMap.

/**
 * @param element
 * @param lines
 * @param params
 */
public static void showMap(Element element, List<String> lines, Map<String, String> params) {
    Style s = element.getStyle();
    float width = floatParam(params, "width", 100);
    Unit widthUnits = unitParam(params, "widthUnits", Unit.PCT);
    s.setWidth(width, widthUnits);
    float height = floatParam(params, "height", 200);
    Unit heightUnits = unitParam(params, "heightUnits", Unit.PT);
    s.setHeight(height, heightUnits);
    float lat = floatParam(params, "lat", -34.397f);
    float lng = floatParam(params, "lng", 150.644f);
    int zoom = intParam(params, "zoom", 8);
    String markerName = params.get("markerName");
    showMap(element, lat, lng, zoom, markerName);
}
Also used : Style(com.google.gwt.dom.client.Style) Unit(com.google.gwt.dom.client.Style.Unit)

Aggregations

Style (com.google.gwt.dom.client.Style)46 Test (org.junit.Test)6 Element (com.google.gwt.dom.client.Element)5 Button (com.google.gwt.user.client.ui.Button)4 Image (com.google.gwt.user.client.ui.Image)4 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)4 ImageElementEx (org.rstudio.core.client.dom.ImageElementEx)3 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Command (com.google.gwt.user.client.Command)2 Element (com.google.gwt.user.client.Element)2 Timer (com.google.gwt.user.client.Timer)2 FlexTable (com.google.gwt.user.client.ui.FlexTable)2 HTMLPanel (com.google.gwt.user.client.ui.HTMLPanel)2 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 MultiLineLabel (org.rstudio.core.client.widget.MultiLineLabel)2 MessageDialogImages (org.rstudio.core.client.widget.images.MessageDialogImages)2 PreloaderCallback (com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderCallback)1