// 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;
/*******************************************************************************
 * Copyright (C) 2007, Google Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

package com.google.eclipse.mechanic.plugin.ui;




/**
 * Dialog box that displays a list of available Tasks. Users use this
 * dialog box to select Tasks to execute.
 *
 * @author smckay@google.com (Steve McKay)
 */
public class MechanicDialog extends TitleAreaDialog {

  // action choice display names
  private static final String YES = "Fix Now";
  private static final String NO = "Fix Later";
  private static final String NEVER = "Never Fix"; 

  private final List<Task> items;
// 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;

/*******************************************************************************
 * Copyright (C) 2007, Google Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

package com.google.eclipse.mechanic.plugin.ui;




/**
 * Dialog box that displays a list of available Tasks. Users use this
 * dialog box to select Tasks to execute.
 *
 * @author smckay@google.com (Steve McKay)
 */
public class MechanicDialog extends TitleAreaDialog {

  // action choice display names
  private static final String YES = "Fix Now";
  private static final String NO = "Fix Later";
  private static final String NEVER = "Never Fix"; 

  private final List<Task> items;
  private final Map<Task, Decision> userTaskChoices;