com.google.gwt.user.client.ui.Widget.asWidget()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.google.gwt.user.client.ui.Widget.asWidget()方法的一些代码示例,展示了Widget.asWidget()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.asWidget()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Widget
类名称:Widget
方法名:asWidget

Widget.asWidget介绍

[英]This convenience method makes a null-safe call to IsWidget#asWidget().
[中]这个方便的方法对IsWidget#asWidget()进行空安全调用。

代码示例

代码示例来源:origin: kiegroup/appformer

void appendWidgetToElement(final HTMLElement container,
              final Widget panelViewWidget) {
  DOMUtil.appendWidgetToElement(container,
                 panelViewWidget.asWidget());
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private void checkOverlay() {
  Widget it = this.dialog.asWidget();
  while (it != null && !isOverlay) {
    it = it.getParent();
    this.isOverlay = it instanceof OverlayWidget;
  }
}

代码示例来源:origin: org.overlord/overlord-commons-gwt

/**
   * Inserts a widget before the specified index.
   * 
   * @param w
   *            the widget to be inserted
   * @param beforeIndex
   *            the index before which it will be inserted
   * @throws IndexOutOfBoundsException
   *             if <code>beforeIndex</code> is out of range
   */
  public void insert(Widget w, int beforeIndex) {
    insert(w, getElement(), beforeIndex, true);
    children.add(beforeIndex, w.asWidget());
  }
}

代码示例来源:origin: org.overlord/overlord-commons-gwt

/**
   * Inserts a widget before the specified index.
   * 
   * @param w
   *            the widget to be inserted
   * @param beforeIndex
   *            the index before which it will be inserted
   * @throws IndexOutOfBoundsException
   *             if <code>beforeIndex</code> is out of range
   */
  public void insert(Widget w, int beforeIndex) {
    insert(w, getElement(), beforeIndex, true);
    children.add(beforeIndex, w.asWidget());
  }
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private boolean isFormVisible() {
  return JQueryWrapper.select(form.asWidget()).is(":visible");
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui

private void removeChildSubPanel(Widget widget) {
 removeWidgetFromSplitPanel(widget.asWidget());
 IsWidget lastWidget = null;
 if (!southSubPanels.isEmpty()) {
  lastWidget = southSubPanels.get(0);
 } else if (!eastSubPanels.isEmpty()) {
  lastWidget = eastSubPanels.get(0);
 }
 if (lastWidget != null) {
  removeWidgetFromSplitPanel(lastWidget.asWidget());
  splitLayoutPanel.add(lastWidget);
 } else {
  ((SubPanelViewImpl) parentPanel).removeWidgetFromSplitPanel(this);
 }
}

代码示例来源:origin: GwtMaterialDesign/gwt-material

public void load() {
  assert !loaded : "Cannot load an already loaded handler registry.";
  attachHandler = widget.asWidget().addAttachHandler(event -> {
    // Detach event
    if(clearOnUnload && !event.isAttached()) {
      clearHandlers();
    }
  });
}

代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material

public void load() {
  assert !loaded : "Cannot load an already loaded handler registry.";
  attachHandler = widget.asWidget().addAttachHandler(event -> {
    // Detach event
    if(clearOnUnload && !event.isAttached()) {
      clearHandlers();
    }
  });
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private int[] getDialogWrapperBorder() {
  if (dialogWrapperBorder == null) {
    Element dialogWrapperElement = JQueryWrapper.select(dialog.asWidget()).find(".dialog-wrapper").get(0);
    if (dialogWrapperElement != null) {
      dialogWrapperBorder = new ComputedStyle(dialogWrapperElement).getBorder();
    } else {
      dialogWrapperBorder = new int[]{0, 0, 0, 0};
    }
  }
  return dialogWrapperBorder;
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private int[] getDialogHeaderPadding() {
  if (dialogHeaderPadding == null) {
    Element headerElement = JQueryWrapper.select(dialog.asWidget()).find(".dialog-header").get(0);
    if (headerElement != null) {
      dialogHeaderPadding = new ComputedStyle(headerElement).getPadding();
    } else {
      dialogHeaderPadding = new int[]{0, 0, 0, 0};
    }
  }
  return dialogHeaderPadding;
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private int[] getDialogContentMargin() {
  if (dialogContentMargin == null) {
    Element contentElement = JQueryWrapper.select(dialog.asWidget()).find(".dialog-content").get(0);
    if (contentElement != null) {
      dialogContentMargin = new ComputedStyle(contentElement).getMargin();
    } else {
      dialogContentMargin = new int[]{0, 0, 0, 0};
    }
  }
  return dialogContentMargin;
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private int getElementsOuterHeight(String... elementClasses) {
  int elementsOuterHeight = 0;
  for (String clazzName : elementClasses) {
    Element element = JQueryWrapper.select(dialog.asWidget()).find(clazzName).get(0);
    if (element != null) {
      int margin[] = new ComputedStyle(element).getMargin();
      elementsOuterHeight += element.getOffsetHeight() + margin[TOP] + margin[BOTTOM];
    }
  }
  return elementsOuterHeight;
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-app

/** {@inheritDoc} */
@Override
public void update(@NotNull PartPresenter part) {
 if (badgeWidget != null) {
  badgeWidget.getElement().removeFromParent();
  badgeWidget = null;
 }
 int unreadMessages = part.getUnreadNotificationsCount();
 if (unreadMessages == 0) {
  return;
 }
 badgeWidget = getBadge(unreadMessages);
 if (badgeWidget != null) {
  iconPanel.getParent().getElement().appendChild(badgeWidget.asWidget().getElement());
  updateBadge();
 }
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

private void updateSize() {
  if (!isFormVisible()) {
    return;
  }
  if (!getState().isCollapsed) {
    stretchControl.replaceClassName("icon-open-fullscreen-2", "icon-close-fullscreen-2");
    stretchControl.replaceClassName(COLLAPSED, STRETCHED);
    form.asWidget().addStyleName("textarea-stretched");
    Style style = textWidget.getElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setZIndex(5);
    int top = calculateTextWidgetTop();
    int left = calculateTextWidgetLeft();
    style.setLeft(left, Style.Unit.PX);
    style.setTop(top, Style.Unit.PX);
    adjustTextAreaAndFormSizeToScreen();
    if (!isRichTextEditor) {
      setStretchControlPosition(top, left);
    }
    hideOtherStretchers();
  } else {
    stretchControl.replaceClassName(STRETCHED, COLLAPSED);
    stretchControl.replaceClassName("icon-close-fullscreen-2", "icon-open-fullscreen-2");
    form.asWidget().removeStyleName(TEXTAREA_STRETCHED);
    // Restore form height
    form.setHeight(formHeight);
    clearTraces();
  }
}

相关文章