01: package net.xoetrope.samples.ctlsamples;
02:
03: import net.xoetrope.swing.XComboBox;
04: import net.xoetrope.swing.XTable;
05: import net.xoetrope.xui.XPage;
06: import net.xoetrope.xui.XProjectManager;
07: import net.xoetrope.xui.data.XModel;
08:
09: /**
10: * <p>Title: Xui</p>
11: * <p>Description: </p>
12: * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003</p>
13: * <p>Company: Xoetrope Ltd.</p>
14: * @author not attributable
15: * @version 1.0
16: */
17:
18: public class STable extends XPage {
19: XTable table;
20: XComboBox cmbSelect;
21:
22: public STable() {
23: table = (XTable) componentFactory.addComponent(XPage.TABLE, 5,
24: 5, 220, 200);
25: table.setStyle("base/TableData");
26: table.setHeaderStyle("base/TableHeading");
27: table.setSelectedStyle("base/TableSelection");
28: XModel model = (XModel) XProjectManager.getModel().get(
29: "componentlist/items");
30: table.setModel(model);
31: table.setInteractiveTable(true);
32: table.setSelectedRow(0);
33: XModel test = (XModel) XProjectManager.getModel().get(
34: "componentlist");
35:
36: componentFactory.addComponent(XPage.LABEL, 10, 230, 100, 20,
37: "Selected row", "prompt");
38: cmbSelect = (XComboBox) componentFactory.addComponent(
39: XPage.COMBO, 120, 230, 50, 20, null, "prompt");
40: cmbSelect.addItem("0");
41: cmbSelect.addItem("1");
42: cmbSelect.addItem("2");
43: cmbSelect.addItem("3");
44: cmbSelect.addItem("4");
45: cmbSelect.addItem("5");
46: cmbSelect.addItem("6");
47: cmbSelect.addItem("7");
48: cmbSelect.addItem("8");
49: cmbSelect.addItem("9");
50: cmbSelect.addItem("10");
51: addItemHandler(cmbSelect, "selectRow");
52: }
53:
54: public void selectRow() {
55: table.setSelectedRow(cmbSelect.getSelectedIndex());
56: }
57:
58: }
|