Interface IEventEditor

  • All Known Implementing Classes:
    DayEditor, MonthCalendar

    public interface IEventEditor
    Interface IEventEditor. An interface for editors of time-based data that can be visualized on various calendar-like controls.
    Since:
    3.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DISPLAYED_HOURS
      The number of hours to display at a time.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addItemDeleteHandler​(CalendarableItemEventHandler deleteHandler)
      Adds the handler to the collection of handlers who will be notified when a CalendarableItem is deleted from the receiver, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class.
      void addItemDisposeHandler​(CalendarableItemEventHandler itemDisposeHandler)
      Adds the handler to the collection of handler who will be notified when a CalendarableItem's control is disposed, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class.
      void addItemEditHandler​(CalendarableItemEventHandler handler)
      Adds the handler to the collection of handlers who will be notified when a CalendarableItem is inserted in the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.
      void addItemInsertHandler​(CalendarableItemEventHandler insertHandler)
      Adds the handler to the collection of handlers who will be notified when a CalendarableItem is inserted in the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.
      void addSelectionChangeListener​(CalendarableSelectionChangeListener l)
      Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the CalendarableSelectionChangeListener interface.
      boolean fireDelete​(CalendarableItem toDelete)
      Requests that the event editor delete the specified CalendarableItem's data.
      NewEvent fireInsert​(java.util.Date date, boolean allDayEvent)
      Requests that the event editor attempt to insert a new element by calling its registered insert handlers
      int getNumberOfDays()
      Method getNumberOfDays.
      int getNumberOfDivisionsInHour()
      Returns the numberOfDivisionsInHour.
      java.util.Date getStartDate()
      Return the current start date for this event editor.
      void refresh()
      Tells the IEventEditor to refresh all days in its display.
      void refresh​(java.util.Date date)
      Tells the IEventEditor to refresh its display for the specified date.
      void removeItemDeleteHandler​(CalendarableItemEventHandler deleteHandler)
      Removes the handler from the collection of handlers who will be notified when a CalendarableItem is deleted from the receiver, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class.
      void removeItemDisposeHandler​(CalendarableItemEventHandler itemDisposeHandler)
      Removes the handler from the collection of handlers who will be notified when a CalendarableItem is disposed, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class.
      void removeItemEditHandler​(CalendarableItemEventHandler handler)
      Removes the handler from the collection of handlers who will be notified when a CalendarableItem is inserted into the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.
      void removeItemInsertHandler​(CalendarableItemEventHandler insertHandler)
      Removes the handler from the collection of handlers who will be notified when a CalendarableItem is inserted into the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.
      void removeSelectionChangeListener​(CalendarableSelectionChangeListener l)
      Removes the listener from the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the CalendarableSelectionChangeListener interface.
      void setEventContentProvider​(EventContentProvider eventContentProvider)
      Sets the strategy pattern object that can set the properties of the event objects in order to display the data associated with the specified event.
      void setEventCountProvider​(EventCountProvider eventCountProvider)
      Set the strategy pattern object that can return how many events to display for specific periods of time.
      void setStartDate​(java.util.Date startDate)
      Set the start date for this event editor.
      void setTimeBreakdown​(int numberOfDays, int numberOfDivisionsInHour)
      Method setTimeBreakdown.
    • Field Detail

      • DISPLAYED_HOURS

        static final int DISPLAYED_HOURS
        The number of hours to display at a time. Normally this is the number of hours in a day.
        See Also:
        Constant Field Values
    • Method Detail

      • setTimeBreakdown

        void setTimeBreakdown​(int numberOfDays,
                              int numberOfDivisionsInHour)
        Method setTimeBreakdown. Call this method exactly once after constructing the control in order to set the number of day columns to display.

        This method may be executed exactly once. Executing more than once will result in undefined behavior.

        This method is a hint. It may be ignored by specific implementations (ie: a month view).

        Parameters:
        numberOfDays - The number of days to display.
        numberOfDivisionsInHour - 1 == one line per hour; 2 == every 1/2 hour; 4 = every 1/4 hour; etc...
      • getNumberOfDays

        int getNumberOfDays()
        Method getNumberOfDays. Returns the number of days being displayed in this IEventEditor.
        Returns:
        The number of days being displayed.
      • getNumberOfDivisionsInHour

        int getNumberOfDivisionsInHour()
        Returns the numberOfDivisionsInHour. For example, to have a new time slice every 1/4 hour, this value would be 4.
        Returns:
        Returns the numberOfDivisionsInHour.
      • setStartDate

        void setStartDate​(java.util.Date startDate)
        Set the start date for this event editor. How this is interpreted depends on how time is being visualized.

        For example, a month editor would only pay attention to the month portion of the date. A multi-day editor would make the date passed be the first date edited in the set of days being visualized.

        Parameters:
        startDate - The date representing what slice of time to visualize in the editor. null is not permitted. Passing null will result in undefined behavior.
      • getStartDate

        java.util.Date getStartDate()
        Return the current start date for this event editor. This is the date that was set in setStartDate.
        Returns:
        The start date, or null if no start date has been specified yet.
      • setEventCountProvider

        void setEventCountProvider​(EventCountProvider eventCountProvider)
        Set the strategy pattern object that can return how many events to display for specific periods of time.

        Note that having a separate event count provider and event content provider assumes that the implementer is single-threaded and that the count can't change between calling the count provider and the content provider.

        Parameters:
        eventCountProvider - The eventCountProvider to set.
      • setEventContentProvider

        void setEventContentProvider​(EventContentProvider eventContentProvider)
        Sets the strategy pattern object that can set the properties of the event objects in order to display the data associated with the specified event.

        Note that having a separate event count provider and event content provider assumes that the implementer is single-threaded and that the count can't change between calling the count provider and the content provider.

        Parameters:
        eventContentProvider - The eventContentProvider to set.
      • refresh

        void refresh​(java.util.Date date)
        Tells the IEventEditor to refresh its display for the specified date. If the specified date is not being displayed, the request will be ignored. If null is passed as the date, the entire display is refreshed.
        Parameters:
        date - The date to refresh or null to refresh everything.
      • refresh

        void refresh()
        Tells the IEventEditor to refresh all days in its display.
      • addItemInsertHandler

        void addItemInsertHandler​(CalendarableItemEventHandler insertHandler)
        Adds the handler to the collection of handlers who will be notified when a CalendarableItem is inserted in the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.

        itemInserted is called when the CalendarableItem is inserted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemInsertHandler, removeItemInsertHandler(org.eclipse.nebula.widgets.compositetable.day.CalendarableItemEventHandler)
      • removeItemInsertHandler

        void removeItemInsertHandler​(CalendarableItemEventHandler insertHandler)
        Removes the handler from the collection of handlers who will be notified when a CalendarableItem is inserted into the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.

        itemInserted is called when the CalendarableItem is inserted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemInsertHandler, addItemInsertHandler(org.eclipse.nebula.widgets.compositetable.day.CalendarableItemEventHandler)
      • fireInsert

        NewEvent fireInsert​(java.util.Date date,
                            boolean allDayEvent)
        Requests that the event editor attempt to insert a new element by calling its registered insert handlers
        Parameters:
        date - The date/time on which to request the insert. The actual date on which the insert is performed may be different. This is a HINT.
        allDayEvent - Indicates if the new event should be an all-day event. This is a HINT; the actual event inserted may be a timed event.
        Returns:
        NewEvent a NewEvent object describing the event that was inserted.
      • addItemDeleteHandler

        void addItemDeleteHandler​(CalendarableItemEventHandler deleteHandler)
        Adds the handler to the collection of handlers who will be notified when a CalendarableItem is deleted from the receiver, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class.

        itemDeleted is called when the CalendarableItem is deleted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemEventHandler, #removeDeleteItemHandler
      • fireDelete

        boolean fireDelete​(CalendarableItem toDelete)
        Requests that the event editor delete the specified CalendarableItem's data.
        Parameters:
        toDelete - The CalendarableItem to delete.
        Returns:
        true if successful; false otherwise.
      • removeItemDeleteHandler

        void removeItemDeleteHandler​(CalendarableItemEventHandler deleteHandler)
        Removes the handler from the collection of handlers who will be notified when a CalendarableItem is deleted from the receiver, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class.

        itemDeleted is called when the CalendarableItem is deleted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemEventHandler, #addDeleteItemHandler
      • addItemDisposeHandler

        void addItemDisposeHandler​(CalendarableItemEventHandler itemDisposeHandler)
        Adds the handler to the collection of handler who will be notified when a CalendarableItem's control is disposed, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class. This is normally used to remove any data bindings that may be attached to the (now-unused) CalendarableItem.

        itemDeleted is called when the CalendarableItem is deleted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemEventHandler, #removeCalendarableItemDisposeHandler
      • removeItemDisposeHandler

        void removeItemDisposeHandler​(CalendarableItemEventHandler itemDisposeHandler)
        Removes the handler from the collection of handlers who will be notified when a CalendarableItem is disposed, by sending it one of the messages defined in the CalendarableItemEventHandler abstract class. This is normally used to remove any data bindings that may be attached to the (now-unused) CalendarableItem.

        itemDeleted is called when the CalendarableItem is deleted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemEventHandler, #removeDeleteListener
      • addItemEditHandler

        void addItemEditHandler​(CalendarableItemEventHandler handler)
        Adds the handler to the collection of handlers who will be notified when a CalendarableItem is inserted in the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.

        itemInserted is called when the CalendarableItem is inserted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemInsertHandler, removeItemInsertHandler(org.eclipse.nebula.widgets.compositetable.day.CalendarableItemEventHandler)
      • removeItemEditHandler

        void removeItemEditHandler​(CalendarableItemEventHandler handler)
        Removes the handler from the collection of handlers who will be notified when a CalendarableItem is inserted into the receiver, by sending it one of the messages defined in the CalendarableItemInsertHandler abstract class.

        itemInserted is called when the CalendarableItem is inserted.

        Parameters:
        handler - the handler which should be notified
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the handler is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        See Also:
        CalendarableItemInsertHandler, addItemInsertHandler(org.eclipse.nebula.widgets.compositetable.day.CalendarableItemEventHandler)