// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TaskType.java
// public enum TaskType {
//   /**
//    * Indicates the task should only overwrite preferences if the file's 
//    * modification date is earlier than the changes.
//    */
//   LASTMOD,
//   
//   /**
//    * Indicates the task should overwrite any preferences that are different 
//    * from the values listed the one written here.
//    */
//   RECONCILE
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java
// public class MechanicPlugin extends AbstractUIPlugin {
// 
//   // The plug-in ID
//   public static final String PLUGIN_ID = "com.google.eclipse.mechanic";
// 
//   // The shared instance
//   private static MechanicPlugin plugin;
// 
//   private IMechanicPreferences mechanicPreferences;
// 
//   private volatile IPreferenceRecordingService preferenceRecordingService =
//       new PreferenceRecordingService();
// 
//   private PopupNotifier popupNotifier;
// 
//   public MechanicPlugin() {
//     plugin = this;
//   }
// 
//   @Override 
//   public void start(BundleContext context) throws Exception {
//     super.start(context);
// 
//     mechanicPreferences = new MechanicPreferences();
// 
//     // popup notifier must start before the mechanic service in order to
//     // catch the first statuses.
//     popupNotifier = new PopupNotifier(MechanicService.getInstance(), getMechanicPreferences());
//     popupNotifier.initialize();
// 
//     UriCaches.initialize();
// 
//     // immediately start the mechanic service
//     MechanicService.getInstance().start();
//   }
// 
//   @Override 
//   public void stop(BundleContext context) throws Exception {
//     MechanicService.getInstance().stop();
//     UriCaches.destroy();
//     popupNotifier.dispose();
//     TasksExtensionPoint.dispose();
//     ScannersExtensionPoint.dispose();
//     ResourceTaskProvidersExtensionPoint.dispose();
//     plugin = null;
//     super.stop(context);
//   }
// 
//   /**
//    * Keep this around as some of the generated code expects it.
//    * @return shared instance of this plug-in class
//    */
//   public static MechanicPlugin getDefault() {
//     return plugin;
//   }
// 
//   /**
//    * Returns an image descriptor for the image file at the given plug-in
//    * relative path
//    *
//    * @param path the path
//    * @return the image descriptor
//    */
//   public static ImageDescriptor getImageDescriptor(String path) {
//     return imageDescriptorFromPlugin(PLUGIN_ID, path);
//   }
// 
//   public IPreferenceRecordingService getPreferenceRecordingService() {
//     if (preferenceRecordingService == null) {
//       preferenceRecordingService = new PreferenceRecordingService();
//     }
// 
//     return preferenceRecordingService;
//   }
// 
//   public IMechanicPreferences getMechanicPreferences() {
//     return mechanicPreferences;
//   }
// }


import java.io.File;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.eclipse.mechanic.internal.TaskType;
import com.google.eclipse.mechanic.plugin.core.MechanicPlugin;
  protected boolean isResizable() {
    return true;
  }

  // TODO: zorzella says: I don't think this overload is doing anything at all.
  // I refactored it to stop growing upon every invocation, but the whole bit
  // about "new Point(p.x, p.y * 3 / 2);" which, on face value, seems like an
  // attempt to make the dialog taller than its otherwise default, seems to
  // simply be having no effect.
  @Override
  protected Point getInitialSize() {
    // We check if the dialog has been resized by the user...
    if (getDialogBoundsSettings() == null) {
      // ... if not, we create a dialog twice the default size
      Point p =  super.getInitialSize();
      return new Point(p.x, p.y * 3 / 2);
    } else {
      // ... if it has been resized, we use that size, otherwise
      // every time we open the dialog it grows...
      return super.getInitialSize();
    }
    // ... there probably is a much better way of doing this, btw.
  }

  @Override
  protected IDialogSettings getDialogBoundsSettings() {
    String dialogSettingsSection = getDialogSettingsSection();
    if (dialogSettingsSection == null) {
      return null;
    }
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/internal/TaskType.java
// public enum TaskType {
//   /**
//    * Indicates the task should only overwrite preferences if the file's 
//    * modification date is earlier than the changes.
//    */
//   LASTMOD,
//   
//   /**
//    * Indicates the task should overwrite any preferences that are different 
//    * from the values listed the one written here.
//    */
//   RECONCILE
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/core/MechanicPlugin.java
// public class MechanicPlugin extends AbstractUIPlugin {
// 
//   // The plug-in ID
//   public static final String PLUGIN_ID = "com.google.eclipse.mechanic";
// 
//   // The shared instance
//   private static MechanicPlugin plugin;
// 
//   private IMechanicPreferences mechanicPreferences;
// 
//   private volatile IPreferenceRecordingService preferenceRecordingService =
//       new PreferenceRecordingService();
// 
//   private PopupNotifier popupNotifier;
// 
//   public MechanicPlugin() {
//     plugin = this;
//   }
// 
//   @Override 
//   public void start(BundleContext context) throws Exception {
//     super.start(context);
// 
//     mechanicPreferences = new MechanicPreferences();
// 
//     // popup notifier must start before the mechanic service in order to
//     // catch the first statuses.
//     popupNotifier = new PopupNotifier(MechanicService.getInstance(), getMechanicPreferences());
//     popupNotifier.initialize();
// 
//     UriCaches.initialize();
// 
//     // immediately start the mechanic service
//     MechanicService.getInstance().start();
//   }
// 
//   @Override 
//   public void stop(BundleContext context) throws Exception {
//     MechanicService.getInstance().stop();
//     UriCaches.destroy();
//     popupNotifier.dispose();
//     TasksExtensionPoint.dispose();
//     ScannersExtensionPoint.dispose();
//     ResourceTaskProvidersExtensionPoint.dispose();
//     plugin = null;
//     super.stop(context);
//   }
// 
//   /**
//    * Keep this around as some of the generated code expects it.
//    * @return shared instance of this plug-in class
//    */
//   public static MechanicPlugin getDefault() {
//     return plugin;
//   }
// 
//   /**
//    * Returns an image descriptor for the image file at the given plug-in
//    * relative path
//    *
//    * @param path the path
//    * @return the image descriptor
//    */
//   public static ImageDescriptor getImageDescriptor(String path) {
//     return imageDescriptorFromPlugin(PLUGIN_ID, path);
//   }
// 
//   public IPreferenceRecordingService getPreferenceRecordingService() {
//     if (preferenceRecordingService == null) {
//       preferenceRecordingService = new PreferenceRecordingService();
//     }
// 
//     return preferenceRecordingService;
//   }
// 
//   public IMechanicPreferences getMechanicPreferences() {
//     return mechanicPreferences;
//   }
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/BaseOutputDialog.java
import java.io.File;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.eclipse.mechanic.internal.TaskType;
import com.google.eclipse.mechanic.plugin.core.MechanicPlugin;

  protected boolean isResizable() {
    return true;
  }

  // TODO: zorzella says: I don't think this overload is doing anything at all.
  // I refactored it to stop growing upon every invocation, but the whole bit
  // about "new Point(p.x, p.y * 3 / 2);" which, on face value, seems like an
  // attempt to make the dialog taller than its otherwise default, seems to
  // simply be having no effect.
  @Override
  protected Point getInitialSize() {
    // We check if the dialog has been resized by the user...
    if (getDialogBoundsSettings() == null) {
      // ... if not, we create a dialog twice the default size
      Point p =  super.getInitialSize();
      return new Point(p.x, p.y * 3 / 2);
    } else {
      // ... if it has been resized, we use that size, otherwise
      // every time we open the dialog it grows...
      return super.getInitialSize();
    }
    // ... there probably is a much better way of doing this, btw.
  }

  @Override
  protected IDialogSettings getDialogBoundsSettings() {
    String dialogSettingsSection = getDialogSettingsSection();
    if (dialogSettingsSection == null) {
      return null;
    }
    IDialogSettings settings = MechanicPlugin.getDefault().getDialogSettings();