1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 package org.dbforms.devgui;
30
31 import javax.swing.*;
32
33
34
35 /***
36 * DOCUMENT ME!
37 *
38 * @author Joachim Peer
39 * @version
40 */
41 public abstract class AbstractPropertyPanel extends javax.swing.JPanel
42 implements PropertyNames {
43 /*** DOCUMENT ME! */
44 protected ProjectData projectData;
45
46 /***
47 * Creates a new PropertyPanel object.
48 *
49 * @param projectData DOCUMENT ME!
50 */
51 public AbstractPropertyPanel(ProjectData projectData) {
52 this.projectData = projectData;
53
54
55 }
56
57 /***
58 * DOCUMENT ME!
59 *
60 * @param projectData DOCUMENT ME!
61 */
62 public abstract void setNewProjectData(ProjectData projectData);
63
64
65 /***
66 * DOCUMENT ME!
67 *
68 * @param tf DOCUMENT ME!
69 * @param p DOCUMENT ME!
70 */
71 protected void addAFocusListener(final JTextField tf,
72 final String p) {
73 tf.addFocusListener(new java.awt.event.FocusAdapter() {
74 public void focusLost(java.awt.event.FocusEvent e) {
75 projectData.setProperty(p, tf.getText());
76 }
77 });
78 }
79
80
81 /***
82 * DOCUMENT ME!
83 *
84 * @param e DOCUMENT ME!
85 */
86 protected void showExceptionDialog(Exception e) {
87 JOptionPane.showMessageDialog(this,
88 "An exception occurred:\n\n" + e.toString()
89 + "\n", "Exception",
90 JOptionPane.ERROR_MESSAGE);
91 }
92 }