Source Code Cross Referenced for DataCheckPanel.java in  » Installer » IzPack » com » izforge » izpack » panels » 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 » Installer » IzPack » com.izforge.izpack.panels 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003:         *
004:         * http://izpack.org/
005:         * http://izpack.codehaus.org/
006:         *
007:         * Copyright 2002 Jan Blok
008:         *
009:         * Licensed under the Apache License, Version 2.0 (the "License");
010:         * you may not use this file except in compliance with the License.
011:         * You may obtain a copy of the License at
012:         *
013:         *     http://www.apache.org/licenses/LICENSE-2.0
014:         *
015:         * Unless required by applicable law or agreed to in writing, software
016:         * distributed under the License is distributed on an "AS IS" BASIS,
017:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018:         * See the License for the specific language governing permissions and
019:         * limitations under the License.
020:         *
021:         * This panel written by Hal Vaughan
022:         * http://thresholddigital.com
023:         * hal@thresholddigital.com
024:         * 
025:         * And updated by Fabrice Mirabile
026:         * miraodb@hotmail.com
027:         */
028:
029:        package com.izforge.izpack.panels;
030:
031:        import java.util.Enumeration;
032:        import java.util.List;
033:        import java.util.Properties;
034:
035:        import javax.swing.BoxLayout;
036:        import javax.swing.JEditorPane;
037:        import javax.swing.JLabel;
038:        import javax.swing.JScrollPane;
039:
040:        import com.izforge.izpack.installer.InstallData;
041:        import com.izforge.izpack.installer.InstallerFrame;
042:        import com.izforge.izpack.installer.IzPanel;
043:        import com.izforge.izpack.Pack;
044:
045:        /**
046:         * 
047:         * DataCheckPanel: Provide a lot of debugging information.  Print a simple header of our 
048:         * instance number and a line to separate output from other instances, then print all
049:         * the InstallData variables and list all the packs and selected packs.  I hope this will
050:         * be expanded by others to provide needed debugging information by those developing panels
051:         * for IzPack.
052:         * @author Hal Vaughan
053:         * @author Fabrice Mirabile
054:         */
055:        public class DataCheckPanel extends IzPanel {
056:
057:            private static final long serialVersionUID = 3257848774955905587L;
058:
059:            static int instanceCount = 0;
060:
061:            protected int instanceNumber = 0;
062:
063:            private InstallData iData;
064:
065:            JEditorPane staticText;
066:
067:            /**
068:             * The constructor.
069:             *
070:             * @param parent The parent.
071:             * @param id The installation data.
072:             */
073:            public DataCheckPanel(InstallerFrame parent, InstallData id) {
074:                super (parent, id);
075:
076:                iData = id;
077:                instanceNumber = instanceCount++;
078:
079:                String sInfo = "Debugging data.  All InstallData variables and all packs (selected packs are marked).";
080:                BoxLayout bLayout = new BoxLayout(this , BoxLayout.Y_AXIS);
081:                setLayout(bLayout);
082:                //		setLayout(new GridLayout(3,1));
083:                JLabel lInfo = new JLabel(sInfo);
084:                add(lInfo);
085:                staticText = new JEditorPane();
086:                staticText.setEditable(false);
087:                JScrollPane scrollText = new JScrollPane(staticText);
088:                add(new JLabel("  "));
089:                add(scrollText);
090:
091:            }
092:
093:            /**
094:             * When the panel is made active, call the printDebugInfo method.
095:             * 
096:             * @see com.izforge.izpack.installer.IzPanel#panelActivate()
097:             */
098:            public void panelActivate() {
099:                printDebugInfo();
100:            }
101:
102:            /**
103:             * Get and return the list of pack names.
104:             * 
105:             * @param packList
106:             * @return String
107:             */
108:            private String getPackNames(List<Pack> packList) {
109:                int i;
110:                String pStatus;
111:                String sOutput = "";
112:                Pack iPack;
113:                for (i = 0; i < packList.size(); i++) {
114:                    iPack = packList.get(i);
115:                    if (iData.selectedPacks.indexOf(iPack) != -1)
116:                        pStatus = "Selected";
117:                    else
118:                        pStatus = "Unselected";
119:                    sOutput = sOutput + "\t" + i + ": " + iPack.name + " ("
120:                            + pStatus + ")\n";
121:                }
122:                return sOutput;
123:            }
124:
125:            /**
126:             * Print list of variables names and value, as well as the list
127:             * of packages and their status (selected or not).
128:             * 
129:             */
130:            private void printDebugInfo() {
131:                int i = 0;
132:                String sInfo = "InstallData Variables:\n";
133:                System.out
134:                        .println("------------------------Data Check Panel Instance "
135:                                + instanceNumber + "------------------------");
136:                System.out.println("InstallData Variables:");
137:                Properties varList = iData.getVariables();
138:                String[] alphaName = new String[varList.size()];
139:                Enumeration<String> varNames = (Enumeration<String>) varList
140:                        .propertyNames();
141:                while (varNames.hasMoreElements())
142:                    alphaName[i++] = varNames.nextElement();
143:                java.util.Arrays.sort(alphaName);
144:                for (i = 0; i < alphaName.length; i++)
145:                    sInfo = sInfo + "\tName: " + alphaName[i] + ", Value: "
146:                            + varList.getProperty(alphaName[i]) + "\n";
147:                sInfo = sInfo + "\nAvailable Packs: \n"
148:                        + getPackNames(iData.allPacks) + "\n";
149:                System.out.println(sInfo);
150:                staticText.setText(sInfo);
151:            }
152:
153:            /**
154:             * By nature, always true.
155:             *
156:             * @return True
157:             */
158:            public boolean isValidated() {
159:                return true;
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.