01: /*
02: * $RCSfile: HtmlNode.java,v $
03: * @modification $Date: 2001/09/28 19:41:42 $
04: * @version $Id: HtmlNode.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.util;
09:
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 title = "";
27: String name = "";
28: String url = "";
29:
30: JPanel panel = null;
31:
32: public HtmlNode() {
33: super ();
34: }
35:
36: public void initialize(String name, String title, String url) {
37: this .name = name;
38: this .title = title;
39: this .url = url;
40: }
41:
42: public String 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 getTitle() {
54: return title;
55: }
56:
57: public ImageIcon getIcon() {
58: return new javax.swing.ImageIcon(getClass().getResource(
59: "/com/memoire/vainstall/builder/images/New16.gif"));
60: }
61:
62: public void start() {
63:
64: try {
65:
66: URL url = null;
67:
68: try {
69: url = getClass().getResource(this .url);
70: } catch (Exception exc) {
71: url = null;
72: exc.printStackTrace();
73: return;
74: }
75:
76: JEditorPane pane = new JEditorPane();
77: pane.setEditable(false);
78:
79: JScrollPane scroller = new JScrollPane();
80: JViewport vp = scroller.getViewport();
81: vp.add(pane);
82:
83: pane.setPage(url);
84:
85: getUI().add(scroller, BorderLayout.CENTER);
86:
87: } catch (Exception exc) {
88: exc.printStackTrace();
89: }
90: }
91:
92: public void stop() {
93: }
94:
95: public void save() {
96: }
97:
98: }
|