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

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

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

Element.replaceChild介绍

暂无

代码示例

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

  1. } else {
  2. Element nextSibling = toReplace.getNextSiblingElement();
  3. childContainer.replaceChild(newChildren.getChild(0), toReplace);
  4. toReplace = nextSibling;

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

  1. @Override
  2. protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus) {
  3. super.setKeyboardSelected(index, selected, stealFocus);
  4. if (!isRowWithinBounds(index)) {
  5. return;
  6. }
  7. // Update the style.
  8. Element elem = getRowElement(index);
  9. T value = getPresenter().getVisibleItem(index);
  10. boolean isOpen = selected && isOpen(index);
  11. setStyleName(elem, style.cellBrowserOpenItem(), isOpen);
  12. // Update the image.
  13. SafeHtml image = null;
  14. if (isOpen) {
  15. image = openImageHtml;
  16. } else if (getTreeViewModel().isLeaf(value)) {
  17. image = LEAF_IMAGE;
  18. } else {
  19. image = closedImageHtml;
  20. }
  21. tmpElem.setInnerSafeHtml(image);
  22. elem.replaceChild(tmpElem.getFirstChildElement(), elem.getFirstChildElement());
  23. // Update the open state.
  24. updateChildState(this, true);
  25. }

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

  1. oldImg.getParentElement().replaceChild(imageElem, oldImg);

代码示例来源:origin: fr.lteconsulting/hexa.core

  1. public void setHeaders( String... headers )
  2. {
  3. Element oldHeaderRow = m_headerRow;
  4. m_headers = headers;
  5. m_headerRow = DOM.createTR();
  6. m_headerRow.setClassName( "thead" );
  7. StringBuilder b = new StringBuilder();
  8. StringBuilder bTemplate = new StringBuilder();
  9. m_nbColumns = headers.length;
  10. for( int i = 0; i < m_nbColumns; i++ )
  11. {
  12. b.append( "<th>" + headers[i] + "</th>" );
  13. bTemplate.append( "<td/>" );
  14. }
  15. m_headerRow.setInnerHTML( b.toString() );
  16. if( oldHeaderRow != null )
  17. m_head.replaceChild( m_headerRow, oldHeaderRow );
  18. else
  19. DOM.insertChild( m_head, m_headerRow, 0 );
  20. m_rowTemplate = bTemplate.toString();
  21. }

代码示例来源:origin: ltearno/hexa.tools

  1. public void setHeaders( String... headers )
  2. {
  3. Element oldHeaderRow = m_headerRow;
  4. m_headers = headers;
  5. m_headerRow = DOM.createTR();
  6. m_headerRow.setClassName( "thead" );
  7. StringBuilder b = new StringBuilder();
  8. StringBuilder bTemplate = new StringBuilder();
  9. m_nbColumns = headers.length;
  10. for( int i = 0; i < m_nbColumns; i++ )
  11. {
  12. b.append( "<th>" + headers[i] + "</th>" );
  13. bTemplate.append( "<td/>" );
  14. }
  15. m_headerRow.setInnerHTML( b.toString() );
  16. if( oldHeaderRow != null )
  17. m_head.replaceChild( m_headerRow, oldHeaderRow );
  18. else
  19. DOM.insertChild( m_head, m_headerRow, 0 );
  20. m_rowTemplate = bTemplate.toString();
  21. }

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

  1. Element rootContainer =
  2. view.getRootContainer(getNodeDescriptor(visible.get(i)));
  3. rootContainer.replaceChild(rootContainer.getFirstChildElement(), html);
  4. } else {
  5. refresh(visible.get(i));

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

  1. parentElement.replaceChild(field.getElement(), element);

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

  1. parentElement.replaceChild(field.getElement(), element);

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

  1. iframe.getParentElement().replaceChild(coverContainer, iframe);
  2. coverContainer.appendChild(iframe);

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

  1. iframe.getParentElement().replaceChild(coverContainer, iframe);
  2. coverContainer.appendChild(iframe);

代码示例来源:origin: com.extjs/gxt

  1. @SuppressWarnings({"unchecked", "rawtypes"})
  2. protected void onUpdate(M model, int index) {
  3. if (rendered) {
  4. Element original = all.getElement(index);
  5. if (original != null) {
  6. List list = Util.createList(model);
  7. Element node = bufferRender(list).getItem(0);
  8. all.replaceElement(original, node);
  9. original.getParentElement().replaceChild(node, original);
  10. }
  11. ListViewEvent<M> evt = new ListViewEvent<M>(this);
  12. evt.setModel(model);
  13. evt.setIndex(index);
  14. fireEvent(Events.RowUpdated, evt);
  15. }
  16. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. } else {
  2. Element nextSibling = toReplace.getNextSiblingElement();
  3. childContainer.replaceChild(newChildren.getChild(0), toReplace);
  4. toReplace = nextSibling;

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. } else {
  2. Element nextSibling = toReplace.getNextSiblingElement();
  3. childContainer.replaceChild(newChildren.getChild(0), toReplace);
  4. toReplace = nextSibling;

代码示例来源:origin: net.wetheinter/gwt-user

  1. @Override
  2. protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus) {
  3. super.setKeyboardSelected(index, selected, stealFocus);
  4. if (!isRowWithinBounds(index)) {
  5. return;
  6. }
  7. // Update the style.
  8. Element elem = getRowElement(index);
  9. T value = getPresenter().getVisibleItem(index);
  10. boolean isOpen = selected && isOpen(index);
  11. setStyleName(elem, style.cellBrowserOpenItem(), isOpen);
  12. // Update the image.
  13. SafeHtml image = null;
  14. if (isOpen) {
  15. image = openImageHtml;
  16. } else if (getTreeViewModel().isLeaf(value)) {
  17. image = LEAF_IMAGE;
  18. } else {
  19. image = closedImageHtml;
  20. }
  21. tmpElem.setInnerSafeHtml(image);
  22. elem.replaceChild(tmpElem.getFirstChildElement(), elem.getFirstChildElement());
  23. // Update the open state.
  24. updateChildState(this, true);
  25. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. @Override
  2. protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus) {
  3. super.setKeyboardSelected(index, selected, stealFocus);
  4. if (!isRowWithinBounds(index)) {
  5. return;
  6. }
  7. // Update the style.
  8. Element elem = getRowElement(index);
  9. T value = getPresenter().getVisibleItem(index);
  10. boolean isOpen = selected && isOpen(index);
  11. setStyleName(elem, style.cellBrowserOpenItem(), isOpen);
  12. // Update the image.
  13. SafeHtml image = null;
  14. if (isOpen) {
  15. image = openImageHtml;
  16. } else if (getTreeViewModel().isLeaf(value)) {
  17. image = LEAF_IMAGE;
  18. } else {
  19. image = closedImageHtml;
  20. }
  21. tmpElem.setInnerSafeHtml(image);
  22. elem.replaceChild(tmpElem.getFirstChildElement(), elem.getFirstChildElement());
  23. // Update the open state.
  24. updateChildState(this, true);
  25. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. oldImg.getParentElement().replaceChild(imageElem, oldImg);

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. oldImg.getParentElement().replaceChild(imageElem, oldImg);

相关文章

Element类方法