Index: trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
===================================================================
--- trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java	(revision 12093)
+++ trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java	(revision 12095)
@@ -63,16 +63,19 @@
     /** A list of formating strings to use at build time. */
     static public FormatManager format_manager;
-    /** The manager in charge of displaying this manager and the controls for other managers. */
+    /** A manager of general options */
     static public GeneralManager general_manager;
-    /** List of indexes to be built, and the default index. */
-    static public IndexManager index_manager;
+    /** List of indexes to be built, and the default index. 
+     also handles build type and levels */
+    static public IndexingManager index_manager;
     /** Contains instructions dealing with the collection language. */
     static public LanguageManager language_manager;
+    /** Handling writing extra.dm file */
+    static public MacrosManager macros_manager;
     /** A simple manager for the visual review of metadata sets. */
     static public MetadataSetView metadataset_view;
     /** A list of plugins to use at build time. */
     static public PluginManager plugin_manager;
-    /** The manager in charge of all aspects of searchtypes. We also ask this manager whether we are MG or MGPP enabled. */
-    static public SearchTypeManager searchtype_manager;
+    /** a manager of searching metadata such as index names*/ 
+    static public SearchMetadataManager searchmetadata_manager;
     /** Contains: A list of subcollections, (defined on metadatadata), a list of which subcollection indexes to build and the default subcollection index. */
     static public SubcollectionManager subcollection_manager;
@@ -82,5 +85,5 @@
     static public SuperCollectionManager supercollection_manager; // Just cause I could ;p
     /** The text translation manager. */
-    static public TranslationView translation_view;
+    static public TranslationView translation_manager;
     /** These mark what needs to happen when building a collection where ONLY design options have been changed.
         The build requirements of the higher numbers must include doing everything from the lower numbers. */
@@ -119,5 +122,4 @@
      * @see org.greenstone.gatherer.cdm.MetadataSetView
      * @see org.greenstone.gatherer.cdm.PluginManager
-     * @see org.greenstone.gatherer.cdm.SearchTypeManager
      * @see org.greenstone.gatherer.cdm.SubcollectionIndexManager
      * @see org.greenstone.gatherer.cdm.SubcollectionManager
@@ -131,14 +133,6 @@
 	classifier_manager = new ClassifierManager();
 	general_manager = new GeneralManager();
-
-	searchtype_manager = new SearchTypeManager(collect_config.getSearchType());
-	if(searchtype_manager.isSearchTypeEnabled()) {
-	    // note this this could be lucene now, the format is the same as for mgpp
-	    index_manager = new IndexManager(collect_config.getMGPPIndexes());
-	}
-	else {
-	    index_manager = new IndexManager(collect_config.getMGIndexes());
-	}
-
+	macros_manager = new MacrosManager();
+	index_manager = new IndexingManager();
 	metadataset_view = new MetadataSetView();
 	plugin_manager = new PluginManager();
@@ -147,5 +141,6 @@
 	subcollectionindex_manager = new SubcollectionIndexManager(collect_config.getSubIndexes());
 	supercollection_manager = new SuperCollectionManager(collect_config.getSuperCollection());
-	translation_view = new TranslationView();
+	searchmetadata_manager = new SearchMetadataManager();
+	translation_manager = new TranslationView();
 	format_manager = new FormatManager(); // Parse formats at the very end, given that they depend upon several other managers to appear properly.
     }
@@ -154,11 +149,9 @@
      */
     public void destroy() {
-	// Remove visual the component from its parent.
-	if(general_manager.getParent() != null) {
-	    general_manager.getParent().remove(general_manager);
-	}
 	// Remove references from persistant listeners.
 	classifier_manager.destroy();
 	classifier_manager = null;
+	searchmetadata_manager.destroy();
+	searchmetadata_manager = null;
 	format_manager.destroy();
 	format_manager = null;
@@ -177,18 +170,6 @@
 	supercollection_manager.destroy();
 	supercollection_manager = null;
-	translation_view.destroy();
-	translation_view = null;
-    }
-
-    /** Display the GUI interface for the CollectionDesignManager in the centre of the indicated panel.
-     * @param target the JPanel you wish to display the gui on
-     */
-    public void display(JPanel target) {
-	target.add(general_manager, BorderLayout.CENTER);
-    }
-    /** When the tab on the JTabbedPane that contains the GUI is selected, this method is called to ensure that the controls are all up to date, in terms of references to metadata etc.
-     */
-    public void gainFocus() {
-	general_manager.gainFocus();
+	translation_manager.destroy();
+	translation_manager = null;
     }
 
@@ -198,5 +179,14 @@
     public void modeChanged(int mode) {
 	plugin_manager.modeChanged(mode);
+	classifier_manager.modeChanged(mode);
 	subcollection_manager.modeChanged(mode);
+	supercollection_manager.modeChanged(mode);
+	format_manager.modeChanged(mode);
+	index_manager.modeChanged(mode);
+	translation_manager.modeChanged(mode);
+	metadataset_view.modeChanged(mode);
+	general_manager.modeChanged(mode);
+	language_manager.modeChanged(mode);
+	searchmetadata_manager.modeChanged(mode);
     }
 
@@ -208,9 +198,4 @@
     }
 
-    /** Ensure that saving will actually work. This can return false if there is a collection filename clash for instance. */
-    public boolean canSave() {
-	return (general_manager == null || general_manager.canSave());
-    }
-
 
     public void save() {
@@ -221,5 +206,4 @@
     public void save(boolean force_save)
     {
-	
 	general_manager.loseFocus();
 	if (!update_collect_cfg_required && !force_save) {
@@ -229,5 +213,4 @@
 
 	DebugStream.println("Saving the collection config file");
-	
 	// Release collection as necessary
 	String collection_name = Gatherer.c_man.getCollection().getName();
