feat(plugins): get a main window reference as JFrame

This commit is contained in:
Skylot 2024-09-28 20:39:52 +01:00
parent 681f8a98b5
commit 90185fd947
No known key found for this signature in database
GPG Key ID: 47A4975761262B6A
2 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package jadx.api.plugins.gui;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.swing.JFrame;
import javax.swing.KeyStroke;
import org.jetbrains.annotations.Nullable;
@ -50,6 +51,12 @@ public interface JadxGuiContext {
*/
JadxGuiSettings settings();
/**
* Main window component.
* Can be used as a parent for creating new windows or dialogs.
*/
JFrame getMainFrame();
ICodeNodeRef getNodeUnderCaret();
ICodeNodeRef getNodeUnderMouse();

View File

@ -4,6 +4,7 @@ import java.awt.Container;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
@ -54,6 +55,11 @@ public class GuiPluginContext implements JadxGuiContext {
return pluginContext;
}
@Override
public JFrame getMainFrame() {
return commonContext.getMainWindow();
}
@Override
public void uiRun(Runnable runnable) {
UiUtils.uiRun(runnable);