Source Code Cross Referenced for IncludeTableColumnsWizardPanel.java in  » Database-Client » DBBrowser » org » dbbrowser » ui » helper » exporthelper » wizard » panel » 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 » DBBrowser » org.dbbrowser.ui.helper.exporthelper.wizard.panel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.dbbrowser.ui.helper.exporthelper.wizard.panel;
002:
003:        import infrastructure.internationalization.InternationalizationManager;
004:        import java.awt.BorderLayout;
005:        import java.awt.event.ActionEvent;
006:        import java.awt.event.ActionListener;
007:        import java.util.ArrayList;
008:        import java.util.Iterator;
009:        import java.util.List;
010:        import javax.swing.BorderFactory;
011:        import javax.swing.BoxLayout;
012:        import javax.swing.JCheckBox;
013:        import javax.swing.JPanel;
014:        import javax.swing.JScrollPane;
015:        import javax.swing.table.AbstractTableModel;
016:        import org.dbbrowser.ui.UIControllerForQueries;
017:        import org.dbbrowser.ui.panel.ButtonsPanel;
018:        import org.dbbrowser.ui.widget.Button;
019:
020:        /**
021:         * Panel to select columns to include in the report
022:         * @author amangat
023:         */
024:        public class IncludeTableColumnsWizardPanel extends AbstractWizardPanel
025:                implements  ActionListener {
026:            private static final long serialVersionUID = UIControllerForQueries.version;
027:            private static final String PANEL_TITLE = InternationalizationManager
028:                    .getInstance()
029:                    .getMessage(
030:                            "dbbrowser-export-wizard",
031:                            "dbbrowser-ui-export-wizard-select-columns-to-include-panel-title",
032:                            null);;
033:            private static final String SELECT_ALL_COLUMNS_BUTTONS_LABEL = InternationalizationManager
034:                    .getInstance()
035:                    .getMessage(
036:                            "dbbrowser-export-wizard",
037:                            "dbbrowser-ui-export-wizard-select-columns-to-include-panel-select-all-button-label",
038:                            null);;
039:            private static final String DESELECT_ALL_COLUMNS_BUTTONS_LABEL = InternationalizationManager
040:                    .getInstance()
041:                    .getMessage(
042:                            "dbbrowser-export-wizard",
043:                            "dbbrowser-ui-export-wizard-select-columns-to-include-panel-deselect-all-button-label",
044:                            null);;
045:
046:            private AbstractTableModel abstractTableModel = null;
047:            private List listOfCheckBoxForColumns = new ArrayList();
048:
049:            /**
050:             * Constrcuter
051:             */
052:            public IncludeTableColumnsWizardPanel(
053:                    AbstractTableModel abstractTableModel) {
054:                super (PANEL_TITLE);
055:                this .abstractTableModel = abstractTableModel;
056:                setupPanel();
057:            }
058:
059:            public List getListOfColumnsToIncludeInExport() {
060:                //Iterate through each checkbox and add it to list if it is checked
061:                List listOfColumnsToIncludeInExport = new ArrayList();
062:                Iterator i = listOfCheckBoxForColumns.iterator();
063:                while (i.hasNext()) {
064:                    JCheckBox box = (JCheckBox) i.next();
065:
066:                    //if box is checked, add it to list
067:                    if (box.isSelected()) {
068:                        listOfColumnsToIncludeInExport.add(box.getText());
069:                    }
070:                }
071:                return listOfColumnsToIncludeInExport;
072:            }
073:
074:            public void actionPerformed(ActionEvent e) {
075:                if (SELECT_ALL_COLUMNS_BUTTONS_LABEL.equals(e
076:                        .getActionCommand())) {
077:                    Iterator i = listOfCheckBoxForColumns.iterator();
078:                    while (i.hasNext()) {
079:                        JCheckBox checkBox = (JCheckBox) i.next();
080:                        checkBox.setSelected(true);
081:                    }
082:                }
083:
084:                if (DESELECT_ALL_COLUMNS_BUTTONS_LABEL.equals(e
085:                        .getActionCommand())) {
086:                    Iterator i = listOfCheckBoxForColumns.iterator();
087:                    while (i.hasNext()) {
088:                        JCheckBox checkBox = (JCheckBox) i.next();
089:                        checkBox.setSelected(false);
090:                    }
091:                }
092:            }
093:
094:            private void setupPanel() {
095:                JPanel panel = new JPanel();
096:                panel.setBorder(BorderFactory.createEtchedBorder());
097:
098:                //Set the layout
099:                panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
100:
101:                //Add the widgets
102:                Button buttonToSelectAllColumns = new Button(
103:                        SELECT_ALL_COLUMNS_BUTTONS_LABEL, this ,
104:                        SELECT_ALL_COLUMNS_BUTTONS_LABEL, null, Boolean.FALSE);
105:                Button buttonToDeSelectAllColumns = new Button(
106:                        DESELECT_ALL_COLUMNS_BUTTONS_LABEL, this ,
107:                        DESELECT_ALL_COLUMNS_BUTTONS_LABEL, null, Boolean.FALSE);
108:                List listOfButtons = new ArrayList();
109:                listOfButtons.add(buttonToSelectAllColumns);
110:                listOfButtons.add(buttonToDeSelectAllColumns);
111:                ButtonsPanel buttonsPanel = new ButtonsPanel(listOfButtons);
112:                panel.add(buttonsPanel);
113:
114:                //Panel for checkboxes for columns
115:                JPanel panelForCheckboxes = new JPanel();
116:                panelForCheckboxes.setLayout(new BoxLayout(panelForCheckboxes,
117:                        BoxLayout.Y_AXIS));
118:                JScrollPane pane = new JScrollPane(panelForCheckboxes);
119:
120:                //Add a checkbox for each column in the table - start from 1 as the first(0) column is column header
121:                if (abstractTableModel != null) {
122:                    for (int i = 1; i < abstractTableModel.getColumnCount(); i++) {
123:                        String columnName = abstractTableModel.getColumnName(i);
124:                        JCheckBox checkBox = new JCheckBox(columnName);
125:                        checkBox.setSelected(true);
126:                        panelForCheckboxes.add(checkBox);
127:                        listOfCheckBoxForColumns.add(checkBox);
128:                    }
129:                }
130:
131:                panel.add(pane);
132:
133:                this.add(panel, BorderLayout.CENTER);
134:            }
135:        }
w___w__w_.___j__a_v_a___2_s._c_o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.