]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation/src/org/simantics/simulation/model/ExperimentLoadingFailed.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / model / ExperimentLoadingFailed.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.model;
13
14 /**
15  * Used in
16  * {@link IModel#loadExperiment(org.simantics.db.ReadGraph, org.simantics.db.Resource, org.simantics.simulation.project.IExperimentActivationListener)}
17  * to indicate that experiment activation has failed due to an error that should
18  * be shown to the user and logged.
19  * 
20  * <p>
21  * It is also possible to provide a {@link Runnable} action through
22  * {@link #ExperimentLoadingFailed(String, Runnable)} that will be executed
23  * after showing the error to the user.
24  * 
25  * @author Tuukka Lehtonen
26  */
27 public class ExperimentLoadingFailed extends Exception {
28
29     private static final long serialVersionUID = -1465266288034655364L;
30
31     private Runnable helperAction;
32
33     public ExperimentLoadingFailed() {
34         super();
35     }
36
37     public ExperimentLoadingFailed(String arg0, Throwable arg1) {
38         super(arg0, arg1);
39     }
40
41     public ExperimentLoadingFailed(String arg0) {
42         super(arg0);
43     }
44
45     public ExperimentLoadingFailed(String arg0, Runnable helperAction) {
46         super(arg0);
47         this.helperAction = helperAction;
48     }
49
50     public ExperimentLoadingFailed(Throwable arg0) {
51         super(arg0);
52     }
53
54     public Runnable getHelperAction() {
55         return helperAction;
56     }
57
58 }