01: package net.xoetrope.samples.travel;
02:
03: import net.xoetrope.awt.XButton;
04: import net.xoetrope.awt.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 FlightResults extends XPage {
19: XTable table;
20: XButton btnBack;
21:
22: public FlightResults() {
23: btnBack = (XButton) componentFactory.addComponent(XPage.BUTTON,
24: 80, 250, 50, 20, "Back");
25: table = (XTable) componentFactory.addComponent(XPage.TABLE, 10,
26: 10, 215, 200);
27: table.setStyle("base/TableData");
28: table.setHeaderStyle("base/TableHeading");
29: table.setSelectedStyle("base/TableSelection");
30: table.setModel((XModel) XProjectManager.getModel().get(
31: "flights/items"));
32: table.setInteractiveTable(true);
33: table.repaint();
34: mapEvents();
35: }
36:
37: public void mapEvents() {
38: addMouseHandler(btnBack, "goBack");
39: }
40:
41: public void goBack() {
42: if (wasMouseClicked())
43: XProjectManager.getPageManager().showPrevious();
44: }
45:
46: }
|