01: /*
02: * MyGWT Widget Library
03: * Copyright(c) 2007, MyGWT.
04: * licensing@mygwt.net
05: *
06: * http://mygwt.net/license
07: */
08: package net.mygwt.samples.explorer.client;
09:
10: import com.google.gwt.user.client.ui.HorizontalPanel;
11:
12: import net.mygwt.samples.resources.client.Folder;
13: import net.mygwt.samples.resources.client.Stock;
14: import net.mygwt.samples.resources.client.TestData;
15: import net.mygwt.ui.client.Style;
16: import net.mygwt.ui.client.widget.List;
17: import net.mygwt.ui.client.widget.ListItem;
18: import net.mygwt.ui.client.widget.WidgetContainer;
19:
20: public class CheckBoxListPage extends Page {
21:
22: protected void createWidget(WidgetContainer container) {
23: final List list = new List(Style.SINGLE | Style.FLAT
24: | Style.CHECK);
25: list.setScrollEnabled(true);
26: list.setSize(230, 200);
27:
28: Folder stocks = TestData.getStocks();
29: for (int i = 0; i < stocks.getChildCount(); i++) {
30: Stock stock = (Stock) stocks.getChild(i);
31: ListItem item = new ListItem();
32:
33: item.setText(stock.getName());
34: item.setIconStyle("icon-chart");
35: list.add(item);
36: }
37:
38: HorizontalPanel hp = new HorizontalPanel();
39: hp.setSpacing(8);
40: hp.add(list);
41:
42: container.add(hp);
43: }
44:
45: }
|