KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $RCSfile: ProductStepsNode.java,v $
3  * @modification $Date: 2001/09/28 19:41:42 $
4  * @version $Id: ProductStepsNode.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 com.memoire.vainstall.VAGlobals;
11
12 import java.awt.*;
13 import javax.swing.*;
14 import javax.swing.border.*;
15 import javax.swing.tree.*;
16
17 /**
18  * This is
19  *
20  * @see
21  *
22  * @author Henrik Falk
23  * @version $Id: ProductStepsNode.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
24  */

25 public class ProductStepsNode extends AbstractVAIProductNode {
26
27     JPanel panel = null;
28
29     private final static Border loweredBorder = new SoftBevelBorder(BevelBorder.LOWERED);
30
31    JPopupMenu menu;
32
33     public ProductStepsNode() {
34         super();
35     }
36
37     public String JavaDoc getName() {
38         return "Steps";
39     }
40
41     public JPanel getUI() {
42         if (panel == null) {
43             panel = new JPanel();
44             panel.setBorder(loweredBorder);
45
46             JLabel label = new JLabel();
47             label.setText("<html><b><font color=black size=3><center>Required step during install can be defined here.</center></font></b></html>");
48             panel.add(label);
49         }
50
51         return panel;
52     }
53
54     public String JavaDoc getTitle() {
55         return "Installation Steps";
56     }
57
58     public ImageIcon getIcon() {
59         return new javax.swing.ImageIcon JavaDoc(getClass().getResource("/com/memoire/vainstall/builder/images/New16.gif"));
60     }
61
62     public void start() {
63 // ((JPanel)getUI()).initialize(getModel());
64
}
65
66     public void stop() {
67 // ((JPanel)getUI()).stop();
68
}
69
70     public void save() {
71     }
72
73     /**
74      * This method is hardwired for the current version of VAInstall
75      * which only accept hardcoded steps.
76      */

77     public JPopupMenu getPopupMenu() {
78
79         if(getModel().getRequiredList().get("Required Steps") == null) {
80             return null;
81         }
82
83         // construct the menu
84
if(menu == null) {
85             menu = new JPopupMenu();
86
87             JMenuItem item = new JMenuItem("Add Required Steps");
88             item.addActionListener(getActionFor("ProductAddRequiredStepsAction"));
89             menu.add(item);
90         }
91
92         return menu;
93     }
94
95 }
96
Popular Tags