1   package debugger.gui.actions.debugging;
2   
3   import debugger.resources.ResourcesFactory;
4   import debugger.JapeDebugger;
5   
6   import javax.swing.*;
7   import java.awt.event.ActionEvent;
8   
9   /**
10   * Copyright (c) Ontos AG (http://www.ontosearch.com).
11   * This class is part of JAPE Debugger component for
12   * GATE (Copyright (c) "The University of Sheffield" see http://gate.ac.uk/) <br>
13   * @author Andrey Shafirin
14   */
15  public class ExecuteRHSAction extends AbstractAction {
16      private static ExecuteRHSAction ourInstance;
17  
18      public synchronized static ExecuteRHSAction getInstance() {
19          if (ourInstance == null) {
20              ourInstance = new ExecuteRHSAction();
21          }
22          return ourInstance;
23      }
24  
25      /**
26       * Constructs action to continue execution SPT with particular image and tooltip.
27       * */
28      private ExecuteRHSAction() {
29          super();
30          putValue(Action.SHORT_DESCRIPTION, new String("Execute RHS"));
31          putValue(Action.SMALL_ICON, new ImageIcon(JapeDebugger.class.getResource("gui/icons/exeRHS.png")));
32          setEnabled(false);
33      }
34  
35      public void actionPerformed(ActionEvent aEvt) {
36          setEnabled(false);
37          ResourcesFactory.getPhaseController().setStopAfterRHSExec(true);
38          ResourcesFactory.getPhaseController().continueSPT();
39      }
40  }
41  
42