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: package de.uka.ilkd.key.gui.nodeviews;
09:
10: import javax.swing.JFrame;
11:
12: import de.uka.ilkd.key.java.Services;
13: import de.uka.ilkd.key.logic.Sequent;
14: import de.uka.ilkd.key.pp.NotationInfo;
15: import de.uka.ilkd.key.rule.ListOfTacletGoalTemplate;
16: import de.uka.ilkd.key.rule.NoFindTaclet;
17: import de.uka.ilkd.key.rule.Taclet;
18:
19: /**
20: * This item groups all insert hidden taclets and offers a
21: * more convienient user interface to add them.
22: *
23: */
24: public class InsertHiddenTacletMenuItem extends
25: InsertionTacletBrowserMenuItem {
26:
27: /**
28: * creates an instance of the insert hidden menu item
29: * @param parent the JFrame with the parent frame
30: * @param notInfo the NotationInfo to be used for pretty printing
31: * the apps
32: * @param services the Services
33: */
34: public InsertHiddenTacletMenuItem(JFrame parent,
35: NotationInfo notInfo, Services services) {
36: super ("Insert Hidden", parent, notInfo, services);
37: }
38:
39: /**
40: * determines the sequent with the formulas to be added
41: * or null if the given taclet is not thought to be displayed
42: * by this component
43: * @param t the Taclet
44: * @return the sequent with the formulas to be added
45: * or null
46: */
47: protected Sequent checkTaclet(Taclet t) {
48: if (!(t instanceof NoFindTaclet)
49: || !t.displayName().startsWith("insert_hidden")) {
50: return null;
51: }
52:
53: final ListOfTacletGoalTemplate goalTemplates = t
54: .goalTemplates();
55: if (goalTemplates.size() != 1)
56: return null;
57: return goalTemplates.head().sequent();
58: }
59: }
|