KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > tool > archive > wizard > E3Type


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  * Paul Mahar
22  *
23  */

24 package org.enhydra.tool.archive.wizard;
25
26 //
27
// ToolBox imports
28
//
29
import org.enhydra.tool.ToolBoxInfo;
30 import org.enhydra.tool.archive.JarPlan;
31 import org.enhydra.tool.archive.ArchiveException;
32 import org.enhydra.tool.archive.ArchiveTool;
33 import org.enhydra.tool.common.PathHandle;
34 import org.enhydra.tool.common.SwingUtil;
35
36 //
37
// Standard imports
38
//
39
import javax.swing.*;
40 import javax.swing.border.*;
41 import java.awt.*;
42 import java.awt.event.ActionEvent JavaDoc;
43 import java.awt.event.ActionListener JavaDoc;
44 import java.io.File JavaDoc;
45 import java.util.ArrayList JavaDoc;
46 import java.util.ResourceBundle JavaDoc;
47 import java.util.jar.Manifest JavaDoc;
48 import java.util.jar.JarInputStream JavaDoc;
49
50 /**
51  * The ArchiveDialog defines a dialog for presenting
52  * archive wizards.
53  */

54 public class E3Type extends ArchiveType {
55     public final static String JavaDoc EXT = "jar";
56     //
57
protected final String JavaDoc getSelectionName() {
58         return "Enhydra Application";
59     }
60
61     protected final String JavaDoc getExtension() {
62         return EXT;
63     }
64
65     protected final String JavaDoc getType() {
66         return "e3-jar";
67     }
68
69
70     protected final String JavaDoc getDescription() {
71         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
72
73         buf.append("Create a jar for an Enhydra super servlet. ");
74         buf.append("Super servlet jars are compatable with Enhydra 5.");
75         return buf.toString();
76     }
77
78     protected void initPanels() throws ArchiveException {
79         E3FilePanel filePanel = new E3FilePanel();
80         ClassesPanel classesPanel = new ClassesPanel();
81         ArchivePanel[] newPanels = new ArchivePanel[2];
82
83         newPanels[0] = filePanel;
84         newPanels[1] = classesPanel;
85         setWizardPanels(newPanels);
86     }
87
88     protected void initPlan() throws ArchiveException {
89         PathHandle path = null;
90
91         setPlan(new JarPlan());
92         getPlan().setArchivePath(getDefaultArchivePath());
93         path = PathHandle.createPathHandle(getPlan().getArchivePath());
94         if (path.isFile()) {
95             readArchive(getPlan().getArchivePath());
96         }
97     }
98
99 }
100
Popular Tags