View Javadoc

1   /*
2    * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/devgui/AbstractPropertyPanel.java,v 1.1 2005/11/30 20:31:17 hkollmann Exp $
3    * $Revision: 1.1 $
4    * $Date: 2005/11/30 20:31:17 $
5    *
6    * DbForms - a Rapid Application Development Framework
7    * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8    *
9    * This library is free software; you can redistribute it and/or
10   * modify it under the terms of the GNU Lesser General Public
11   * License as published by the Free Software Foundation; either
12   * version 2.1 of the License, or (at your option) any later version.
13   *
14   * This library is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17   * Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this library; if not, write to the Free Software
21   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22   */
23  
24  /*
25   * DbPanel.java
26   *
27   * Created on 26. April 2001, 15:42
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        //ToolTipManager.sharedInstance().registerComponent(this);
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  }