]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/ui/internal/Activator.java
1 package org
.argeo
.cms
.ui
.internal
;
3 import org
.argeo
.cms
.CmsStyles
;
4 import org
.argeo
.cms
.maintenance
.MaintenanceUi
;
5 import org
.argeo
.cms
.ui
.internal
.rwt
.UserUi
;
6 import org
.argeo
.node
.NodeState
;
7 import org
.argeo
.util
.LangUtils
;
8 import org
.eclipse
.rap
.rwt
.application
.ApplicationConfiguration
;
9 import org
.osgi
.framework
.BundleActivator
;
10 import org
.osgi
.framework
.BundleContext
;
11 import org
.osgi
.util
.tracker
.ServiceTracker
;
13 public class Activator
implements BundleActivator
{
15 // avoid dependency to RWT OSGi
16 private final static String CONTEXT_NAME_PROP
= "contextName";
18 private static ServiceTracker
<NodeState
, NodeState
> nodeState
;
21 public void start(BundleContext bc
) throws Exception
{
23 bc
.registerService(ApplicationConfiguration
.class, new MaintenanceUi(),
24 LangUtils
.init(CONTEXT_NAME_PROP
, "system"));
25 bc
.registerService(ApplicationConfiguration
.class, new UserUi(), LangUtils
.init(CONTEXT_NAME_PROP
, "user"));
27 nodeState
= new ServiceTracker
<>(bc
, NodeState
.class, null);
32 public void stop(BundleContext context
) throws Exception
{
33 if (nodeState
!= null) {
39 public static NodeState
getNodeState() {
40 return nodeState
.getService();