本文整理汇总了Java中com.google.gwt.dom.client.Style.setFontSize方法的典型用法代码示例。如果您正苦于以下问题:Java Style.setFontSize方法的具体用法?Java Style.setFontSize怎么用?Java Style.setFontSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.Style
的用法示例。
在下文中一共展示了Style.setFontSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ensureFocusElement
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
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);
}
示例2: setMessage
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
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);
}
示例3: TextBoxDOMElement
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
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);
}
示例4: ListBoxDOMElement
import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
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);
}