01: package net.sourceforge.squirrel_sql.plugins.oracle;
02:
03: import net.sourceforge.squirrel_sql.client.gui.db.aliasproperties.IAliasPropertiesPanelController;
04: import net.sourceforge.squirrel_sql.fw.util.StringManager;
05: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
06:
07: import java.awt.*;
08: import java.awt.event.ActionListener;
09: import java.awt.event.ActionEvent;
10:
11: public class OracleAliasPrefsPanelController implements
12: IAliasPropertiesPanelController {
13: private static final StringManager s_stringMgr = StringManagerFactory
14: .getStringManager(OracleAliasPrefsPanelController.class);
15:
16: private OracleAliasPrefsPanel _panel;
17: private OracleAliasPrefs _prefs;
18:
19: OracleAliasPrefsPanelController(OracleAliasPrefs prefs) {
20: _panel = new OracleAliasPrefsPanel();
21: _prefs = prefs;
22:
23: _panel.radLoadAccessibleSchemasExceptSYS.setSelected(_prefs
24: .isLoadAccessibleSchemasExceptSYS());
25: _panel.radLoadAccessibleSchemasAndSYS.setSelected(_prefs
26: .isLoadAccessibleSchemasAndSYS());
27: _panel.radLoadAllSchemas.setSelected(_prefs.isLoadAllSchemas());
28:
29: _panel.btnApplyNow.addActionListener(new ActionListener() {
30: public void actionPerformed(ActionEvent e) {
31: applyChanges();
32: }
33: });
34: }
35:
36: public void applyChanges() {
37: _prefs
38: .setLoadAccessibleSchemasExceptSYS(_panel.radLoadAccessibleSchemasExceptSYS
39: .isSelected());
40: _prefs
41: .setLoadAccessibleSchemasAndSYS(_panel.radLoadAccessibleSchemasAndSYS
42: .isSelected());
43: _prefs.setLoadAllSchemas(_panel.radLoadAllSchemas.isSelected());
44: }
45:
46: public String getTitle() {
47: // i18n[OraclePrefsPanelController.title=Oracle]
48: return s_stringMgr
49: .getString("OraclePrefsPanelController.title");
50: }
51:
52: public String getHint() {
53: // i18n[OraclePrefsPanelController.hint=Oracle Plugin preferences]
54: return s_stringMgr.getString("OraclePrefsPanelController.hint");
55: }
56:
57: public Component getPanelComponent() {
58: return _panel;
59: }
60:
61: }
|