private List<Package> getPackages() { 
        List<Package> packages = new LinkedList<Package>();
         
        for ( int i = 0; i < toolsTableModel.getRowCount(); i++ ) {
            Boolean isSelected = (Boolean)toolsTableModel.getValueAt(i, ToolsTableModel.COLUMN_SELECTED);
            String name =  (String)toolsTableModel.getValueAt(i, ToolsTableModel.COLUMN_NAME);
            String configfield_name =(String)toolsTableModel.getValueAt(i, ToolsTableModel.COLUMN_CONFIGFIELD_NAME);

            if ( isSelected ) {
                String version =  (String)toolsTableModel.getValueAt(i, ToolsTableModel.COLUMN_VERSION);
                String configfield_version =(String)toolsTableModel.getValueAt(i, ToolsTableModel.COLUMN_CONFIGFIELD_VERSION);

                String location = toolsPath + name;
                if ( !version.equals("-") )
                    location+="-" + version;
                else
                    version = "*";

                Configuration.setConfig(configfield_name, "true");
                Configuration.setConfig(configfield_version, version);

                Package p = new Package();
                p.setLocation(location);
                p.setVersion(version);
                p.setName(name);
                
                if ( name.equals("EMBOSS") ) {
                    p.addVariable("EMBOSS_ACDROOT", location + "/acd");
                    p.addVariable("PATH", location  + ":${PATH}");
                } else if ( name.equals("Picard") ) {
                    p.addVariable("java_dir", Constants.javaHomeDir());
                    p.addVariable("PICARDPATH", location);
                    String rhome = System.getenv("RHOME");
                    if (rhome == null)
                        rhome = toolsPath + "/LONI/apps/R";
                    p.addVariable("RHOME", rhome);
                    p.addVariable("PATH", rhome + "/bin:${PATH}");
                } else if ( name.equals("MSA")) {
                    p.addVariable("MSA_DIR", location);
                } else if (name.equals("Migrate") ) {
                    p.addVariable("MIGRATE_DIR", location);
                }
                
                packages.add(p);
            } else {
                Configuration.setConfig(configfield_name, "false");
            }

        }
        
        
        return packages;
    }