]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - eclipse/runtime/org.argeo.eclipse.ui.jcr/src/main/java/org/argeo/eclipse/ui/jcr/JcrUiPlugin.java
5f333f71d250430bc3641e012a5ddfbc93cbd4b9
1 package org
.argeo
.eclipse
.ui
.jcr
;
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
;
11 public class JcrUiPlugin
extends AbstractUIPlugin
{
12 private final static Log log
= LogFactory
.getLog(JcrUiPlugin
.class);
14 public final static String ID
= "org.argeo.eclipse.ui.jcr";
16 private ResourceBundle messages
;
18 private static JcrUiPlugin plugin
;
20 public void start(BundleContext context
) throws Exception
{
23 messages
= ResourceBundle
.getBundle("org.argeo.eclipse.ui.jcr");
26 public static JcrUiPlugin
getDefault() {
30 public static ImageDescriptor
getImageDescriptor(String path
) {
31 return imageDescriptorFromPlugin(ID
, path
);
34 /** Returns the internationalized label for the given key */
35 public static String
getMessage(String key
) {
37 return getDefault().messages
.getString(key
);
38 } catch (NullPointerException npe
) {
39 log
.warn(key
+ " not found.");
45 * Gives access to the internationalization message bundle. Returns null in
46 * case the ClientUiPlugin is not started (for JUnit tests, by instance)
48 public static ResourceBundle
getMessagesBundle() {
49 if (getDefault() != null)
51 return getDefault().messages
;