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.std; |
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.std.StdI18n.i18n; |
36 |
|
37 |
|
38 |
/** |
39 |
* |
40 |
* @author Grigor Iliev |
41 |
*/ |
42 |
public class JSDbDescriptionDlg extends OkCancelDialog { |
43 |
private final JTextField tfDesc = new JTextField(); |
44 |
|
45 |
/** |
46 |
* Creates a new instance of <code>JSDbDescriptionDlg</code> |
47 |
*/ |
48 |
public |
49 |
JSDbDescriptionDlg(Frame owner) { |
50 |
super(owner, i18n.getLabel("JSDbDescriptionDlg.title")); |
51 |
initDbDescriptionDlg(); |
52 |
} |
53 |
|
54 |
/** |
55 |
* Creates a new instance of <code>JSDbDescriptionDlg</code> |
56 |
*/ |
57 |
public |
58 |
JSDbDescriptionDlg(Dialog owner) { |
59 |
super(owner, i18n.getLabel("JSDbDescriptionDlg.title")); |
60 |
initDbDescriptionDlg(); |
61 |
} |
62 |
|
63 |
private void |
64 |
initDbDescriptionDlg() { |
65 |
setMainPane(tfDesc); |
66 |
setMinimumSize(getPreferredSize()); |
67 |
setResizable(true); |
68 |
} |
69 |
|
70 |
protected void |
71 |
onOk() { |
72 |
if(!btnOk.isEnabled()) return; |
73 |
setCancelled(false); |
74 |
setVisible(false); |
75 |
} |
76 |
|
77 |
protected void |
78 |
onCancel() { setVisible(false); } |
79 |
|
80 |
public String |
81 |
getDescription() { return tfDesc.getText(); } |
82 |
|
83 |
public void |
84 |
setDescription(String s) { tfDesc.setText(s); } |
85 |
} |