Switch to unified view

a/tool/run/plugins/spdx/create.java b/tool/run/plugins/spdx/create.java
...
...
67
    public void addNode(){
67
    public void addNode(){
68
        addTreeNode(id, "box--plus.png", "main");
68
        addTreeNode(id, "box--plus.png", "main");
69
        
69
        
70
        addChildNode("from web", "application-dock-270.png", "mainWeb");
70
        addChildNode("from web", "application-dock-270.png", "mainWeb");
71
        addChildNode("from folder", "folder-smiley.png", "mainFolder");
71
        addChildNode("from folder", "folder-smiley.png", "mainFolder");
72
        addChildNode("from zipped file", "vise-drawer.png", "mainZip");
73
        
72
        
74
    }
73
    }
75
    
74
    
76
    /**
75
    /**
77
     * Displays the menu for creating new SPDX documents
76
     * Displays the menu for creating new SPDX documents
78
     * @param request the request for this method
77
     * @param request the request for this method
79
     */
78
     */
80
    @Override
79
    @Override
81
    public void main(WebRequest request){
80
    public void main(WebRequest request){
82
       //request.setPage("spdxDialog.html");
81
       request.setPage("spdxMain.html");
83
        String result = "<html>\n" +
82
//        String result = "<html>\n" +
84
//            "<head>\n" +
83
////            "<head>\n" +
85
//            "<style type=\"text/css\">body {font-family:verdana,arial,"
84
////            "<style type=\"text/css\">body {font-family:verdana,arial,"
86
//                + "sans-serif;font-size:10pt;margin:30px;}</style>"
85
////                + "sans-serif;font-size:10pt;margin:30px;}</style>"
87
//                + "</head>\n" +
86
////                + "</head>\n" +
88
//            "\n" +
87
////            "\n" +
89
            "<body>"
88
//            "<body>"
90
                + ""
89
//                + ""
91
                + "Testing stuff!"
90
//                + "Testing stuff!"
92
                + ""
91
//                + ""
93
                + "</body>"
92
//                + "</body>"
94
                + "</html>";
93
//                + "</html>";
95
        request.setAnswer(result);
94
//        request.setAnswer(result);
96
    }
95
    }
97
96
98
    
97
    
99
    public void mainWeb(WebRequest request){
98
    public void mainWeb(WebRequest request){
100
       request.setPage("spdxDialog.html");
99
       request.setPage("spdxDialog.html");
...
...
272
               }
271
               }
273
272
274
               // third step, create the SPDX document from the extracted files
273
               // third step, create the SPDX document from the extracted files
275
               String result = createDocument(extractedFolder, this);
274
               String result = createDocument(extractedFolder, this);
276
               
275
               
277
               // all done here, explain where the SPDX document can be found
278
               nextStep = 
279
                         html.link("SPDX summary", 
280
                        "/spdx/show?x=summary&"
281
                        + param.spdx + "=" + result)
282
                       + " | " +
283
                       html.link("Show full text", 
284
                        "/spdx/show?x=full&"
285
                        + param.spdx + "=" + result)
286
                       ;
287
               
288
             }
276
             }
289
        };
277
        };
290
        task.launch();
278
        task.launch();
291
        
279
        
292
        
280
        
...
...
313
                + "necessary to complete this task";
301
                + "necessary to complete this task";
314
        task.setStatus(timeCount);
302
        task.setStatus(timeCount);
315
        // all done
303
        // all done
316
        task.setStatus("All done!");
304
        task.setStatus("All done!");
317
        task.setPercentageComplete(100);
305
        task.setPercentageComplete(100);
306
        
307
        
308
        // all done here, explain where the SPDX document can be found
309
               task.nextStep = 
310
                         html.link("SPDX summary", 
311
                        "/spdx/show?x=summary&"
312
                        + param.spdx + "=" + result)
313
                       + " | " +
314
                       html.link("Show full text", 
315
                        "/spdx/show?x=full&"
316
                        + param.spdx + "=" + result)
317
                       ;
318
               // when all things said and done
319
               concludeCreation(newSPDX);
320
        
318
        return result;
321
        return result;
319
    }
322
    }
320
    
323
    
321
     private File extractFile(File downloadedFile, RunningTask task){
324
     private File extractFile(File downloadedFile, RunningTask task){
322
         String fileName = downloadedFile.getName().toLowerCase();
325
         String fileName = downloadedFile.getName().toLowerCase();
...
...
426
        task.setPercentageComplete(10);
429
        task.setPercentageComplete(10);
427
        return targetFile;
430
        return targetFile;
428
    }
431
    }
429
    
432
    
430
    
433
    
431
    
434
/**
435
 * Do the things that are necessary after creating a new SPDX document, such as
436
 * updating the tree view
437
 */
438
private void concludeCreation(DocumentCreate newSPDX){
439
    String UID = newSPDX.UID;
440
    // refresh the tree
441
    swingUtils.refreshAll(core.studio.getTree(), UID);
432
}
442
}
443
    
444
}
445
446
447
433
448
434
//    
449
//    
435
//    /**
450
//    /**
436
//     * Opens the choose a folder dialog
451
//     * Opens the choose a folder dialog
437
//     */
452
//     */