com.google.gwt.user.client.ui.Tree.addItem()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(183)

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

Tree.addItem介绍

[英]Adds a simple tree item containing the specified html.
[中]添加包含指定html的简单树项。

代码示例

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

/**
 * Adds the widget as a root tree item.
 *
 * @see com.google.gwt.user.client.ui.HasWidgets#add(com.google.gwt.user.client.ui.Widget)
 * @param widget widget to add.
 */
@Override
public void add(Widget widget) {
 addItem(widget);
}

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

/**
 * Overloaded version for IsWidget.
 *
 * @see #addItem(Widget)
 */
@Override
public TreeItem addItem(IsWidget w) {
 return this.addItem(asWidgetOrNull(w));
}

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

/**
 * Adds the widget as a root tree item.
 *
 * @see com.google.gwt.user.client.ui.HasWidgets#add(com.google.gwt.user.client.ui.Widget)
 * @param widget widget to add.
 */
@Override
public void add(Widget widget) {
 addItem(widget);
}

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

/**
 * Adds the widget as a root tree item.
 *
 * @see com.google.gwt.user.client.ui.HasWidgets#add(com.google.gwt.user.client.ui.Widget)
 * @param widget widget to add.
 */
@Override
public void add(Widget widget) {
 addItem(widget);
}

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

/**
 * Overloaded version for IsWidget.
 *
 * @see #addItem(Widget)
 */
@Override
public TreeItem addItem(IsWidget w) {
 return this.addItem(asWidgetOrNull(w));
}

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

public WSTree addSubTree() {
 WSTree gTree = new WSTree();
 tree.addItem(gTree);
 return gTree;
}

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

/**
 * Overloaded version for IsWidget.
 *
 * @see #addItem(Widget)
 */
@Override
public TreeItem addItem(IsWidget w) {
 return this.addItem(asWidgetOrNull(w));
}

代码示例来源:origin: org.optaplanner/optaplanner-wb-solver-editor-client

@Override
public void initTree(TreeItem rootTreeItem) {
  this.tree.clear();
  this.tree.addItem(rootTreeItem);
}

代码示例来源:origin: org.jboss.ballroom/widgets

@Override
public void addItem(TreeItem item) {
  item.getElement().setAttribute(TREE_ID_ATTRIBUTE, treeId);
  super.addItem(item);
}

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

public void addItem(WSTreeItem item) {
 item.getElement().getStyle().setProperty("marginTop", "1px");
 item.getElement().getStyle().setProperty("userSelect", "none");
 tree.addItem(item);
}

代码示例来源: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: stackoverflow.com

Tree t = new Tree();
 HorizontalPanel hc = new HorizontalPanel();
 hc.add(new Label("some text"));
 hc.add(new Image("http://tueffel.net/images/icons/icon13.gif"));
 TreeItem ti = new TreeItem(hc);
 HorizontalPanel hc2 = new HorizontalPanel();
 hc2.add(new Label("some text"));
 hc2.add(new Image("http://tueffel.net/images/icons/icon13.gif"));
 ti.addItem(new TreeItem(hc2));
 t.addItem(ti);
 RootPanel.get().add(t);

代码示例来源:origin: org.uberfire/widgets-core-client

@Override
public void init(final FileExplorerPresenter presenter) {
  this.presenter = presenter;
  rootTreeItem = tree.addItem(Util.getHeader(images.packageIcon(), "Repositories"));
  rootTreeItem.setState(true);
  initWidget(tree);
}

代码示例来源: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: org.jboss.errai/errai-widgets

public WSTreeItem addItem(Image icon, Widget content) {
 HorizontalPanel hPanel = new HorizontalPanel();
 hPanel.add(icon);
 hPanel.add(content);
 hPanel.setCellWidth(icon, "16px");
 WSTreeItem item = new WSTreeItem(hPanel);
 tree.addItem(item);
 return item;
}

代码示例来源: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: 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.kie.guvnor/guvnor-categories-editor-client

protected void buildTree( final Categories categories ) {
  final TreeItem root = new TreeItem();
  root.setHTML( AbstractImagePrototype.create( ImageResources.INSTANCE.desc() ).getHTML() );
  navTreeWidget.addItem( root );
  for ( final CategoryItem category : categories ) {
    final TreeItem it = buildTreeItem( category );
    root.addItem( it );
    if ( category.hasChild() ) {
      loadChildren( it, category );
    }
  }
  root.setState( true );
}

代码示例来源: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 ) );
    }
  }
}

相关文章