Source Code Cross Referenced for CodeCompletionPreferencesPanel.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » plugins » codecompletion » 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.codecompletion.prefs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sourceforge.squirrel_sql.plugins.codecompletion.prefs;
002:
003:        import net.sourceforge.squirrel_sql.fw.util.StringManager;
004:        import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
005:        import net.sourceforge.squirrel_sql.fw.gui.MultipleLineLabel;
006:
007:        import javax.swing.*;
008:        import java.awt.*;
009:        import java.text.NumberFormat;
010:
011:        public class CodeCompletionPreferencesPanel extends JPanel {
012:            private static final StringManager s_stringMgr = StringManagerFactory
013:                    .getStringManager(CodeCompletionPreferencesPanel.class);
014:
015:            JRadioButton optSPWithParams;
016:            JRadioButton optSPWithoutParams;
017:            JRadioButton optUDFWithParams;
018:            JRadioButton optUDFWithoutParams;
019:
020:            JTable tblPrefixes;
021:
022:            JButton btnNewRow;
023:            JButton btnDeleteRows;
024:            JTextField txtMaxLastSelectedCompletionNamesPanel;
025:
026:            public CodeCompletionPreferencesPanel() {
027:                setLayout(new GridBagLayout());
028:
029:                GridBagConstraints gbc;
030:
031:                gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0,
032:                        GridBagConstraints.NORTHWEST,
033:                        GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5),
034:                        0, 0);
035:                // i18n[codeCompletion.prefsExplain=When completing functions SQuirreL doesn't know
036:                // if a function is a stored procedure or a user defined function.
037:                // To make code completion of these two kinds of functions convenient SQuirreL offers to
038:                // configure which way completion should work.]
039:                add(new MultipleLineLabel(s_stringMgr
040:                        .getString("codeCompletion.prefsExplain")), gbc);
041:
042:                gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0,
043:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
044:                        new Insets(5, 5, 5, 5), 0, 0);
045:                // i18n[codeCompletion.globalFunctCompltion=If there is no matching prefix configuration functions should complete like:]
046:                add(new JLabel(s_stringMgr
047:                        .getString("codeCompletion.globalFunctCompltion")), gbc);
048:
049:                ButtonGroup grp = new ButtonGroup();
050:
051:                // i18n[codeCompletion.spWithParams=stored procedure with parameter info: {call mySP(<IN INTEGER tid>)}]
052:                optSPWithParams = new JRadioButton(s_stringMgr
053:                        .getString("codeCompletion.spWithParams"));
054:                gbc = new GridBagConstraints(0, 2, 1, 1, 0, 0,
055:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
056:                        new Insets(0, 5, 5, 5), 0, 0);
057:                add(optSPWithParams, gbc);
058:                grp.add(optSPWithParams);
059:
060:                // i18n[codeCompletion.spWithoutParams=stored procedure without parameter info: {call mySP()}]
061:                optSPWithoutParams = new JRadioButton(s_stringMgr
062:                        .getString("codeCompletion.spWithoutParams"));
063:                gbc = new GridBagConstraints(0, 3, 1, 1, 0, 0,
064:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
065:                        new Insets(0, 5, 5, 5), 0, 0);
066:                add(optSPWithoutParams, gbc);
067:                grp.add(optSPWithoutParams);
068:
069:                // i18n[codeCompletion.UDFWithParams=user defined function with parameter info: myFunct(<IN INTEGER tid>)]
070:                optUDFWithParams = new JRadioButton(s_stringMgr
071:                        .getString("codeCompletion.UDFWithParams"));
072:                gbc = new GridBagConstraints(0, 4, 1, 1, 0, 0,
073:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
074:                        new Insets(0, 5, 5, 5), 0, 0);
075:                add(optUDFWithParams, gbc);
076:                grp.add(optUDFWithParams);
077:
078:                // i18n[codeCompletion.UDFWithoutParams=user defined function without parameter info: myFunct()]
079:                optUDFWithoutParams = new JRadioButton(s_stringMgr
080:                        .getString("codeCompletion.UDFWithoutParams"));
081:                gbc = new GridBagConstraints(0, 5, 1, 1, 0, 0,
082:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
083:                        new Insets(0, 5, 5, 5), 0, 0);
084:                add(optUDFWithoutParams, gbc);
085:                grp.add(optUDFWithoutParams);
086:
087:                gbc = new GridBagConstraints(0, 6, 1, 1, 0, 0,
088:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
089:                        new Insets(10, 5, 5, 5), 0, 0);
090:                // i18n[codeCompletion.prefixConfig=Configure function completion for function name prefixes:]
091:                add(new JLabel(s_stringMgr
092:                        .getString("codeCompletion.prefixConfig")), gbc);
093:
094:                tblPrefixes = new JTable();
095:                gbc = new GridBagConstraints(0, 7, 1, 1, 1, 1,
096:                        GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
097:                        new Insets(0, 5, 5, 5), 0, 0);
098:                add(new JScrollPane(tblPrefixes), gbc);
099:
100:                gbc = new GridBagConstraints(0, 8, 1, 1, 0, 0,
101:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
102:                        new Insets(0, 5, 5, 5), 0, 0);
103:                add(createButtonsPanel(), gbc);
104:
105:                gbc = new GridBagConstraints(0, 9, 1, 1, 1, 0,
106:                        GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
107:                        new Insets(15, 5, 5, 5), 0, 0);
108:                add(createMaxLastSelectedCompletionNamesPanel(), gbc);
109:            }
110:
111:            private JPanel createMaxLastSelectedCompletionNamesPanel() {
112:                JPanel ret = new JPanel();
113:
114:                ret.setLayout(new GridBagLayout());
115:
116:                GridBagConstraints gbc;
117:
118:                // i18n[CodeCompletionPreferencesPanel.maxLastSelectedCompletionNames=If you call code completion without being in the scope of a table,
119:                //for which number of tables the parser last found would you like to see colums on top of the completion list?]
120:                MultipleLineLabel lbl = new MultipleLineLabel(
121:                        s_stringMgr
122:                                .getString("CodeCompletionPreferencesPanel.maxLastSelectedCompletionNames"));
123:                //JLabel lbl = new JLabel(s_stringMgr.getString("CodeCompletionPreferencesPanel.maxLastSelectedCompletionNames"));
124:                gbc = new GridBagConstraints(0, 0, 2, 1, 1, 0,
125:                        GridBagConstraints.NORTHWEST,
126:                        GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5),
127:                        0, 0);
128:                ret.add(lbl, gbc);
129:
130:                gbc = new GridBagConstraints(0, 1, 1, 1, 0, 0,
131:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
132:                        new Insets(0, 5, 5, 5), 0, 0);
133:                NumberFormat format = NumberFormat.getIntegerInstance();
134:                txtMaxLastSelectedCompletionNamesPanel = new JFormattedTextField(
135:                        format);
136:                txtMaxLastSelectedCompletionNamesPanel
137:                        .setPreferredSize(new Dimension(30,
138:                                txtMaxLastSelectedCompletionNamesPanel
139:                                        .getPreferredSize().height));
140:
141:                ret.add(txtMaxLastSelectedCompletionNamesPanel, gbc);
142:
143:                // i18n[CodeCompletionPreferencesPanel.numberOfTables=number of tables]
144:                gbc = new GridBagConstraints(1, 1, 1, 1, 0, 0,
145:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
146:                        new Insets(0, 0, 5, 5), 0, 0);
147:                ret
148:                        .add(
149:                                new JLabel(
150:                                        s_stringMgr
151:                                                .getString("CodeCompletionPreferencesPanel.numberOfTables")),
152:                                gbc);
153:
154:                ret.setBorder(BorderFactory.createEtchedBorder());
155:
156:                return ret;
157:            }
158:
159:            private JPanel createButtonsPanel() {
160:                GridBagConstraints gbc;
161:                JPanel pnlButtons = new JPanel(new GridBagLayout());
162:
163:                // i18n[codeCompletion.prefixConfig.newRow=Add new row]
164:                btnNewRow = new JButton(s_stringMgr
165:                        .getString("codeCompletion.prefixConfig.newRow"));
166:                gbc = new GridBagConstraints(0, 0, 1, 1, 1, 0,
167:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
168:                        new Insets(0, 0, 5, 5), 0, 0);
169:                pnlButtons.add(btnNewRow, gbc);
170:
171:                // i18n[codeCompletion.prefixConfig.deleteSelRows=Delete selected rows]
172:                btnDeleteRows = new JButton(s_stringMgr
173:                        .getString("codeCompletion.prefixConfig.deleteSelRows"));
174:                gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0,
175:                        GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
176:                        new Insets(0, 5, 5, 5), 0, 0);
177:                pnlButtons.add(btnDeleteRows, gbc);
178:                return pnlButtons;
179:            }
180:
181:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.