01: /*
02: * $RCSfile: ProductAddRequiredStepsAction.java,v $
03: * @modification $Date: 2001/09/28 19:31:19 $
04: * @version $Id: ProductAddRequiredStepsAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.action;
09:
10: import com.memoire.vainstall.VAGlobals;
11: import com.memoire.vainstall.builder.*;
12: import com.memoire.vainstall.builder.util.*;
13:
14: import java.util.Enumeration;
15:
16: import javax.swing.JTree;
17: import javax.swing.tree.DefaultTreeModel;
18: import javax.swing.tree.DefaultMutableTreeNode;
19:
20: /**
21: * This action adds all required steps for a product.
22: * The action may be obsolete when we have truely configurable
23: * steps implemented in VAInstall.
24: *
25: * @see com.memoire.vainstall.builder.util.AbstractVAIProductAction
26: *
27: * @author Henrik Falk
28: * @version $Id: ProductAddRequiredStepsAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
29: */
30: public class ProductAddRequiredStepsAction extends
31: AbstractVAIProductAction {
32:
33: /**
34: * Default constructor
35: */
36: public ProductAddRequiredStepsAction() {
37: super ();
38: }
39:
40: /**
41: * Implements the runnit method
42: */
43: public void runnit() {
44:
45: ProductBaseNode root = (ProductBaseNode)getRootNode();
46:
47: Enumeration enum = root.depthFirstEnumeration();
48: while (enum.hasMoreElements() == true) {
49: DefaultMutableTreeNode node = (DefaultMutableTreeNode)enum.nextElement();
50: if(node instanceof ProductStepsNode) {
51:
52: ProductStepWelcomeNode welcome = new ProductStepWelcomeNode();
53: welcome.initialize(getController());
54: node.add(welcome);
55: getModel().addStep("welcome");
56:
57: ProductStepLicenseNode license = new ProductStepLicenseNode();
58: license.initialize(getController());
59: node.add(license);
60: getModel().addStep("license");
61:
62: ProductStepReadmeNode readme = new ProductStepReadmeNode();
63: readme.initialize(getController());
64: node.add(readme);
65: getModel().addStep("readme");
66:
67: ProductStepUpgradeNode upgrade = new ProductStepUpgradeNode();
68: upgrade.initialize(getController());
69: node.add(upgrade);
70: getModel().addStep("upgrade");
71:
72: ProductStepDirectoryNode directory = new ProductStepDirectoryNode();
73: directory.initialize(getController());
74: node.add(directory);
75: getModel().addStep("directory");
76:
77: ProductStepInstallNode installation = new ProductStepInstallNode();
78: installation.initialize(getController());
79: node.add(installation);
80: getModel().addStep("install");
81:
82: ProductStepShortcutsNode shortcut = new ProductStepShortcutsNode();
83: shortcut.initialize(getController());
84: node.add(shortcut);
85: getModel().addStep("shortcut");
86:
87: ProductStepEndNode end = new ProductStepEndNode();
88: end.initialize(getController());
89: node.add(end);
90: getModel().addStep("end");
91:
92: ((DefaultTreeModel)getTree().getModel()).nodeStructureChanged(node);
93: }
94: }
95:
96: getTree().expandPath(getTree().getSelectionPath());
97: getModel().removeRequirement("Required Steps");
98: }
99: }
|