diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:36:50 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 15:25:03 +0100 |
commit | 41ac47d732eed8392d60d0f6773e5a279d49b999 (patch) | |
tree | cf19d099db9cfdb8d73aa21c31e7aa1cc86ff860 /plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/Activator.java | |
download | eclipse-poky-juno-41ac47d732eed8392d60d0f6773e5a279d49b999.tar.gz |
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/Activator.java')
-rw-r--r-- | plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/Activator.java | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/Activator.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/Activator.java new file mode 100644 index 0000000..33de5c1 --- /dev/null +++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/Activator.java | |||
@@ -0,0 +1,79 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010 Intel Corporation. | ||
3 | * All rights reserved. This program and the accompanying materials | ||
4 | * are made available under the terms of the Eclipse Public License v1.0 | ||
5 | * which accompanies this distribution, and is available at | ||
6 | * http://www.eclipse.org/legal/epl-v10.html | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Intel - initial API and implementation | ||
10 | *******************************************************************************/ | ||
11 | package org.yocto.sdk.remotetools; | ||
12 | |||
13 | import org.eclipse.core.runtime.jobs.IJobManager; | ||
14 | import org.eclipse.core.runtime.jobs.Job; | ||
15 | import org.eclipse.jface.resource.ImageDescriptor; | ||
16 | import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
17 | import org.osgi.framework.BundleContext; | ||
18 | |||
19 | /** | ||
20 | * The activator class controls the plug-in life cycle | ||
21 | */ | ||
22 | public class Activator extends AbstractUIPlugin { | ||
23 | |||
24 | // The plug-in ID | ||
25 | public static final String PLUGIN_ID = "org.yocto.sdk.remotetools"; //$NON-NLS-1$ | ||
26 | |||
27 | // The shared instance | ||
28 | private static Activator plugin; | ||
29 | |||
30 | /** | ||
31 | * The constructor | ||
32 | */ | ||
33 | public Activator() { | ||
34 | } | ||
35 | |||
36 | /* | ||
37 | * (non-Javadoc) | ||
38 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) | ||
39 | */ | ||
40 | public void start(BundleContext context) throws Exception { | ||
41 | super.start(context); | ||
42 | plugin = this; | ||
43 | } | ||
44 | |||
45 | /* | ||
46 | * (non-Javadoc) | ||
47 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) | ||
48 | */ | ||
49 | public void stop(BundleContext context) throws Exception { | ||
50 | |||
51 | //cancel all jobs before plugin stop | ||
52 | IJobManager jobMan = Job.getJobManager(); | ||
53 | jobMan.cancel(LocalJob.LOCAL_JOB_FAMILY); | ||
54 | jobMan.join(LocalJob.LOCAL_JOB_FAMILY, null); | ||
55 | |||
56 | plugin = null; | ||
57 | super.stop(context); | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * Returns the shared instance | ||
62 | * | ||
63 | * @return the shared instance | ||
64 | */ | ||
65 | public static Activator getDefault() { | ||
66 | return plugin; | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * Returns an image descriptor for the image file at the given | ||
71 | * plug-in relative path | ||
72 | * | ||
73 | * @param path the path | ||
74 | * @return the image descriptor | ||
75 | */ | ||
76 | public static ImageDescriptor getImageDescriptor(String path) { | ||
77 | return imageDescriptorFromPlugin(PLUGIN_ID, path); | ||
78 | } | ||
79 | } | ||