Index: trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentControl.java
===================================================================
--- trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentControl.java	(revision 12824)
+++ trunk/gli/src/org/greenstone/gatherer/cdm/ArgumentControl.java	(revision 12825)
@@ -11,5 +11,4 @@
 import java.util.Map;
 import java.util.Iterator;
-import java.util.HashMap;
 
 import org.greenstone.gatherer.Configuration;
@@ -30,6 +29,5 @@
 
     static protected Dimension LABEL_SIZE = new Dimension(175, 25);
-    static protected Dimension ROW_SIZE = new Dimension(800, 30);
-
+    static protected Dimension ROW_SIZE = new Dimension(400, 30);
     /** The Argument this control will be based on. */
     private Argument argument = null;
@@ -44,13 +42,12 @@
     public ArgumentControl(Argument argument, boolean is_enabled, String preset_value) {
 	this.argument = argument;
-	///ystem.err.println("generating controls for arg "+argument.getName());
-	String tip = "<html>" + argument.getDescription() + "</html>";
-	tip = Utility.formatHTMLWidth(tip, 60);
+
+	String tip = "<html>" + argument.getName()+": "+argument.getDescription() + "</html>";
+	tip = Utility.formatHTMLWidth(tip, 80);
 
 	setBackground(Configuration.getColor("coloring.collection_tree_background", false));
 	setBorder(BorderFactory.createEmptyBorder(2,0,2,0));
 	setLayout(new BorderLayout());
-	//setPreferredSize(ROW_SIZE);
-	setMaximumSize(ROW_SIZE);
+	setPreferredSize(ROW_SIZE);
 
 	if (argument.isRequired()) {
@@ -84,18 +81,8 @@
 	switch(argument.getType()) {
 	case Argument.ENUM:
-	    // Build an option model, wrapping each entry of the list table.
-	    HashMap arg_list = argument.getOptions();
-	    ArrayList options_model = new ArrayList();
-	    Iterator it = arg_list.entrySet().iterator();
-	    while(it.hasNext()) {
-		Map.Entry e = (Map.Entry)it.next();
-		//String key = (String) it.next();
-		//options_model.add(new ListOption(key, (String)arg_list.get(key)));
-		options_model.add(new ListOption((String)e.getKey(), (String)e.getValue()));
-	    }
-	    Collections.sort(options_model);
-	    value_control = new GComboBox(options_model.toArray(), false);
+	    ArrayList option_list = argument.getOptions();
+	    value_control = new GComboBox(option_list.toArray(), false, false);
+	    selectValue((JComboBox)value_control, initial_value); // also sets the tooltip
 	    ((JComboBox)value_control).addActionListener(new ToolTipUpdater());
-	    selectValue((JComboBox)value_control, initial_value);
 	    break;
 	    
@@ -237,5 +224,8 @@
 	// Listener
 	if(value_control != null) {
-	    value_control.setToolTipText(tip);
+	    if (argument.getType() != Argument.ENUM) {
+		// enums have already set tooltips based on option value
+		value_control.setToolTipText(tip);
+	    }
 	    add(value_control, BorderLayout.CENTER);
 	    if (!argument.isRequired()) {
@@ -266,6 +256,6 @@
 		    return ((MetadataSet) selected_item).getNamespace();
 		}
-		if (selected_item instanceof ListOption) {
-		    return ((ListOption)selected_item).getValue();
+		if (selected_item instanceof Argument.ArgumentOption) {
+		    return ((Argument.ArgumentOption)selected_item).name;
 		}
 		if (selected_item instanceof MetadataElement) {
@@ -305,5 +295,5 @@
     /** Updates the enwrapped Argument using the values provided by the controls.
      * @return <i>true</i> if the update was successful, <i>false</i> otherwise.
-     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl.ListOption
+     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.Argument.ArgumentOption
      * @see org.greenstone.gatherer.cdm.Language
      */
@@ -314,7 +304,7 @@
 	    switch(argument.getType()) {
 	    case Argument.ENUM:
-		ListOption option = (ListOption)((JComboBox)value_control).getSelectedItem();
-		if(option != null && option.getValue().length() > 0) {
-		    argument.setValue(option.getValue());
+		Argument.ArgumentOption option = (Argument.ArgumentOption)((JComboBox)value_control).getSelectedItem();
+		if(option != null && option.name.length() > 0) {
+		    argument.setValue(option.name);
 		}
 		else {
@@ -466,5 +456,5 @@
      * @param target The desired value of the selection as a <strong>String</strong>.
      * @return true if the item was found and selected, false otherwise
-     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.ArgumentControl.ListOption
+     * @see org.greenstone.gatherer.cdm.ArgumentConfiguration.Argument.ArgumentOption
      */
     public static boolean selectValue(JComboBox combobox, String target) {
@@ -472,10 +462,11 @@
 	for(int i = 0; i < combobox.getItemCount(); i++) {
 	    Object object = combobox.getItemAt(i);
-	    if(object instanceof ListOption) {
-		ListOption lo = (ListOption) object;
+	    if(object instanceof Argument.ArgumentOption) {
+		Argument.ArgumentOption opt = (Argument.ArgumentOption) object;
 		///ystem.err.print("/tChecking: " + lo.getValue() + "... ");
-		if(lo.getValue().startsWith(target)) {
+		if(opt.name.startsWith(target)) {
 		    ///ystem.err.println("Match!");
 		    combobox.setSelectedIndex(i);
+		    combobox.setToolTipText(opt.getToolTip());
 		    return true;
 		}
@@ -553,68 +544,4 @@
     
 
-
-    /** A ListOption is a compound item which is constructed from several Strings. That magic part is that the length of screen real-estate used by the text version of this item is limited. */
-    private class ListOption
-	implements Comparable {
-	/** The maximum length of this String version of this item. */
-	private int MAX_DESC = 47;
-	/** The description of the value for this item. */
-	private String description = null;
-	/** A cached value for the text value of this option, as it never changes after the first call to toString(). */
-	private String text = null;
-	/** The value for this item. */
-	private String value = null;
-	/** Constructor.
-	 * @param value The value for this item as a <strong>String</strong>.
-	 * @param description The description of the value as a <strong>String</strong>.
-	 */
-	public ListOption(String value, String description) {
-	    this.description = description;
-	    this.value = value;
-	}
-	/** Compare two possible ListOption objects for ordering.
-	 * @param object The <strong>Object</strong> to compare to.
-	 * @return An <i>int</i> indicating order as explained in String.
-	 * @see java.lang.String#compareTo
-	 */
-	public int compareTo(Object object) {
-	    return toString().compareTo(object.toString());
-	}
-	/** Tests two possible ListOption objects for equality. Uses the result from compareTo().
-	 * @param object The <strong>Object</strong> which may be equal.
-	 * @return <i>true</i> if the objects are equal, <i>false</i> otherwise.
-	 */
-	public boolean equals(Object object) {
-	    return (object != null && compareTo(object) == 0);
-	}
-	/** Retrieve the description of this list item.
-	 * @return The description as a <strong>String</strong>.
-	 */
-	public String getDesc() {
-	    return description;
-	}
-	/** Retrieve the value of this list item.
-	 * @return The value as a <strong>String</strong>.
-	 */
-	public String getValue() {
-	    return value;
-	}
-	/** Convert this object into a nice readable String.
-	 * @return A <strong>String</strong> representing this object.
-	 */
-	public String toString() {
-	    if(text == null) {
-		if(value.length() + description.length() >= MAX_DESC) {
-		    text = value + " "+ StaticStrings.MINUS_CHARACTER + " "+ description.substring(0, MAX_DESC-value.length()) + StaticStrings.TRUNCATED_STRING;
-		}
-		else {
-		    text = value + " "+ StaticStrings.MINUS_CHARACTER + " "+ description;
-		}
-	    }
-	    return text;
-	}
-    }
-
-
     /** Listener that sets the tooltip associated to a combobox to the tooltip relevant to the selected item. */
     private class ToolTipUpdater
@@ -626,9 +553,8 @@
 	    JComboBox source = (JComboBox)event.getSource();
 	    Object object = source.getSelectedItem();
-	    if(object instanceof ListOption) {
-		ListOption lo = (ListOption)object;
-		if(lo != null) {
-		    String description = Utility.formatHTMLWidth(lo.getDesc(), 60);
-		    source.setToolTipText(description);
+	    if(object instanceof Argument.ArgumentOption) {
+		Argument.ArgumentOption opt = (Argument.ArgumentOption)object;
+		if(opt != null) {
+		    source.setToolTipText(opt.getToolTip());
 		}
 		else {
