@@ -58,6 +58,7 @@ public class UtplsqlRunner implements RealtimeReporterEventConsumer {
5858 private final List <String > schemaList ;
5959 private final List <String > includeObjectList ;
6060 private final List <String > excludeObjectList ;
61+ private Context context ;
6162 private String connectionName ;
6263 private Connection producerConn ;
6364 private Connection consumerConn ;
@@ -68,7 +69,7 @@ public class UtplsqlRunner implements RealtimeReporterEventConsumer {
6869 private JFrame frame ; // for testing purposes only (outside of SQL Developer)
6970 private Thread producerThread ;
7071 private Thread consumerThread ;
71- private Context context ; // required for debugging
72+ private boolean debug = false ;
7273
7374 public UtplsqlRunner (final List <String > pathList , final String connectionName ) {
7475 this .withCodeCoverage = false ;
@@ -77,6 +78,7 @@ public UtplsqlRunner(final List<String> pathList, final String connectionName) {
7778 this .includeObjectList = null ;
7879 this .excludeObjectList = null ;
7980 setConnection (connectionName );
81+ this .context = Context .newIdeContext ();
8082 }
8183
8284 public UtplsqlRunner (final List <String > pathList , final List <String > schemaList ,
@@ -87,6 +89,7 @@ public UtplsqlRunner(final List<String> pathList, final List<String> schemaList,
8789 this .includeObjectList = includeObjectList ;
8890 this .excludeObjectList = excludeObjectList ;
8991 setConnection (connectionName );
92+ this .context = Context .newIdeContext ();
9093 }
9194
9295 /**
@@ -127,8 +130,8 @@ private void setConnection(final String connectionName) {
127130 this .connectionName = connectionName ;
128131 }
129132
130- public void enableDebugging (Context context ) {
131- this .context = context ;
133+ public void enableDebugging () {
134+ this .debug = true ;
132135 }
133136
134137 public void dispose () {
@@ -140,6 +143,7 @@ public void dispose() {
140143 }
141144 }
142145
146+ @ SuppressWarnings ("StatementWithEmptyBody" )
143147 @ Override
144148 public void process (final RealtimeReporterEvent event ) {
145149 logger .fine (event ::toString );
@@ -305,7 +309,7 @@ private void produce() {
305309 if (withCodeCoverage ) {
306310 dao .produceReportWithCoverage (realtimeReporterId , coverageReporterId , pathList , schemaList , includeObjectList , excludeObjectList );
307311 } else {
308- if (context == null ) {
312+ if (! debug ) {
309313 dao .produceReport (realtimeReporterId , pathList );
310314 } else {
311315 produceReportWithDebugger (dao .getProduceReportPlsql (realtimeReporterId , pathList ));
@@ -355,6 +359,7 @@ private boolean initGUI() {
355359 if (isRunningInSqlDeveloper ()) {
356360 RunnerFactory .showDockable ();
357361 panel = dockable .getRunnerPanel ();
362+ context .setView (dockable );
358363 } else {
359364 frame = new JFrame ("utPLSQL Runner Panel" );
360365 frame .setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
0 commit comments