mirror of
https://github.com/skylot/jadx.git
synced 2024-10-07 01:53:34 +00:00
feat(plugins): get a main window reference as JFrame
This commit is contained in:
parent
681f8a98b5
commit
90185fd947
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user