KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > builder > util > HtmlNode


1 /*
2  * $RCSfile: HtmlNode.java,v $
3  * @modification $Date: 2001/09/28 19:41:42 $
4  * @version $Id: HtmlNode.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
5  *
6  */

7
8 package com.memoire.vainstall.builder.util;
9
10 import java.awt.*;
11 import java.io.*;
12 import java.net.*;
13
14 import javax.swing.*;
15
16 /**
17  * This is
18  *
19  * @see
20  *
21  * @author Henrik Falk
22  * @version $Id: HtmlNode.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
23  */

24 public class HtmlNode extends AbstractVAIBuilderNode {
25
26     String JavaDoc title = "";
27     String JavaDoc name = "";
28     String JavaDoc url = "";
29
30     JPanel panel = null;
31
32     public HtmlNode() {
33         super();
34     }
35
36     public void initialize(String JavaDoc name, String JavaDoc title, String JavaDoc url) {
37         this.name = name;
38         this.title = title;
39         this.url = url;
40     }
41
42     public String JavaDoc getName() {
43         return name;
44     }
45
46     public JPanel getUI() {
47         if(panel == null) {
48             panel = new JPanel(new BorderLayout());
49         }
50         return panel;
51     }
52
53     public String JavaDoc getTitle() {
54         return title;
55     }
56
57     public ImageIcon getIcon() {
58         return new javax.swing.ImageIcon JavaDoc(getClass().getResource("/com/memoire/vainstall/builder/images/New16.gif"));
59     }
60
61     public void start() {
62
63         try {
64
65         URL url = null;
66
67         try {
68             url = getClass().getResource(this.url);
69         } catch(Exception JavaDoc exc) {
70             url = null;
71             exc.printStackTrace();
72             return;
73         }
74
75         JEditorPane pane = new JEditorPane();
76         pane.setEditable(false);
77
78         JScrollPane scroller = new JScrollPane();
79         JViewport vp = scroller.getViewport();
80         vp.add(pane);
81
82         pane.setPage(url);
83
84         getUI().add(scroller,BorderLayout.CENTER);
85
86         } catch(Exception JavaDoc exc) {
87             exc.printStackTrace();
88         }
89     }
90
91     public void stop() {
92     }
93
94     public void save() {
95     }
96
97 }
98
Popular Tags