KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > guiframework > view > DescriptorContainerView


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.tools.guiframework.view;
25
26 import com.iplanet.jato.NavigationException;
27 import com.iplanet.jato.RequestContext;
28 import com.iplanet.jato.model.ModelControlException;
29 import com.iplanet.jato.view.ContainerView;
30 import com.iplanet.jato.view.View;
31 import com.iplanet.jato.view.event.ChildDisplayEvent;
32 import com.iplanet.jato.view.event.DisplayEvent;
33
34 import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor;
35 import java.util.Map JavaDoc;
36
37
38 /**
39  * Interface defining a DescriptorView.
40  *
41  * <P>NOTE: Top-level display items (ViewBean's) should also implement
42  * com.iplanet.jato.command.Command</P>
43  */

44 public interface DescriptorContainerView extends ContainerView {
45     /**
46      * This method retrieves this View ViewDescriptor.
47      *
48      * @return This View's ViewDescriptor.
49      */

50     public ViewDescriptor getViewDescriptor();
51
52
53
54     //////////////////////////////////////////////////////////////////////
55
// Child Registration / Creation Methods //
56
//////////////////////////////////////////////////////////////////////
57

58     /**
59      * <P>This method is defined in ContainerView, but it is important to
60      * to override this.</P>
61      *
62      * <P>This method should delegate to the helper createChild method to use
63      * the descriptor information.</P>
64      *
65      * <P>For example:</P>
66      * <P>&nbsp;</P>
67      * <CODE>return DescriptorViewHelper.createChild(this, name);</CODE>
68      * <P>&nbsp;</P>
69      */

70     public View createChild(String JavaDoc name);
71
72
73     /**
74      *
75      */

76     public RequestContext getRequestContext();
77
78
79     /**
80      *
81      */

82     public void setRequestContext(RequestContext context);
83
84
85     /**
86      * Make forwarding easy
87      */

88     public void forwardTo(RequestContext requestContext) throws NavigationException;
89
90
91
92     //////////////////////////////////////////////////////////////////////
93
// Event Methods //
94
//////////////////////////////////////////////////////////////////////
95

96     /**
97      * This method dispatches BeginDisplay events to each registered
98      * BeginDisplay event handler according the the ViewDescriptor.
99      * This method is defined in ContainerView, but it is important to
100      * to override this.
101      *
102      * @param event The DisplayEvent, created internally by JATO
103      */

104     public void beginDisplay(DisplayEvent event) throws ModelControlException;
105
106
107     /**
108      * This method is defined in ContainerView, but it is important to
109      * override this.
110      */

111     public boolean beginChildDisplay(com.iplanet.jato.view.event.ChildDisplayEvent event) throws ModelControlException;
112
113
114     /**
115      * This method is defined in ContainerView, but it is important to
116      * override this.
117      */

118     public String JavaDoc endChildDisplay(com.iplanet.jato.view.event.ChildContentDisplayEvent event) throws ModelControlException;
119
120
121     /**
122      * This method is defined in ContainerView, but it is important to
123      * override this.
124      */

125     public void endDisplay(DisplayEvent event);
126
127
128     /**
129      * <P>Children need to be registered so that values can be submitted back
130      * to DisplayFields, CommandFields can be handled, and containers which
131      * contain these things will work. So... to ensure that
132      * DescriptorContainerView's work, the following
133      * registerViewDescriptorChildren() method must be implemented. This
134      * method is named this way to avoid accidentally overriding a
135      * registerChildren method. Since JATO did not make this part of an
136      * interface, we cannot do super.registerChildren(). <B>This method should
137      * be invoked from the constructor after the ViewDescriptor has been
138      * set.</B> Most implementations of this method should do the
139      * following:</P>
140      *
141      * <BLOCKQUOTE><CODE>
142      * DescriptorViewHelper.registerViewDescriptorChildren(getViewDescriptor(), this);
143      * </CODE></BLOCKQUOTE>
144      *
145      */

146     public void registerViewDescriptorChildren();
147 }
148
Popular Tags