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;
}
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;
}
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);
}
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", ""));
}
}
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);
}
Aggregations