本文整理了Java中com.google.gwt.user.client.ui.Tree.clear()
方法的一些代码示例,展示了Tree.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.clear()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Tree
类名称:Tree
方法名:clear
[英]Clears all tree items from the current tree.
[中]清除当前树中的所有树项。
代码示例来源:origin: oVirt/ovirt-engine
public void clearTree() {
tree.clear();
}
代码示例来源:origin: io.github.nibiruos.ui/org.nibiru.ui.gwt
@Override
protected void setValue(@Nullable Iterable<Item> value) {
items = value;
control.clear();
if (items != null) {
for (Item item : items) {
addItem(control, item);
}
}
}
代码示例来源:origin: org.optaplanner/optaplanner-wb-solver-editor-client
@Override
public void initTree(TreeItem rootTreeItem) {
this.tree.clear();
this.tree.addItem(rootTreeItem);
}
代码示例来源:origin: org.eagle-i/eagle-i-common-ui-suggest-gwt
public void setResource(final EIClass resource) {
rootClass = resource;
if ( tree != null ) {
tree.clear();
scroll.getElement().getStyle().clearHeight();
}
if ( rootClass.hasSubClass() ) {
if ( tree != null ) {
// tree.add(ApplicationImages.LOADING); // TODO: move this somewhere
// accessible!
}
rootListLoading = true;
} else {
// Probably should assert...
if ( tree != null ) {
tree.addItem( "No types are available" );
}
}
}
代码示例来源:origin: org.eagle-i/eagle-i-common-ui-suggest-gwt
@Override
public void setResource(final EIClass resource) {
rootClass = resource;
if ( tree != null ) {
tree.clear();
scroll.getElement().getStyle().clearHeight();
}
if ( rootClass.hasSubClass() ) {
if ( tree != null ) {
tree.add( LOADING );
}
rootListLoading = true;
} else {
// Probably should assert...
if ( tree != null ) {
tree.addItem( "No types are available" );
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
@SuppressWarnings("unchecked")
protected void updateItems() {
List<M> items = (List<M>) model.getItems();
tree.clear();
if (items != null) {
for (M rootModel : items) {
addRootNode(createRootNode(rootModel), createLeafNode(getLeafModel(rootModel)));
}
}
}
代码示例来源:origin: de.esoco/gewt
/***************************************
* Sets the data model of the tree. The data elements of the model will be
* displayed as the top level items of the tree hierarchy. Model elements
* that also implement the interface DataModel will be displayed as nodes of
* the tree with their elements as sub-nodes. Elements that don't have
* children or elements that don't implement DataModel will be shown as
* leafs with no further children.
*
* @param rDataModel A data model that contains the root items of the tree
*/
public void setData(DataModel<?> rDataModel)
{
com.google.gwt.user.client.ui.Tree rTree =
(com.google.gwt.user.client.ui.Tree) getWidget();
rTree.clear();
for (int i = 0; i < rDataModel.getElementCount(); i++)
{
Object rElement = rDataModel.getElement(i);
rTree.addItem(createTreeItem(rElement));
}
}
代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt
public void setResource(final EIClass resource) {
rootClass = resource;
if ( tree != null ) {
tree.clear();
scroll.getElement().getStyle().clearHeight();
}
if ( rootClass.hasSubClass() ) {
if ( tree != null ) {
// tree.add(ApplicationImages.LOADING); // TODO: move this somewhere
// accessible!
}
rootListLoading = true;
} else {
// Probably should assert...
if ( tree != null ) {
final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
tree.addItem( safeHtmlBuilder.appendEscaped( "No types are available").toSafeHtml() );
}
}
}
代码示例来源:origin: kiegroup/drools-wb
public void setDSLSentences( final List<DSLSentence> dslSentences ) {
if ( tree.getItem( 0 ) != null ) {
tree.clear();
}
if ( dslSentences != null ) {
for ( DSLSentence dslSentence : dslSentences ) {
final TreeItem it = new TreeItem();
it.setHTML( "<small>" + dslSentence.toString() + "</small>" );
it.setUserObject( dslSentence );
tree.addItem( it );
}
}
}
代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt
@Override
public void setResource(final EIClass resource) {
if ( resource != null ) {
rootClass = resource;
setTitle( "Taxonomy Browser for Class " + rootClass.getEntity().getLabel() );
if ( tree != null ) {
tree.clear();
scroll.getElement().getStyle().clearHeight();
}
if ( rootClass.hasSubClass() ) {
if ( tree != null ) {
tree.add( LOADING );
}
rootListLoading = true;
} else {
// Probably should assert...
if ( tree != null ) {
final SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
tree.addItem( safeHtmlBuilder.appendEscaped( "No types are available").toSafeHtml() );
}
}
} else {
setTitle( UIMessages.NO_ONTOLOGY_TERMS );
button.setVisible( false );
this.setStyleName( "OntologyDropDownNoTerm" );
}
}
代码示例来源:origin: kiegroup/drools-wb
public void setFullyQualifiedClassNames( final List<String> fullyQualifiedClassNames ) {
if ( tree.getItem( 0 ) != null ) {
tree.clear();
}
if ( fullyQualifiedClassNames != null ) {
for ( String type : fullyQualifiedClassNames ) {
final TreeItem it = new TreeItem();
it.setHTML( AbstractImagePrototype.create( DRLTextEditorResources.INSTANCE.images().classImage() ).getHTML()
+ "<small style=\"cursor: pointer\">"
+ type + "</small>" );
it.setUserObject( new ClassUserObject( type + "( )",
type ) );
tree.addItem( it );
it.addItem( Util.toSafeHtml( LAZY_LOAD ) );
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
tree.clear();
代码示例来源:origin: org.kie.guvnor/guvnor-drl-text-editor-client
public void setDataModel( final DataModelOracle dataModel ) {
if ( tree.getItem( 0 ) != null ) {
tree.clear();
}
if ( dataModel.getFactTypes() != null ) {
for ( String type : dataModel.getFactTypes() ) {
TreeItem it = new TreeItem();
it.setHTML( AbstractImagePrototype.create( ImageResources.INSTANCE.classImage() ).getHTML()
+ "<small>"
+ type + "</small>" );
it.setUserObject( type + "( )" );
tree.addItem( it );
String[] fields = dataModel.getFieldCompletions( type );
if ( fields != null ) {
for ( String field : fields ) {
TreeItem fi = new TreeItem();
fi.setHTML( AbstractImagePrototype.create( ImageResources.INSTANCE.field() ).getHTML()
+ "<small>"
+ field + "</small>" );
fi.setUserObject( field );
it.addItem( fi );
}
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!