01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10: package de.uka.ilkd.key.util.install;
11:
12: import java.awt.BorderLayout;
13:
14: import javax.swing.Box;
15: import javax.swing.JFileChooser;
16: import javax.swing.JOptionPane;
17: import javax.swing.JTextArea;
18:
19: /** The installer frame consists of a header, the content pane and a
20: * button panel. This content pane is an instance of this class.
21: */
22: public class LibrarySettingsPane extends InstallationPane {
23:
24: private InstallationPathChooser chooser = null;
25:
26: public LibrarySettingsPane(KeYInstaller installer) {
27: super ("Library", installer);
28: setup();
29: }
30:
31: private void setup() {
32: setLayout(new BorderLayout());
33: Box box = Box.createVerticalBox();
34:
35: JTextArea text = new JTextArea(5, 30);
36: text.setLineWrap(true);
37: text.setWrapStyleWord(true);
38: text.setText("KeY makes use of several external libraries. "
39: + "You can download them from the KeY-Homepage: "
40: + "http://www.key-project.org/download/3rdparty.html\n"
41: + "Please make sure that all required libraries are "
42: + "located in the indicated library path.");
43: text.setEditable(false);
44: text.setBackground(getBackground());
45: box.add(text);
46:
47: chooser = new InstallationPathChooser("Library Path", keyLib(),
48: JFileChooser.DIRECTORIES_ONLY);
49: box.add(chooser);
50:
51: add(box, BorderLayout.NORTH);
52: }
53:
54: public String path() {
55: return chooser.getPath();
56: }
57:
58: public String path(String path) {
59: return chooser.setPath(path);
60: }
61:
62: public boolean updateModel() {
63: if (!chooser.updateModel()) {
64: JOptionPane.showMessageDialog(null,
65: "Library is not a directory.",
66: "Wrong Library Directory",
67: JOptionPane.ERROR_MESSAGE);
68: return false;
69: }
70: keyLib(path());
71: return true;
72: }
73:
74: }
|