/[svn]/jsampler/trunk/src/org/jsampler/view/classic/DbDescriptionDlg.java
ViewVC logotype

Contents of /jsampler/trunk/src/org/jsampler/view/classic/DbDescriptionDlg.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1205 - (show annotations) (download)
Thu May 24 21:55:41 2007 UTC (16 years, 10 months ago) by iliev
File size: 2073 byte(s)
* upgrading to version 0.5a

1 /*
2 * JSampler - a java front-end for LinuxSampler
3 *
4 * Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com>
5 *
6 * This file is part of JSampler.
7 *
8 * JSampler is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 *
12 * JSampler is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with JSampler; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23 package org.jsampler.view.classic;
24
25 import java.awt.Dialog;
26 import java.awt.Frame;
27
28 import javax.swing.Box;
29 import javax.swing.BoxLayout;
30 import javax.swing.JPanel;
31 import javax.swing.JTextField;
32
33 import net.sf.juife.OkCancelDialog;
34
35 import static org.jsampler.view.classic.ClassicI18n.i18n;
36
37
38 /**
39 *
40 * @author Grigor Iliev
41 */
42 public class DbDescriptionDlg extends OkCancelDialog {
43 private final JTextField tfDesc = new JTextField();
44
45 /** Creates a new instance of <code>DbDescriptionDlg</code> */
46 public
47 DbDescriptionDlg(Frame owner) {
48 super(owner, i18n.getLabel("DbDescriptionDlg.title"));
49 initDbDescriptionDlg();
50 }
51
52 /** Creates a new instance of <code>DbDescriptionDlg</code> */
53 public
54 DbDescriptionDlg(Dialog owner) {
55 super(owner, i18n.getLabel("DbDescriptionDlg.title"));
56 initDbDescriptionDlg();
57 }
58
59 private void
60 initDbDescriptionDlg() {
61 setMainPane(tfDesc);
62 setMinimumSize(getPreferredSize());
63 setResizable(true);
64 }
65
66 protected void
67 onOk() {
68 if(!btnOk.isEnabled()) return;
69 setCancelled(false);
70 setVisible(false);
71 }
72
73 protected void
74 onCancel() { setVisible(false); }
75
76 public String
77 getDescription() { return tfDesc.getText(); }
78
79 public void
80 setDescription(String s) { tfDesc.setText(s); }
81 }

  ViewVC Help
Powered by ViewVC