01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: /** @author Kristofer Johannisson */package de.uka.ilkd.key.casetool.together.scripts.menuextension;
12:
13: import javax.swing.ProgressMonitor;
14:
15: import org.apache.log4j.Logger;
16:
17: import de.uka.ilkd.key.casetool.UMLModelClass;
18: import de.uka.ilkd.key.casetool.together.TogetherGFInterface;
19: import de.uka.ilkd.key.ocl.gf.CallbackClassInv;
20: import de.uka.ilkd.key.ocl.gf.Utils;
21:
22: public class ClassMenuPoint5 extends ClassMenu {
23: protected static Logger timelogger = Logger
24: .getLogger("de.uka.ilkd.key.ocl.gf.Timer");
25: protected static Logger logger = Logger.getLogger("key.ocl.gf");
26:
27: public String getMenuEntry() {
28: return "Edit Invariant [GF]";
29: }
30:
31: protected String runCore(UMLModelClass modelClass) {
32: if (timelogger.isDebugEnabled()) {
33: timelogger.debug(System.currentTimeMillis()
34: + " ObMenuPoint6 runCore");
35: }
36: if (logger.isDebugEnabled()) {
37: logger.debug("Class: " + modelClass.getFullClassName());
38: }
39: pm = new ProgressMonitor(null, "Loading the GF editor for OCL",
40: "", 0, 9700);
41: Utils.tickProgress(pm, 1, "Initializing TogetherGFInterface");
42:
43: CallbackClassInv cci = new CallbackClassInv(modelClass);
44: String name = modelClass.getClassName();
45: String pack = modelClass.getContainingPackage();
46: String inv = modelClass.getMyInv();
47: String abs = modelClass.getMyInvGFAbs();
48:
49: // aReprModelClass.setMyInvGFAbs("just testing...");
50:
51: // return (new GFinterface()).editClassInvariant(aReprModelClass.getClassName(),
52: // aReprModelClass.getMyInv());
53: return (new TogetherGFInterface()).editClassInvariant(name,
54: pack, inv, cci, pm, abs);
55: }
56: }
|