01: package net.sourceforge.squirrel_sql.client.session.schemainfo;
02:
03: import net.sourceforge.squirrel_sql.fw.util.StringManager;
04: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
05: import net.sourceforge.squirrel_sql.fw.gui.MultipleLineLabel;
06: import net.sourceforge.squirrel_sql.client.resources.SquirrelResources;
07: import net.sourceforge.squirrel_sql.client.IApplication;
08:
09: import javax.swing.*;
10: import java.awt.*;
11:
12: public class SessionStartupTimeHintDlg extends JDialog {
13:
14: private static final StringManager s_stringMgr = StringManagerFactory
15: .getStringManager(SessionStartupTimeHintDlg.class);
16:
17: JCheckBox chkDontShowAgain;
18: JButton btnShowProps;
19: JButton btnClose;
20:
21: public SessionStartupTimeHintDlg(JFrame owner, IApplication app) {
22: // i18n[SessionStartupTimeHintDlg.title=Session startup time hint]
23: super (owner, s_stringMgr
24: .getString("SessionStartupTimeHintDlg.title"), true);
25:
26: getContentPane().setLayout(new GridBagLayout());
27:
28: GridBagConstraints gbc;
29:
30: gbc = new GridBagConstraints(0, 0, 1, 1, 1, 1,
31: GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
32: new Insets(10, 10, 5, 10), 0, 0);
33: // i18n[SessionStartupTimeHintDlg.text=This Session seems to take considerable time to load. You may configure Alias Schema Properties to improve startup performance.]
34: getContentPane().add(
35: new MultipleLineLabel(s_stringMgr
36: .getString("SessionStartupTimeHintDlg.text")),
37: gbc);
38:
39: gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0,
40: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
41: new Insets(5, 10, 5, 10), 0, 0);
42: // i18n[SessionStartupTimeHintDlg.dontShowAgain=Don't show this message again]
43: chkDontShowAgain = new JCheckBox(s_stringMgr
44: .getString("SessionStartupTimeHintDlg.dontShowAgain"));
45: getContentPane().add(chkDontShowAgain, gbc);
46:
47: gbc = new GridBagConstraints(0, 2, 1, 1, 0, 0,
48: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
49: new Insets(5, 5, 5, 5), 0, 0);
50: getContentPane().add(createButtonPanel(app), gbc);
51: }
52:
53: private JPanel createButtonPanel(IApplication app) {
54: JPanel ret = new JPanel();
55: ret.setLayout(new GridBagLayout());
56:
57: GridBagConstraints gbc;
58:
59: gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0,
60: GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
61: new Insets(5, 5, 5, 5), 0, 0);
62: // i18n[SessionStartupTimeHintDlg.showAliasProps=Open Alias Schema Properties]
63: btnShowProps = new JButton(s_stringMgr
64: .getString("SessionStartupTimeHintDlg.showAliasProps"));
65: btnShowProps.setIcon(app.getResources().getIcon(
66: SquirrelResources.IImageNames.ALIAS_PROPERTIES));
67: ret.add(btnShowProps, gbc);
68:
69: gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0,
70: GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
71: new Insets(5, 5, 5, 5), 0, 0);
72: // i18n[SessionStartupTimeHintDlg.close=Close]
73: btnClose = new JButton(s_stringMgr
74: .getString("SessionStartupTimeHintDlg.close"));
75: ret.add(btnClose, gbc);
76:
77: return ret;
78: }
79: }
|