22
33import jadx .api .JavaMethod ;
44import jadx .api .plugins .JadxPluginContext ;
5- import jadx .gui .treemodel .JNode ;
6- import jadx .gui .ui .MainWindow ;
7- import jadx .gui .ui .dialog .UsageDialog ;
85import org .ajsmith .jadx .plugins .nativelibraries .components .NativeMethod ;
96import org .ajsmith .jadx .plugins .nativelibraries .components .NativeRoot ;
107import org .jetbrains .annotations .Nullable ;
@@ -65,7 +62,6 @@ public PluginDialog(JFrame parent, JadxPluginContext context, PluginOptions opti
6562 findUsageBtn .setEnabled (false );
6663 findUsageBtn .addActionListener (e -> {
6764 if (context .getGuiContext () == null ) return ;
68- MainWindow mw = (MainWindow ) context .getGuiContext ().getMainFrame ();
6965
7066 TreeNode treeNode = (TreeNode ) tree .getLastSelectedPathComponent ();
7167 if (!(treeNode instanceof NativeMethod )) return ;
@@ -76,10 +72,7 @@ public PluginDialog(JFrame parent, JadxPluginContext context, PluginOptions opti
7672 showMethodNotFoundDialog (treeNode );
7773 return ;
7874 }
79-
80- JNode node = mw .getCacheObject ().getNodeCache ().makeFrom (javaMethod );
81- if (node == null ) return ;
82- new UsageDialog (mw , node ).setVisible (true );
75+ context .getGuiContext ().openUsageDialog (javaMethod .getCodeNodeRef ());
8376 });
8477
8578 JButton closeBtn = new JButton ("Close" );
0 commit comments