KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ixenon > free > nodes > PrefixRoot


1 /* $Id$
2  *
3  * Copyright (c) 1999 Xenonsoft Limited. All Rights Reserved.
4  *
5  * This software is protected by copyright. You are hereby notified from
6  * now by reading this message. This software is also the confidential
7  * and proprietary information of Xenonsoft Limited. ("Confidential
8  * Information").
9  *
10  * This software is distributed under the Xenonsoft Public end user
11  * License ("XPeL"), where the machine-readable source code is provided
12  * under the "Open Source" model.
13  * For more information, please read the file "LICENSE-XPL.txt"
14  */

15
16 //
17
// DESCRIPTION
18
//
19
// Peter Pilgrim
20
// Sun Jan 17 19:28:41 GMT 1999
21
//
22
// RCS HEADER ``PrefixRoot.java''
23
//
24
// $Author$
25
// $Date$
26
// $Source$
27
// $Revision$ $State$ $Locker$
28
//
29

30 package ixenon.free.nodes;
31
32 import java.io.*;
33 import java.util.*;
34 import java.awt.*;
35 import java.awt.event.*;
36
37 import javax.swing.*; // For JTree
38
import javax.swing.event.*; //
39
import javax.swing.tree.*; // for MutableTreeNode
40

41 import ixenon.free.install.*; // for FreeInstallerApplication
42
import ixenon.free.uninstall.*; // for Uninstallable
43

44 /**
45  * An <code>Installable</code> tree node that represents the prefix root.
46  * This object class is alway a <B>root</B> in the tree model.
47  */

48 public class PrefixRoot extends AbstractInstallable
49 implements Installable
50 {
51     protected String JavaDoc nodeName;
52     protected File rootDirectory;
53     
54     /**
55      * Construct a prefix root installable
56      * @param nodeName the name of the installable node
57      * @param rootdir the root directory file
58      */

59     public PrefixRoot( String JavaDoc nodeName, String JavaDoc rootdir )
60     {
61     this(nodeName, new File(rootdir) );
62     }
63
64     /**
65      * Construct a prefix root installable
66      * @param nodeName the name of the installable node
67      * @param rootdir the root directory
68      */

69     public PrefixRoot( String JavaDoc nodeName, File rootdir )
70     {
71     super( nodeName, null, true /*allowsChildren*/ );
72     rootDirectory = rootdir;
73     }
74     
75     /** returns the root directory as a <code>File</code> */
76     public File getRootDirectory()
77     {
78     return (rootDirectory);
79     }
80     
81     /**
82      * create or retrieve the visual component of the installable
83      * if one exists. Otherwise return null.
84      */

85     public Component getVisualComponent()
86     {
87     return (null);
88     }
89     
90     /**
91      * create or retrieve the configurable component of the installable
92      * if one exists. Otherwise return null object.
93      */

94     public Component getConfigurableComponent()
95     {
96     return (null);
97     }
98
99     /**
100      * method to perform the installation of content
101      * This method does nothing more but print the root directory
102      * to the progress frame panel.
103      *
104      * @exception <code>InstallException</code> if there is an
105      * problem trying to install the entity.
106      */

107     public void install() throws InstallException
108     {
109     FreeInstallerApplication theApp =
110         FreeInstallerApplication.getInstance();
111     theApp.printInfo( "Prefix root directory: "+rootDirectory);
112     }
113
114     /**
115      * method to perform the cleanup of content if cancelled, or aborted
116      */

117     public void cleanup() throws InstallException
118     {
119     // empty
120
}
121 }
122
123 // fini
124
Popular Tags