Source Code Cross Referenced for HyperlinkFrame.java in  » Net » Terracotta » com » tc » welcome » 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 » Net » Terracotta » com.tc.welcome 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tc.welcome;
005:
006:        import org.dijon.ApplicationManager;
007:        import org.dijon.DictionaryResource;
008:        import org.dijon.Frame;
009:        import org.dijon.Image;
010:        import org.dijon.Label;
011:        import org.dijon.Menu;
012:        import org.dijon.MenuBar;
013:        import org.dijon.Separator;
014:
015:        import com.tc.admin.common.ContactTerracottaAction;
016:        import com.tc.admin.common.XAbstractAction;
017:        import com.tc.object.tools.BootJarSignature;
018:        import com.tc.object.tools.UnsupportedVMException;
019:        import com.tc.util.ResourceBundleHelper;
020:        import com.tc.util.ProductInfo;
021:        import com.tc.util.runtime.Os;
022:
023:        import java.awt.event.ActionEvent;
024:        import java.awt.event.WindowAdapter;
025:        import java.awt.event.WindowEvent;
026:        import java.io.File;
027:        import java.io.IOException;
028:        import java.io.InputStream;
029:        import java.lang.reflect.Method;
030:        import java.net.URL;
031:
032:        import javax.swing.JOptionPane;
033:        import javax.swing.WindowConstants;
034:        import javax.swing.event.HyperlinkListener;
035:
036:        public abstract class HyperlinkFrame extends Frame implements 
037:                HyperlinkListener {
038:            private static ResourceBundleHelper m_bundleHelper = new ResourceBundleHelper(
039:                    HyperlinkFrame.class);
040:
041:            private File m_installRoot;
042:            private File m_bootPath;
043:            private File m_javaCmd;
044:            private File m_tcLib;
045:            private File m_samplesDir;
046:
047:            public HyperlinkFrame() {
048:                super ();
049:
050:                MenuBar menubar = new MenuBar();
051:                Menu menu;
052:
053:                setJMenuBar(menubar);
054:                menubar
055:                        .add(menu = new Menu(getBundleString("file.menu.title")));
056:                initFileMenu(menu);
057:                menubar
058:                        .add(menu = new Menu(getBundleString("help.menu.title")));
059:                menu.add(new ContactTerracottaAction(
060:                        getBundleString("visit.forums.title"),
061:                        getBundleString("forums.url")));
062:                menu.add(new ContactTerracottaAction(
063:                        getBundleString("contact.support.title"),
064:                        getBundleString("support.url")));
065:                menu.add(new Separator());
066:                menu.add(new AboutAction());
067:
068:                URL url;
069:                String iconPath = "/com/tc/admin/icons/logo_small.gif";
070:
071:                if ((url = getClass().getResource(iconPath)) != null) {
072:                    setIconImage(new Image(url));
073:                }
074:
075:                setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
076:
077:                addWindowListener(new WindowAdapter() {
078:                    public void windowClosing(WindowEvent we) {
079:                        quit();
080:                    }
081:                });
082:            }
083:
084:            protected void initFileMenu(Menu fileMenu) {
085:                fileMenu.add(new QuitAction());
086:            }
087:
088:            private String getBundleString(String key) {
089:                return m_bundleHelper.getString(key);
090:            }
091:
092:            protected void quit() {
093:                System.exit(0);
094:            }
095:
096:            protected File getInstallRoot() {
097:                if (m_installRoot == null) {
098:                    m_installRoot = new File(System.getProperty(
099:                            "tc.install-root").trim());
100:                }
101:                return m_installRoot;
102:            }
103:
104:            protected String getBootPath() throws UnsupportedVMException {
105:                if (m_bootPath == null) {
106:                    File bootPath = new File(getInstallRoot(), "lib");
107:                    bootPath = new File(bootPath, "dso-boot");
108:                    bootPath = new File(bootPath, BootJarSignature
109:                            .getBootJarNameForThisVM());
110:                    m_bootPath = bootPath;
111:                }
112:
113:                return m_bootPath.getAbsolutePath();
114:            }
115:
116:            protected static String getenv(String key) {
117:                try {
118:                    Method m = System.class.getMethod("getenv",
119:                            new Class[] { String.class });
120:
121:                    if (m != null) {
122:                        return (String) m.invoke(null, new Object[] { key });
123:                    }
124:                } catch (Throwable t) {/**/
125:                }
126:
127:                return null;
128:            }
129:
130:            static File staticGetJavaCmd() {
131:                File javaBin = new File(System.getProperty("java.home"), "bin");
132:                return new File(javaBin, "java"
133:                        + (Os.isWindows() ? ".exe" : ""));
134:            }
135:
136:            protected File getJavaCmd() {
137:                if (m_javaCmd == null) {
138:                    m_javaCmd = staticGetJavaCmd();
139:                }
140:
141:                return m_javaCmd;
142:            }
143:
144:            static File staticGetTCLib() {
145:                File file = new File(System.getProperty("tc.install-root")
146:                        .trim());
147:                file = new File(file, "lib");
148:                return new File(file, "tc.jar");
149:            }
150:
151:            protected File getTCLib() {
152:                if (m_tcLib == null) {
153:                    m_tcLib = staticGetTCLib();
154:                }
155:                return m_tcLib;
156:            }
157:
158:            protected File getSamplesDir() {
159:                if (m_samplesDir == null) {
160:                    m_samplesDir = new File(getInstallRoot(), "samples");
161:                }
162:                return m_samplesDir;
163:            }
164:
165:            protected Process exec(String[] cmdarray, String[] envp, File dir) {
166:                try {
167:                    return Runtime.getRuntime().exec(cmdarray, envp, dir);
168:                } catch (IOException ioe) {
169:                    ioe.printStackTrace();
170:                }
171:
172:                return null;
173:            }
174:
175:            class QuitAction extends XAbstractAction {
176:                QuitAction() {
177:                    super (getBundleString("quit.action.name"));
178:                }
179:
180:                public void actionPerformed(ActionEvent ae) {
181:                    quit();
182:                }
183:            }
184:
185:            class AboutAction extends XAbstractAction {
186:                org.dijon.Container m_aboutPanel;
187:
188:                AboutAction() {
189:                    super (getBundleString("about.title.prefix")
190:                            + HyperlinkFrame.this .getTitle());
191:                }
192:
193:                DictionaryResource loadTopRes() {
194:                    InputStream is = getClass().getResourceAsStream(
195:                            "Welcome.xml");
196:                    DictionaryResource topRes = null;
197:
198:                    try {
199:                        topRes = ApplicationManager.loadResource(is);
200:                    } catch (Exception e) {
201:                        e.printStackTrace();
202:                    }
203:
204:                    return topRes;
205:                }
206:
207:                public void actionPerformed(ActionEvent ae) {
208:                    if (m_aboutPanel == null) {
209:                        DictionaryResource topRes = loadTopRes();
210:
211:                        if (topRes != null) {
212:                            m_aboutPanel = (org.dijon.Container) topRes
213:                                    .resolve("AboutPanel");
214:
215:                            ProductInfo prodInfo = ProductInfo.getInstance();
216:                            Label label = (Label) m_aboutPanel
217:                                    .findComponent("TitleLabel");
218:
219:                            label.setText(prodInfo.toShortString());
220:
221:                            label = (Label) m_aboutPanel
222:                                    .findComponent("CopyrightLabel");
223:                            label.setText(prodInfo.copyright());
224:                        }
225:                    }
226:
227:                    JOptionPane.showConfirmDialog(HyperlinkFrame.this,
228:                            m_aboutPanel, getName(),
229:                            JOptionPane.DEFAULT_OPTION,
230:                            JOptionPane.PLAIN_MESSAGE);
231:                }
232:            }
233:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.