// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static enum AxisOption {
//   /**
//    * No axis constraint
//    */
//   NONE,
// 
//   /**
//    * X_AXIS constraints the drag operation to the horizontal axis
//    */
//   X_AXIS,
// 
//   /**
//    * Y_AXIS constraints the drag operation to the vertical axis
//    */
//   Y_AXIS;
// }
// 
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static class CursorAt {
// 
//   private Integer bottom;
//   private Integer left;
//   private Integer right;
//   private Integer top;
// 
//   /**
//    * Specify coordinates by giving one or two parameters. If you define more
//    * than two argument, the bottom parameter has priority over the top
//    * parameter and the right parameter has priority over left parameter
//    *
//    * @param top
//    * @param left
//    * @param bottom
//    * @param right
//    */
//   public CursorAt(Integer top, Integer left, Integer bottom, Integer right) {
//     if (bottom != null) {
//       this.bottom = bottom;
//     } else if (top != null) {
//       this.top = top;
//     }
// 
//     if (right != null) {
//       this.right = right;
//     } else if (left != null) {
//       this.left = left;
//     }
//   }
// 
//   public Integer getBottom() {
//     return bottom;
//   }
// 
//   public Integer getLeft() {
//     return left;
//   }
// 
//   public Integer getRight() {
//     return right;
//   }
// 
//   public Integer getTop() {
//     return top;
//   }
// 
// }
// 
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static enum HelperType {
//   /**
//    * CLONE : a clone of the original element will be used as dragging display
//    */
//   CLONE {
//     @Override
//     public GQuery createHelper(Element original, GQuery helperFromOptions) {
//       return $(original).clone();
//     }
//   },
// 
//   /**
//    * ORIGINAL : an other element will be used as dragging display
//    */
//   ELEMENT {
//     @Override
//     public GQuery createHelper(Element original, GQuery helperFromOptions) {
//       return helperFromOptions;
//     }
//   },
// 
//   /**
//    * ORIGINAL : the original element will be used as dragging display
//    */
//   ORIGINAL {
//     @Override
//     public GQuery createHelper(Element original, GQuery helperFromOptions) {
//       return $(original);
//     }
//   };
// 
//   public abstract GQuery createHelper(Element original,
//                                       GQuery helperFromOptions);
// }
// 
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static enum RevertOption {
//   /**
//    * ALWAYS : the helper will return to its start position when dragging
//    * stops.
//    */
//   ALWAYS,
// 
//   /**
//    * NEVER : the draggable will not return to its start position when dragging
//    * stops.
//    */
//   NEVER,
// 
//   /**
//    * ON_INVALID_DROP :revert will only occur if the draggable has not been
//    * dropped (useful with droppable plug-in)
//    */
//   ON_INVALID_DROP,
// 
//   /**
//    * ON_VALID_DROP : revert will only occur if the draggable has been dropped
//    * (useful with droppable plug-in)
//    */
//   ON_VALID_DROP;
// 
//   public boolean doRevert(boolean dropped) {
//     return this == ALWAYS || (this == ON_INVALID_DROP && !dropped)
//         || (this == ON_VALID_DROP && dropped);
//   }
// }


import java.util.HashMap;
import java.util.Map;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import gwtquery.plugins.draggable.client.DraggableOptions.AxisOption;
import gwtquery.plugins.draggable.client.DraggableOptions.CursorAt;
import gwtquery.plugins.draggable.client.DraggableOptions.HelperType;
import gwtquery.plugins.draggable.client.DraggableOptions.RevertOption;
import static com.google.gwt.query.client.GQuery.$;
  @UiField
  CheckBox handleCheckBox;
  @UiField
  TextBox opacityBox;
  @UiField
  CheckBox scrollCheckBox;
  @UiField
  TextBox scrollSensivityBox;
  @UiField
  TextBox scrollSpeedBox;
  @UiField
  ListBox revertListBox;
  @UiField
  TextBox revertDurationTextBox;

  public DraggableOptionsPanel(Element draggable) {
    this.draggable = draggable;
    initWidget(uiBinder.createAndBindUi(this));

    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
      @Override
      public void execute() {
        init();
      }
    });

  }

  @UiHandler(value = "axisListBox")
  public void onAxisChange(ChangeEvent e) {
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static enum AxisOption {
//   /**
//    * No axis constraint
//    */
//   NONE,
// 
//   /**
//    * X_AXIS constraints the drag operation to the horizontal axis
//    */
//   X_AXIS,
// 
//   /**
//    * Y_AXIS constraints the drag operation to the vertical axis
//    */
//   Y_AXIS;
// }
// 
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static class CursorAt {
// 
//   private Integer bottom;
//   private Integer left;
//   private Integer right;
//   private Integer top;
// 
//   /**
//    * Specify coordinates by giving one or two parameters. If you define more
//    * than two argument, the bottom parameter has priority over the top
//    * parameter and the right parameter has priority over left parameter
//    *
//    * @param top
//    * @param left
//    * @param bottom
//    * @param right
//    */
//   public CursorAt(Integer top, Integer left, Integer bottom, Integer right) {
//     if (bottom != null) {
//       this.bottom = bottom;
//     } else if (top != null) {
//       this.top = top;
//     }
// 
//     if (right != null) {
//       this.right = right;
//     } else if (left != null) {
//       this.left = left;
//     }
//   }
// 
//   public Integer getBottom() {
//     return bottom;
//   }
// 
//   public Integer getLeft() {
//     return left;
//   }
// 
//   public Integer getRight() {
//     return right;
//   }
// 
//   public Integer getTop() {
//     return top;
//   }
// 
// }
// 
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static enum HelperType {
//   /**
//    * CLONE : a clone of the original element will be used as dragging display
//    */
//   CLONE {
//     @Override
//     public GQuery createHelper(Element original, GQuery helperFromOptions) {
//       return $(original).clone();
//     }
//   },
// 
//   /**
//    * ORIGINAL : an other element will be used as dragging display
//    */
//   ELEMENT {
//     @Override
//     public GQuery createHelper(Element original, GQuery helperFromOptions) {
//       return helperFromOptions;
//     }
//   },
// 
//   /**
//    * ORIGINAL : the original element will be used as dragging display
//    */
//   ORIGINAL {
//     @Override
//     public GQuery createHelper(Element original, GQuery helperFromOptions) {
//       return $(original);
//     }
//   };
// 
//   public abstract GQuery createHelper(Element original,
//                                       GQuery helperFromOptions);
// }
// 
// Path: plugin/src/main/java/gwtquery/plugins/draggable/client/DraggableOptions.java
// public static enum RevertOption {
//   /**
//    * ALWAYS : the helper will return to its start position when dragging
//    * stops.
//    */
//   ALWAYS,
// 
//   /**
//    * NEVER : the draggable will not return to its start position when dragging
//    * stops.
//    */
//   NEVER,
// 
//   /**
//    * ON_INVALID_DROP :revert will only occur if the draggable has not been
//    * dropped (useful with droppable plug-in)
//    */
//   ON_INVALID_DROP,
// 
//   /**
//    * ON_VALID_DROP : revert will only occur if the draggable has been dropped
//    * (useful with droppable plug-in)
//    */
//   ON_VALID_DROP;
// 
//   public boolean doRevert(boolean dropped) {
//     return this == ALWAYS || (this == ON_INVALID_DROP && !dropped)
//         || (this == ON_VALID_DROP && dropped);
//   }
// }


// Path: sample/src/main/java/gwtquery/plugins/draggable/client/DraggableOptionsPanel.java
import java.util.HashMap;
import java.util.Map;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import gwtquery.plugins.draggable.client.DraggableOptions.AxisOption;
import gwtquery.plugins.draggable.client.DraggableOptions.CursorAt;
import gwtquery.plugins.draggable.client.DraggableOptions.HelperType;
import gwtquery.plugins.draggable.client.DraggableOptions.RevertOption;
import static com.google.gwt.query.client.GQuery.$;

  @UiField
  CheckBox handleCheckBox;
  @UiField
  TextBox opacityBox;
  @UiField
  CheckBox scrollCheckBox;
  @UiField
  TextBox scrollSensivityBox;
  @UiField
  TextBox scrollSpeedBox;
  @UiField
  ListBox revertListBox;
  @UiField
  TextBox revertDurationTextBox;

  public DraggableOptionsPanel(Element draggable) {
    this.draggable = draggable;
    initWidget(uiBinder.createAndBindUi(this));

    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
      @Override
      public void execute() {
        init();
      }
    });

  }

  @UiHandler(value = "axisListBox")
  public void onAxisChange(ChangeEvent e) {
    AxisOption axis = AxisOption.valueOf(axisListBox.getValue(axisListBox