1 7 34 35 package com.sun.tools.example.debug.gui; 36 37 import javax.swing.*; 38 import java.awt.*; 39 import java.awt.event.*; 40 41 import com.sun.jdi.*; 42 import com.sun.tools.example.debug.bdi.*; 43 44 class JDBToolBar extends JToolBar { 45 46 Environment env; 47 48 ExecutionManager runtime; 49 ClassManager classManager; 50 SourceManager sourceManager; 51 52 CommandInterpreter interpreter; 53 54 JDBToolBar(Environment env) { 55 56 this.env = env; 57 this.runtime = env.getExecutionManager(); 58 this.classManager = env.getClassManager(); 59 this.sourceManager = env.getSourceManager(); 60 this.interpreter = new CommandInterpreter(env, true); 61 62 64 addTool("Run application", "run", "run"); 65 addTool("Connect to application", "connect", "connect"); 66 addSeparator(); 67 68 addTool("Step into next line", "step", "step"); 69 addTool("Step over next line", "next", "next"); 70 72 76 addTool("Step out of current method call", "step up", "step up"); 77 addSeparator(); 78 79 addTool("Suspend execution", "interrupt", "interrupt"); 80 addTool("Continue execution", "cont", "cont"); 81 addSeparator(); 82 83 86 addTool("Move up one stack frame", "up", "up"); 87 addTool("Move down one stack frame", "down", "down"); 88 90 93 95 97 } 98 99 private void addTool(String toolTip, String labelText, String command) { 100 JButton button = new JButton(labelText); 101 button.setToolTipText(toolTip); 102 final String cmd = command; 103 button.addActionListener(new ActionListener() { 104 public void actionPerformed(ActionEvent e) { 105 interpreter.executeCommand(cmd); 106 } 107 }); 108 this.add(button); 109 } 110 111 } 112 | Popular Tags |