package spinat.codecoverage;

import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Toolkit;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import oracle.jdbc.OracleConnection;
import spinat.codecoverage.gui.EventQueueProxy;
import spinat.codecoverage.gui.Gui2;
import spinat.oraclelogin.OraConnectionDesc;

public class Main {

    public static void main(String[] args) throws Exception {
        try {
            UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }

        EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        queue.push(new EventQueueProxy());
        final Gui2 g = new Gui2();
        boolean conSuccess = false;
        if (args.length == 1) {
            String s = args[0];
            final OraConnectionDesc od = OraConnectionDesc.fromString(s);
            final OracleConnection c = od.getConnection();
            conSuccess = true;
            java.awt.EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    try {
                        g.frame.setExtendedState(Frame.MAXIMIZED_BOTH);
                        g.frame.setVisible(true);
                        if (!g.setConnection(od, c)) {
                            c.close();
                        }
                    } catch (Exception ex) {
                        throw new RuntimeException(ex);
                    }
                }
            });
        }
        if (!conSuccess) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                @Override
                public void run() {
                    try {
                        g.frame.setExtendedState(Frame.MAXIMIZED_BOTH);
                        g.frame.setVisible(true);
                        g.tryConnect();
                    } catch (Exception ex) {
                        throw new RuntimeException(ex);
                    }
                }
            });
        }
    }

}

@@ -153,18 +153,17 @@
 ng.U
-nsupported
+IManager.
 Look
@@ -169,25 +169,20 @@
 kAndFeel
-Exception
+Info
 ;%0Aimport
@@ -426,16 +426,17 @@
 ption %7B%0A
+%0A
         
@@ -444,32 +444,60 @@
 ry %7B%0A           
+ for (LookAndFeelInfo info :
  UIManager.setLo
@@ -491,19 +491,28 @@
 Manager.
-s
+g
 et
+Installed
 LookAndF
@@ -514,17 +514,77 @@
 kAndFeel
-(
+s()) %7B%0A                if (%22Nimbus%22.equals(info.getName())) %7B
 %0A       
@@ -606,25 +606,19 @@
 Manager.
-getSystem
+set
 LookAndF
@@ -620,16 +620,25 @@
 kAndFeel
+(info.get
 ClassNam
@@ -639,24 +639,83 @@
 assName());%0A
+                    break;%0A                %7D%0A            %7D%0A
         %7D ca
@@ -905,24 +905,25 @@
 ueProxy());%0A
+%0A
         fina
@@ -941,24 +941,24 @@
 new Gui2();%0A
-
         bool
@@ -981,16 +981,78 @@
  false;%0A
+        // there is at most one argument, a connection string%0A
         

use nimbus