01: // RemoteResourceWrapper.java
02: // $Id: RemoteResourceWrapper.java,v 1.7 2000/08/16 21:37:28 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1997.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigadmin;
07:
08: import org.w3c.jigsaw.admin.RemoteResource;
09: import org.w3c.jigsaw.admin.RemoteAccessException;
10:
11: import org.w3c.jigadmin.gui.ServerBrowser;
12:
13: /**
14: * This class is a wrapper for RemoteResource, used to store the
15: * resource tree.
16: */
17: public class RemoteResourceWrapper extends
18: org.w3c.jigadm.RemoteResourceWrapper {
19: ServerBrowser sb = null;
20:
21: /**
22: * Constructor.
23: * @param rr The remoteResource.
24: * @param sb The ServerBrowser
25: */
26: public RemoteResourceWrapper(RemoteResource rr, ServerBrowser sb) {
27: super (rr);
28: this .sb = sb;
29: }
30:
31: /**
32: * Constructor.
33: * @param rr The remoteResource.
34: * @param rr The father remoteResource.
35: * @param sb The ServerBrowser
36: */
37: public RemoteResourceWrapper(RemoteResource father,
38: RemoteResource rr, ServerBrowser sb) {
39: super (father, rr);
40: this .sb = sb;
41: }
42:
43: /**
44: * Constructor.
45: * @param rrwf The father remoteResource wrapper.
46: * @param rr The remoteResource.
47: */
48: public RemoteResourceWrapper(RemoteResourceWrapper rrwf,
49: RemoteResource rr) {
50: super (rrwf, rr);
51: this .sb = rrwf.sb;
52: }
53:
54: /**
55: * Constructor.
56: * @param rrwf The father remoteResource wrapper.
57: * @param rr The remoteResource.
58: * @param sb The ServerBrowser
59: */
60: public RemoteResourceWrapper(RemoteResourceWrapper rrwf,
61: RemoteResource rr, ServerBrowser sb) {
62: super (rrwf, rr);
63: this .sb = sb;
64: }
65:
66: /**
67: * Get the associated ServerBrowser
68: * @return a ServerBrowser instance
69: */
70: public ServerBrowser getServerBrowser() {
71: return sb;
72: }
73:
74: /**
75: * Get the father RemoteResourceWrapper.
76: * @return a RemoteResourceWrapper instance
77: */
78: public RemoteResourceWrapper getFatherRemoteResourceWrapper() {
79: return (RemoteResourceWrapper) getFatherWrapper();
80: }
81:
82: /**
83: * Load and get a child of this wrapped RemoteResource.
84: * @param name the child name
85: * @return a RemoteResourceWrapper instance
86: */
87: public RemoteResourceWrapper getChildResource(String name)
88: throws RemoteAccessException {
89: RemoteResource resource = null;
90: resource = getResource().loadResource(name);
91: return new RemoteResourceWrapper(this, resource);
92: }
93:
94: }
|