Index: /main/trunk/gli/src/org/greenstone/gatherer/cdm/BaseIndexManager.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/cdm/BaseIndexManager.java	(revision 36156)
+++ /main/trunk/gli/src/org/greenstone/gatherer/cdm/BaseIndexManager.java	(revision 36157)
@@ -105,5 +105,5 @@
     }
 
-    private Index createIndex(Element elem) {
+    protected Index createIndex(Element elem) {
 	return (Index)getClassType().create(elem);
     }
@@ -118,5 +118,5 @@
      * @see org.greenstone.gatherer.collection.CollectionManager
      */
-    private void addIndex(Index index, CollectionMeta metadatum) {
+    protected void addIndex(Index index, CollectionMeta metadatum) {
 	///ystem.err.println("Adding an index: " + index.toString());
 	if(!contains(index)) {
@@ -190,5 +190,5 @@
     }
 
-    private void moveIndex(Index index, boolean move_up)
+    protected void moveIndex(Index index, boolean move_up)
     {
 	// Determine the current position of the index
@@ -229,5 +229,5 @@
      * @see org.greenstone.gatherer.collection.CollectionManager
      */
-    private void removeIndex(Index index) {
+    protected void removeIndex(Index index) {
 	if(index != null) {
 	    // Remove any current metadata from this index
@@ -253,5 +253,5 @@
     /* replace an index in the list. new index may have the same sources but a
        different name, or may be a new index altogether */
-    private void replaceIndex(Index old_index, Index new_index,
+    protected void replaceIndex(Index old_index, Index new_index,
 			      CollectionMeta coll_meta) {
 	if (old_index == null || new_index == null || coll_meta == null) {
@@ -310,19 +310,20 @@
     }
 
-
-    private class IndexControl
+  
+
+    protected class IndexControl
 	extends JPanel
 	implements Control {
 
-	private JList index_list;
-	private JButton move_down_button;
-	private JButton move_up_button;
-	private JButton set_default_button;
-
-	private JButton new_button;
-	private JButton edit_button;
-	private JButton remove_button;
-
-	private boolean has_default = false;
+	protected JList index_list;
+	protected JButton move_down_button;
+	protected JButton move_up_button;
+	protected JButton set_default_button;
+
+	protected JButton new_button;
+	protected JButton edit_button;
+	protected JButton remove_button;
+
+	protected boolean has_default = false;
 	public IndexControl() {
 	    super();
@@ -412,7 +413,11 @@
 	public void gainFocus() {}
 	public void destroy() {}
-  
+
+      protected NewIndexPrompt createNewIndexPrompt(String build_type, Index index) {
+        return new NewIndexPrompt(build_type, index);
+        
+      }
 	/** Listens for double clicks apon the list and react as if the configure button was pushed. */
-	private class ClickListener
+	protected class ClickListener
 	    extends MouseAdapter {
 	    /** Called whenever the mouse is clicked over a registered component, we use this to chain through to the configure prompt.
@@ -423,5 +428,5 @@
         if(!index_list.isSelectionEmpty()) {
           Index index = (Index) index_list.getSelectedValue();
-          NewIndexPrompt nip = new NewIndexPrompt(build_type, index);
+          NewIndexPrompt nip = createNewIndexPrompt(build_type, index);
           nip.destroy();          
         }
@@ -431,5 +436,5 @@
 
   
-	private class IndexListListener
+	protected class IndexListListener
 	    implements ListSelectionListener {
 	    
@@ -465,5 +470,5 @@
 	}
 
-	private class IndexListRenderer
+	protected class IndexListRenderer
 	    extends DefaultListCellRenderer {
 
@@ -479,24 +484,24 @@
 	}
 
-	private class NewIndexListener
+	protected class NewIndexListener
 	    implements ActionListener {
 
 	    public void actionPerformed(ActionEvent event) {
-		NewIndexPrompt nip = new NewIndexPrompt(build_type, null);
+		NewIndexPrompt nip = createNewIndexPrompt(build_type, null);
 		nip.destroy();
 	    }
 	}
 	
-	private class EditIndexListener
+	protected class EditIndexListener
 	    implements ActionListener {
 
 	    public void actionPerformed(ActionEvent event) {
 		Index index = (Index) index_list.getSelectedValue();
-		NewIndexPrompt nip = new NewIndexPrompt(build_type, index);
+		NewIndexPrompt nip = createNewIndexPrompt(build_type, index);
 		nip.destroy();
 	    }
 	}
 
-	private class RemoveIndexListener
+	protected class RemoveIndexListener
 	    implements ActionListener {
 	    
@@ -516,8 +521,8 @@
 	}
 
-	private class MoveListener
+	protected class MoveListener
 	    implements ActionListener {
 
-	    private boolean move_up;
+	    protected boolean move_up;
 
 	    public MoveListener(boolean move_up) {
@@ -537,5 +542,5 @@
 	}
 
-	private class SetDefaultListener
+	protected class SetDefaultListener
 	    implements ActionListener {
 
@@ -553,19 +558,22 @@
 	
 
-	private class NewIndexPrompt 
+	protected class NewIndexPrompt 
 	    extends ModalDialog {
 
 	    NewIndexPrompt new_index_prompt = null;
 
-	    private CheckList source_list;
-	    private JButton add_or_replace_button;
-
-	    //private JButton select_none_button;
-	    //private JButton add_all_button;
-	    //private JButton select_all_button;
-	    //private JButton replace_button;
-	    private JButton cancel_button;
-
-	    private boolean editing = false;
+	    protected CheckList source_list;
+	    protected JButton add_or_replace_button;
+
+	    //protected JButton select_none_button;
+	    //protected JButton add_all_button;
+	    //protected JButton select_all_button;
+	    //protected JButton replace_button;
+	    protected JButton cancel_button;
+
+          protected JPanel content_pane;
+          protected JPanel details_pane;
+          protected JPanel button_pane;
+	    protected boolean editing = false;
 	
 		
@@ -587,10 +595,34 @@
 		setJMenuBar(new SimpleMenuBar("searchindexes"));
 
-		JPanel content_pane = (JPanel)this.getContentPane();
+		content_pane = (JPanel)this.getContentPane();
                 content_pane.setComponentOrientation(Dictionary.getOrientation());
+                generateContents(build_type, existing_index);
+	    
+		// Display on screen.
+		Dimension screen_size = Configuration.screen_size;
+		setLocation((screen_size.width - PROMPT_SIZE.width) / 2, (screen_size.height - PROMPT_SIZE.height) / 2);
+		screen_size = null;
+		setVisible(true);
+	    
+	    }
+
+          
+	    /** Method which actually forces the dialog to be shown on screen.
+	     * @return <i>true</i> if the user completed configuration and pressed ok, <i>false</i> otherwise.
+	     */
+	    public boolean display() {
+		setVisible(true);
+		return true;
+		//    return success;
+	    }
+	
+	    public void destroy() {
+	    }
+
+          protected void generateContents(String build_type, Index existing_index) {
 		ArrayList new_data = new ArrayList();
 		new_data.addAll(MetadataSetManager.getEveryMetadataSetElement());
 
-		JPanel details_pane = new JPanel();
+		details_pane = new JPanel();
                 details_pane.setComponentOrientation(Dictionary.getOrientation());
 		
@@ -602,5 +634,5 @@
 		source_list.addListSelectionListener(new SourceListListener());
 
-		JPanel button_pane = new JPanel();
+		button_pane = new JPanel();
 		button_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
 		button_pane.setComponentOrientation(Dictionary.getOrientation());
@@ -646,27 +678,9 @@
 		content_pane.add(details_pane, BorderLayout.CENTER);
 		content_pane.add(button_pane, BorderLayout.SOUTH);
-	    
-		// Display on screen.
-		Dimension screen_size = Configuration.screen_size;
-		setLocation((screen_size.width - PROMPT_SIZE.width) / 2, (screen_size.height - PROMPT_SIZE.height) / 2);
-		screen_size = null;
-		setVisible(true);
-	    
-	    }
-
-	    /** Method which actually forces the dialog to be shown on screen.
-	     * @return <i>true</i> if the user completed configuration and pressed ok, <i>false</i> otherwise.
-	     */
-	    public boolean display() {
-		setVisible(true);
-		return true;
-		//    return success;
-	    }
-	
-	    public void destroy() {
-	    }
-
+
+            
+          }
 	    // Checks that specified index not already in the collection
-	    private void validateAddOrReplaceButton() {
+	    protected void validateAddOrReplaceButton() {
 		Index index;
 		ArrayList sources;
@@ -690,5 +704,5 @@
 	    }
 
-	    private Index generateNewIndex() {
+	    protected Index generateNewIndex() {
 		Index index = null;
 		ArrayList sources;
@@ -701,5 +715,5 @@
 	    }
 	    
-	    private CollectionMeta generateCollectionMeta(Index index) {
+	    protected CollectionMeta generateCollectionMeta(Index index) {
 		CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + index.getID());
 		if (use_macro_as_display_name(index.getID())) {
@@ -711,5 +725,5 @@
 	    }
 	    
-	    private class AddIndexListener
+	    protected class AddIndexListener
 		implements ActionListener
 	    {
@@ -729,5 +743,5 @@
 
 
-	    private class SourceListListener
+	    protected class SourceListListener
 		implements ListSelectionListener {
 	    
@@ -741,5 +755,5 @@
 	
 
-	    private class ReplaceIndexListener
+	    protected class ReplaceIndexListener
 		implements ActionListener {
 	    
@@ -765,5 +779,5 @@
 	     * @return Whether macro variable should be used.
 	     */
-	    private boolean use_macro_as_display_name(String index_id) {
+	    protected boolean use_macro_as_display_name(String index_id) {
 		//String metaname = index_id;	
 		if (index_id.indexOf(":") != -1) {
@@ -803,5 +817,5 @@
 	     * @return Name of the macro variable.
 	     */
-	    private String get_macro_name(String index_id) {
+	    protected String get_macro_name(String index_id) {
 		if (index_id.indexOf(":") != -1) {
 		    index_id = index_id.substring(index_id.indexOf(":") + 1);
