Source Code Cross Referenced for DataEditOptionsPanel.java in  » Database-Client » SQL-Workbench » workbench » gui » settings » 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 » SQL Workbench » workbench.gui.settings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DataEditOptionsPanel.java
003:         *
004:         * This file is part of SQL Workbench/J, http://www.sql-workbench.net
005:         *
006:         * Copyright 2002-2008, Thomas Kellerer
007:         * No part of this code maybe reused without the permission of the author
008:         *
009:         * To contact the author please send an email to: support@sql-workbench.net
010:         *
011:         */
012:        package workbench.gui.settings;
013:
014:        import javax.swing.JPanel;
015:        import workbench.gui.components.FlatButton;
016:        import workbench.gui.components.WbCheckBoxLabel;
017:        import workbench.resource.ResourceMgr;
018:        import workbench.resource.Settings;
019:        import workbench.util.FileDialogUtil;
020:
021:        /**
022:         * A panel to edit the options for data editing, such as the font to be 
023:         * used in the JTable, the PK Mapping file, colors used for required
024:         * fields and alternating row coloring.
025:         * 
026:         * @author  support@sql-workbench.net
027:         */
028:        public class DataEditOptionsPanel extends JPanel implements 
029:                java.awt.event.ActionListener, workbench.interfaces.Restoreable {
030:
031:            public DataEditOptionsPanel() {
032:                initComponents();
033:            }
034:
035:            public void restoreSettings() {
036:                pkMapFile.setCaretPosition(0);
037:                previewDml.setSelected(Settings.getInstance().getPreviewDml());
038:                requiredFieldColor.setSelectedColor(Settings.getInstance()
039:                        .getRequiredFieldColor());
040:                highlightRequired.setSelected(Settings.getInstance()
041:                        .getHighlightRequiredFields());
042:                pkMapFile
043:                        .setText(Settings.getInstance().getPKMappingFilename());
044:            }
045:
046:            public void saveSettings() {
047:                Settings set = Settings.getInstance();
048:                set
049:                        .setRequiredFieldColor(requiredFieldColor
050:                                .getSelectedColor());
051:                set.setHighlightRequiredFields(this .highlightRequired
052:                        .isSelected());
053:                set.setPreviewDml(this .previewDml.isSelected());
054:                set.setPKMappingFilename(pkMapFile.getText());
055:            }
056:
057:            /** This method is called from within the constructor to
058:             * initialize the form.
059:             * WARNING: Do NOT modify this code. The content of this method is
060:             * always regenerated by the Form Editor.
061:             */
062:            // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
063:            private void initComponents() {
064:                java.awt.GridBagConstraints gridBagConstraints;
065:
066:                pkMapFileLabel = new javax.swing.JLabel();
067:                jPanel3 = new javax.swing.JPanel();
068:                pkMapFile = new javax.swing.JTextField();
069:                selectMapFile = new FlatButton();
070:                previewDmlLabel = new WbCheckBoxLabel();
071:                previewDml = new javax.swing.JCheckBox();
072:                requiredFieldLabel = new javax.swing.JLabel();
073:                requiredFieldColor = new workbench.gui.components.WbColorPicker();
074:                highlightRequiredLabel = new WbCheckBoxLabel();
075:                highlightRequired = new javax.swing.JCheckBox();
076:                dummyPanel = new javax.swing.JPanel();
077:
078:                setLayout(new java.awt.GridBagLayout());
079:
080:                pkMapFileLabel.setText(ResourceMgr.getString("LblPKMapFile"));
081:                pkMapFileLabel.setToolTipText(ResourceMgr
082:                        .getDescription("LblPKMapFile"));
083:                gridBagConstraints = new java.awt.GridBagConstraints();
084:                gridBagConstraints.gridx = 0;
085:                gridBagConstraints.gridy = 5;
086:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
087:                gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
088:                add(pkMapFileLabel, gridBagConstraints);
089:
090:                jPanel3.setLayout(new java.awt.BorderLayout(5, 0));
091:
092:                pkMapFile.setHorizontalAlignment(javax.swing.JTextField.LEFT);
093:                pkMapFile
094:                        .setMaximumSize(new java.awt.Dimension(2147483647, 22));
095:                pkMapFile.setMinimumSize(new java.awt.Dimension(6, 22));
096:                pkMapFile.setPreferredSize(new java.awt.Dimension(72, 22));
097:                jPanel3.add(pkMapFile, java.awt.BorderLayout.CENTER);
098:
099:                selectMapFile.setText("...");
100:                selectMapFile.setMaximumSize(new java.awt.Dimension(22, 22));
101:                selectMapFile.setMinimumSize(new java.awt.Dimension(22, 22));
102:                selectMapFile.setPreferredSize(new java.awt.Dimension(22, 22));
103:                selectMapFile.addActionListener(this );
104:                jPanel3.add(selectMapFile, java.awt.BorderLayout.EAST);
105:
106:                gridBagConstraints = new java.awt.GridBagConstraints();
107:                gridBagConstraints.gridx = 1;
108:                gridBagConstraints.gridy = 5;
109:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
110:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
111:                gridBagConstraints.insets = new java.awt.Insets(7, 8, 0, 15);
112:                add(jPanel3, gridBagConstraints);
113:
114:                previewDmlLabel.setLabelFor(previewDml);
115:                previewDmlLabel.setText(ResourceMgr.getString("LblPreviewDml"));
116:                previewDmlLabel.setToolTipText(ResourceMgr
117:                        .getDescription("LblPreviewDml"));
118:                gridBagConstraints = new java.awt.GridBagConstraints();
119:                gridBagConstraints.gridx = 0;
120:                gridBagConstraints.gridy = 0;
121:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
122:                gridBagConstraints.insets = new java.awt.Insets(10, 12, 0, 0);
123:                add(previewDmlLabel, gridBagConstraints);
124:
125:                previewDml.setFont(null);
126:                previewDml.setText(" ");
127:                previewDml.setBorder(null);
128:                previewDml
129:                        .setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
130:                previewDml
131:                        .setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
132:                previewDml.setIconTextGap(5);
133:                gridBagConstraints = new java.awt.GridBagConstraints();
134:                gridBagConstraints.gridx = 1;
135:                gridBagConstraints.gridy = 0;
136:                gridBagConstraints.gridwidth = 3;
137:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
138:                gridBagConstraints.insets = new java.awt.Insets(10, 9, 0, 11);
139:                add(previewDml, gridBagConstraints);
140:
141:                requiredFieldLabel.setText(ResourceMgr
142:                        .getString("LblReqFldColor"));
143:                gridBagConstraints = new java.awt.GridBagConstraints();
144:                gridBagConstraints.gridx = 0;
145:                gridBagConstraints.gridy = 3;
146:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
147:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
148:                gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
149:                add(requiredFieldLabel, gridBagConstraints);
150:                gridBagConstraints = new java.awt.GridBagConstraints();
151:                gridBagConstraints.gridx = 1;
152:                gridBagConstraints.gridy = 3;
153:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
154:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
155:                gridBagConstraints.insets = new java.awt.Insets(8, 4, 0, 25);
156:                add(requiredFieldColor, gridBagConstraints);
157:
158:                highlightRequiredLabel.setLabelFor(highlightRequired);
159:                highlightRequiredLabel.setText(ResourceMgr
160:                        .getString("LblHiliteRqd"));
161:                highlightRequiredLabel.setToolTipText(ResourceMgr
162:                        .getDescription("LblHiliteRqd"));
163:                gridBagConstraints = new java.awt.GridBagConstraints();
164:                gridBagConstraints.gridx = 0;
165:                gridBagConstraints.gridy = 2;
166:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
167:                gridBagConstraints.insets = new java.awt.Insets(8, 12, 0, 0);
168:                add(highlightRequiredLabel, gridBagConstraints);
169:
170:                highlightRequired.setFont(null);
171:                highlightRequired.setBorder(null);
172:                highlightRequired
173:                        .setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
174:                highlightRequired
175:                        .setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
176:                highlightRequired.setIconTextGap(5);
177:                gridBagConstraints = new java.awt.GridBagConstraints();
178:                gridBagConstraints.gridx = 1;
179:                gridBagConstraints.gridy = 2;
180:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
181:                gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
182:                gridBagConstraints.insets = new java.awt.Insets(9, 9, 0, 0);
183:                add(highlightRequired, gridBagConstraints);
184:                gridBagConstraints = new java.awt.GridBagConstraints();
185:                gridBagConstraints.gridx = 1;
186:                gridBagConstraints.gridy = 6;
187:                gridBagConstraints.weightx = 1.0;
188:                gridBagConstraints.weighty = 1.0;
189:                add(dummyPanel, gridBagConstraints);
190:            }
191:
192:            // Code for dispatching events from components to event handlers.
193:
194:            public void actionPerformed(java.awt.event.ActionEvent evt) {
195:                if (evt.getSource() == selectMapFile) {
196:                    DataEditOptionsPanel.this .selectMapFile(evt);
197:                }
198:            }// </editor-fold>//GEN-END:initComponents
199:
200:            private void selectMapFile(java.awt.event.ActionEvent evt)//GEN-FIRST:event_selectMapFile
201:            {//GEN-HEADEREND:event_selectMapFile
202:                String fileName = FileDialogUtil.selectPkMapFile(this );
203:                if (fileName != null)
204:                    pkMapFile.setText(fileName);
205:            }//GEN-LAST:event_selectMapFile
206:
207:            // Variables declaration - do not modify//GEN-BEGIN:variables
208:            private javax.swing.JPanel dummyPanel;
209:            private javax.swing.JCheckBox highlightRequired;
210:            private javax.swing.JLabel highlightRequiredLabel;
211:            private javax.swing.JPanel jPanel3;
212:            private javax.swing.JTextField pkMapFile;
213:            private javax.swing.JLabel pkMapFileLabel;
214:            private javax.swing.JCheckBox previewDml;
215:            private javax.swing.JLabel previewDmlLabel;
216:            private workbench.gui.components.WbColorPicker requiredFieldColor;
217:            private javax.swing.JLabel requiredFieldLabel;
218:            private javax.swing.JButton selectMapFile;
219:            // End of variables declaration//GEN-END:variables
220:
221:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.