1 /*
2  *  CVS: $Id: HelpViewerDialog.java,v 1.2 2004/07/25 21:40:56 marcus Exp $
3  * 
4  *  This file is part of zuul.
5  *
6  *  zuul is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10 *
11 *  zuul is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with zuul; if not, write to the Free Software
18 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 * 
20 *  Copyrigth 2004 by marcus, leh
21 * 
22 */
23package org.jzuul.gdk.swt;
24
25
26import java.io.File;
27import java.io.FileInputStream;
28import java.io.InputStreamReader;
29import java.nio.charset.Charset;
30
31import org.eclipse.swt.SWT;
32import org.eclipse.swt.browser.Browser;
33import org.eclipse.swt.layout.FillLayout;
34import org.eclipse.swt.layout.GridData;
35import org.eclipse.swt.layout.GridLayout;
36import org.eclipse.swt.widgets.Dialog;
37import org.eclipse.swt.widgets.Display;
38import org.eclipse.swt.widgets.Label;
39import org.eclipse.swt.widgets.Shell;
40import org.jzuul.engine.gui.utils.Util;
41
42public class HelpViewerDialog extends Dialog {
43    
44    public HelpViewerDialog (Shell parent, int style) {
45            super (parent, style);
46    }
47    public HelpViewerDialog (Shell parent) {
48            this (parent, 0); // your default style bits go here (not the Shell's style bits)
49    }
50    public void open() {
51            Shell parent = getParent();
52            final Shell shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.MIN  | SWT.RESIZE );
53            shell.setText(Messages.getString("HELP_TITLE")); //$NON-NLS-1$
54            shell.setImage(Util.getImagefromResource(parent.getDisplay(),"etc/artwork/jz.png")); //$NON-NLS-1$
55            shell.setLayout(new GridLayout(1,true));
56
57            Browser b = new Browser(shell, SWT.NONE);
58            
59            GridData bDat = new GridData(GridData.FILL_BOTH);
60            b.setLayoutData(bDat);
61            
62            b.setUrl("http://www.jzuul.org/gdkdoc/gdk_documentation.html"); //$NON-NLS-1$
63            
64            shell.pack();
65            shell.setSize(900,600);
66            
67            shell.open();
68            Display display = parent.getDisplay();
69            
70            while (!shell.isDisposed()) {
71                    if (!display.readAndDispatch()) display.sleep();
72            }
73            
74    }
75 
76 
77}
78