Source Code Cross Referenced for RulesClassSelectDialog.java in  » UML » jrefactory » org » acm » seguin » pmd » swingui » 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 » UML » jrefactory » org.acm.seguin.pmd.swingui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.acm.seguin.pmd.swingui;
002:
003:        import org.acm.seguin.pmd.PMDDirectory;
004:        import org.acm.seguin.pmd.PMDException;
005:
006:        import javax.swing.JButton;
007:        import javax.swing.JDialog;
008:        import javax.swing.JFrame;
009:        import javax.swing.JPanel;
010:        import javax.swing.JScrollPane;
011:        import javax.swing.JSplitPane;
012:        import javax.swing.UIManager;
013:        import java.awt.BorderLayout;
014:        import java.awt.Color;
015:        import java.awt.event.ActionEvent;
016:        import java.awt.event.ActionListener;
017:        import java.io.File;
018:
019:        /**
020:         *
021:         * @author Donald A. Leckie
022:         * @since August 29, 2002
023:         * @version $Revision: 1.1 $, $Date: 2003/07/29 20:51:59 $
024:         */
025:        class RulesClassSelectDialog extends JDialog {
026:
027:            private DirectoryTree m_tree;
028:            private DirectoryTable m_table;
029:            private JSplitPane m_splitPane;
030:            private JScrollPane m_treeScrollPane;
031:            private JScrollPane m_tableScrollPane;
032:            private File m_selectedClassFile;
033:            private boolean m_selectWasPressed;
034:
035:            /**
036:             *******************************************************************************
037:             *
038:             * @param parentWindow
039:             */
040:            protected RulesClassSelectDialog(JFrame parentWindow)
041:                    throws PMDException {
042:                super (parentWindow, "Rules Class File Selector", true);
043:
044:                setSize(ComponentFactory.adjustWindowSize(1200, 800));
045:                setLocationRelativeTo(PMDViewer.getViewer());
046:                setResizable(true);
047:                setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
048:                createDirectoryTreeScrollPane();
049:                createDirectoryTableScrollPane();
050:                createDirectorySplitPane();
051:                buildTree();
052:                JPanel buttonPanel = createButtonPanel();
053:                JPanel contentPanel = new JPanel(new BorderLayout());
054:                contentPanel.add(m_splitPane, BorderLayout.CENTER);
055:                contentPanel.add(buttonPanel, BorderLayout.SOUTH);
056:
057:                getContentPane().add(contentPanel);
058:            }
059:
060:            /**
061:             *********************************************************************************
062:             *
063:             */
064:            private void createDirectoryTreeScrollPane() {
065:                Color background;
066:
067:                m_tree = new DirectoryTree("Rules Repository");
068:                m_treeScrollPane = ComponentFactory.createScrollPane(m_tree);
069:                background = UIManager.getColor("pmdTreeBackground");
070:
071:                m_treeScrollPane.getViewport().setBackground(background);
072:            }
073:
074:            /**
075:             *********************************************************************************
076:             *
077:             */
078:            private void createDirectoryTableScrollPane() {
079:                Color background;
080:
081:                m_table = new DirectoryTable(m_tree, ".class");
082:                m_tableScrollPane = ComponentFactory.createScrollPane(m_table);
083:                background = UIManager.getColor("pmdTableBackground");
084:
085:                m_tableScrollPane.getViewport().setBackground(background);
086:            }
087:
088:            /**
089:             *********************************************************************************
090:             *
091:             */
092:            private void createDirectorySplitPane() {
093:                m_splitPane = ComponentFactory.createHorizontalSplitPane(
094:                        m_treeScrollPane, m_tableScrollPane);
095:            }
096:
097:            /**
098:             *******************************************************************************
099:             *
100:             */
101:            private void buildTree() throws PMDException {
102:                PMDDirectory pmdDirectory = PMDDirectory.getDirectory();
103:                String rulesDirectoryPath = pmdDirectory
104:                        .getRuleSetsDirectoryPath();
105:                File[] rulesDirectory = { new File(rulesDirectoryPath) };
106:                ((DirectoryTreeModel) m_tree.getModel())
107:                        .setupFiles(rulesDirectory);
108:                m_tree.expandRootNode();
109:            }
110:
111:            /**
112:             *******************************************************************************
113:             *
114:             */
115:            private JPanel createButtonPanel() {
116:                ActionListener selectActionListener = new SelectButtonActionListener();
117:                ActionListener cancelActionListener = new CancelButtonActionListener();
118:                JPanel buttonPanel = ComponentFactory.createButtonPanel();
119:                JButton selectButton = ComponentFactory
120:                        .createSaveButton(selectActionListener);
121:                JButton cancelButton = ComponentFactory
122:                        .createCancelButton(cancelActionListener);
123:                selectButton.setText("Select");
124:                buttonPanel.add(selectButton);
125:                buttonPanel.add(cancelButton);
126:
127:                return buttonPanel;
128:            }
129:
130:            /**
131:             *******************************************************************************
132:             *
133:             * @return
134:             */
135:            protected File getSelectedClassFile() {
136:                return m_selectedClassFile;
137:            }
138:
139:            /**
140:             *******************************************************************************
141:             *
142:             * @return
143:             */
144:            protected boolean selectWasPressed() {
145:                return m_selectWasPressed;
146:            }
147:
148:            /**
149:             *******************************************************************************
150:             *******************************************************************************
151:             *******************************************************************************
152:             */
153:            private class SelectButtonActionListener implements  ActionListener {
154:
155:                /**
156:                 ********************************************************************
157:                 *
158:                 * @param event
159:                 */
160:                public void actionPerformed(ActionEvent event) {
161:                    m_selectWasPressed = true;
162:                    m_selectedClassFile = m_table.getSelectedFile();
163:                    RulesClassSelectDialog.this .setVisible(false);
164:                }
165:            }
166:
167:            /**
168:             *******************************************************************************
169:             *******************************************************************************
170:             *******************************************************************************
171:             */
172:            private class CancelButtonActionListener implements  ActionListener {
173:
174:                /**
175:                 ********************************************************************
176:                 *
177:                 * @param event
178:                 */
179:                public void actionPerformed(ActionEvent event) {
180:                    RulesClassSelectDialog.this .setVisible(false);
181:                }
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.