Debian Codegraph @

doc/org.eclipse.emf.cheatsheets/src/org/eclipse/emf/cheatsheets/CheatSheetsPlugin.java

raw
1 /**
2 * Copyright (c) 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v20.html
7 *
8 * Contributors:
9 * IBM - Initial API and implementation
10 */
11 package org.eclipse.emf.cheatsheets;
12
13 import org.eclipse.emf.common.EMFPlugin;
14 import org.eclipse.emf.common.util.ResourceLocator;
15
16
17 /**
18 * The <b>Plugin</b> for the EMF Cheat Sheets.
19 * @since 2.2.0
20 */
21 public final class CheatSheetsPlugin extends EMFPlugin
22 {
23 /**
24 * The singleton instance of the plugin.
25 */
26 public static final CheatSheetsPlugin INSTANCE = new CheatSheetsPlugin();
27
28 /**
29 * The one instance of this class.
30 */
31 private static Implementation plugin;
32
33 /**
34 * Creates the singleton instance.
35 */
36 private CheatSheetsPlugin()
37 {
38 super(new ResourceLocator []{});
39 }
40
41 /*
42 * Javadoc copied from base class.
43 */
44 @Override
45 public ResourceLocator getPluginResourceLocator()
46 {
47 return plugin;
48 }
49
50 /**
51 * Returns the singleton instance of the Eclipse plugin.
52 * @return the singleton instance.
53 */
54 public static Implementation getPlugin()
55 {
56 return plugin;
57 }
58
59 /**
60 * Returns the singleton instance of the Eclipse plugin.
61 */
62 public static void write(Exception exception)
63 {
64 INSTANCE.log(exception);
65 }
66
67 /**
68 * The actual implementation of the Eclipse <b>Plugin</b>.
69 */
70 public static class Implementation extends EMFPlugin.EclipsePlugin
71 {
72 /**
73 * Creates an instance.
74 */
75 public Implementation()
76 {
77 super();
78
79 // Remember the static instance.
80 //
81 plugin = this;
82 }
83 }
84 }