1 /*******************************************************************************
2 * Copyright (c) 2015 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.analysis
.graph
.core
.tests
;
15 import java
.io
.IOException
;
18 import org
.eclipse
.core
.runtime
.FileLocator
;
19 import org
.eclipse
.core
.runtime
.IPath
;
20 import org
.eclipse
.core
.runtime
.Path
;
21 import org
.eclipse
.core
.runtime
.Plugin
;
22 import org
.eclipse
.jdt
.annotation
.NonNull
;
23 import org
.osgi
.framework
.BundleContext
;
26 * Activator for this plugin
28 * @author Geneviève Bastien
30 public class Activator
extends Plugin
{
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
38 public static final String PLUGIN_ID
= "org.eclipse.tracecompass.analysis.graph.core.tests"; //$NON-NLS-1$
43 private static Activator PLUGIN
;
45 // ------------------------------------------------------------------------
47 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 * Returns the shared instance
62 * @return the shared instance
64 public static Activator
getDefault() {
68 // ------------------------------------------------------------------------
70 // ------------------------------------------------------------------------
73 public void start(BundleContext context
) throws Exception
{
79 public void stop(BundleContext context
) throws Exception
{
85 * Return a path to a file relative to this plugin's base directory
88 * The path relative to the plugin's root directory
89 * @return The path corresponding to the relative path in parameter
91 public static @NonNull IPath
getAbsoluteFilePath(String relativePath
) {
92 Activator plugin
= Activator
.getDefault();
95 * Shouldn't happen but at least throw something to get the test to
98 throw new IllegalStateException();
100 URL location
= FileLocator
.find(plugin
.getBundle(), new Path(relativePath
), null);
102 return new Path(FileLocator
.toFileURL(location
).getPath());
103 } catch (IOException e
) {
104 throw new IllegalStateException();
This page took 0.036051 seconds and 5 git commands to generate.