com.google.gwt.dom.client.Element.removeFromParent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(349)

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

Element.removeFromParent介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. public void removeChild(Element container, Element child) {
  2. container.removeFromParent();
  3. // We want this code to be resilient to the child having already been
  4. // removed from its container (perhaps by widget code).
  5. if (child.getParentElement() == container) {
  6. child.removeFromParent();
  7. }
  8. // Cleanup child styles set by fillParent().
  9. Style style = child.getStyle();
  10. style.clearPosition();
  11. style.clearLeft();
  12. style.clearTop();
  13. style.clearWidth();
  14. style.clearHeight();
  15. }
  16. }

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

  1. @Override
  2. public void unload() {
  3. if (themeColorElement != null) {
  4. themeColorElement.removeFromParent();
  5. themeColorElement = null;
  6. GWT.log("Meta theme color has been unloaded.");
  7. }
  8. }

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

  1. @Override
  2. public void unload() {
  3. if (manifestElement != null) {
  4. manifestElement.removeFromParent();
  5. manifestElement = null;
  6. GWT.log("Web manifest has been unloaded.");
  7. }
  8. }

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

  1. @Override
  2. public void unload() {
  3. if (manifestElement != null) {
  4. manifestElement.removeFromParent();
  5. manifestElement = null;
  6. GWT.log("Web manifest has been unloaded.");
  7. }
  8. }

代码示例来源:origin: org.vaadin.addons/dragdroplayouts

  1. public void detachDragImageFromLayout(VDragEvent drag) {
  2. if (placeHolderElement != null) {
  3. if (placeHolderElement.hasParentElement()) {
  4. placeHolderElement.removeFromParent();
  5. }
  6. placeHolderElement = null;
  7. }
  8. }

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

  1. @Override
  2. public void unload() {
  3. if (themeColorElement != null) {
  4. themeColorElement.removeFromParent();
  5. themeColorElement = null;
  6. GWT.log("Meta theme color has been unloaded.");
  7. }
  8. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. public void detachDragImageFromLayout(VDragEvent drag) {
  2. if (placeHolderElement != null) {
  3. if (placeHolderElement.hasParentElement()) {
  4. placeHolderElement.removeFromParent();
  5. }
  6. placeHolderElement = null;
  7. }
  8. }

代码示例来源:origin: org.uberfire/uberfire-runtime-plugins-client

  1. @Override
  2. public void onMouseUp(final MouseUpEvent event) {
  3. mouseDown = false;
  4. glassElem.removeFromParent();
  5. Event.releaseCapture(getElement());
  6. }
  7. },

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

  1. /**
  2. * Removes the value of the image element if any. It is safe to call this
  3. * method regardless of if an image has been set or not.
  4. */
  5. public JQMListItem removeImage() {
  6. if (imageElem != null) {
  7. imageElem.removeFromParent();
  8. imageElem = null;
  9. }
  10. getElement().removeClassName(STYLE_UI_LI_HAS_THUMB);
  11. return this;
  12. }

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. mouseDown = false;
  2. glassElem.removeFromParent();

代码示例来源:origin: gwtbootstrap3/gwtbootstrap3

  1. @Override
  2. public void onChange(ChangeEvent event) {
  3. if (iconElement != null) {
  4. iconElement.removeFromParent();
  5. }
  6. String html = getHTML();
  7. if (showRequiredIndicator && html != null && !"".equals(html)) {
  8. iconElement = createIconElement();
  9. getElement().appendChild(iconElement);
  10. }
  11. }
  12. }, ChangeEvent.getType());

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

  1. protected void onOpening() {
  2. open = true;
  3. $("#sidenav-overlay").each((param1, element) -> element.removeFromParent());
  4. SideNavOpeningEvent.fire(this);
  5. }

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

  1. protected void onOpening() {
  2. open = true;
  3. $("#sidenav-overlay").each((param1, element) -> element.removeFromParent());
  4. SideNavOpeningEvent.fire(this);
  5. }

代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3

  1. @Override
  2. public void onChange(ChangeEvent event) {
  3. if (iconElement != null) {
  4. iconElement.removeFromParent();
  5. }
  6. if (error && iconType != null) {
  7. iconElement = createIconElement();
  8. getElement().insertFirst(iconElement);
  9. }
  10. }
  11. }, ChangeEvent.getType());

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Recalculate the height and width of a native scrollbar.
  3. */
  4. private static void maybeRecalculateNativeScrollbarSize() {
  5. // Check if the size has already been calculated.
  6. if (nativeHeight > -1) {
  7. return;
  8. }
  9. // Create a scrollable element and attach it to the body.
  10. Element scrollable = Document.get().createDivElement();
  11. scrollable.getStyle().setPosition(Position.ABSOLUTE);
  12. scrollable.getStyle().setTop(-1000.0, Unit.PX);
  13. scrollable.getStyle().setLeft(-1000.0, Unit.PX);
  14. scrollable.getStyle().setHeight(100.0, Unit.PX);
  15. scrollable.getStyle().setWidth(100.0, Unit.PX);
  16. scrollable.getStyle().setOverflow(Overflow.SCROLL);
  17. scrollable.getStyle().setProperty("direction", "rtl");
  18. Document.get().getBody().appendChild(scrollable);
  19. // Add some content.
  20. Element content = Document.get().createDivElement();
  21. content.setInnerText("content");
  22. scrollable.appendChild(content);
  23. // Measure the height and width.
  24. nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight();
  25. nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth();
  26. nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft());
  27. // Detach the scrollable element.
  28. scrollable.removeFromParent();
  29. }

代码示例来源:origin: pl.touk.gwtaculous/gwtaculous-lib

  1. public static void terminateClone(DragObject dragElement){
  2. if (dragElement.getDragOptions().contains(DragOption.MOVE_TO_CLONE)) {
  3. moveElementToElement(dragElement.getSourceElement(), dragElement.getDragElement(), Position.FIXED);
  4. }
  5. dragElement.getDragElement().removeFromParent();
  6. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. private void hideModalityCurtain() {
  2. Document.get().getBody().removeClassName(MODAL_WINDOW_OPEN_CLASSNAME);
  3. modalityCurtain.removeFromParent();
  4. if (BrowserInfo.get().isIE()) {
  5. // IE leaks memory in certain cases unless we release the reference
  6. // (#9197)
  7. modalityCurtain = null;
  8. }
  9. }

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

  1. public void onJointChange(NodeDescriptor node, Tree.Joint joint) {
  2. Element currJointEl = getJointContainer(node);
  3. if (currJointEl == null) {
  4. return;
  5. }
  6. Element jointContainer = tree.getPresentationRenderer().getJointContainer(joint);
  7. getNodeContainer(node).insertFirst(jointContainer);
  8. currJointEl.removeFromParent();
  9. node.setJointContainerElement(jointContainer);
  10. }

代码示例来源:origin: org.jboss.errai/errai-ui

  1. public static void initTemplated(final Object templated, final Element wrapped, final Collection<Widget> dataFields) {
  2. // All template fragments are contained in a single element, during initialization.
  3. wrapped.removeFromParent();
  4. final TemplateWidget widget = new TemplateWidget(wrapped, dataFields);
  5. TemplateWidgetMapper.put(templated, widget);
  6. StyleBindingsRegistry.get().updateStyles(templated);
  7. widget.onAttach();
  8. RootPanel.detachOnWindowClose(widget);
  9. TemplateInitializedEvent.fire(widget);
  10. }

代码示例来源:origin: io.github.nibiruos.ui/org.nibiru.ui.gwt

  1. @Override
  2. protected int getNativeWidth() {
  3. Element e = DOM.createDiv();
  4. e.setInnerText(getValue().get() != null ? getValue().get() : "I");
  5. e.getStyle().setPosition(Style.Position.ABSOLUTE);
  6. Document.get().getBody().appendChild(e);
  7. int width = e.getOffsetWidth();
  8. e.removeFromParent();
  9. return width + MAGIC_PADDING;
  10. }

相关文章

Element类方法