1 package com.tirsen.angkor;
2
3 import java.io.IOException;
4
5 /*
6 * Angkor Web Framework
7 *
8 * Distributable under LGPL license.
9 * See terms of license at gnu.org.
10 */
11
12
13 /***
14 * Refactor this a little bit.
15 * Maybe we need a ViewHolder that holds a named registered component from an application.
16 * We don't need this class though, it is only used internally within an application.
17 * <!-- $Id: ViewLink.java,v 1.4 2002/10/09 21:37:37 tirsen Exp $ -->
18 * <!-- $Author: tirsen $ -->
19 *
20 * @author Jon Tirs´n (tirsen@users.sourceforge.net)
21 * @version $Revision: 1.4 $
22 */
23 public class ViewLink extends AbstractViewFactory implements View
24 {
25 private ViewFactory current;
26 private ViewFactory original;
27
28 public ViewLink(ViewFactory original)
29 {
30 this.original = original;
31 reset();
32 }
33
34 public ViewFactory getTarget()
35 {
36 return current;
37 }
38
39 public void relink(ViewFactory target)
40 {
41 this.current = target;
42 }
43
44 /***
45 * Resets the link to it's original binding.
46 */
47 public void reset()
48 {
49 current = original;
50 }
51
52 public View getView()
53 {
54 return getTarget().getView();
55 }
56
57 public View getContainer()
58 {
59 return getView().getContainer();
60 }
61
62 public void setContainer(View container)
63 {
64 getView().setContainer(container);
65 }
66
67 public String uniqueId(RenderContext context)
68 {
69 return getView().uniqueId(context);
70 }
71
72 public void render(RenderContext context) throws IOException
73 {
74 getView().render(context);
75 }
76
77 public void parse(RenderContext context)
78 {
79 getView().parse(context);
80 }
81
82 public void setVisible(boolean visible)
83 {
84 getView().setVisible(visible);
85 }
86
87 public boolean isVisible()
88 {
89 return getView().isVisible();
90 }
91 }
This page was automatically generated by Maven