View Javadoc

1   /*
2    Wotonomy: OpenStep design patterns for pure Java applications.
3    Copyright (C) 2000 Blacksmith, Inc.
4   
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9   
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14  
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, see http://www.gnu.org
17   */
18  
19  package net.wotonomy.web;
20  
21  import net.wotonomy.foundation.NSDictionary;
22  
23  /***
24   * Used to dynamically generate HTML containers (elements with opening and closing tags and something in between).
25   * @author michael@mpowers.net
26   * @author $Author: cgruber $
27   * @version $Revision: 905 $
28   */
29  public class WOGenericContainer extends WOGenericElement {
30  
31      public WOGenericContainer() {
32          super();
33      }
34  
35      public WOGenericContainer(String n, NSDictionary m, WOElement t) {
36          super(n, m, t);
37      }
38  
39      public void appendToResponse(WOResponse r, WOContext c) {
40          super.appendToResponse(r, c);
41          rootElement.appendToResponse(r, c);
42          r.appendContentString("</");
43          r.appendContentString(elementName(c));
44          r.appendContentString(">");
45      }
46  
47      public void takeValuesFromRequest(WORequest r, WOContext c) {
48          super.takeValuesFromRequest( r, c );
49          rootElement.takeValuesFromRequest(r, c);
50      }
51  
52      public WOActionResults invokeAction(WORequest r, WOContext c) {
53          WOActionResults result = super.invokeAction( r, c );
54          if ( result == null )
55          {
56              result = rootElement.invokeAction(r, c);
57          }
58          return result;
59      }
60  
61  }