]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/JcrExplorerPlugin.java
1 package org
.argeo
.jcr
.ui
.explorer
;
3 import java
.util
.ResourceBundle
;
5 import org
.apache
.commons
.logging
.Log
;
6 import org
.apache
.commons
.logging
.LogFactory
;
7 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
8 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
9 import org
.osgi
.framework
.BundleContext
;
12 * The activator class controls the plug-in life cycle
14 public class JcrExplorerPlugin
extends AbstractUIPlugin
{
15 private final static Log log
= LogFactory
.getLog(JcrExplorerPlugin
.class);
16 private ResourceBundle messages
;
19 public static final String ID
= "org.argeo.jcr.ui.explorer"; //$NON-NLS-1$
21 // The shared instance
22 private static JcrExplorerPlugin plugin
;
27 public JcrExplorerPlugin() {
34 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
37 public void start(BundleContext context
) throws Exception
{
40 messages
= ResourceBundle
41 .getBundle("org.argeo.jcr.ui.explorer.messages");
49 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
52 public void stop(BundleContext context
) throws Exception
{
58 * Returns the shared instance
60 * @return the shared instance
62 public static JcrExplorerPlugin
getDefault() {
66 public static ImageDescriptor
getImageDescriptor(String path
) {
67 return imageDescriptorFromPlugin(ID
, path
);
70 /** Returns the internationalized label for the given key */
71 public static String
getMessage(String key
) {
73 return getDefault().messages
.getString(key
);
74 } catch (NullPointerException npe
) {
75 log
.warn(key
+ " not found.");
81 * Gives access to the internationalization message bundle. Returns null in
82 * case the ClientUiPlugin is not started (for JUnit tests, by instance)
84 public static ResourceBundle
getMessagesBundle() {
85 if (getDefault() != null)
87 return getDefault().messages
;