Source Code Cross Referenced for TemplateConfigPanel.java in  » J2EE » jag » com » finalist » jaggenerator » template » 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 » J2EE » jag » com.finalist.jaggenerator.template 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*   Copyright (C) 2003 Finalist IT Group
002:         *
003:         *   This file is part of JAG - the Java J2EE Application Generator
004:         *
005:         *   JAG is free software; you can redistribute it and/or modify
006:         *   it under the terms of the GNU General Public License as published by
007:         *   the Free Software Foundation; either version 2 of the License, or
008:         *   (at your option) any later version.
009:         *   JAG is distributed in the hope that it will be useful,
010:         *   but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         *   GNU General Public License for more details.
013:         *   You should have received a copy of the GNU General Public License
014:         *   along with JAG; if not, write to the Free Software
015:         *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
016:         */
017:        package com.finalist.jaggenerator.template;
018:
019:        import org.netbeans.lib.awtextra.AbsoluteConstraints;
020:
021:        import javax.swing.*;
022:
023:        import com.finalist.jaggenerator.JagGenerator;
024:
025:        import java.util.HashMap;
026:        import java.util.Map;
027:
028:        /**
029:         * This class is a JPanel containing configuration settings derived from a particular
030:         * JAG application generation template.
031:         * 
032:         * @author Michael O'Connor - Finalist IT Group
033:         */
034:        public class TemplateConfigPanel extends JPanel {
035:
036:            private HashMap configComponents = new HashMap();
037:
038:            public TemplateConfigPanel(TemplateConfigParameter[] params,
039:                    String title) {
040:                super ();
041:                setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
042:
043:                if (title != null) {
044:                    JLabel titleLabel = new JLabel();
045:                    titleLabel.setText(title);
046:                    add(titleLabel, new AbsoluteConstraints(0, 0, 350, -1));
047:                    titleLabel.setBorder(new javax.swing.border.TitledBorder(
048:                            "Selected template:"));
049:                }
050:
051:                for (int i = 0; i < params.length; i++) {
052:                    int y = (i * 25) + 45;
053:                    JLabel jLabel1 = new JLabel();
054:                    jLabel1
055:                            .setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
056:                    jLabel1.setText(params[i].getName() + ':');
057:                    String description = params[i].getDescription();
058:                    if (description != null) {
059:                        jLabel1.setToolTipText(description);
060:                    }
061:                    add(jLabel1, new AbsoluteConstraints(0, y, 150, -1));
062:
063:                    JComponent component = null;
064:                    if (params[i].getType() == TemplateConfigParameter.TYPE_TEXT) {
065:                        component = new JTextField();
066:                        component.setName(params[i].getId());
067:                    } else if (params[i].getType() == TemplateConfigParameter.TYPE_CHECKBOX) {
068:                        component = new JCheckBox();
069:                        component.setName(params[i].getId());
070:
071:                    } else if (params[i].getType() == TemplateConfigParameter.TYPE_LIST) {
072:                        component = new JComboBox(params[i].getPresetValues());
073:                        component.setName(params[i].getId());
074:
075:                    } else if (params[i].getType() == TemplateConfigParameter.TYPE_EDITABLE_LIST) {
076:                        component = new JComboBox(params[i].getPresetValues());
077:                        component.setName(params[i].getId());
078:                        ((JComboBox) component).setEditable(true);
079:                    } else {
080:                        JagGenerator
081:                                .logToConsole("ERROR: Template's config contains an unknown parameter type.");
082:                        continue;
083:                    }
084:
085:                    if (description != null) {
086:                        component.setToolTipText(description);
087:                    }
088:
089:                    add(component,
090:                            new org.netbeans.lib.awtextra.AbsoluteConstraints(
091:                                    150, y, 215, -1));
092:                    configComponents.put(params[i].getId(), component);
093:                }
094:            }
095:
096:            /**
097:             * Gets the mapping of (String) parameter id -> JComponent for all the configurable parameters.
098:             *
099:             * @return
100:             */
101:            public Map getConfigComponents() {
102:                return configComponents;
103:            }
104:
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.