1 |
package appl.ext; |
2 |
|
3 |
import javax.swing.JFrame; |
4 |
import javax.swing.JPanel; |
5 |
import javax.swing.SwingUtilities; |
6 |
import javax.swing.WindowConstants; |
7 |
|
8 |
/** |
9 |
* Displays the {@link XuluConfig} in a frame based using the |
10 |
* {@link ConfigurationEditorEngine}. This class is independent of Xulu and may |
11 |
* be used separately. |
12 |
* |
13 |
* @author Dominik Appl |
14 |
*/ |
15 |
public class ConfigurationEditor extends JFrame { |
16 |
|
17 |
private static final long serialVersionUID = 1L; |
18 |
|
19 |
private JPanel jContentPane = null; |
20 |
|
21 |
/** |
22 |
* @param args |
23 |
*/ |
24 |
public static void main(String[] args) { |
25 |
// TODO Auto-generated method stub |
26 |
SwingUtilities.invokeLater(new Runnable() { |
27 |
public void run() { |
28 |
ConfigurationEditor thisClass = new ConfigurationEditor(); |
29 |
thisClass.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); |
30 |
thisClass.setVisible(true); |
31 |
} |
32 |
}); |
33 |
} |
34 |
|
35 |
/** |
36 |
* This is the default constructor |
37 |
*/ |
38 |
public ConfigurationEditor() { |
39 |
super(); |
40 |
initialize(); |
41 |
} |
42 |
|
43 |
/** |
44 |
* This method initializes this |
45 |
* |
46 |
* @return void |
47 |
*/ |
48 |
private void initialize() { |
49 |
this.setSize(621, 445); |
50 |
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
51 |
this.setContentPane(new ConfigurationEditorEngine().getGUI()); |
52 |
this.setTitle("Xulu Configuration Editor"); |
53 |
} |
54 |
|
55 |
public void dispose() { |
56 |
XuluConfig.getXuluConfig().store(); |
57 |
System.exit(0); |
58 |
} |
59 |
|
60 |
} |