// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/ClickListener.java
// public static class ClickEvent extends Component.Event {
// 
//   private final EventProperties props;
//   private final Object itemId;
// 
//   /**
//    * Constructs the event.
//    *
//    * @param source the source component
//    * @param itemId the ID of the item clicked or null
//    * @param props the event properties relayed from the client side
//    */
//   public ClickEvent(Timeline source, Object itemId, EventProperties props) {
//     super(source);
//     this.props = props;
//     this.itemId = itemId;
//   }
// 
//   public Date getSnappedTime() {
//     return props.snappedTime;
//   }
// 
//   public Date getTime() {
//     return props.time;
//   }
// 
//   public String getWhat() {
//     return props.what;
//   }
// 
//   public Object getItem() {
//     return itemId;
//   }
// 
//   public String getGroup() {
//     return props.group;
//   }
// 
//   public int getY() {
//     return props.y;
//   }
// 
//   public int getX() {
//     return props.x;
//   }
// 
//   public int getPageY() {
//     return props.pageY;
//   }
// 
//   public int getPageX() {
//     return props.pageX;
//   }
// 
//   public Timeline getTimeline() {
//     return (Timeline) getSource();
//   }
// 
//   @Override
//   public String toString() {
//     return props.toString();
//   }
// }
// 
// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/ContextMenuListener.java
// public static class ContextMenuEvent extends ClickListener.ClickEvent {
// 
//   public ContextMenuEvent(Timeline source, Object itemId,
//       EventProperties props) {
//     super(source, itemId, props);
//   }
// }
// 
// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/DoubleClickListener.java
// public static class DoubleClickEvent extends ClickListener.ClickEvent {
// 
//   public DoubleClickEvent(Timeline source, Object itemId,
//       EventProperties props) {
//     super(source, itemId, props);
//   }
// }


import java.util.*;
import org.mpilone.vaadin.timeline.ClickListener.ClickEvent;
import org.mpilone.vaadin.timeline.ContextMenuListener.ContextMenuEvent;
import org.mpilone.vaadin.timeline.DoubleClickListener.DoubleClickEvent;
import org.mpilone.vaadin.timeline.shared.*;
import com.vaadin.annotations.JavaScript;
import com.vaadin.annotations.StyleSheet;
import com.vaadin.ui.AbstractJavaScriptComponent;
      // consistent with Vaadin components.
      if (!selection.equals(oldSelection)) {
        SelectListener.SelectEvent evt = new SelectListener.SelectEvent(
            Timeline.this, selection);

        fireEvent(evt);
      }
    }

    @Override
    public void click(EventProperties eventProps) {
      Object itemId = eventProps.item == null ? null : keyMapper.getItemId(
          eventProps.item);

      fireEvent(new ClickEvent(Timeline.this, itemId, eventProps));
    }

    @Override
    public void doubleClick(EventProperties eventProps) {
      Object itemId = eventProps.item == null ? null : keyMapper.getItemId(
          eventProps.item);

      fireEvent(new DoubleClickEvent(Timeline.this, itemId, eventProps));
    }

    @Override
    public void contextmenu(EventProperties eventProps) {
      Object itemId = eventProps.item == null ? null : keyMapper.getItemId(
          eventProps.item);

// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/ClickListener.java
// public static class ClickEvent extends Component.Event {
// 
//   private final EventProperties props;
//   private final Object itemId;
// 
//   /**
//    * Constructs the event.
//    *
//    * @param source the source component
//    * @param itemId the ID of the item clicked or null
//    * @param props the event properties relayed from the client side
//    */
//   public ClickEvent(Timeline source, Object itemId, EventProperties props) {
//     super(source);
//     this.props = props;
//     this.itemId = itemId;
//   }
// 
//   public Date getSnappedTime() {
//     return props.snappedTime;
//   }
// 
//   public Date getTime() {
//     return props.time;
//   }
// 
//   public String getWhat() {
//     return props.what;
//   }
// 
//   public Object getItem() {
//     return itemId;
//   }
// 
//   public String getGroup() {
//     return props.group;
//   }
// 
//   public int getY() {
//     return props.y;
//   }
// 
//   public int getX() {
//     return props.x;
//   }
// 
//   public int getPageY() {
//     return props.pageY;
//   }
// 
//   public int getPageX() {
//     return props.pageX;
//   }
// 
//   public Timeline getTimeline() {
//     return (Timeline) getSource();
//   }
// 
//   @Override
//   public String toString() {
//     return props.toString();
//   }
// }
// 
// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/ContextMenuListener.java
// public static class ContextMenuEvent extends ClickListener.ClickEvent {
// 
//   public ContextMenuEvent(Timeline source, Object itemId,
//       EventProperties props) {
//     super(source, itemId, props);
//   }
// }
// 
// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/DoubleClickListener.java
// public static class DoubleClickEvent extends ClickListener.ClickEvent {
// 
//   public DoubleClickEvent(Timeline source, Object itemId,
//       EventProperties props) {
//     super(source, itemId, props);
//   }
// }


// Path: timeline/src/main/java/org/mpilone/vaadin/timeline/Timeline.java
import java.util.*;
import org.mpilone.vaadin.timeline.ClickListener.ClickEvent;
import org.mpilone.vaadin.timeline.ContextMenuListener.ContextMenuEvent;
import org.mpilone.vaadin.timeline.DoubleClickListener.DoubleClickEvent;
import org.mpilone.vaadin.timeline.shared.*;
import com.vaadin.annotations.JavaScript;
import com.vaadin.annotations.StyleSheet;
import com.vaadin.ui.AbstractJavaScriptComponent;

      // consistent with Vaadin components.
      if (!selection.equals(oldSelection)) {
        SelectListener.SelectEvent evt = new SelectListener.SelectEvent(
            Timeline.this, selection);

        fireEvent(evt);
      }
    }

    @Override
    public void click(EventProperties eventProps) {
      Object itemId = eventProps.item == null ? null : keyMapper.getItemId(
          eventProps.item);

      fireEvent(new ClickEvent(Timeline.this, itemId, eventProps));
    }

    @Override
    public void doubleClick(EventProperties eventProps) {
      Object itemId = eventProps.item == null ? null : keyMapper.getItemId(
          eventProps.item);

      fireEvent(new DoubleClickEvent(Timeline.this, itemId, eventProps));
    }

    @Override
    public void contextmenu(EventProperties eventProps) {
      Object itemId = eventProps.item == null ? null : keyMapper.getItemId(
          eventProps.item);

      fireEvent(new ContextMenuEvent(Timeline.this, itemId, eventProps));