Source Code Cross Referenced for OraclePluginPreferencesPanel.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » plugins » oracle » prefs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.plugins.oracle.prefs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2007 Rob Manning
003:         * manningr@users.sourceforge.net
004:         *
005:         * This library is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU Lesser General Public
007:         * License as published by the Free Software Foundation; either
008:         * version 2.1 of the License, or (at your option) any later version.
009:         *
010:         * This library is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:         * Lesser General Public License for more details.
014:         *
015:         * You should have received a copy of the GNU Lesser General Public
016:         * License along with this library; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
018:         */
019:        package net.sourceforge.squirrel_sql.plugins.oracle.prefs;
020:
021:        import java.awt.GridBagConstraints;
022:        import java.awt.Insets;
023:
024:        import javax.swing.JCheckBox;
025:        import javax.swing.JPanel;
026:
027:        import net.sourceforge.squirrel_sql.client.plugin.PluginQueryTokenizerPreferencesManager;
028:        import net.sourceforge.squirrel_sql.client.plugin.gui.PluginQueryTokenizerPreferencesPanel;
029:        import net.sourceforge.squirrel_sql.fw.preferences.IQueryTokenizerPreferenceBean;
030:        import net.sourceforge.squirrel_sql.fw.util.StringManager;
031:        import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
032:
033:        /**
034:         * Adds the preference widget for allowing the user to specify whether or not 
035:         * Oracle 10g recycle bin tables should be hidden.
036:         *  
037:         * @author manningr 
038:         */
039:        public class OraclePluginPreferencesPanel extends
040:                PluginQueryTokenizerPreferencesPanel {
041:
042:            private static final long serialVersionUID = 1L;
043:
044:            /** Internationalized strings for this class. */
045:            private static final StringManager s_stringMgr = StringManagerFactory
046:                    .getStringManager(OraclePluginPreferencesPanel.class);
047:
048:            static interface i18n {
049:                //i18n[OraclePluginPreferencesPanel.hideRecycleBinCheckBoxLabel=Remove 
050:                //Recycle Bin Tables from the Object Tree]
051:                String HIDE_RECYCLE_BIN_CB_LABEL = s_stringMgr
052:                        .getString("OraclePluginPreferencesPanel.hideRecycleBinCheckBoxLabel");
053:
054:                //i18n[OraclePluginPreferencesPanel.hideRecycleBinCheckBoxToolTip=Recycle
055:                //Bin tables are a Flashback Database Option in Oracle 10g]
056:                String HIDE_RECYCLE_BIN_CB_TT = s_stringMgr
057:                        .getString("OraclePluginPreferencesPanel.hideRecycleBinCheckBoxToolTip");
058:
059:                //i18n[OraclePluginPreferencesPanel.showErrorOffsetLabel=Show Syntax 
060:                //Error Offset in SQL Editor]
061:                String SHOW_ERROR_OFFSET_LABEL = s_stringMgr
062:                        .getString("OraclePluginPreferencesPanel.showErrorOffsetLabel");
063:
064:                //i18n[OraclePluginPreferencesPanel.showErrorOffsetTT=Creates and uses a 
065:                //user-defined function that is used to determine the syntax error token]
066:                String SHOW_ERROR_OFFSET_TT = s_stringMgr
067:                        .getString("OraclePluginPreferencesPanel.showErrorOffsetTT");
068:            }
069:
070:            /** The checkbox for specifying exclusion of recycle bin tables */
071:            private final static JCheckBox excludeRecycleBinTablesCheckBox = new JCheckBox(
072:                    i18n.HIDE_RECYCLE_BIN_CB_LABEL);
073:
074:            private final static JCheckBox showErrorOffsetCheckBox = new JCheckBox(
075:                    i18n.SHOW_ERROR_OFFSET_LABEL);
076:
077:            /**
078:             * Construct a new PreferencesPanel.
079:             * @param prefs
080:             * @param databaseName
081:             */
082:            public OraclePluginPreferencesPanel(
083:                    PluginQueryTokenizerPreferencesManager prefsMgr) {
084:                super (prefsMgr, "Oracle");
085:            }
086:
087:            /**
088:             * @see net.sourceforge.squirrel_sql.client.plugin.gui.PluginQueryTokenizerPreferencesPanel#createTopPanel()
089:             */
090:            @Override
091:            protected JPanel createTopPanel() {
092:                JPanel result = super .createTopPanel();
093:                int lastY = super .lastY;
094:                addRecycleBinCheckBox(result, 0, lastY++);
095:                addShowErrorOffsetCheckBox(result, 0, lastY++);
096:                return result;
097:            }
098:
099:            private void addRecycleBinCheckBox(JPanel result, int col, int row) {
100:                GridBagConstraints c = new GridBagConstraints();
101:                c.gridx = col;
102:                c.gridy = row;
103:                c.gridwidth = 2; // Span across two columns
104:                c.anchor = GridBagConstraints.WEST;
105:                c.insets = new Insets(5, 5, 0, 0);
106:                excludeRecycleBinTablesCheckBox
107:                        .setToolTipText(i18n.HIDE_RECYCLE_BIN_CB_TT);
108:                result.add(excludeRecycleBinTablesCheckBox, c);
109:            }
110:
111:            private void addShowErrorOffsetCheckBox(JPanel result, int col,
112:                    int row) {
113:                GridBagConstraints c = new GridBagConstraints();
114:                c.gridx = col;
115:                c.gridy = row;
116:                c.gridwidth = 2; // Span across two columns
117:                c.anchor = GridBagConstraints.WEST;
118:                c.insets = new Insets(5, 5, 0, 0);
119:                showErrorOffsetCheckBox
120:                        .setToolTipText(i18n.SHOW_ERROR_OFFSET_TT);
121:                result.add(showErrorOffsetCheckBox, c);
122:            }
123:
124:            /**
125:             * @see net.sourceforge.squirrel_sql.client.plugin.gui.PluginQueryTokenizerPreferencesPanel#loadData()
126:             */
127:            @Override
128:            protected void loadData() {
129:                super .loadData();
130:                IQueryTokenizerPreferenceBean prefs = _prefsManager
131:                        .getPreferences();
132:                OraclePreferenceBean oraclePrefs = (OraclePreferenceBean) prefs;
133:                excludeRecycleBinTablesCheckBox.setSelected(oraclePrefs
134:                        .isExcludeRecycleBinTables());
135:                showErrorOffsetCheckBox.setSelected(oraclePrefs
136:                        .isShowErrorOffset());
137:            }
138:
139:            /**
140:             * @see net.sourceforge.squirrel_sql.client.plugin.gui.PluginQueryTokenizerPreferencesPanel#save()
141:             */
142:            @Override
143:            protected void save() {
144:                IQueryTokenizerPreferenceBean prefs = _prefsManager
145:                        .getPreferences();
146:                OraclePreferenceBean oraclePrefs = (OraclePreferenceBean) prefs;
147:                oraclePrefs
148:                        .setExcludeRecycleBinTables(excludeRecycleBinTablesCheckBox
149:                                .isSelected());
150:                oraclePrefs.setShowErrorOffset(showErrorOffsetCheckBox
151:                        .isSelected());
152:                super.save();
153:            }
154:
155:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.