Methods Summary |
---|
private void | createItem(com.google.gwt.sample.kitchensink.client.Lists$Proto proto)
proto.item = new TreeItem(proto.text);
proto.item.setUserObject(proto);
if (proto.children != null) {
proto.item.addItem(new PendingItem());
}
|
private void | fillList(int idx)
// Set the contents of the list box to reflect the combo selection.
list.clear();
String[] strings = stringLists[idx];
for (int i = 0; i < strings.length; ++i) {
list.addItem(strings[i]);
}
|
public static SinkInfo | init(Sink.Images images)
return new SinkInfo("Lists",
"<h2>Lists and Trees</h2>" +
"<p>GWT provides a number of ways to display lists and trees. This " +
"includes the browser's built-in list and drop-down boxes, as well as " +
"the more advanced suggestion combo-box and trees.</p><p>Try typing " +
"some text in the SuggestBox below to see what happens!</p>") {
public Sink createInstance() {
return new Lists(images);
}
};
|
public void | onChange(com.google.gwt.user.client.ui.Widget sender)
if (sender == combo) {
fillList(combo.getSelectedIndex());
} else if (sender == list) {
}
|
public void | onShow()
|
public void | onTreeItemSelected(com.google.gwt.user.client.ui.TreeItem item)
|
public void | onTreeItemStateChanged(com.google.gwt.user.client.ui.TreeItem item)
TreeItem child = item.getChild(0);
if (child instanceof PendingItem) {
item.removeItem(child);
Proto proto = (Proto) item.getUserObject();
for (int i = 0; i < proto.children.length; ++i) {
createItem(proto.children[i]);
item.addItem(proto.children[i].item);
}
}
|