本文整理了Java中com.google.gwt.dom.client.Element.insertAfter()
方法的一些代码示例,展示了Element.insertAfter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.insertAfter()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:insertAfter
暂无
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void insertAnimatingDiv() {
Element tableBody = getElement();
Element tableBodyParent = tableBody.getParentElement();
tableBodyParent.insertAfter(cloneDiv, tableBody);
}
代码示例来源:origin: fr.lteconsulting/hexa.core
private <T extends Shape> T adjustZOrder( T shape )
{
shape.getElement().getParentElement().insertAfter( shape.getElement(), zOrderPlace.getElement() );
return shape;
}
}
代码示例来源:origin: ltearno/hexa.tools
private <T extends Shape> T adjustZOrder( T shape )
{
shape.getElement().getParentElement().insertAfter( shape.getElement(), zOrderPlace.getElement() );
return shape;
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public ItemImpl addItem( ItemImpl parentItem )
{
ItemImpl item = new ItemImpl( parentItem == null ? m_rootItem : parentItem );
int level = item.getLevel();
while( m_rows.size() < level + 1 )
{
Element tr = DOM.createTR();
m_thead.appendChild( tr );
m_rows.add( tr );
}
item.m_tr = m_rows.get( level );
// th is inserted after the last child of our parent
item.m_td = DOM.createTH();
ItemImpl previousItem = item.getPreviousAtSameLevel();
if( previousItem != null )
item.m_tr.insertAfter( item.m_td, previousItem.m_td );
else
item.m_tr.appendChild( item.m_td );
return item;
}
}
代码示例来源:origin: ltearno/hexa.tools
public ItemImpl addItem( ItemImpl parentItem )
{
ItemImpl item = new ItemImpl( parentItem == null ? m_rootItem : parentItem );
int level = item.getLevel();
while( m_rows.size() < level + 1 )
{
Element tr = DOM.createTR();
m_thead.appendChild( tr );
m_rows.add( tr );
}
item.m_tr = m_rows.get( level );
// th is inserted after the last child of our parent
item.m_td = DOM.createTH();
ItemImpl previousItem = item.getPreviousAtSameLevel();
if( previousItem != null )
item.m_tr.insertAfter( item.m_td, previousItem.m_td );
else
item.m_tr.appendChild( item.m_td );
return item;
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
m_table.insertAfter( row, parent.m_row );
m_table.insertAfter( row, parentLastChild.m_row );
代码示例来源:origin: ltearno/hexa.tools
public Object addSpliter()
{
Element row = DOM.createTR();
Element cell = DOM.createTD();
cell.setAttribute( "colspan", "10" ); // because only ff supports
// colspan=0, this is hardcoded
// here
row.appendChild( cell );
row.addClassName( "Spliter" );
cell.addClassName( "Spliter" );
m_table.insertAfter( row, m_root.m_row );
HTItem item = new HTItem( HTItemType.Splitter, m_root );
cells.put( cell, item );
item.m_row = row;
item.m_cell = cell;
return item;
}
代码示例来源:origin: ltearno/hexa.tools
m_table.insertAfter( row, parent.m_row );
m_table.insertAfter( row, parentLastChild.m_row );
代码示例来源:origin: fr.lteconsulting/hexa.core
public Object addSpliter()
{
Element row = DOM.createTR();
Element cell = DOM.createTD();
cell.setAttribute( "colspan", "10" ); // because only ff supports
// colspan=0, this is hardcoded
// here
row.appendChild( cell );
row.addClassName( "Spliter" );
cell.addClassName( "Spliter" );
m_table.insertAfter( row, m_root.m_row );
HTItem item = new HTItem( HTItemType.Splitter, m_root );
cells.put( cell, item );
item.m_row = row;
item.m_cell = cell;
return item;
}
代码示例来源:origin: stephenh/tessell
/** Assumes {@code widget} is a table and puts its first TR into row {@code i} of our own table's body. */
public void insertRow(final int i, final Widget newWidget) {
final Element newTr = findTr(newWidget.getElement());
assert newTr != null : "newWidget did not contain a TR";
newWidget.removeFromParent();
// logical
widgets.add(newWidget);
rows.add(i, newWidget);
// physical
if (i == 0) {
body.insertFirst(newTr);
} else {
body.insertAfter(newTr, findBodyTr(i - 1));
}
// adopt
adopt(newWidget);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void appendStretcher(Element rootElement) {
rootElement.getStyle().setPosition(Style.Position.RELATIVE);
rootElement.getParentElement().insertAfter(stretchControl, rootElement);
Widget parent = textWidget.getParent();
TouchDelegate touchDelegate = new TouchDelegate(parent);
touchDelegate.addTouchEndHandler(new TouchEndHandler() {
@Override
public void onTouchEnd(TouchEndEvent event) {
Element target = event.getNativeEvent().getEventTarget().cast();
if (stretchControl.isOrHasChild(target)) {
if (!getState().isCollapsed) {
unregisterSizeChangeListeners();
}
getRpcProxy(TextAreaStretcherServerRpc.class).toggle(textWidget.getOffsetWidth(), textWidget.getOffsetHeight());
}
}
});
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
public void setCaption(String caption) {
final MatchResult localisedPropertyMatcher = localisedPropertyCaptionPattern.exec(caption);
if (localisedPropertyMatcher != null && localisedPropertyMatcher.getGroupCount() > 2) {
caption = localisedPropertyMatcher.getGroup(1);
label.setInnerText(caption);
final Element localeLabel = SpanElement.as(DOM.createSpan());
localeLabel.setClassName("locale-label");
localeLabel.setInnerText(localisedPropertyMatcher.getGroup(2));
if (requirementAsterisk != null && label.isOrHasChild(requirementAsterisk)) {
label.insertAfter(localeLabel, requirementAsterisk);
} else {
label.insertFirst(localeLabel);
}
} else {
label.setInnerText(caption);
}
if (caption != null) {
label.setTitle(caption);
}
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-git-ext-git
@Override
public Element render(
final Node node, final String domID, final Tree.Joint joint, final int depth) {
// Initialize HTML elements.
final Element rootContainer = super.render(node, domID, joint, depth);
final Element nodeContainer = rootContainer.getFirstChildElement();
final Element checkBoxElement = new CheckBox().getElement();
final InputElement checkBoxInputElement =
(InputElement) checkBoxElement.getElementsByTagName("input").getItem(0);
final Path nodePath =
node instanceof ChangedFileNode
? Path.valueOf(node.getName())
: ((ChangedFolderNode) node).getPath();
setCheckBoxState(nodePath, checkBoxInputElement);
setCheckBoxClickHandler(nodePath, checkBoxElement, checkBoxInputElement.isChecked());
// Paste check-box element to node container.
nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild());
return rootContainer;
}
代码示例来源:origin: fr.lteconsulting/hexa.core
void resize()
{
if( fakeDiv == null )
{
fakeDiv = DOM.createDiv();
fakeDiv.getStyle().setPosition( Position.FIXED );
fakeDiv.getStyle().setLeft( -10000, Unit.PX );
getElement().getParentElement().insertAfter( fakeDiv, getElement() );
applyStyle( fakeDiv );
}
int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
fakeDiv.setInnerText( getText() );
int height = getElement().getClientHeight();
int newHeight = fakeDiv.getClientHeight() + 25;
if( height < newHeight )
getElement().getStyle().setHeight( newHeight, Unit.PX );
}
代码示例来源:origin: ltearno/hexa.tools
void resize()
{
if( fakeDiv == null )
{
fakeDiv = DOM.createDiv();
fakeDiv.getStyle().setPosition( Position.FIXED );
fakeDiv.getStyle().setLeft( -10000, Unit.PX );
getElement().getParentElement().insertAfter( fakeDiv, getElement() );
applyStyle( fakeDiv );
}
int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
fakeDiv.setInnerText( getText() );
int height = getElement().getClientHeight();
int newHeight = fakeDiv.getClientHeight() + 25;
if( height < newHeight )
getElement().getStyle().setHeight( newHeight, Unit.PX );
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static TableRowElement insertRow(TableElement e, int index) {
NodeList<TableRowElement> rows = e.getRows();
TableRowElement newRow = Document.get().createTRElement();
if (rows.getLength() < 1) {
TableSectionElement tbody = Document.get().createTBodyElement();
e.appendChild(tbody);
tbody.appendChild(newRow);
} else {
if (index == -1 || index >= rows.getLength()) {
TableRowElement after = rows.getItem(rows.getLength() - 1);
after.getParentElement().insertAfter(newRow, after);
} else {
TableRowElement before = rows.getItem(index);
before.getParentElement().insertBefore(newRow, before);
}
}
return newRow;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static TableRowElement insertRow(TableElement e, int index) {
NodeList<TableRowElement> rows = e.getRows();
TableRowElement newRow = Document.get().createTRElement();
if (rows.getLength() < 1) {
TableSectionElement tbody = Document.get().createTBodyElement();
e.appendChild(tbody);
tbody.appendChild(newRow);
} else {
if (index == -1 || index >= rows.getLength()) {
TableRowElement after = rows.getItem(rows.getLength() - 1);
after.getParentElement().insertAfter(newRow, after);
} else {
TableRowElement before = rows.getItem(index);
before.getParentElement().insertBefore(newRow, before);
}
}
return newRow;
}
代码示例来源:origin: Putnami/putnami-web-toolkit
parent.insertAfter(toDisplayElement, target);
toDisplayElement.getStyle().setDisplay(Display.BLOCK);
this.resetPosition(toDisplayElement, this.getWidget(), this.placement);
代码示例来源:origin: fr.putnami.pwt/pwt
parent.insertAfter(toDisplayElement, target);
toDisplayElement.getStyle().setDisplay(Display.BLOCK);
this.resetPosition(toDisplayElement, this.getWidget(), this.placement);
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
@Override
protected boolean addTreeSpacer(UIDL rowUidl) {
if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) {
Element container = (Element) getElement().getLastChild().getChild(0);
if (rowUidl.hasAttribute("icon")) {
// icons are in first content cell in TreeTable
ImageElement icon = Document.get().createImageElement();
icon.setClassName("v-icon");
icon.setAlt("icon");
icon.setSrc(client.translateVaadinUri(rowUidl.getStringAttribute("icon")));
container.insertFirst(icon);
}
String classname = "v-treetable-treespacer-patched";
if (rowUidl.getBooleanAttribute("ca")) {
canHaveChildren = true;
open = rowUidl.getBooleanAttribute("open");
classname += open ? " v-treetable-node-open" : " v-treetable-node-closed";
classname += open ? " icon-arrow1_s" : " icon-arrow1_e";
}
treeSpacer = Document.get().createDivElement();
treeSpacer.getStyle().setDisplay(Display.INLINE_BLOCK);
treeSpacer.setClassName(classname);
container.insertAfter(treeSpacer, container.getFirstChild());
depth = rowUidl.hasAttribute("depth") ? rowUidl.getIntAttribute("depth") : 0;
setIndent();
isTreeCellAdded = true;
return true;
}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!