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

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

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

Tree.<init>介绍

[英]Constructs an empty tree.
[中]构造一棵空树。

代码示例

代码示例来源:origin: stackoverflow.com

var myTree = new Tree( 
{
  model: treeModel, 
  autoExpand: true,
  showRoot: false,
  title: 'My Items',
  openOnClick: true,
  getDomNodeById: function( id ) // new function to find DOM node
  {
    return this._itemNodesMap[ id ][0];
  }
} );

代码示例来源:origin: stackoverflow.com

var theTree = new Tree({
       model: myModel,
       onClick: function(item, node){
         // auto-expand the node when clicked
         var nodes = that.theTree.getNodesByItem(item.id);
         if(!nodes[0].isExpanded)
           theTree._expandNode(nodes[0]);
       }
     });

代码示例来源:origin: stackoverflow.com

public class Forest{
  private int valueINeed;

  public Forest() {
  }

  public int getValueINeed(){
    valueINeed = (new Tree(5)).getValue();
  }
}

代码示例来源:origin: stackoverflow.com

void go() {
  go2(new Tree(), new Redwood());
  go2(new Redwood(), new Redwood());

}

代码示例来源:origin: stackoverflow.com

DataNode[] a2 = new DataNode[1];
Tree[] b2 = a2; // this is okay
b2[0] = new Tree(); // this will cause ArrayStoreException since b2 is actually a DataNode[] and can't store a Tree

代码示例来源:origin: stackoverflow.com

for (int i = 0; i < length; i++) {
  for (int j = 0; j < width; j++) {
    trees[i][j] = new Tree(); // obviously changes the array content.
  }
}

代码示例来源:origin: stackoverflow.com

function Tree() {
  this.name = 'Boris';
  return this;
}

Tree.prototype = Object.create({
  age: 18
});

var tree = new Tree();
tree.name == 'Boris'; // true
tree.age == 18; // true

代码示例来源:origin: de.esoco/gewt

/***************************************
   * {@inheritDoc}
   */
  @Override
  public Widget createWidget(Component rComponent, StyleData rStyle)
  {
    return new com.google.gwt.user.client.ui.Tree();
  }
}

代码示例来源:origin: stackoverflow.com

/**
 * @constructor
 */
var Tree = function(){

  this.left = new Tree()
};

/**
 * @type {Tree}
 */
Tree.prototype.left = null;

代码示例来源:origin: stackoverflow.com

Tree t = new Tree("1",
     new Tree("2",
      new Tree("4"),
       new Tree("5",
        new Tree("8"),
        new Tree("9"))),
     new Tree("3",
      new Tree("6"),
      new Tree("7")));

代码示例来源:origin: stackoverflow.com

for (Tree[] tree : this.trees){
  for(Tree tree2 : tree){
  tree2 = new Tree(); // changes tha variable tree2, does not touch the array.
  System.out.println(tree2);
  }
}

代码示例来源:origin: stackoverflow.com

for (int l = 0; l < length; l++){
 for(int h = 0; h < height; h++) {
  trees[l][h] = new Tree();
  System.out.println(trees[l][h]);
 }
}

代码示例来源:origin: stackoverflow.com

private static Tree createTree() {
  final Tree tree = new Tree();
  tree.rootNode = new Node1("1");
  tree.allNodes = new ArrayList<Node>();
  tree.allNodes.add(new Node1("1", new Node2("2")));
  tree.allNodes.add(new Node2("2"));
  return tree;
}

代码示例来源:origin: stackoverflow.com

OutputNodeHierachical dataSource = new OutputNodeHierachical(rootNodes);

Tree mainTree = new Tree();
mainTree.setSizeFull();
mainTree.setContainerDataSource(dataSource);
mainTree.addItemClickListener(new ItemClickListener() {
  private static final long serialVersionUID = -413371711541672605L;

  @Override
  public void itemClick(ItemClickEvent event) {
    OutputNode node = (OutputNode) event.getItemId();
    openObject(node.getObjectId());
  }
});

代码示例来源:origin: stackoverflow.com

OutputNodeHierachical dataSource = new OutputNodeHierachical(rootNodes);

Tree mainTree = new Tree();
mainTree.setSizeFull();
mainTree.setContainerDataSource(dataSource);
mainTree.addItemClickListener(new ItemClickListener() {
  private static final long serialVersionUID = -413371711541672605L;

  @Override
  public void itemClick(ItemClickEvent event) {
    OutputNode node = (OutputNode) event.getItemId();
    openObject(node.getObjectId());
  }
});

代码示例来源:origin: oVirt/ovirt-engine

protected void createSanStorageListWidget() {
  tree = new Tree();
  treeContainer.add(tree);
}

代码示例来源:origin: stackoverflow.com

Tree myTree = new Tree();
myTree.root = new Node();
int[] path = {0, 0, 0};
myTree.put("hi", path);
System.out.println(myTree.get(path));

代码示例来源:origin: stackoverflow.com

Tree animal = new Tree();
animal.instruction();
animal.play();
animal.writeToFile("treeData.ser");
Tree newAnimal = Tree.readFromFile("treeData.ser");
///should the following not be newAnimal?
animal.play();

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

Panel panel = new Panel();
panel.setSizeFull();
panel.getContent().setSizeUndefined();
tab.addComponent(panel);
tab.setExpandRatio(panel, 1);

Tree tree = new Tree();
tree.setSizeUndefined();
panel.addComponent(tree);

相关文章