X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram.profile%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fprofile%2Fview%2FActivator.java;h=9cf13ff72357fa38a98a48c2c1e21949a3739a2f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=3910bc08485ebdca7043c71d60a848ec738328ee;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/Activator.java b/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/Activator.java index 3910bc084..9cf13ff72 100644 --- a/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/Activator.java +++ b/bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/Activator.java @@ -1,71 +1,71 @@ -package org.simantics.diagram.profile.view; - -import java.net.URL; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.osgi.util.tracker.ServiceTracker; - -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.simantics.diagram.profile"; - - // The shared instance - private static Activator plugin; - - private BundleContext bundleContext; - - private ServiceTracker logTracker; - - /** - * The constructor - */ - public Activator() { - } - - /* (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - this.bundleContext = context; - plugin = this; - } - - /* (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - if (logTracker != null) { - logTracker.close(); - logTracker = null; - } - - this.bundleContext = null; - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - public BundleContext getContext() { - return bundleContext; - } - - public static URL getDefaultResource(String name) { - Activator plugin = getDefault(); - if(plugin == null) throw new IllegalStateException("The plugin is not active."); - return plugin.getBundle().getResource(name); - } - -} +package org.simantics.diagram.profile.view; + +import java.net.URL; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.simantics.diagram.profile"; + + // The shared instance + private static Activator plugin; + + private BundleContext bundleContext; + + private ServiceTracker logTracker; + + /** + * The constructor + */ + public Activator() { + } + + /* (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + this.bundleContext = context; + plugin = this; + } + + /* (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + if (logTracker != null) { + logTracker.close(); + logTracker = null; + } + + this.bundleContext = null; + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + public BundleContext getContext() { + return bundleContext; + } + + public static URL getDefaultResource(String name) { + Activator plugin = getDefault(); + if(plugin == null) throw new IllegalStateException("The plugin is not active."); + return plugin.getBundle().getResource(name); + } + +}