Switch to unified view

a/tool/run/plugins/basic/TreeNodeDetails.java b/tool/run/plugins/basic/TreeNodeDetails.java
...
...
19
import definitions.Messages;
19
import definitions.Messages;
20
import definitions.definition;
20
import definitions.definition;
21
import definitions.is;
21
import definitions.is;
22
import java.awt.Cursor;
22
import java.awt.Cursor;
23
import java.io.File;
23
import java.io.File;
24
import java.util.Collection;
25
import java.util.Enumeration;
24
import java.util.Enumeration;
26
import java.util.HashMap;
27
import java.util.Iterator;
28
import main.core;
25
import main.core;
29
import main.param;
26
import main.param;
30
import script.Plugin;
27
import script.Plugin;
31
import script.log;
28
import script.log;
32
import spdxlib.FileInfo;
29
import spdxlib.FileInfo;
...
...
100
    
97
    
101
    /**
98
    /**
102
     * Add the files inside this SPDX document
99
     * Add the files inside this SPDX document
103
     */
100
     */
104
    private void addFiles(SPDXfile spdx, TreeNodeSPDX spdxNode){
101
    private void addFiles(SPDXfile spdx, TreeNodeSPDX spdxNode){
102
        Enumeration list = spdxNode.children();
103
        while(list.hasMoreElements()){
104
            TreeNodeSPDX child = (TreeNodeSPDX) list.nextElement();
105
            if(child.nodeType == NodeType.sectionFile){
106
                // no need to continue, our files were already listed
107
                return;
108
            }
109
        }
110
        
111
        
105
        // title of the node that we want to create
112
        // title of the node that we want to create
106
        String title = "Files";
113
        String title = "Files";
107
        
114
        
108
        // do we have more than one reviewer?
115
        // do we have more than one reviewer?
109
        if(spdx.fileSection.files.size() > 1){
116
        if(spdx.fileSection.files.size() > 1){
...
...
283
        }
290
        }
284
        return null;
291
        return null;
285
    }
292
    }
286
    
293
    
287
    
294
    
288
    /**
295
//    /**
289
     * Returns the parent path (if available)
296
//     * Returns the parent path (if available)
290
     */
297
//     */
291
    private String getParentFolder(String path){
298
//    private String getParentFolder(String path){
292
        // we need to count the number of slashes
299
//        // we need to count the number of slashes
293
        int lengthOriginal = path.length();
300
//        int lengthOriginal = path.length();
294
        String temp = path.replace("/", "");
301
//        String temp = path.replace("/", "");
295
        // do we have at least two slashes?
302
//        // do we have at least two slashes?
296
        if(lengthOriginal > (temp.length() + 1)){
303
//        if(lengthOriginal > (temp.length() + 1)){
297
            // get everything up to last slash
304
//            // get everything up to last slash
298
            return path.substring(0, path.lastIndexOf("/"));
305
//            return path.substring(0, path.lastIndexOf("/"));
299
        }
306
//        }
300
        // we have nothing, return the root folder
307
//        // we have nothing, return the root folder
301
        return "./";
308
//        return "./";
302
    }
309
//    }
303
    
310
    
304
    
311
    
305
    /**
312
    /**
306
     * Returns the path portion from a given FileInfo object
313
     * Returns the path portion from a given FileInfo object
307
     * @return 
314
     * @return