com.allen_sauer.gwt.dnd.client.drop
Class MonthViewDropController
java.lang.Object
com.allen_sauer.gwt.dnd.client.drop.AbstractDropController
com.allen_sauer.gwt.dnd.client.drop.AbstractPositioningDropController
com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController
com.allen_sauer.gwt.dnd.client.drop.MonthViewDropController
- All Implemented Interfaces:
- com.allen_sauer.gwt.dnd.client.drop.DropController
public class MonthViewDropController
- extends com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController
Controls the Move and Drop (after dragging) events that can be generated in
the Month View.
- Author:
- Brad Rydzewski, Carlos D. Morales
|
Constructor Summary |
MonthViewDropController(com.google.gwt.user.client.ui.AbsolutePanel dropTarget,
com.google.gwt.user.client.ui.FlexTable monthGrid)
|
|
Method Summary |
protected com.google.gwt.user.client.Element[] |
getCells(int row,
int col,
int days)
Gets all the cells (as DOM Elements) that an appointment spans. |
int |
getColumn(com.allen_sauer.gwt.dnd.client.DragContext context,
com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController.Draggable draggable)
|
Date |
getFirstDateDisplayed()
|
int |
getRow(com.allen_sauer.gwt.dnd.client.DragContext context,
com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController.Draggable draggable)
|
void |
onDrop(com.allen_sauer.gwt.dnd.client.DragContext context)
Callback method executed once the drag has completed. |
void |
onMove(com.allen_sauer.gwt.dnd.client.DragContext context)
Manages the highlighting of cells in the month view grid when an
Appointment is being dragged. |
void |
setDaysPerWeek(int daysPerWeek)
|
void |
setFirstDateDisplayed(Date firstDateDisplayed)
|
void |
setWeeksPerMonth(int weeksPerMonth)
|
| Methods inherited from class com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController |
drop, onEnter, onLeave |
| Methods inherited from class com.allen_sauer.gwt.dnd.client.drop.AbstractDropController |
getDropTarget, onPreviewDrop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MonthViewDropController
public MonthViewDropController(com.google.gwt.user.client.ui.AbsolutePanel dropTarget,
com.google.gwt.user.client.ui.FlexTable monthGrid)
setDaysPerWeek
public void setDaysPerWeek(int daysPerWeek)
setWeeksPerMonth
public void setWeeksPerMonth(int weeksPerMonth)
getFirstDateDisplayed
public Date getFirstDateDisplayed()
setFirstDateDisplayed
public void setFirstDateDisplayed(Date firstDateDisplayed)
onMove
public void onMove(com.allen_sauer.gwt.dnd.client.DragContext context)
- Manages the highlighting of cells in the month view grid when an
Appointment is being dragged.
- Specified by:
onMove in interface com.allen_sauer.gwt.dnd.client.drop.DropController- Overrides:
onMove in class com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController
- Parameters:
context - An object providing information about the object being
dragged
onDrop
public void onDrop(com.allen_sauer.gwt.dnd.client.DragContext context)
- Callback method executed once the drag has completed. We need to reset the
background color of all previously highlighted cells. Also need to
actually change the appointment's start / end date here (code doesn't
exist yet).
- Specified by:
onDrop in interface com.allen_sauer.gwt.dnd.client.drop.DropController- Overrides:
onDrop in class com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController
- Parameters:
context - An object containing information of what was dragged and
dropped, including the Appointment,
coordinates of the drop, etc.
getCells
protected com.google.gwt.user.client.Element[] getCells(int row,
int col,
int days)
- Gets all the cells (as DOM Elements) that an appointment spans. Note: It
only includes cells in the table. If an appointment ends in the following
month the last cell in the list will be the last cell in the table.
- Parameters:
row - Appointment's starting rowcol - Appointment's starting columndays - Number of days an appointment spans
- Returns:
- Cell elements that an appointment spans
getRow
public int getRow(com.allen_sauer.gwt.dnd.client.DragContext context,
com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController.Draggable draggable)
getColumn
public int getColumn(com.allen_sauer.gwt.dnd.client.DragContext context,
com.allen_sauer.gwt.dnd.client.drop.AbsolutePositionDropController.Draggable draggable)
Copyright © 2012. All Rights Reserved.