// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java
// public interface Task {
// 
//   /**
//    * Return an id for this task. The id should be unique to any instance that
//    * behaves differently than another instance. Typically the id would be the
//    * fully qualified class name unless two task instances somehow manage to 
//    * behave differently. In this case they should each return a unique id.
//    */
//   public String getId();
// 
//   /**
//    * Returns a string suitable for display to the user providing a title for
//    * this Task. This is used in contexts where a short
//    * description is needed. Capitalization should follow the same rules as
//    * applied to book titles.
//    */
//   public String getTitle();
// 
//   /**
//    * Returns a string suitable for display to the user describing what action
//    * will be taken when the associated {@link RepairAction} is executed.
//    * <p/>
//    * The description should start with a 3rd person descriptive verb such as:
//    * <p/>
//    * "Customizes your java code templates with user information."
//    * "Configures a local extension location."
//    */
//   public String getDescription();
// 
//   /**
//    * Returns an Evaluator for this task. The Evaluator should return false
//    * if the associated RepairAction needs to be executed.
//    */
//   public Evaluator getEvaluator();
// 
//   /**
//    * Returns a {@link RepairAction} capable of bringing this {@link Task}
//    * into compliance.
//    */
//   public RepairAction getRepairAction();
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/RepairDecisionProvider.java
// public enum Decision {
// 
//   YES,
//   NO,
//   NEVER;
// 
//   public static Decision valueOf(int ord) {
//     return Decision.values()[ord];
//   }
// }


import com.google.eclipse.mechanic.Task;
import com.google.eclipse.mechanic.RepairDecisionProvider.Decision;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
   * it with a listener capable of updating the right entry in our
   * map of item->decision.
   */
  private Combo createDecisionCombo(Composite parent, Task item) {
    Combo combo = new Combo(parent, SWT.READ_ONLY);
    combo.add(YES);
    combo.add(NO);
    combo.add(NEVER);
    combo.select(0);

    combo.addSelectionListener(new ComboListener(item));
    return combo;
  }

  /**
   * Listens to combo box "selection" events. Updates the entry in the
   * outer classes map of item->decision.
   */
  private class ComboListener extends SelectionAdapter {
    
    private final Task item;

    public ComboListener(Task item) {
      this.item = item;
    }

    @Override 
    public void widgetSelected(SelectionEvent e) {
      Combo combo = (Combo) e.getSource();
      int index = combo.getSelectionIndex();
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/Task.java
// public interface Task {
// 
//   /**
//    * Return an id for this task. The id should be unique to any instance that
//    * behaves differently than another instance. Typically the id would be the
//    * fully qualified class name unless two task instances somehow manage to 
//    * behave differently. In this case they should each return a unique id.
//    */
//   public String getId();
// 
//   /**
//    * Returns a string suitable for display to the user providing a title for
//    * this Task. This is used in contexts where a short
//    * description is needed. Capitalization should follow the same rules as
//    * applied to book titles.
//    */
//   public String getTitle();
// 
//   /**
//    * Returns a string suitable for display to the user describing what action
//    * will be taken when the associated {@link RepairAction} is executed.
//    * <p/>
//    * The description should start with a 3rd person descriptive verb such as:
//    * <p/>
//    * "Customizes your java code templates with user information."
//    * "Configures a local extension location."
//    */
//   public String getDescription();
// 
//   /**
//    * Returns an Evaluator for this task. The Evaluator should return false
//    * if the associated RepairAction needs to be executed.
//    */
//   public Evaluator getEvaluator();
// 
//   /**
//    * Returns a {@link RepairAction} capable of bringing this {@link Task}
//    * into compliance.
//    */
//   public RepairAction getRepairAction();
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/RepairDecisionProvider.java
// public enum Decision {
// 
//   YES,
//   NO,
//   NEVER;
// 
//   public static Decision valueOf(int ord) {
//     return Decision.values()[ord];
//   }
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/MechanicDialog.java
import com.google.eclipse.mechanic.Task;
import com.google.eclipse.mechanic.RepairDecisionProvider.Decision;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

   * it with a listener capable of updating the right entry in our
   * map of item->decision.
   */
  private Combo createDecisionCombo(Composite parent, Task item) {
    Combo combo = new Combo(parent, SWT.READ_ONLY);
    combo.add(YES);
    combo.add(NO);
    combo.add(NEVER);
    combo.select(0);

    combo.addSelectionListener(new ComboListener(item));
    return combo;
  }

  /**
   * Listens to combo box "selection" events. Updates the entry in the
   * outer classes map of item->decision.
   */
  private class ComboListener extends SelectionAdapter {
    
    private final Task item;

    public ComboListener(Task item) {
      this.item = item;
    }

    @Override 
    public void widgetSelected(SelectionEvent e) {
      Combo combo = (Combo) e.getSource();
      int index = combo.getSelectionIndex();
      Decision choice = Decision.valueOf(index);