KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > common > importer > ImporterPanel


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * 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.kelp.common.importer;
24
25 // Kelp imports
26
import org.enhydra.kelp.common.ValidationException;
27 import org.enhydra.kelp.common.ValidationUtil;
28 import org.enhydra.kelp.common.importer.ImportPaths;
29
30 // Standard imports
31
import javax.swing.*;
32 import javax.swing.border.*;
33 import java.awt.*;
34 import java.awt.event.ActionEvent JavaDoc;
35 import java.awt.event.ActionListener JavaDoc;
36 import java.beans.*;
37 import java.io.File JavaDoc;
38 import java.util.Properties JavaDoc;
39
40 /**
41  * Panel for entering the default options: project name, package
42  * and destination.
43  *
44  * @author Paul Mahar
45  */

46 public class ImporterPanel extends JPanel {
47     transient private ImportPaths paths;
48
49     // strings not to be resourced
50
private final String JavaDoc WRITE_OPTIONS_EXCEPTION =
51         "writeOptions() not implemented"; // nores
52
private final String JavaDoc VALIDATE_OPTIONS_EXCEPTION =
53         "validateOptions() not implemented"; // nores
54
private final String JavaDoc PAGE_TITLE = "PAGE TITLE"; // nores
55
private final String JavaDoc INSTRUCTIONS = "INSTRUCTIONS"; // nores
56

57     public void setPaths(ImportPaths p) {
58         paths = p;
59         readOptions();
60     }
61
62     public ImportPaths getPaths() {
63         return paths;
64     }
65
66     public void activated() {}
67
68     public void checkPage() throws ValidationException {
69         writeOptions();
70     }
71
72     /**
73      * Read project name, package and destination values from the
74      * option set into the swing controls.
75      *
76      * @exception GeneratorException
77      * Thrown if unable to update Swing controls with option set values.
78      */

79     public void readOptions() {}
80
81     /**
82      * Write project name, package and destination values from the
83      * swing controls into the option set.
84      *
85      * @exception GeneratorException
86      * Thrown if unable to update option set from Swing control values.
87      */

88     public void writeOptions() throws ValidationException {
89         throw new ValidationException(WRITE_OPTIONS_EXCEPTION);
90     }
91
92     /**
93      * Validate project name, package and destination values
94      * in the swing controls.
95      *
96      * @exception ValidationException
97      * Thrown if swing control values are not valid for the
98      * current option set.
99      */

100     public void validateOptions() throws ValidationException {
101         throw new ValidationException(VALIDATE_OPTIONS_EXCEPTION);
102     }
103
104     /**
105      * Get the title to use on the current page.
106      *
107      * @return
108      * A string to place at the top of a CodeGen wizard panel.
109      */

110     public String JavaDoc getPageTitle() {
111         return PAGE_TITLE;
112     }
113
114     /**
115      * Get the instructions for entering option values for the
116      * current page.
117      *
118      * @return
119      * A string to place below the page title.
120      */

121     public String JavaDoc getInstructions() {
122         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
123
124         buf.append(INSTRUCTIONS);
125         return buf.toString();
126     }
127
128 }
129
Popular Tags