本文整理了Java中com.google.gwt.dom.client.Element.setPropertyObject()
方法的一些代码示例,展示了Element.setPropertyObject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.setPropertyObject()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:setPropertyObject
[英]Sets an object property on this element.
[中]设置此元素的对象属性。
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
public void setAttribute(Element e, String key, Object value) {
e.setPropertyObject("value", String.valueOf(value));
super.setAttribute(e, key, value);
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
public void removeAttribute(GQuery gQuery, String key) {
for (Element e : gQuery.elements()) {
if (e.getNodeType() != 1) {
continue;
}
if (JsUtils.hasProperty(e, key)) {
if (BOOLEAN_ATTR_REGEX.test(key)) {
e.setPropertyBoolean(key, false);
} else {
e.setPropertyObject(key, null);
}
}
e.removeAttribute(key);
}
}
代码示例来源:origin: ltearno/hexa.tools
public Row addBefore()
{
assert (this.treeTable.m_nbColumns > 0);
// which is the parent ? => same parent as item
Row parentItem = m_parent;
if( parentItem == null )
parentItem = this.treeTable.m_rootItem;
Row newItem = new Row( this.treeTable );
newItem.m_tr = Document.get().createTRElement();
newItem.m_tr.setPropertyObject( "linkedItem", newItem );
newItem.m_tr.setInnerHTML( this.treeTable.m_rowTemplate );
// DOM add
this.treeTable.m_body.insertBefore( newItem.m_tr, m_tr );
// logical add
newItem.m_parent = parentItem;
int itemPos = parentItem.getChilds().indexOf( this );
parentItem.getChilds().add( itemPos, newItem );
parentItem.signalStateChange();
// take care of the left padding
Element firstTd = DOM.getChild( newItem.m_tr, 0 );
firstTd.getStyle().setPaddingLeft( newItem.getLevel() * this.treeTable.treePadding, Unit.PX );
return newItem;
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public Row addBefore()
{
assert (this.treeTable.m_nbColumns > 0);
// which is the parent ? => same parent as item
Row parentItem = m_parent;
if( parentItem == null )
parentItem = this.treeTable.m_rootItem;
Row newItem = new Row(this.treeTable);
newItem.m_tr = Document.get().createTRElement();
newItem.m_tr.setPropertyObject( "linkedItem", newItem );
newItem.m_tr.setInnerHTML( this.treeTable.m_rowTemplate );
// DOM add
this.treeTable.m_body.insertBefore( newItem.m_tr, m_tr );
// logical add
newItem.m_parent = parentItem;
int itemPos = parentItem.getChilds().indexOf( this );
parentItem.getChilds().add( itemPos, newItem );
parentItem.signalStateChange();
// take care of the left padding
Element firstTd = DOM.getChild( newItem.m_tr, 0 );
firstTd.getStyle().setPaddingLeft( newItem.getLevel() * this.treeTable.treePadding, Unit.PX );
return newItem;
}
代码示例来源:origin: ltearno/hexa.tools
public Row addLastChild()
{
assert (this.treeTable.m_nbColumns > 0) : "Table should have at least one column before adding items";
Row newItem = new Row( this.treeTable );
newItem.m_tr = DOM.createTR();
newItem.m_tr.setPropertyObject( "linkedItem", newItem );
newItem.m_tr.setInnerHTML( this.treeTable.m_rowTemplate );
// DOM add
Row lastParentLeaf = getLastLeaf();
Element trToInsertAfter = lastParentLeaf.m_tr;
if( trToInsertAfter != null )
{
int after = DOM.getChildIndex( this.treeTable.m_body, trToInsertAfter );
int before = after + 1;
DOM.insertChild( this.treeTable.m_body, newItem.m_tr, before );
}
else
{
DOM.appendChild( this.treeTable.m_body, newItem.m_tr );
}
// logical add
newItem.m_parent = this;
getChilds().add( newItem );
signalStateChange();
// take care of the left padding
Element firstTd = DOM.getChild( newItem.m_tr, 0 );
firstTd.getStyle().setPaddingLeft( newItem.getLevel() * this.treeTable.treePadding, Unit.PX );
return newItem;
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public Row addLastChild()
{
assert (this.treeTable.m_nbColumns > 0) : "Table should have at least one column before adding items";
Row newItem = new Row(this.treeTable);
newItem.m_tr = DOM.createTR();
newItem.m_tr.setPropertyObject( "linkedItem", newItem );
newItem.m_tr.setInnerHTML( this.treeTable.m_rowTemplate );
// DOM add
Row lastParentLeaf = getLastLeaf();
Element trToInsertAfter = lastParentLeaf.m_tr;
if( trToInsertAfter != null )
{
int after = DOM.getChildIndex( this.treeTable.m_body, trToInsertAfter );
int before = after + 1;
DOM.insertChild( this.treeTable.m_body, newItem.m_tr, before );
}
else
{
DOM.appendChild( this.treeTable.m_body, newItem.m_tr );
}
// logical add
newItem.m_parent = this;
getChilds().add( newItem );
signalStateChange();
// take care of the left padding
Element firstTd = DOM.getChild( newItem.m_tr, 0 );
firstTd.getStyle().setPaddingLeft( newItem.getLevel() * this.treeTable.treePadding, Unit.PX );
return newItem;
}
内容来源于网络,如有侵权,请联系作者删除!