]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation/src/org/simantics/simulation/project/ExperimentSupportFeature.java
Added new ExperimentRuns.createRun utility
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / project / ExperimentSupportFeature.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.simulation.project;
13
14 import org.simantics.project.exception.ProjectException;
15 import org.simantics.project.features.AbstractProjectFeature;
16
17 /**
18  * @author Tuukka Lehtonen
19  */
20 public class ExperimentSupportFeature extends AbstractProjectFeature {
21
22     ExperimentManager em;
23
24     @Override
25     public void configure() throws ProjectException {
26         em = new ExperimentManager();
27         getProjectElement().setHint(IExperimentManager.KEY_EXPERIMENT_MANAGER, em);
28     }
29
30     @Override
31     public void deconfigure() throws ProjectException {
32         if (getProjectElement().getHint(IExperimentManager.KEY_EXPERIMENT_MANAGER) == em)
33             getProjectElement().removeHint(IExperimentManager.KEY_EXPERIMENT_MANAGER);
34         em.dispose(null);
35         em = null;
36     }
37
38 }