Index: trunk/gli/src/org/greenstone/gatherer/gems/DeleteMetadataSetPrompt.java
===================================================================
--- trunk/gli/src/org/greenstone/gatherer/gems/DeleteMetadataSetPrompt.java	(revision 12674)
+++ trunk/gli/src/org/greenstone/gatherer/gems/DeleteMetadataSetPrompt.java	(revision 12675)
@@ -53,5 +53,5 @@
 
 public class DeleteMetadataSetPrompt 
-    extends ModalDialog{
+    extends ModalDialog { 
 
     static private Dimension SIZE = new Dimension(500, 500);
@@ -64,7 +64,8 @@
     private JButton close_button = null;    
     private JList available_set_list = null;
+    /** The model behind the list. */
+    private DefaultListModel list_model = null;
     private JTextArea description_textarea = null;
     private DeleteMetadataSetPrompt self;
-    private String current_language = GEMSConstants.DEFAULT_LANGUAGE;
     private MetadataSetManager meta_manager;
   
@@ -83,14 +84,17 @@
 	
 
-	JLabel  available_metadata_sets_label = new JLabel(Dictionary.get("GEMS.DeleteMetadataSetPrompt.Available_Sets"));
-	 available_metadata_sets_label.setOpaque(true);
+	JLabel available_metadata_sets_label = new JLabel(Dictionary.get("GEMS.DeleteMetadataSetPrompt.Available_Sets"));
+	available_metadata_sets_label.setOpaque(true);
+	
+	list_model = new DefaultListModel();
 	
         available_set_list = new JList();
 	available_set_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+	available_set_list.setModel(list_model);
 	available_set_list.setCellRenderer(new MetadatSetListCellRenderer()); 
 	available_set_list.setFixedCellHeight(20);
 	available_set_list.addListSelectionListener(new MetadataSetListSelectionListener());
 
-         JPanel set_pane = new JPanel();
+	JPanel set_pane = new JPanel();
         set_pane.setLayout(new BorderLayout());
         set_pane.add(available_metadata_sets_label,BorderLayout.NORTH);
@@ -98,5 +102,5 @@
 
 
-	JLabel  metadata_set_des_label = new JLabel(Dictionary.get("GEMS.Set_Description"));
+	JLabel metadata_set_des_label = new JLabel(Dictionary.get("GEMS.Set_Description"));
 	metadata_set_des_label.setOpaque(true);
 
@@ -127,6 +131,6 @@
 		public void actionPerformed(ActionEvent event) {
 		    delete_button.setEnabled(confirmation.isSelected());
-		    confirmation.setEnabled(false);
-		    confirmation.setSelected(false);
+		    //confirmation.setEnabled(false);
+		    //confirmation.setSelected(false);
 		}
 	    });
@@ -164,7 +168,10 @@
 
       
-    public void display(){
+    public void display() {
 	available_metadata_sets =  meta_manager.getAvailableMetadataSets();
-	available_set_list.setListData(new Vector((Collection)available_metadata_sets));
+	for (int i=0; i<available_metadata_sets.size(); i++) {
+	    list_model.addElement(available_metadata_sets.get(i));
+	}
+	//available_set_list.setListData(new Vector((Collection)available_metadata_sets));
 	delete_button.setEnabled(false);
 	confirmation.setEnabled(false);
@@ -186,31 +193,32 @@
 	public void actionPerformed(ActionEvent event) {
 	    // Delete the selected MetadataSet.
-	    	Object selectedValue = available_set_list.getSelectedValue();
+	    Object selectedValue = available_set_list.getSelectedValue();
 		
-		if (selectedValue !=null && (selectedValue instanceof MetadataSetInfo)){
-		    ((MetadataSetInfo)selectedValue).deleteMetadataSet();
-		}
-		delete_button.setEnabled(false);
-		confirmation.setEnabled(false);
-		confirmation.setSelected(false);
-		self.dispose();
-	}
-
-    }
-
-
-  private class MetadatSetListCellRenderer extends JLabel implements ListCellRenderer {
+	    if (selectedValue !=null && (selectedValue instanceof MetadataSetInfo)){
+		((MetadataSetInfo)selectedValue).deleteMetadataSet();
+		list_model.removeElement(selectedValue);
+	    }
+	    delete_button.setEnabled(false);
+	    confirmation.setEnabled(false);
+	    confirmation.setSelected(false);
+	    description_textarea.setText(Dictionary.get("GEMS.DeleteMetadataSetPrompt.No_Set"));
+	    //self.dispose();
+	}
+
+    }
+
+
+    private class MetadatSetListCellRenderer extends JLabel implements ListCellRenderer {
 	public  MetadatSetListCellRenderer() {
 	    setOpaque(true);
 	}
 	
-      public Component getListCellRendererComponent(
-						   JList list,
-						   Object value,
-         int index,
-						   boolean isSelected,
-         boolean cellHasFocus)
+	public Component getListCellRendererComponent(JList list,
+						      Object value,
+						      int index,
+						      boolean isSelected,
+						      boolean cellHasFocus)
 	{
-             String name= "unknown";
+	    String name= "unknown";
 
 	    if (value instanceof MetadataSetInfo){
@@ -236,6 +244,7 @@
     private class MetadataSetListSelectionListener implements ListSelectionListener  {
         public void valueChanged(ListSelectionEvent lse){
-	     delete_button.setEnabled(false);
 	    if (lse.getValueIsAdjusting()) return;
+	    
+	    delete_button.setEnabled(false);
 	   
 	    Object selectedValue = available_set_list.getSelectedValue();
@@ -243,10 +252,11 @@
             if (selectedValue !=null && (selectedValue instanceof MetadataSetInfo)){
                 MetadataSetInfo meta_info = (MetadataSetInfo)selectedValue; 
-		String des =  meta_info.getMetadataSetDescription(); //get the description of the metadata set
-                description_textarea.setText(des);
+		description_textarea.setText(meta_info.getMetadataSetDescription());
 		confirmation.setEnabled(true);
-	    }
-	    else{
+		confirmation.setSelected(false);
+	    }
+	    else {
 		confirmation.setEnabled(false);
+		description_textarea.setText(Dictionary.get("GEMS.DeleteMetadataSetPrompt.No_Set"));
 	    }      
 
