Switch to unified view

a/tool/src/GUI/StudioUI2.java b/tool/src/GUI/StudioUI2.java
...
...
61
            //currentPage = new Page();
61
            //currentPage = new Page();
62
    
62
    
63
    
63
    
64
    private File 
64
    private File 
65
            baseFolderPresent = null,
65
            baseFolderPresent = null,
66
            baseFolderPrevious = null;
66
            baseFolderPast = null,
67
            baseFilePresent = null,
68
            baseFilePast = null;
67
    
69
    
68
    /**
70
    /**
69
     * Creates new form StudioUI2
71
     * Creates new form StudioUI2
70
     */
72
     */
71
    public StudioUI2() {
73
    public StudioUI2() {
...
...
510
            text.setEditable(editable);
512
            text.setEditable(editable);
511
            if(editable){
513
            if(editable){
512
                // this is needed to workaround a defect in text/plain mode
514
                // this is needed to workaround a defect in text/plain mode
513
                text.setCursor(Cursor.getDefaultCursor());
515
                text.setCursor(Cursor.getDefaultCursor());
514
            }
516
            }
515
            
517
           
516
            // no point to continue if the request is empty
518
             // no point to continue if the request is empty
517
            if(request == null){
519
            if(request == null){
518
                baseFolderPresent = null;
520
                baseFolderPresent = null;
519
                return;
521
                return;
520
            }
522
            }
521
            
523
            
524
            // keep track of what was executed last time
525
            if(request.scriptFile != null){
526
                baseFilePast = baseFilePresent;
527
                baseFilePresent = request.scriptFile;
528
            }else{
529
                baseFilePast = null;
530
                baseFilePresent = null;
531
            }
532
            
533
           
534
            
522
            // this is necessary to load pages from the same folder
535
            // this is necessary to load pages from the same folder
523
            baseFolderPrevious = baseFolderPresent;
536
            baseFolderPast = baseFolderPresent;
524
            baseFolderPresent = request.BaseFolder;
537
            baseFolderPresent = request.BaseFolder;
525
538
526
            // important step, sometimes we just want to define a page on disk
539
            // important step, sometimes we just want to define a page on disk
527
            if(request.hasPage()){
540
            if(request.hasPage()){
528
                try {
541
                try {
...
...
591
                lastPage.editable, 
604
                lastPage.editable, 
592
                lastPage.carotPosition, 
605
                lastPage.carotPosition, 
593
                lastPage.getText());
606
                lastPage.getText());
594
        // destroy the old page
607
        // destroy the old page
595
        lastPage = new Page();
608
        lastPage = new Page();
596
        baseFolderPresent = baseFolderPrevious;
609
        baseFolderPresent = baseFolderPast;
610
        baseFilePresent = baseFilePast;
597
        // disable button
611
        // disable button
598
        button.setEnabled(false);
612
        button.setEnabled(false);
599
    }
613
    }
600
614
601
  
615
  
...
...
689
        if(URL.startsWith("?")){
703
        if(URL.startsWith("?")){
690
            //?x=full&spdx=jfreechart-1.0.17.tar.gz.spdx
704
            //?x=full&spdx=jfreechart-1.0.17.tar.gz.spdx
691
            // remove the "?" from the string
705
            // remove the "?" from the string
692
            String parameters = URL.substring(1);
706
            String parameters = URL.substring(1);
693
            
707
            
694
            //TODO this needs to be sorted
708
            // the script can't have the full path defined, just a relative path
695
//            String script = baseFolderPresent.;
709
            String temp = baseFilePresent.getAbsolutePath();
710
            String script = temp.replace(core.getPluginsFolder().getAbsolutePath(), "");
696
//            request.
711
//            request.
697
                
712
                
698
            // execute the link request
713
            // execute the link request
699
           // processFormSubmit2(request, script, parameters);
714
            processFormSubmit2(request, script, parameters);
700
            return;
715
            return;
701
        }
716
        }
702
        
717
        
703
        // normal web link, open in browser
718
        // normal web link, open in browser
704
        if(URL.startsWith("http://")){
719
        if(URL.startsWith("http://")){