List of usage examples for com.google.gwt.gen2.commonevent.shared BeforeOpenEvent isFirstTime
boolean isFirstTime
To view the source code for com.google.gwt.gen2.commonevent.shared BeforeOpenEvent isFirstTime.
Click Source Link
From source file:com.google.gwt.gen2.demo.fasttree.client.FastTreeDemo.java
License:Apache License
/** * Creates a lazy tree.//from w ww . j a v a 2 s . c o 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();//w ww .j a va 2 s. c o m } } }); final ScrollPanel panel = new ScrollPanel(); panel.add(dimensionTree); return panel; }