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.JScrollPane; |
32 |
import javax.swing.JTextArea; |
33 |
|
34 |
import net.sf.juife.OkCancelDialog; |
35 |
|
36 |
import static org.jsampler.view.std.StdI18n.i18n; |
37 |
|
38 |
|
39 |
/** |
40 |
* |
41 |
* @author Grigor Iliev |
42 |
*/ |
43 |
public class JSDbDescriptionDlg extends OkCancelDialog { |
44 |
private final JTextArea taDesc = new JTextArea(); |
45 |
|
46 |
/** |
47 |
* Creates a new instance of <code>JSDbDescriptionDlg</code> |
48 |
*/ |
49 |
public |
50 |
JSDbDescriptionDlg(Frame owner) { |
51 |
super(owner, i18n.getLabel("JSDbDescriptionDlg.title")); |
52 |
initDbDescriptionDlg(); |
53 |
} |
54 |
|
55 |
/** |
56 |
* Creates a new instance of <code>JSDbDescriptionDlg</code> |
57 |
*/ |
58 |
public |
59 |
JSDbDescriptionDlg(Dialog owner) { |
60 |
super(owner, i18n.getLabel("JSDbDescriptionDlg.title")); |
61 |
initDbDescriptionDlg(); |
62 |
} |
63 |
|
64 |
private void |
65 |
initDbDescriptionDlg() { |
66 |
taDesc.setLineWrap(true); |
67 |
taDesc.setWrapStyleWord(true); |
68 |
JScrollPane sp = new JScrollPane(taDesc); |
69 |
sp.setPreferredSize(new java.awt.Dimension(300, 60)); |
70 |
setMainPane(sp); |
71 |
setMinimumSize(getPreferredSize()); |
72 |
setResizable(true); |
73 |
} |
74 |
|
75 |
protected void |
76 |
onOk() { |
77 |
if(!btnOk.isEnabled()) return; |
78 |
setCancelled(false); |
79 |
setVisible(false); |
80 |
} |
81 |
|
82 |
protected void |
83 |
onCancel() { setVisible(false); } |
84 |
|
85 |
public String |
86 |
getDescription() { return taDesc.getText(); } |
87 |
|
88 |
public void |
89 |
setDescription(String s) { taDesc.setText(s); } |
90 |
} |