GT-2901: Python interpreter keybinding improvements.

This commit is contained in:
Ryan Kurtz
2019-06-10 13:48:27 -04:00
parent d0ee2aa26b
commit b2c65d147d
4 changed files with 89 additions and 37 deletions
@@ -21,7 +21,16 @@ import javax.swing.ImageIcon;
import ghidra.app.plugin.core.console.CodeCompletion;
/**
* A connection between an implementation of an interpreter and its generic GUI components.
*/
public interface InterpreterConnection {
/**
* Gets the title of the interpreter.
*
* @return The title of the interpreter
*/
public String getTitle();
/**
@@ -31,15 +40,11 @@ public interface InterpreterConnection {
*/
public ImageIcon getIcon();
/**
* Gets a {@link List} of {@link CodeCompletion code completions} for the given command.
*
* @param cmd The command to get code completions for
* @return A {@link List} of {@link CodeCompletion code completions} for the given command
*/
public List<CodeCompletion> getCompletions(String cmd);
/**
* Interrupts what the interpreter is currently doing.
*/
public void interrupt();
/**
* Resets the interpreter. Each interpreter can define what "reset" for them means.
*/
public void reset();
}
@@ -277,20 +277,6 @@ public class InterpreterPanel extends JPanel implements OptionsChangeListener {
completionWindow.setVisible(false);
e.consume();
break;
case KeyEvent.VK_D:
if (e.isControlDown()) {
// Ctrl+D - reset interpreter
e.consume();
interpreter.reset();
}
break;
case KeyEvent.VK_I:
if (e.isControlDown()) {
// Ctrl+I - interrupt interpreter
e.consume();
interpreter.interrupt();
}
break;
default:
// Check for the completion window trigger on input that contains text