List of usage examples for com.google.gwt.gen2.commonevent.shared BeforeOpenEvent getTarget
public T getTarget()
From source file:com.google.gwt.gen2.demo.fasttree.client.FastTreeDemo.java
License:Apache License
/** * Creates a lazy tree./* w w w.j a va 2 s .co m*/ */ protected Widget lazyTree() { final FastTree t = new FastTree(); lazyCreateChild(t, 0, 50); t.addBeforeOpenHandler(new BeforeOpenHandler<FastTreeItem>() { public void onBeforeOpen(BeforeOpenEvent<FastTreeItem> event) { if (event.isFirstTime()) { for (int i = 0; i < 50; i++) { lazyCreateChild(event.getTarget(), i, 50 + (i * 10)); } } } }); return t; }
From source file:org.pentaho.pat.client.ui.widgets.DimensionTreeWidget.java
License:Open Source License
protected Widget onInitialize() { dimensionTree = new FastTree(); lazyCreateChild(dimensionTree.getTreeRoot(), 0, 50); dimensionTree.addBeforeOpenHandler(new BeforeOpenHandler<FastTreeItem>() { public void onBeforeOpen(BeforeOpenEvent<FastTreeItem> event) { parentItem = (FastTreeItem) event.getTarget(); if (event.isFirstTime()) { lazyCreateChilds();/*from ww w . java 2 s. c om*/ } } }); final ScrollPanel panel = new ScrollPanel(); panel.add(dimensionTree); return panel; }