本文整理了Java中com.google.gwt.user.client.ui.Widget
类的一些代码示例,展示了Widget
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget
类的具体详情如下:
包路径:com.google.gwt.user.client.ui.Widget
类名称:Widget
[英]The base class for the majority of user-interface objects. Widget adds support for receiving events from the browser and being added directly to com.google.gwt.user.client.ui.Panel.
[中]大多数用户界面对象的基类。小部件增加了对从浏览器接收事件并直接添加到com的支持。谷歌。gwt。使用者客户用户界面。面板
代码示例来源:origin: kaaproject/kaa
/**
* Insert a widget before the specified widget. If the widget is already a
* child of this panel, this method behaves as though {@link #remove(Widget)}
* had already been called.
*
* @param widget the widget to be added
* @param before the widget before which to insert the new child, or <code>null</code> to append
*/
public void insert(Widget widget, Widget before) {
assertIsChild(before);
// Detach new child.
widget.removeFromParent();
// Logical attach.
WidgetCollection children = getChildren();
if (before == null) {
children.add(widget);
} else {
int index = children.indexOf(before);
children.insert(widget, index);
}
// Physical attach.
Layer layer = layout.attachChild(widget.getElement(), (before != null)
? before.getElement() : null, widget);
setWidgetVisible(widget, layer, false);
widget.setLayoutData(layer);
// Adopt.
adopt(widget);
// Update the layout.
animate(0);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected int getTargetSize() {
return target.getOffsetHeight();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
protected int getTargetSize() {
return target.getOffsetWidth();
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void execute(Widget w) {
if (w.isAttached()) {
w.onDetach();
}
}
};
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Reset the dimensions of the widget when it is removed.
*/
private void resetChildWidget(Widget w) {
w.setSize("", "");
w.setVisible(true);
}
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public void adjust(Widget main, FlowPanel container) {
int widgetCount = container.getWidgetCount();
double scaleFactor = 100d / widgetCount;
for (int i = 0; i < widgetCount; i++) {
Widget w = container.getWidget(i);
w.setWidth(scaleFactor + "%");
w.getElement().getStyle().setLeft(i * scaleFactor, Unit.PCT);
}
container.setWidth((widgetCount * 100) + "%");
container.getElement().getStyle().setHeight(main.getOffsetHeight(), Unit.PX);
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public void addFull(Widget widget)
{
panel.add( widget );
widget.setWidth( "100%" );
widget.setHeight( "100%" );
widget.getElement().getParentElement().getParentElement().getStyle().setHeight( 100, Unit.PCT );
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int contentHeight = (w == null) ? 0 : w.getOffsetHeight();
int contentWidth = (w == null) ? 0 : w.getOffsetWidth();
int realScrollbarWidth = 0;
if (hScrollbar != null
&& (alwaysShowScrollbars || getElement().getClientWidth() < contentWidth)) {
&& (alwaysShowScrollbars || getElement().getClientHeight() < contentHeight)) {
w.getElement().getStyle().setMarginBottom(realScrollbarHeight, Unit.PX);
contentHeight += realScrollbarHeight;
} else {
w.getElement().getStyle().clearMarginBottom();
代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl
private void prepareForAnimation(Widget p) {
if (p != null) {
Style style = p.getElement().getParentElement().getStyle();
String property = style.getProperty(Css3Propertynames
.transform());
MatchResult exec = regExp3dValues.exec(property);
style.setProperty(Css3Propertynames.transform(),
"translate3d(" + exec.getGroup(1) + ",0,0)");
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Setup the container around the widget.
*/
private void finishWidgetInitialization(Element container, Widget w) {
UIObject.setVisible(container, false);
container.getStyle().setProperty("height", "100%");
// Set 100% by default.
Element element = w.getElement();
if (element.getStyle().getProperty("width").equals("")) {
w.setWidth("100%");
}
if (element.getStyle().getProperty("height").equals("")) {
w.setHeight("100%");
}
// Issue 2510: Hiding the widget isn't necessary because we hide its
// wrapper, but it's in here for legacy support.
w.setVisible(false);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
while (DOM.getChildCount(bodyElem) > 0) {
bodyElem.removeChild(DOM.getChild(bodyElem, 0));
for (Iterator<Widget> it = getChildren().iterator(); it.hasNext();) {
Widget child = it.next();
DockLayoutConstant dir = ((LayoutData) child.getLayoutData()).direction;
if ((dir == NORTH) || (dir == SOUTH)) {
++rowCount;
for (int i = 0; i < rowCount; ++i) {
rows[i] = new TmpRow();
rows[i].tr = DOM.createTR();
LayoutData layout = (LayoutData) child.getLayoutData();
layout.td.setPropertyString("align", layout.hAlign);
layout.td.getStyle().setProperty("verticalAlign", layout.vAlign);
DOM.appendChild(td, child.getElement());
DOM.appendChild(td, child.getElement());
DOM.appendChild(td, child.getElement());
DOM.appendChild(td, child.getElement());
DOM.appendChild(centerTd, center.getElement());
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
public MessageBubbleWidget(String primaryStyleName) {
super();
setStyleName(primaryStyleName + "-inline");
messageWrapper.addClassName(primaryStyleName);
triangleSVG.addStyleName("triangle");
compositeIcon.setStyleName("composite-icon");
compositeIcon.addStyleName("message-bubble-icon");
compositeIcon.getElement().getStyle().setProperty("lineHeight", "1.4");
messageWrapper.replaceChild(compositeIcon.getElement(), icon);
messageEl.getStyle().setDisplay(Style.Display.BLOCK);
messageEl.getStyle().setMarginLeft(30, Style.Unit.PX);
}
代码示例来源:origin: kiegroup/appformer
@Override
public void onResize() {
hover.getElement().getStyle().setWidth(target.getOffsetWidth(),
Unit.PX);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void clearTraces() {
Style style = textWidget.getElement().getStyle();
style.clearLeft();
style.clearTop();
style.clearPosition();
style.clearZIndex();
stretchControl.getStyle().clearTop();
stretchControl.getStyle().clearLeft();
stretchControl.getStyle().clearDisplay();
JQueryWrapper.select("." + STRETCHER_BASE).setCss("display", "");
}
代码示例来源:origin: kiegroup/appformer
@Override
public void onResize() {
hover.getElement().getStyle().setHeight(target.getOffsetHeight(),
Unit.PX);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
focusableWidget.setFocus(true);
if (scrollOnSelectEnabled) {
((Widget) focusableWidget).getElement().scrollIntoView();
int containerTop = getAbsoluteTop();
int left = selectedElem.getAbsoluteLeft() - containerLeft;
int top = selectedElem.getAbsoluteTop() - containerTop;
int width = selectedElem.getPropertyInt("offsetWidth");
int height = selectedElem.getPropertyInt("offsetHeight");
DOM.setIntStyleAttribute(focusable, "left", 0);
DOM.setIntStyleAttribute(focusable, "top", 0);
return;
focusable.getStyle().setProperty("left", left + "px");
focusable.getStyle().setProperty("top", top + "px");
focusable.getStyle().setProperty("width", width + "px");
focusable.getStyle().setProperty("height", height + "px");
代码示例来源:origin: GwtMaterialDesign/gwt-material
@Override
public void setLabelWidth(double percentWidth) {
if (label != null) {
label.getElement().getStyle().setWidth(percentWidth, Style.Unit.PCT);
if (getFieldType().equals(FieldType.ALIGNED_LABEL)) {
errorLabel.getElement().getStyle().setPaddingLeft(percentWidth, Style.Unit.PCT);
}
} else {
GWT.log("Label is not defined", new IllegalStateException());
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
newWidget.removeFromParent();
contentElem.removeChild(widget.getElement());
widget = null;
contentElem.setInnerHTML("");
DOM.appendChild(contentElem, newWidget.getElement());
if (Tree.shouldTreeDelegateFocusToElement(widget.getElement())) {
widget.getElement().setAttribute("tabIndex", "-1");
代码示例来源:origin: GwtMaterialDesign/gwt-material
protected void applyCheckBoxType() {
if (getWidgetCount() > 0) {
getWidget(0).getElement().getStyle().setDisplay(Style.Display.INLINE);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public boolean remove(Widget w) {
// Validate.
if (w.getParent() != this) {
return false;
}
// Orphan.
try {
orphan(w);
} finally {
// Physical detach.
w.getElement().removeFromParent();
// Logical detach.
if (w == content) {
content = null;
contentContainer.getStyle().setDisplay(Display.NONE);
} else if (w == header) {
header = null;
headerContainer.getStyle().setDisplay(Display.NONE);
} else if (w == footer) {
footer = null;
footerContainer.getStyle().setDisplay(Display.NONE);
}
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!