Index: /gli/trunk/src/org/greenstone/gatherer/cdm/LanguageManager.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/cdm/LanguageManager.java	(revision 14743)
+++ /gli/trunk/src/org/greenstone/gatherer/cdm/LanguageManager.java	(revision 14744)
@@ -284,4 +284,8 @@
 	/** button to move a language down in the list */
 	private JButton move_up_button;
+	/** button to select all the languages in the list */
+	private JButton select_all_button;
+	/** button to clear the current selection in the list */
+	private JButton select_none_button; 
 	/** The button to set the current language as the default one. */
 	private JButton set_default_button = null;
@@ -311,5 +315,9 @@
 	    
 	    JPanel control_panel = new JPanel();
+	    
+	    JPanel labels_pane = new JPanel();	    
 	    JLabel selector_label = new JLabel(Dictionary.get("CDM.LanguageManager.Selector"));
+	    select_all_button = new GLIButton(Dictionary.get("CDM.IndexManager.Select_All"), Dictionary.get("CDM.IndexManager.Select_All_Tooltip"));
+	    select_none_button = new GLIButton(Dictionary.get("CDM.IndexManager.Select_None"), Dictionary.get("CDM.IndexManager.Select_None_Tooltip"));
 	    
 	    language_metadata_combo = new JComboBox(MetadataSetManager.getEveryMetadataSetElement().toArray());
@@ -326,4 +334,7 @@
 	    language_list.setToolTipText(Dictionary.get("CDM.LanguageManager.Selector_Tooltip"));
 	    language_list.setCellRenderer(new LanguageCheckListCellRenderer());
+	    
+	    select_all_button.setEnabled(isSelectAllEnabled());
+	    select_none_button.setEnabled(isSelectAllEnabled());
 	    	    
 	    JPanel movement_pane = new JPanel();
@@ -359,4 +370,8 @@
 	    replace_button.addActionListener(new ReplaceListener());
 	    replace_button.addActionListener(CollectionDesignManager.buildcol_change_listener);
+	    select_all_button.addActionListener(new SelectAllListener());			
+	    select_all_button.addActionListener(CollectionDesignManager.buildcol_change_listener);
+	    select_none_button.addActionListener(new SelectNoneListener());
+	    select_none_button.addActionListener(CollectionDesignManager.buildcol_change_listener);
 
 	    language_list.addListSelectionListener(new LanguageListListener());
@@ -395,5 +410,35 @@
 	    control_panel.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
 	    control_panel.setLayout(new BorderLayout());
-	    control_panel.add(selector_label, BorderLayout.WEST);
+	    	    
+	    labels_pane.setLayout(new BorderLayout());
+	    labels_pane.setBorder(BorderFactory.createEmptyBorder(5, 5, 10, 5));
+	    
+	    // add the select all and select none buttons to the label panel			 
+	    GridBagLayout gridbag = new GridBagLayout();			
+	    GridBagConstraints c = new GridBagConstraints();
+	    labels_pane.setLayout(gridbag);
+
+	    c.fill = GridBagConstraints.BOTH;		
+	    c.weightx = 1.0;
+	    c.weighty = 1.0;
+	    c.gridx = 0;
+	    c.gridy = 0;
+	    
+	    gridbag.setConstraints(selector_label, c);
+	    labels_pane.add(selector_label);
+	    
+	    c.fill = GridBagConstraints.HORIZONTAL;
+	    c.weighty = 0.0;
+	    c.gridy = 1;
+	    
+	    gridbag.setConstraints(select_all_button, c);
+	    labels_pane.add(select_all_button);			
+	    
+	    c.gridy = 2;
+	    gridbag.setConstraints(select_none_button, c);
+	    labels_pane.add(select_none_button);	
+	    	    
+	    control_panel.add(labels_pane, BorderLayout.WEST);
+	    
 	    control_panel.add(new JScrollPane(language_list), BorderLayout.CENTER);
 	    control_panel.add(button_panel, BorderLayout.SOUTH);
@@ -435,4 +480,6 @@
 	    move_down_button.setEnabled(false);
 	    move_up_button.setEnabled(false);
+	    select_all_button.setEnabled(isSelectAllEnabled());			
+	    select_none_button.setEnabled(isSelectAllEnabled());
 
 	}
@@ -447,7 +494,10 @@
 	    
 	    // Display the selected subcollection index's sources
-	    language_list.clearTicked();
-	    language_list.setTickedObjects(selected_lang.getCode().split(","));
-	    
+	    language_list.clearTicked();	
+	    // for multi-languages indexes, getCode returns null
+	    if(selected_lang.getCode()==null){	      	      
+	      return;
+	    }
+	    language_list.setTickedObjects(selected_lang.getCode().split(","));	    
 	}
 
@@ -481,4 +531,6 @@
 	    add_button.setEnabled(add_enabled);
 	    replace_button.setEnabled(replace_enabled);
+	    select_all_button.setEnabled(isSelectAllEnabled());
+	    select_none_button.setEnabled(isSelectAllEnabled());
 	}
 	
@@ -538,4 +590,26 @@
 		validateButtons();
 	    }
+	}
+	
+	private class SelectAllListener
+	implements ActionListener {
+		
+		public void actionPerformed(ActionEvent event){
+			if(select_all_button.isEnabled()){
+			  language_list.setAllTicked();
+			  validateButtons();
+			}
+		}
+	}
+	
+	private class SelectNoneListener
+	implements ActionListener {
+		
+		public void actionPerformed(ActionEvent event){
+			if(select_all_button.isEnabled()){
+			  language_list.clearTicked();
+			  validateButtons();
+			}
+		}
 	}
 	
@@ -598,4 +672,8 @@
 		int i = selected_languages_list.getSelectedIndex();
  		int size = selected_languages_list.getModel().getSize();
+ 		
+ 		select_all_button.setEnabled(isSelectAllEnabled());
+		select_none_button.setEnabled(isSelectAllEnabled());
+		
 		Language selected_lang = (Language)selected_languages_list.getSelectedValue();
 		remove_button.setEnabled(true);
@@ -631,4 +709,8 @@
 		return component;
 	    }
+	}
+	
+	private boolean isSelectAllEnabled(){
+	  return language_list.getModel().getSize() > 0 ? true : false;		  	
 	}
     }
@@ -662,4 +744,6 @@
 	}
     }
+    
+    
 
 }
