Source Code Cross Referenced for Header.java in  » Portal » Open-Portal » applications » 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 » Portal » Open Portal » applications 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *      CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF
003:         *      NETSCAPE COMMUNICATIONS CORPORATION
004:         *
005:         *      Copyright (c) 1996 Netscape Communications Corporation.
006:         *      All Rights Reserved.
007:         *      Use of this Source Code is subject to the terms of the applicable
008:         *      license agreement from Netscape Communications Corporation.
009:         */
010:
011:        package applications;
012:
013:        import java.applet.Applet;
014:
015:        import netscape.application.Application;
016:        import netscape.application.ExternalWindow;
017:        import netscape.application.InternalWindow;
018:        import netscape.application.Rect;
019:        import netscape.application.Size;
020:
021:        import soif.CSID;
022:        import util.ReportError;
023:
024:        /**
025:         Lo, a header file.
026:         *
027:         */
028:        public class Header {
029:            /* ----------------------------------------------------------- */
030:
031:            /**
032:             * Compass version string.
033:             * Minor needs to match ALFRED_VERMINOR in batman/compass.mak.
034:             * Date is excluded if it is a final build.
035:             */
036:            public final static String PRODUCT_VERSION = "Sun ONE Compass Server";
037:
038:            /**
039:             * Version string.
040:             */
041:            public final static String VERSION = "Application Package";
042:
043:            /**
044:             * Long version string.
045:             */
046:            public final static String LONG_VERSION = VERSION;
047:
048:            /**
049:             * Prints the version string and, if the <b>dbgLvl</b> parameter
050:             * includes the value <i>longVer</i>, also prints the long
051:             * version of the version string.
052:             */
053:            public final static void printVersion(Applet a) {
054:                String dbgString = a.getParameter("dbgLvl");
055:
056:                if (dbgString != null) {
057:                    if (dbgString.indexOf("longVer") != -1) {
058:                        System.out.println(LONG_VERSION);
059:                        return;
060:                    }
061:                }
062:
063:                System.out.println(Header.VERSION);
064:            }
065:
066:            /* ----------------------------------------------------------- */
067:
068:            /**
069:             * Show the current version.
070:             * @param s application name
071:             * @param sys flag do System.out.println
072:             * @param stat flag do showStatus()
073:             */
074:            public final static void showVersion(String s, boolean sys,
075:                    boolean stat) {
076:                if (sys) {
077:                    System.out.println(s + " / " + PRODUCT_VERSION);
078:                }
079:
080:                if (stat) {
081:                    graphical.Header.showStatus(s + " / " + PRODUCT_VERSION);
082:                }
083:            }
084:
085:            /**
086:             * Get and parse a parameter which is expected to be an integer
087:             * and pass back as an integer.
088:             * If the parameter doesn't exist or is not an interger,
089:             * pass back the proposed default.
090:             * @param a application
091:             * @param param the name of the parameter
092:             * @param dflt default to pass back if necessary
093:             */
094:            public final static int getIntParam(Application a, String param,
095:                    int dflt) {
096:                String s = a.parameterNamed(param);
097:
098:                if (s == null) {
099:                    return dflt;
100:                } else {
101:                    try {
102:                        return Integer.parseInt(s);
103:                    } catch (NumberFormatException e) {
104:                        return dflt;
105:                    }
106:                }
107:            }
108:
109:            /**
110:             * Build a CSID based on the codebase and expected application
111:             * parameters host, port and name.
112:             * @param app application
113:             */
114:            public final static CSID parameterCSIDMacro(Application app) {
115:                CSID csid = new CSID(app.codeBase().toString(), app
116:                        .parameterNamed("host"), app.parameterNamed("port"),
117:                        app.parameterNamed("name"));
118:
119:                if (csid.isValid() == false) {
120:                    ReportError.reportError(ReportError.ADMIN, "Header",
121:                            "parameterCSIDMacro", Messages.INVALIDCSID);
122:                }
123:
124:                return csid;
125:            }
126:
127:            /**
128:             * Build a database CSID based on the codebase and expected application
129:             * parameters dbhost, dbport and dbname.
130:             * @param app application
131:             */
132:            public final static CSID parameterDBCSIDMacro(Application app) {
133:                CSID csid = new CSID(app.codeBase().toString(), app
134:                        .parameterNamed("dbhost"),
135:                        app.parameterNamed("dbport"), app
136:                                .parameterNamed("dbname"));
137:
138:                if (csid.isValid() == false) {
139:                    ReportError.reportError(ReportError.ADMIN, "Header",
140:                            "parameterDBCSIDMacro", Messages.INVALIDCSID);
141:                }
142:
143:                return csid;
144:            }
145:
146:            /**
147:             * Macro for obtaining parameters and returning not found errors.
148:             * @param app application
149:             * @param param parameter
150:             */
151:            public final static String parameterMacro(Application app,
152:                    String param) {
153:                String s = app.parameterNamed(param);
154:
155:                if (s == null) {
156:                    ReportError.reportError(ReportError.ADMIN, "Header",
157:                            "parameterMacro", Messages.MISSINGPARAMETER + ": "
158:                                    + param);
159:                }
160:
161:                return s;
162:            }
163:
164:            /**
165:             * ExternalWindow standard sizing macro for InternalWindow.
166:             */
167:            public final static void EWSizer(ExternalWindow externalWindow) {
168:                Size size = externalWindow.windowSizeForContentSize(
169:                        graphical.Header.WINDOWHGAP
170:                                + graphical.Header.IWINDWIDTH
171:                                + graphical.Header.WINDOWHGAP, externalWindow
172:                                .menuView().height()
173:                                + graphical.Header.WINDOWVGAP
174:                                + graphical.Header.IWINDHEIGHT
175:                                + graphical.Header.WINDOWVGAP);
176:                externalWindow.sizeTo(size.width, size.height);
177:            }
178:
179:            /**
180:             * ExternalWindow standard sizing macro for InternalWindow.
181:             */
182:            public final static void EWSizer(ExternalWindow externalWindow,
183:                    InternalWindow internalWindow) {
184:                Size size = externalWindow.windowSizeForContentSize(
185:                        internalWindow.x() + internalWindow.width()
186:                                + graphical.Header.WINDOWHGAP, internalWindow
187:                                .y()
188:                                + internalWindow.height()
189:                                + graphical.Header.WINDOWVGAP);
190:                externalWindow.sizeTo(size.width, size.height);
191:            }
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.