01: package net.sourceforge.squirrel_sql.plugins.userscript.kernel;
02:
03: import net.sourceforge.squirrel_sql.fw.util.StringManager;
04: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
05:
06: import javax.swing.*;
07: import java.awt.*;
08:
09: public class ScriptPropertiesDialog extends JDialog {
10: private static final StringManager s_stringMgr = StringManagerFactory
11: .getStringManager(ScriptPropertiesDialog.class);
12:
13: JTextField txtName;
14: JTextField txtScriptClass;
15: JCheckBox chkShowInStandard;
16: JButton btnOk;
17: JButton btnCancel;
18: JButton btnCheck;
19:
20: public ScriptPropertiesDialog(Frame owner) {
21: // i18n[userscript.scriptProps=Script properties]
22: super (owner, s_stringMgr.getString("userscript.scriptProps"),
23: false);
24:
25: getContentPane().setLayout(new GridLayout(4, 1));
26:
27: JPanel pnl1 = new JPanel(new BorderLayout());
28: // i18n[userscript.scriptPropsName=Name]
29: JLabel lblName = new JLabel(s_stringMgr
30: .getString("userscript.scriptPropsName"));
31: pnl1.add(lblName, BorderLayout.WEST);
32: txtName = new JTextField();
33: pnl1.add(txtName, BorderLayout.CENTER);
34: getContentPane().add(pnl1);
35:
36: JPanel pnl2 = new JPanel(new BorderLayout());
37: // i18n[userscript1.scriptClass=Script class]
38: JLabel lblScriptClass = new JLabel(s_stringMgr
39: .getString("userscript.scriptClass1"));
40: pnl2.add(lblScriptClass, BorderLayout.WEST);
41: txtScriptClass = new JTextField();
42: pnl2.add(txtScriptClass, BorderLayout.CENTER);
43: getContentPane().add(pnl2);
44:
45: // i18n[userscript.showInStandardMenues1=Show in standard menues]
46: chkShowInStandard = new JCheckBox(s_stringMgr
47: .getString("userscript.showInStandardMenues1"));
48: getContentPane().add(chkShowInStandard);
49:
50: JPanel pnl3 = new JPanel();
51: pnl3.setLayout(new GridLayout(1, 3));
52: // i18n[userscript.propsDlgCheck=Check]
53: btnCheck = new JButton(s_stringMgr
54: .getString("userscript.propsDlgCheck"));
55: pnl3.add(btnCheck);
56: // i18n[userscript.propsDlgOk=OK]
57: btnOk = new JButton(s_stringMgr
58: .getString("userscript.propsDlgOk"));
59: pnl3.add(btnOk);
60: // i18n[userscript.propsDlgCancel=Cancel]
61: btnCancel = new JButton(s_stringMgr
62: .getString("userscript.propsDlgCancel"));
63: pnl3.add(btnCancel);
64: getContentPane().add(pnl3);
65:
66: lblScriptClass.setPreferredSize(new Dimension(lblScriptClass
67: .getPreferredSize().width + 5, lblScriptClass
68: .getPreferredSize().height));
69: lblName.setPreferredSize(new Dimension(lblScriptClass
70: .getPreferredSize().width, lblScriptClass
71: .getPreferredSize().height));
72:
73: setSize(300, 120);
74: }
75: }
|