01: /*
02: * Created on Jul 27, 2005
03: */
04: package uk.org.ponder.rsf.view;
05:
06: import java.util.HashMap;
07:
08: import uk.org.ponder.rsf.components.UIComponent;
09:
10: /**
11: * The View holds the component tree while it is in transit between
12: * component producers and the view renderer. The tree is built up by
13: * accreting components from one or more producers, and then passes through
14: * various "fixups" (ComponentProcessors) before it is handed to the IKAT
15: * renderer implemented in ViewRender.
16: * @author Antranig Basman (antranig@caret.cam.ac.uk)
17: *
18: */
19: public class View {
20: public View() {
21: viewroot = new ViewRoot();
22: }
23:
24: public ViewRoot viewroot;
25:
26: // This is a map of full component IDs to components.
27: private HashMap IDtocomponent = new HashMap();
28:
29: /** Registers the supplied component into the ID map */
30: public void registerComponent(UIComponent toregister) {
31: IDtocomponent.put(toregister.getFullID(), toregister);
32: }
33:
34: public UIComponent getComponent(String fullID) {
35: return (UIComponent) IDtocomponent.get(fullID);
36: }
37: }
|