X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui.workbench%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2Fworkbench%2FWorkbenchUiPlugin.java;h=d96daf221e2730b9399ebc65c16f64ae3847f77e;hb=5b444174cd13680f99944026877f6cac2e1faba1;hp=e6e43a0d383a3c6ca4201a550153e9a27c5a52e5;hpb=328d27b8653a55d9561134f120bca09776f43c1c;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/WorkbenchUiPlugin.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/WorkbenchUiPlugin.java index e6e43a0d3..d96daf221 100644 --- a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/WorkbenchUiPlugin.java +++ b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/WorkbenchUiPlugin.java @@ -37,12 +37,15 @@ import org.osgi.framework.ServiceRegistration; /** The activator class controls the plug-in life cycle */ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener { - private final static Log log = LogFactory.getLog(WorkbenchUiPlugin.class); - private ResourceBundle messages; + // The plug-in ID + public final static String PLUGIN_ID = "org.argeo.cms.ui.workbench"; //$NON-NLS-1$ + public final static String THEME_PLUGIN_ID = "org.argeo.cms.ui.theme"; //$NON-NLS-1$ + private ResourceBundle messages; private static BundleContext bundleContext; + public static InheritableThreadLocal display = new InheritableThreadLocal() { @Override @@ -51,10 +54,6 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener } }; - // The plug-in ID - // public final static String PLUGIN_ID = "org.argeo.security.ui"; //$NON-NLS-1$ - public final static String PLUGIN_ID = "org.argeo.cms.ui.workbench"; //$NON-NLS-1$ - final static String CONTEXT_KEYRING = "KEYRING"; private CallbackHandler defaultCallbackHandler; @@ -65,19 +64,15 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener public void start(BundleContext context) throws Exception { super.start(context); - bundleContext = context; - defaultCallbackHandler = new DefaultCallbackHandler(); - defaultCallbackHandlerReg = context.registerService( - CallbackHandler.class, defaultCallbackHandler, null); + defaultCallbackHandlerReg = context.registerService(CallbackHandler.class, defaultCallbackHandler, null); plugin = this; messages = ResourceBundle.getBundle(PLUGIN_ID + ".messages"); Platform.addLogListener(this); if (log.isTraceEnabled()) log.trace("Eclipse logging now directed to standard logging"); - } public void stop(BundleContext context) throws Exception { @@ -99,8 +94,7 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener } protected class DefaultCallbackHandler implements CallbackHandler { - public void handle(final Callback[] callbacks) throws IOException, - UnsupportedCallbackException { + public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { // if (display != null) // RCP Display displayToUse = display.get(); @@ -108,8 +102,7 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener displayToUse = Display.getDefault(); displayToUse.syncExec(new Runnable() { public void run() { - DefaultLoginDialog dialog = new DefaultLoginDialog(display - .get().getActiveShell()); + DefaultLoginDialog dialog = new DefaultLoginDialog(display.get().getActiveShell()); try { dialog.handle(callbacks); } catch (IOException e) { @@ -126,7 +119,7 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener } public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); + return imageDescriptorFromPlugin(THEME_PLUGIN_ID, path); } /** Returns the internationalized label for the given key */ @@ -140,8 +133,8 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener } /** - * Gives access to the internationalization message bundle. Returns null in - * case this UiPlugin is not started (for JUnit tests, by instance) + * Gives access to the internationalization message bundle. Returns null in case + * this UiPlugin is not started (for JUnit tests, by instance) */ public static ResourceBundle getMessagesBundle() { if (getDefault() != null)