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

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

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

Element.insertAfter介绍

暂无

代码示例

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

  1. private void insertAnimatingDiv() {
  2. Element tableBody = getElement();
  3. Element tableBodyParent = tableBody.getParentElement();
  4. tableBodyParent.insertAfter(cloneDiv, tableBody);
  5. }

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

  1. private <T extends Shape> T adjustZOrder( T shape )
  2. {
  3. shape.getElement().getParentElement().insertAfter( shape.getElement(), zOrderPlace.getElement() );
  4. return shape;
  5. }
  6. }

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

  1. private <T extends Shape> T adjustZOrder( T shape )
  2. {
  3. shape.getElement().getParentElement().insertAfter( shape.getElement(), zOrderPlace.getElement() );
  4. return shape;
  5. }
  6. }

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

  1. public ItemImpl addItem( ItemImpl parentItem )
  2. {
  3. ItemImpl item = new ItemImpl( parentItem == null ? m_rootItem : parentItem );
  4. int level = item.getLevel();
  5. while( m_rows.size() < level + 1 )
  6. {
  7. Element tr = DOM.createTR();
  8. m_thead.appendChild( tr );
  9. m_rows.add( tr );
  10. }
  11. item.m_tr = m_rows.get( level );
  12. // th is inserted after the last child of our parent
  13. item.m_td = DOM.createTH();
  14. ItemImpl previousItem = item.getPreviousAtSameLevel();
  15. if( previousItem != null )
  16. item.m_tr.insertAfter( item.m_td, previousItem.m_td );
  17. else
  18. item.m_tr.appendChild( item.m_td );
  19. return item;
  20. }
  21. }

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

  1. public ItemImpl addItem( ItemImpl parentItem )
  2. {
  3. ItemImpl item = new ItemImpl( parentItem == null ? m_rootItem : parentItem );
  4. int level = item.getLevel();
  5. while( m_rows.size() < level + 1 )
  6. {
  7. Element tr = DOM.createTR();
  8. m_thead.appendChild( tr );
  9. m_rows.add( tr );
  10. }
  11. item.m_tr = m_rows.get( level );
  12. // th is inserted after the last child of our parent
  13. item.m_td = DOM.createTH();
  14. ItemImpl previousItem = item.getPreviousAtSameLevel();
  15. if( previousItem != null )
  16. item.m_tr.insertAfter( item.m_td, previousItem.m_td );
  17. else
  18. item.m_tr.appendChild( item.m_td );
  19. return item;
  20. }
  21. }

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

  1. m_table.insertAfter( row, parent.m_row );
  2. m_table.insertAfter( row, parentLastChild.m_row );

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

  1. public Object addSpliter()
  2. {
  3. Element row = DOM.createTR();
  4. Element cell = DOM.createTD();
  5. cell.setAttribute( "colspan", "10" ); // because only ff supports
  6. // colspan=0, this is hardcoded
  7. // here
  8. row.appendChild( cell );
  9. row.addClassName( "Spliter" );
  10. cell.addClassName( "Spliter" );
  11. m_table.insertAfter( row, m_root.m_row );
  12. HTItem item = new HTItem( HTItemType.Splitter, m_root );
  13. cells.put( cell, item );
  14. item.m_row = row;
  15. item.m_cell = cell;
  16. return item;
  17. }

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

  1. m_table.insertAfter( row, parent.m_row );
  2. m_table.insertAfter( row, parentLastChild.m_row );

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

  1. public Object addSpliter()
  2. {
  3. Element row = DOM.createTR();
  4. Element cell = DOM.createTD();
  5. cell.setAttribute( "colspan", "10" ); // because only ff supports
  6. // colspan=0, this is hardcoded
  7. // here
  8. row.appendChild( cell );
  9. row.addClassName( "Spliter" );
  10. cell.addClassName( "Spliter" );
  11. m_table.insertAfter( row, m_root.m_row );
  12. HTItem item = new HTItem( HTItemType.Splitter, m_root );
  13. cells.put( cell, item );
  14. item.m_row = row;
  15. item.m_cell = cell;
  16. return item;
  17. }

代码示例来源:origin: stephenh/tessell

  1. /** Assumes {@code widget} is a table and puts its first TR into row {@code i} of our own table's body. */
  2. public void insertRow(final int i, final Widget newWidget) {
  3. final Element newTr = findTr(newWidget.getElement());
  4. assert newTr != null : "newWidget did not contain a TR";
  5. newWidget.removeFromParent();
  6. // logical
  7. widgets.add(newWidget);
  8. rows.add(i, newWidget);
  9. // physical
  10. if (i == 0) {
  11. body.insertFirst(newTr);
  12. } else {
  13. body.insertAfter(newTr, findBodyTr(i - 1));
  14. }
  15. // adopt
  16. adopt(newWidget);
  17. }

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

  1. private void appendStretcher(Element rootElement) {
  2. rootElement.getStyle().setPosition(Style.Position.RELATIVE);
  3. rootElement.getParentElement().insertAfter(stretchControl, rootElement);
  4. Widget parent = textWidget.getParent();
  5. TouchDelegate touchDelegate = new TouchDelegate(parent);
  6. touchDelegate.addTouchEndHandler(new TouchEndHandler() {
  7. @Override
  8. public void onTouchEnd(TouchEndEvent event) {
  9. Element target = event.getNativeEvent().getEventTarget().cast();
  10. if (stretchControl.isOrHasChild(target)) {
  11. if (!getState().isCollapsed) {
  12. unregisterSizeChangeListeners();
  13. }
  14. getRpcProxy(TextAreaStretcherServerRpc.class).toggle(textWidget.getOffsetWidth(), textWidget.getOffsetHeight());
  15. }
  16. }
  17. });
  18. }

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

  1. public void setCaption(String caption) {
  2. final MatchResult localisedPropertyMatcher = localisedPropertyCaptionPattern.exec(caption);
  3. if (localisedPropertyMatcher != null && localisedPropertyMatcher.getGroupCount() > 2) {
  4. caption = localisedPropertyMatcher.getGroup(1);
  5. label.setInnerText(caption);
  6. final Element localeLabel = SpanElement.as(DOM.createSpan());
  7. localeLabel.setClassName("locale-label");
  8. localeLabel.setInnerText(localisedPropertyMatcher.getGroup(2));
  9. if (requirementAsterisk != null && label.isOrHasChild(requirementAsterisk)) {
  10. label.insertAfter(localeLabel, requirementAsterisk);
  11. } else {
  12. label.insertFirst(localeLabel);
  13. }
  14. } else {
  15. label.setInnerText(caption);
  16. }
  17. if (caption != null) {
  18. label.setTitle(caption);
  19. }
  20. }

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-git-ext-git

  1. @Override
  2. public Element render(
  3. final Node node, final String domID, final Tree.Joint joint, final int depth) {
  4. // Initialize HTML elements.
  5. final Element rootContainer = super.render(node, domID, joint, depth);
  6. final Element nodeContainer = rootContainer.getFirstChildElement();
  7. final Element checkBoxElement = new CheckBox().getElement();
  8. final InputElement checkBoxInputElement =
  9. (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0);
  10. final Path nodePath =
  11. node instanceof ChangedFileNode
  12. ? Path.valueOf(node.getName())
  13. : ((ChangedFolderNode) node).getPath();
  14. setCheckBoxState(nodePath, checkBoxInputElement);
  15. setCheckBoxClickHandler(nodePath, checkBoxElement, checkBoxInputElement.isChecked());
  16. // Paste check-box element to node container.
  17. nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild());
  18. return rootContainer;
  19. }

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

  1. void resize()
  2. {
  3. if( fakeDiv == null )
  4. {
  5. fakeDiv = DOM.createDiv();
  6. fakeDiv.getStyle().setPosition( Position.FIXED );
  7. fakeDiv.getStyle().setLeft( -10000, Unit.PX );
  8. getElement().getParentElement().insertAfter( fakeDiv, getElement() );
  9. applyStyle( fakeDiv );
  10. }
  11. int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
  12. fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
  13. fakeDiv.setInnerText( getText() );
  14. int height = getElement().getClientHeight();
  15. int newHeight = fakeDiv.getClientHeight() + 25;
  16. if( height < newHeight )
  17. getElement().getStyle().setHeight( newHeight, Unit.PX );
  18. }

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

  1. void resize()
  2. {
  3. if( fakeDiv == null )
  4. {
  5. fakeDiv = DOM.createDiv();
  6. fakeDiv.getStyle().setPosition( Position.FIXED );
  7. fakeDiv.getStyle().setLeft( -10000, Unit.PX );
  8. getElement().getParentElement().insertAfter( fakeDiv, getElement() );
  9. applyStyle( fakeDiv );
  10. }
  11. int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
  12. fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
  13. fakeDiv.setInnerText( getText() );
  14. int height = getElement().getClientHeight();
  15. int newHeight = fakeDiv.getClientHeight() + 25;
  16. if( height < newHeight )
  17. getElement().getStyle().setHeight( newHeight, Unit.PX );
  18. }

代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static TableRowElement insertRow(TableElement e, int index) {
  3. NodeList<TableRowElement> rows = e.getRows();
  4. TableRowElement newRow = Document.get().createTRElement();
  5. if (rows.getLength() < 1) {
  6. TableSectionElement tbody = Document.get().createTBodyElement();
  7. e.appendChild(tbody);
  8. tbody.appendChild(newRow);
  9. } else {
  10. if (index == -1 || index >= rows.getLength()) {
  11. TableRowElement after = rows.getItem(rows.getLength() - 1);
  12. after.getParentElement().insertAfter(newRow, after);
  13. } else {
  14. TableRowElement before = rows.getItem(index);
  15. before.getParentElement().insertBefore(newRow, before);
  16. }
  17. }
  18. return newRow;
  19. }

代码示例来源:origin: gwt-test-utils/gwt-test-utils

  1. @PatchMethod
  2. static TableRowElement insertRow(TableElement e, int index) {
  3. NodeList<TableRowElement> rows = e.getRows();
  4. TableRowElement newRow = Document.get().createTRElement();
  5. if (rows.getLength() < 1) {
  6. TableSectionElement tbody = Document.get().createTBodyElement();
  7. e.appendChild(tbody);
  8. tbody.appendChild(newRow);
  9. } else {
  10. if (index == -1 || index >= rows.getLength()) {
  11. TableRowElement after = rows.getItem(rows.getLength() - 1);
  12. after.getParentElement().insertAfter(newRow, after);
  13. } else {
  14. TableRowElement before = rows.getItem(index);
  15. before.getParentElement().insertBefore(newRow, before);
  16. }
  17. }
  18. return newRow;
  19. }

代码示例来源:origin: Putnami/putnami-web-toolkit

  1. parent.insertAfter(toDisplayElement, target);
  2. toDisplayElement.getStyle().setDisplay(Display.BLOCK);
  3. this.resetPosition(toDisplayElement, this.getWidget(), this.placement);

代码示例来源:origin: fr.putnami.pwt/pwt

  1. parent.insertAfter(toDisplayElement, target);
  2. toDisplayElement.getStyle().setDisplay(Display.BLOCK);
  3. this.resetPosition(toDisplayElement, this.getWidget(), this.placement);

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

  1. @Override
  2. protected boolean addTreeSpacer(UIDL rowUidl) {
  3. if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) {
  4. Element container = (Element) getElement().getLastChild().getChild(0);
  5. if (rowUidl.hasAttribute("icon")) {
  6. // icons are in first content cell in TreeTable
  7. ImageElement icon = Document.get().createImageElement();
  8. icon.setClassName("v-icon");
  9. icon.setAlt("icon");
  10. icon.setSrc(client.translateVaadinUri(rowUidl.getStringAttribute("icon")));
  11. container.insertFirst(icon);
  12. }
  13. String classname = "v-treetable-treespacer-patched";
  14. if (rowUidl.getBooleanAttribute("ca")) {
  15. canHaveChildren = true;
  16. open = rowUidl.getBooleanAttribute("open");
  17. classname += open ? " v-treetable-node-open" : " v-treetable-node-closed";
  18. classname += open ? " icon-arrow1_s" : " icon-arrow1_e";
  19. }
  20. treeSpacer = Document.get().createDivElement();
  21. treeSpacer.getStyle().setDisplay(Display.INLINE_BLOCK);
  22. treeSpacer.setClassName(classname);
  23. container.insertAfter(treeSpacer, container.getFirstChild());
  24. depth = rowUidl.hasAttribute("depth") ? rowUidl.getIntAttribute("depth") : 0;
  25. setIndent();
  26. isTreeCellAdded = true;
  27. return true;
  28. }
  29. return false;
  30. }

相关文章

Element类方法