Java Code Examples for com.google.gwt.dom.client.Style.setFontSize()

The following are Jave code examples for showing how to use setFontSize() of the com.google.gwt.dom.client.Style class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: che   File: Tree.java   Source Code and License Vote up 6 votes
private void ensureFocusElement() {
  if (focusEl != null) {
    focusEl.removeFromParent();
  }
  focusEl = getElement().appendChild(focusImpl.createFocusable());
  focusEl.addClassName(treeStyles.styles().noFocusOutline());
  if (focusEl.hasChildNodes()) {
    focusEl.getFirstChildElement().addClassName(treeStyles.styles().noFocusOutline());
    Style focusElStyle = focusEl.getFirstChildElement().getStyle();
    focusElStyle.setBorderWidth(0, Style.Unit.PX);
    focusElStyle.setFontSize(1, Style.Unit.PX);
    focusElStyle.setPropertyPx("lineHeight", 1);
  }
  focusEl.getStyle().setLeft(0, Style.Unit.PX);
  focusEl.getStyle().setTop(0, Style.Unit.PX);
  focusEl.getStyle().setPosition(Style.Position.ABSOLUTE);

  // subscribe for Event.FOCUSEVENTS
  int bits =
      DOM.getEventsSunk(
          (Element) focusEl.cast()); // do not remove redundant cast, GWT tests will fail
  DOM.sinkEvents((Element) focusEl.cast(), bits | Event.FOCUSEVENTS);
}
 
Example 2
Project: minus   File: Indicator.java   Source Code and License Vote up 5 votes
public void setMessage(String msg, String bkgColor, String txtColor) {

    label_.setText(msg);

    Style labelStyle = label_.getElement().getStyle();
    labelStyle.setFontSize(1.6, Style.Unit.EM);
    labelStyle.setBackgroundColor(bkgColor);
    labelStyle.setColor(txtColor);
    labelStyle.setPadding(5, Style.Unit.PX);
  }
 
Example 3
Project: appformer   File: TextBoxDOMElement.java   Source Code and License Vote up 5 votes
public TextBoxDOMElement(final TextBox widget,
                         final GridLayer gridLayer,
                         final GridWidget gridWidget) {
    super(widget,
          gridLayer,
          gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setWidth(100,
                   Style.Unit.PCT);
    style.setHeight(HEIGHT,
                    Style.Unit.PX);
    style.setPaddingLeft(2,
                         Style.Unit.PX);
    style.setPaddingRight(2,
                          Style.Unit.PX);
    style.setFontSize(10,
                      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().getElement().getStyle().setPaddingLeft(5,
                                                          Style.Unit.PX);
    getContainer().getElement().getStyle().setPaddingRight(5,
                                                           Style.Unit.PX);
    getContainer().setWidget(widget);
}
 
Example 4
Project: appformer   File: ListBoxDOMElement.java   Source Code and License Vote up 5 votes
public ListBoxDOMElement(final ListBox widget,
                         final GridLayer gridLayer,
                         final GridWidget gridWidget) {
    super(widget,
          gridLayer,
          gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setWidth(100,
                   Style.Unit.PCT);
    style.setHeight(HEIGHT,
                    Style.Unit.PX);
    style.setPaddingLeft(2,
                         Style.Unit.PX);
    style.setPaddingRight(2,
                          Style.Unit.PX);
    style.setFontSize(10,
                      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().getElement().getStyle().setPaddingLeft(5,
                                                          Style.Unit.PX);
    getContainer().getElement().getStyle().setPaddingRight(5,
                                                           Style.Unit.PX);
    getContainer().setWidget(widget);
}