]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation/src/org/simantics/simulation/model/ExperimentLoadingFailed.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / model / ExperimentLoadingFailed.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.simulation.model;\r
13 \r
14 /**\r
15  * Used in\r
16  * {@link IModel#loadExperiment(org.simantics.db.ReadGraph, org.simantics.db.Resource, org.simantics.simulation.project.IExperimentActivationListener)}\r
17  * to indicate that experiment activation has failed due to an error that should\r
18  * be shown to the user and logged.\r
19  * \r
20  * <p>\r
21  * It is also possible to provide a {@link Runnable} action through\r
22  * {@link #ExperimentLoadingFailed(String, Runnable)} that will be executed\r
23  * after showing the error to the user.\r
24  * \r
25  * @author Tuukka Lehtonen\r
26  */\r
27 public class ExperimentLoadingFailed extends Exception {\r
28 \r
29     private static final long serialVersionUID = -1465266288034655364L;\r
30 \r
31     private Runnable helperAction;\r
32 \r
33     public ExperimentLoadingFailed() {\r
34         super();\r
35     }\r
36 \r
37     public ExperimentLoadingFailed(String arg0, Throwable arg1) {\r
38         super(arg0, arg1);\r
39     }\r
40 \r
41     public ExperimentLoadingFailed(String arg0) {\r
42         super(arg0);\r
43     }\r
44 \r
45     public ExperimentLoadingFailed(String arg0, Runnable helperAction) {\r
46         super(arg0);\r
47         this.helperAction = helperAction;\r
48     }\r
49 \r
50     public ExperimentLoadingFailed(Throwable arg0) {\r
51         super(arg0);\r
52     }\r
53 \r
54     public Runnable getHelperAction() {\r
55         return helperAction;\r
56     }\r
57 \r
58 }\r