Search in sources :

Example 1 with BandScrollEvent

use of org.zkforge.timeline.event.BandScrollEvent in project adempiere by adempiere.

the class WSchedule method onEvent.

public void onEvent(Event event) throws Exception {
    if (event instanceof MouseEvent) {
        MouseEvent me = (MouseEvent) event;
        if (me.getX() > 0) {
            MResourceAssignment assignment = new MResourceAssignment(Env.getCtx(), me.getX(), null);
            WAssignmentDialog wad = new WAssignmentDialog(assignment, false, infoSchedule.isCreateNew());
            if (!wad.isCancelled()) {
                _assignmentDialogResult = wad.getMResourceAssignment();
                Events.echoEvent("onAssignmentCallback", this, null);
            }
        }
    } else if (event instanceof BandScrollEvent) {
        BandScrollEvent e = (BandScrollEvent) event;
        Date end = e.getMax();
        Date start = e.getMin();
        Date mid = e.getCenter();
        if (mid != null) {
            m_center = mid;
            infoSchedule.dateCallback(mid);
        }
    }
}
Also used : MResourceAssignment(org.compiere.model.MResourceAssignment) MouseEvent(org.zkoss.zk.ui.event.MouseEvent) WAssignmentDialog(org.adempiere.webui.window.WAssignmentDialog) BandScrollEvent(org.zkforge.timeline.event.BandScrollEvent) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 WAssignmentDialog (org.adempiere.webui.window.WAssignmentDialog)1 MResourceAssignment (org.compiere.model.MResourceAssignment)1 BandScrollEvent (org.zkforge.timeline.event.BandScrollEvent)1 MouseEvent (org.zkoss.zk.ui.event.MouseEvent)1