/** * Performs all layout calculations for the list of appointments and resizes the Calendar View * appropriately. */ protected void refresh() { if (layoutSuspended) { layoutPending = true; return; } appointmentManager.resetHoveredAppointment(); appointmentManager.sortAppointments(); doLayout(); doSizing(); }
public void fireMouseOverEvent(Appointment appointment, Element element) { // we need to make sure we aren't re-firing the event // for the same appointment. This is a bit problematic, // because the mouse over event will fire for an appointment's // child elements (title label, footer, body, for example) // and will cause this method to be called with a null // appointment. this is a temp workaround, but basically // an appointment cannot be hovered twice in a row if (appointment != null && !appointment.equals(appointmentManager.getHoveredAppointment())) { appointmentManager.setHoveredAppointment(appointment); MouseOverEvent.fire(this, appointment, element); } }
public boolean selectNextAppointment() { boolean selected = appointmentManager.selectNextAppointment(); if (selected) { fireSelectionEvent(getSelectedAppointment()); } return selected; }
/** * Adds an appointment to the calendar. * * @param appointment item to be added */ public void addAppointment(Appointment appointment) { if (appointment == null) { throw new NullPointerException("Added appointment cannot be null."); } appointmentManager.addAppointment(appointment); refresh(); }
public void fireCreateEvent(Appointment appointment) { boolean allow = CreateEvent.fire(this, appointment); if (!allow) { appointmentManager.rollback(); refresh(); } }
public void fireDeleteEvent(Appointment appointment) { // fire the event to notify the client boolean allow = DeleteEvent.fire(this, appointment); if (allow) { appointmentManager.removeAppointment(appointment); refresh(); } }
public void fireUpdateEvent(Appointment appointment) { // refresh the appointment refresh(); // fire the event to notify the client boolean allow = UpdateEvent.fire(this, appointment); if (!allow) { appointmentManager.rollback(); refresh(); } }
/** * Removes an appointment from the calendar. * * @param appointment the item to be removed. * @param fireEvents <code>true</code> to allow deletion events to be fired */ public void removeAppointment(Appointment appointment, boolean fireEvents) { boolean commitChange = true; if (fireEvents) { commitChange = DeleteEvent.fire(this, getSelectedAppointment()); } if (commitChange) { appointmentManager.removeAppointment(appointment); refresh(); } }
/** * Tells whether the passed <code>appointment</code> is the currently selected appointment. * * @param appointment The appointment to test to be the currently selected * @return <code>true</code> if there is a currently selected appointment and happens to be equal * to the passed <code>appointment</code> * @see * com.bradrydzewski.gwt.calendar.client.AppointmentManager#isTheSelectedAppointment(Appointment) */ public boolean isTheSelectedAppointment(Appointment appointment) { return appointmentManager.isTheSelectedAppointment(appointment); }
/** Removes the currently selected appointment from the model, if such appointment is set. */ public void removeCurrentlySelectedAppointment() { appointmentManager.removeCurrentlySelectedAppointment(); }
public void setRollbackAppointment(Appointment appt) { appointmentManager.setRollbackAppointment(appt); }
public void setSelectedAppointment(Appointment appointment, boolean fireEvents) { appointmentManager.setSelectedAppointment(appointment); if (fireEvents) { fireSelectionEvent(appointment); } }
/** Clears all appointment items. */ public void clearAppointments() { appointmentManager.clearAppointments(); refresh(); }
/** * Adds each appointment in the list to the calendar. * * @param appointments items to be added. */ public void addAppointments(List<Appointment> appointments) { appointmentManager.addAppointments(appointments); refresh(); }
/** * Resets the "currently selected" appointment of this calendar. * * @see com.bradrydzewski.gwt.calendar.client.AppointmentManager */ public void resetSelectedAppointment() { appointmentManager.resetSelectedAppointment(); }
/** * Indicates whether there is a "currently selected" appointment at the moment. * * @return <code>true</code> if there is an appointment currently selected, <code>false</code> if * it is <code>null</code>. * @see com.bradrydzewski.gwt.calendar.client.AppointmentManager#hasAppointmentSelected() */ public boolean hasAppointmentSelected() { return appointmentManager.hasAppointmentSelected(); }
/** * Gets the currently selected item. * * @return the selected item. */ public Appointment getSelectedAppointment() { return appointmentManager.getSelectedAppointment(); }
public void setCommittedAppointment(Appointment appt) { appointmentManager.setCommittedAppointment(appt); }
/** * Returns the collection of appointments in the underlying in-memory model of this calendar * widget. <strong>Warning</strong>: the returned collection of apointments can be modified by * client code, possibly breaking the system model invariants. * * @return The set of appointments to be displayed by this calendar widget * @see AppointmentManager#getAppointments() */ public List<Appointment> getAppointments() { return appointmentManager.getAppointments(); }