01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: * Paul Mahar
21: *
22: */
23: package org.enhydra.tool.archive.wizard;
24:
25: //
26: // ToolBox imports
27: //
28: import org.enhydra.tool.ToolBoxInfo;
29: import org.enhydra.tool.archive.JarPlan;
30: import org.enhydra.tool.archive.ArchiveException;
31: import org.enhydra.tool.archive.ArchiveTool;
32: import org.enhydra.tool.common.PathHandle;
33: import org.enhydra.tool.common.SwingUtil;
34:
35: //
36: // Standard imports
37: //
38: import javax.swing.*;
39: import javax.swing.border.*;
40: import java.awt.*;
41: import java.awt.event.ActionEvent;
42: import java.awt.event.ActionListener;
43: import java.io.File;
44: import java.util.ArrayList;
45: import java.util.ResourceBundle;
46: import java.util.jar.Manifest;
47: import java.util.jar.JarInputStream;
48:
49: /**
50: * The ArchiveDialog defines a dialog for presenting
51: * archive wizards.
52: */
53: public class E3Type extends ArchiveType {
54: public final static String EXT = "jar";
55:
56: //
57: protected final String getSelectionName() {
58: return "Enhydra Application";
59: }
60:
61: protected final String getExtension() {
62: return EXT;
63: }
64:
65: protected final String getType() {
66: return "e3-jar";
67: }
68:
69: protected final String getDescription() {
70: StringBuffer buf = new StringBuffer();
71:
72: buf.append("Create a jar for an Enhydra super servlet. ");
73: buf.append("Super servlet jars are compatable with Enhydra 5.");
74: return buf.toString();
75: }
76:
77: protected void initPanels() throws ArchiveException {
78: E3FilePanel filePanel = new E3FilePanel();
79: ClassesPanel classesPanel = new ClassesPanel();
80: ArchivePanel[] newPanels = new ArchivePanel[2];
81:
82: newPanels[0] = filePanel;
83: newPanels[1] = classesPanel;
84: setWizardPanels(newPanels);
85: }
86:
87: protected void initPlan() throws ArchiveException {
88: PathHandle path = null;
89:
90: setPlan(new JarPlan());
91: getPlan().setArchivePath(getDefaultArchivePath());
92: path = PathHandle.createPathHandle(getPlan().getArchivePath());
93: if (path.isFile()) {
94: readArchive(getPlan().getArchivePath());
95: }
96: }
97:
98: }
|