1 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 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("/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 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 exc) { 87 exc.printStackTrace(); 88 } 89 } 90 91 public void stop() { 92 } 93 94 public void save() { 95 } 96 97 } 98 | Popular Tags |