01: package net.xoetrope.xui.test;
02:
03: import java.awt.Container;
04:
05: import junit.framework.TestCase;
06: import net.xoetrope.awt.XApplet;
07: import net.xoetrope.xui.XPage;
08: import net.xoetrope.xui.XPageDisplay;
09: import net.xoetrope.xui.XPageManager;
10: import net.xoetrope.xui.XTarget;
11: import net.xoetrope.xui.XProjectManager;
12:
13: /**
14: * Title: XUI
15: * Description:
16: * Copyright (c) Xoetrope Ltd., 1998-2004
17: * @version 1.0
18: */
19: public class TestXPageManager extends TestCase implements XPageDisplay {
20: XPageManager pageMgr;
21:
22: public TestXPageManager() {
23: }
24:
25: public void testLoadPage() {
26: XApplet testApplet = new XApplet();
27: pageMgr = XProjectManager.getPageManager();
28: pageMgr.setPackageName("net.xoetrope.xui.test.");
29: pageMgr.setPageDisplay(testApplet);
30: pageMgr.showPage("PageTester");
31: }
32:
33: public XPage displayPage(XPage page) {
34: System.out.println(page.getName());
35: return null;
36: }
37:
38: public XPage displayPage(XPage page, String target) {
39: System.out.println("Page: " + page.getName() + ", target: "
40: + target);
41: return null;
42: }
43:
44: /**
45: * Adds a frame to the frameset
46: * @param frame the new traget frame
47: * @param constraint the BorderLayout constraint
48: */
49: public void addTarget(XTarget frame, Object constraint) {
50: System.out.println("addTarget: " + frame.getName() + ", "
51: + constraint.toString());
52: }
53:
54: /**
55: * Get a named frame/target from the current frameset
56: * @param name the name of the frame
57: * @return the target frame
58: */
59: public Container findTarget(String name) {
60: System.out.println("findTarget: " + name);
61: return null;
62: }
63:
64: /**
65: * Get the number of frame/target from the current frameset
66: * @return the number of target frames
67: */
68: public int getNumTargets() {
69: System.out.println("getNumTargets ");
70: return 0;
71: }
72:
73: /**
74: * Get the target for a page display request
75: * @param idx the target area
76: * @return the container to be updated
77: */
78: public Container getTarget(int idx) {
79: System.out.println("getTarget: " + idx);
80: return null;
81: }
82: }
|