Esempio n. 1
0
  /**
   * 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();
  }
Esempio n. 2
0
 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);
   }
 }
Esempio n. 3
0
 public boolean selectNextAppointment() {
   boolean selected = appointmentManager.selectNextAppointment();
   if (selected) {
     fireSelectionEvent(getSelectedAppointment());
   }
   return selected;
 }
Esempio n. 4
0
 /**
  * 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();
 }
Esempio n. 5
0
 public void fireCreateEvent(Appointment appointment) {
   boolean allow = CreateEvent.fire(this, appointment);
   if (!allow) {
     appointmentManager.rollback();
     refresh();
   }
 }
Esempio n. 6
0
  public void fireDeleteEvent(Appointment appointment) {

    // fire the event to notify the client
    boolean allow = DeleteEvent.fire(this, appointment);

    if (allow) {
      appointmentManager.removeAppointment(appointment);
      refresh();
    }
  }
Esempio n. 7
0
  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();
    }
  }
Esempio n. 8
0
  /**
   * 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();
    }
  }
Esempio n. 9
0
 /**
  * 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);
 }
Esempio n. 10
0
 /** Removes the currently selected appointment from the model, if such appointment is set. */
 public void removeCurrentlySelectedAppointment() {
   appointmentManager.removeCurrentlySelectedAppointment();
 }
Esempio n. 11
0
 public void setRollbackAppointment(Appointment appt) {
   appointmentManager.setRollbackAppointment(appt);
 }
Esempio n. 12
0
 public void setSelectedAppointment(Appointment appointment, boolean fireEvents) {
   appointmentManager.setSelectedAppointment(appointment);
   if (fireEvents) {
     fireSelectionEvent(appointment);
   }
 }
Esempio n. 13
0
 /** Clears all appointment items. */
 public void clearAppointments() {
   appointmentManager.clearAppointments();
   refresh();
 }
Esempio n. 14
0
 /**
  * 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();
 }
Esempio n. 15
0
 /**
  * Resets the &quot;currently selected&quot; appointment of this calendar.
  *
  * @see com.bradrydzewski.gwt.calendar.client.AppointmentManager
  */
 public void resetSelectedAppointment() {
   appointmentManager.resetSelectedAppointment();
 }
Esempio n. 16
0
 /**
  * Indicates whether there is a &quot;currently selected&quot; 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();
 }
Esempio n. 17
0
 /**
  * Gets the currently selected item.
  *
  * @return the selected item.
  */
 public Appointment getSelectedAppointment() {
   return appointmentManager.getSelectedAppointment();
 }
Esempio n. 18
0
 public void setCommittedAppointment(Appointment appt) {
   appointmentManager.setCommittedAppointment(appt);
 }
Esempio n. 19
0
 /**
  * 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();
 }