001: package net.sourceforge.squirrel_sql.plugins.sqlbookmark;
002:
003: import net.sourceforge.squirrel_sql.fw.util.StringManager;
004: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
005:
006: import javax.swing.*;
007: import java.awt.*;
008: import java.awt.event.ActionEvent;
009: import java.awt.event.KeyEvent;
010:
011: public class BookmarkEditDialog extends JDialog {
012:
013: private static final StringManager s_stringMgr = StringManagerFactory
014: .getStringManager(BookmarkEditDialog.class);
015:
016: JTextField txtName;
017: JTextField txtDescription;
018: JTextArea txtSql;
019: JButton btnOk;
020: JButton btnCancel;
021: boolean cancelled = false;
022:
023: /**
024: * Create the entry dialog
025: *
026: * @param owner The frame the dialog will be centered in
027: */
028: public BookmarkEditDialog(Frame owner) {
029:
030: // i18n[sqlbookmark.editBookmark=Edit bookmark]
031: super (owner, s_stringMgr.getString("sqlbookmark.editBookmark"),
032: true);
033:
034: Container contentPane = getContentPane();
035: contentPane.setLayout(new GridBagLayout());
036:
037: GridBagConstraints gbc;
038:
039: gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0,
040: GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
041: new Insets(5, 5, 5, 5), 0, 0);
042: // i18n[sqlbookmark.prefName=Name:]
043: contentPane.add(new JLabel(s_stringMgr
044: .getString("sqlbookmark.prefName")), gbc);
045:
046: txtName = new JTextField(30);
047: gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0,
048: GridBagConstraints.NORTHEAST,
049: GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5),
050: 0, 0);
051: contentPane.add(txtName, gbc);
052:
053: gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0,
054: GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
055: new Insets(0, 5, 5, 5), 0, 0);
056: // i18n[sqlbookmark.desc=Description:]
057: contentPane.add(new JLabel(s_stringMgr
058: .getString("sqlbookmark.desc")), gbc);
059:
060: txtDescription = new JTextField();
061: gbc = new GridBagConstraints(1, 1, 1, 1, 0, 0,
062: GridBagConstraints.NORTHEAST,
063: GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 5),
064: 0, 0);
065: contentPane.add(txtDescription, gbc);
066:
067: gbc = new GridBagConstraints(0, 2, 2, 1, 0, 0,
068: GridBagConstraints.NORTHEAST,
069: GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5),
070: 0, 0);
071: // i18n[sqlbookmark.script=Script:]
072: contentPane.add(new JLabel(s_stringMgr
073: .getString("sqlbookmark.script")), gbc);
074:
075: txtSql = new JTextArea(5, 30);
076: gbc = new GridBagConstraints(0, 3, 2, 1, 1, 1,
077: GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH,
078: new Insets(0, 5, 5, 5), 0, 0);
079: contentPane.add(new JScrollPane(txtSql), gbc);
080:
081: // i18n[sqlbookmark.prefOk=OK]
082: btnOk = new JButton(s_stringMgr.getString("sqlbookmark.prefOk"));
083: gbc = new GridBagConstraints(0, 4, 1, 1, 0, 0,
084: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
085: new Insets(0, 5, 5, 5), 0, 0);
086: contentPane.add(btnOk, gbc);
087:
088: // i18n[sqlbookmark.prefClose=Close]
089: btnCancel = new JButton(s_stringMgr
090: .getString("sqlbookmark.prefClose"));
091: gbc = new GridBagConstraints(1, 4, 1, 1, 0, 0,
092: GridBagConstraints.NORTHEAST, GridBagConstraints.NONE,
093: new Insets(0, 5, 5, 5), 0, 0);
094: contentPane.add(btnCancel, gbc);
095:
096: getRootPane().setDefaultButton(btnOk);
097:
098: pack();
099: }
100: }
|