KickJava   Java API By Example, From Geeks To Geeks.

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


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
import org.enhydra.tool.archive.ArchiveException;
28 import org.enhydra.tool.archive.JarPlan;
29 import org.enhydra.tool.archive.WarPlan;
30
31 //
32
import java.awt.*;
33 import java.beans.Beans JavaDoc;
34 import java.io.File JavaDoc;
35 import javax.swing.*;
36
37 //
38
public class LibraryPanel extends ArchivePanel {
39     private BorderLayout layoutMain = null;
40     private OneColumnFileSelector selectorPanel = null;
41
42     public LibraryPanel() {
43         try {
44             jbInit();
45         } catch (Exception JavaDoc ex) {
46             ex.printStackTrace();
47         }
48     }
49
50     public void readPlan(JarPlan plan) throws ArchiveException {
51         selectorPanel.setSelections(plan.getLibFiles());
52     }
53
54     public void writePlan(JarPlan plan) throws ArchiveException {
55         plan.setLibFiles(selectorPanel.getSelections());
56     }
57
58     public String JavaDoc getPageTitle() {
59         return "Libraries";
60     }
61
62     public String JavaDoc getInstructions() {
63         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
64
65         buf.append("Select libraries to include in archive");
66         return buf.toString();
67     }
68
69     // override ArchivePanel
70
protected void setWizard(ArchiveWizard wizard) {
71         super.setWizard(wizard);
72         selectorPanel.setWizard(wizard);
73     }
74
75     private void jbInit() throws Exception JavaDoc {
76         layoutMain =
77             (BorderLayout) Beans.instantiate(getClass().getClassLoader(),
78                                              BorderLayout.class.getName());
79         selectorPanel =
80             (OneColumnFileSelector) Beans.instantiate(getClass().getClassLoader(),
81                 OneColumnFileSelector.class.getName());
82         this.setLayout(layoutMain);
83         this.add(selectorPanel, BorderLayout.CENTER);
84     }
85
86 }
87
Popular Tags