Source code: jac/aspects/gui/web/AbstractPage.java
1 /*
2 Copyright (C) 2002 Laurent Martelli <laurent@aopsys.com>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
18 package jac.aspects.gui.web;
19
20 import jac.aspects.gui.*;
21 import java.io.IOException;
22 import java.io.PrintWriter;
23
24 /**
25 * An HTML page containing a View
26 */
27 public abstract class AbstractPage extends AbstractView
28 implements HTMLViewer
29 {
30 /* the view embedded in the page */
31 protected View view;
32 /* tells if the page is in a new window */
33 boolean newWindow=false;
34
35 public AbstractPage(View view,boolean newWindow) {
36 super();
37 view.setParentView(this);
38 this.view=view;
39 this.newWindow=newWindow;
40 }
41
42 public void close() {
43 if (!newWindow) {
44 super.close();
45 view.close();
46 }
47 }
48
49 // HTMLViewer interface
50
51 public void genHTML(PrintWriter out) throws IOException {
52 genPage(out);
53 }
54
55 }