Source Code Cross Referenced for BytecodeOutlinePlugin.java in  » Byte-Code » asm » de » loskutov » bco » 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 » Byte Code » asm » de.loskutov.bco 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*****************************************************************************************
002:         * Copyright (c) 2004 Andrei Loskutov. All rights reserved. This program and the
003:         * accompanying materials are made available under the terms of the BSD License which
004:         * accompanies this distribution, and is available at
005:         * http://www.opensource.org/licenses/bsd-license.php Contributor: Andrei Loskutov -
006:         * initial API and implementation
007:         ****************************************************************************************/package de.loskutov.bco;
008:
009:        import java.util.MissingResourceException;
010:        import java.util.ResourceBundle;
011:
012:        import org.eclipse.core.runtime.IStatus;
013:        import org.eclipse.core.runtime.Status;
014:        import org.eclipse.jface.dialogs.MessageDialog;
015:        import org.eclipse.swt.widgets.Shell;
016:        import org.eclipse.ui.plugin.AbstractUIPlugin;
017:        import org.osgi.framework.BundleContext;
018:
019:        /**
020:         * The main plugin class to be used in the desktop.
021:         */
022:        public class BytecodeOutlinePlugin extends AbstractUIPlugin {
023:            //The shared instance.
024:            private static BytecodeOutlinePlugin plugin;
025:            //Resource bundle.
026:            private ResourceBundle resourceBundle;
027:
028:            /**
029:             * The constructor.
030:             */
031:            public BytecodeOutlinePlugin() {
032:                super ();
033:                plugin = this ;
034:                try {
035:                    resourceBundle = ResourceBundle
036:                            .getBundle("de.loskutov.bco.BytecodeOutlinePluginResources"); //$NON-NLS-1$
037:                } catch (MissingResourceException x) {
038:                    resourceBundle = null;
039:                }
040:            }
041:
042:            /**
043:             * This method is called upon plug-in activation
044:             * @param context
045:             * @throws Exception
046:             */
047:            public void start(BundleContext context) throws Exception {
048:                super .start(context);
049:            }
050:
051:            /**
052:             * This method is called when the plug-in is stopped
053:             * @param context
054:             * @throws Exception
055:             */
056:            public void stop(BundleContext context) throws Exception {
057:                super .stop(context);
058:            }
059:
060:            /**
061:             * Returns the shared instance.
062:             * @return plugin
063:             */
064:            public static BytecodeOutlinePlugin getDefault() {
065:                return plugin;
066:            }
067:
068:            /**
069:             * Returns the string from the plugin's resource bundle, or 'key' if not found.
070:             * @param key
071:             * @return translation
072:             */
073:            public static String getResourceString(String key) {
074:                ResourceBundle bundle = BytecodeOutlinePlugin.getDefault()
075:                        .getResourceBundle();
076:                try {
077:                    return (bundle != null) ? bundle.getString(key) : key;
078:                } catch (MissingResourceException e) {
079:                    return key;
080:                }
081:            }
082:
083:            /**
084:             * Returns the plugin's resource bundle,
085:             */
086:            public ResourceBundle getResourceBundle() {
087:                return resourceBundle;
088:            }
089:
090:            /**
091:             * Returns the workspace instance.
092:             * @return shell object
093:             */
094:            public static Shell getShell() {
095:                return getDefault().getWorkbench().getActiveWorkbenchWindow()
096:                        .getShell();
097:            }
098:
099:            /**
100:             * @param messageID
101:             * @param error
102:             */
103:            public static void error(String messageID, Throwable error) {
104:                Shell shell = getShell();
105:                String message = getResourceString("BytecodeOutline.Error"); //$NON-NLS-1$
106:                if (messageID != null) {
107:                    message = getResourceString(messageID);
108:                }
109:                message = message + " " + error.getMessage();//$NON-NLS-1$
110:                MessageDialog.openError(shell,
111:                        getResourceString("BytecodeOutline.Title"), //$NON-NLS-1$
112:                        message);
113:
114:                getDefault().getLog().log(
115:                        new Status(IStatus.ERROR,
116:                                "BytecodeOutline", 0, message, error)); //$NON-NLS-1$
117:            }
118:
119:            /**
120:             * @param statusID one of IStatus. constants like IStatus.ERROR etc
121:             * @param error
122:             */
123:            public static void log(Throwable error, int statusID) {
124:                String message = error.getMessage();
125:                if (message == null) {
126:                    message = error.toString();
127:                }
128:                getDefault().getLog().log(
129:                        new Status(statusID,
130:                                "BytecodeOutline", 0, message, error)); //$NON-NLS-1$
131:            }
132:
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.