Switch to side-by-side view

--- a/tool/src/GUI/StudioUI2.java
+++ b/tool/src/GUI/StudioUI2.java
@@ -314,11 +314,11 @@
         
          // set our first product as the default thing when adding
          // more components from the library
-        if(core.products != null) 
-           if(core.products.isEmpty() == false){
-            productSelected = core.products.get(0);
-            System.out.println("KH09 - Selecting the first product as default");
-        } 
+//        if(core.products != null) 
+//           if(core.products.isEmpty() == false){
+//            productSelected = core.products.get(0);
+//            System.out.println("KH09 - Selecting the first product as default");
+//        } 
         
         // get the list of RunPlugins going
         RunPlugins.listPlugins();
@@ -350,12 +350,13 @@
             // capture the clicks on HTML content
             doFormInterception();
             
-            // some experiments to add line-wrapping
+            // this is needed to ensure we get line-wrapping
             jScrollPane2.setViewportView(text);
            
             // change our title
             this.setTitle("TripleCheck");
            
+            doFrontScreen();
     }
 
     public JTree getTree(){
@@ -499,7 +500,7 @@
             text.setContentType(contentType);
             text.setText(content);
             // disable this box if you don't need to see the output on a file
-            //utils.files.SaveStringToFile(new File("output.html"), content);
+            utils.files.SaveStringToFile(new File("output.html"), content);
                     
             // should the button enabled?
             button.setEnabled(true);
@@ -636,7 +637,6 @@
             //newRequest.addParameter("method", node.scriptMethod);
             controller.process(newRequest);
         }
-        
     }
 
     
@@ -688,11 +688,11 @@
             String parameters = "";
            
                 if(URL.contains("?")){
-                    String[] part = URL.split("\\?");
+                    String[] part = text.split("\\?");
                     script = part[0];
                     parameters= part[1];
                 }else{
-                    script = URL; 
+                    script = text; 
                 }
             // execute the link request
             processFormSubmit2(request, script, parameters);
@@ -717,7 +717,7 @@
         
         // normal web link, open in browser
         if(URL.startsWith("http://")){
-            internet.openURL(URL);
+            internet.openURL(text);
             log.write(is.COMMAND, "Opening URL: %1", URL);
             // nothing else to be done
             return;
@@ -725,7 +725,7 @@
         
         // web(secure) link, open in browser
         if(URL.startsWith("https://")){
-            internet.openURL(URL);
+            internet.openURL(text);
             log.write(is.COMMAND, "Opening secure URL: %1", URL);
             // nothing else to be done
             return;
@@ -885,5 +885,29 @@
 //        for(String[] parameter : request.parameters){
 //            System.err.println(parameter[0] +"->"+ parameter[1]);
 //        }
+
+    /**
+     * Add related news to the front screen
+     */
+    private void doFrontScreen() {
+        
+        String timeLine = www.twitter.getTimeLine("@triplechecked");
+        
+        // did we got anything from the web?
+        if(timeLine == null){
+            // nothing, just return without further action
+            return;
+        }
+        
+        String result = ""
+                + html.div()
+                + html.h2("Recent news "
+                        + "@" + html.link("triplechecked", "http://twitter.com/triplechecked")
+                        + "") 
+                + timeLine
+                + html._div
+                ;
+        this.editorPane(is.contentHTML, false, 0, result);
+    }
  
 }