mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-01 10:45:01 +08:00
GT-2901: Python interpreter keybinding improvements.
This commit is contained in:
+15
-10
@@ -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();
|
||||
}
|
||||
|
||||
-14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user