FacesContext context = getFacesContext();
//invoke the mouselistener first
if (event instanceof ScheduleMouseEvent)
{
ScheduleMouseEvent mouseEvent = (ScheduleMouseEvent) event;
MethodBinding mouseListener = getMouseListener();
if (mouseListener != null)
{
mouseListener.invoke(context,
new Object[] { mouseEvent });
}
}
//then invoke private ScheduleActionListener for set
//the selected entry (if exists), so other
//listeners can retrieve it from getSelectedEntry.
if (event.isAppropriateListener(_scheduleListener))
{
event.processListener(_scheduleListener);
}
//then invoke any other listeners
super.broadcast(event);
if (event instanceof ActionEvent)
{
//Call registered actionListener if applies
MethodBinding actionListener = getActionListener();
if (actionListener != null)
{
actionListener.invoke(context, new Object[] { event });
}
//Since UISchedule is an ActionSource component,
//we should call to the application actionListener
//when an ActionEvent happens.