Class AbstractEventEditor

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable
    Direct Known Subclasses:
    DayEditor, MonthCalendar

    public abstract class AbstractEventEditor
    extends org.eclipse.swt.widgets.Composite
    Since:
    3.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int defaultEventDuration  
      private java.util.List insertHandlers  
      • Fields inherited from class org.eclipse.swt.widgets.Composite

        embeddedHandle
      • Fields inherited from class org.eclipse.swt.widgets.Widget

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractEventEditor​(org.eclipse.swt.widgets.Composite parent, int style)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addItemInsertHandler​(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.
      protected boolean fireEvents​(CalendarableItemEvent e, java.util.List handlers)  
      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 getDefaultEventDuration()
      Returns the default duration of a new event, in hours.
      private java.util.Date incrementHour​(java.util.Date date, int increment)  
      abstract void refresh()
      Tells the IEventEditor to refresh all days in its display.
      void removeItemInsertHandler​(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 setDefaultEventDuration​(int defaultEventDuration)
      Sets the default duration of a new event, in hours.
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
      • Methods inherited from class org.eclipse.swt.widgets.Scrollable

        computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
      • Methods inherited from class org.eclipse.swt.widgets.Control

        addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • defaultEventDuration

        private int defaultEventDuration
      • insertHandlers

        private java.util.List insertHandlers
    • Constructor Detail

      • AbstractEventEditor

        public AbstractEventEditor​(org.eclipse.swt.widgets.Composite parent,
                                   int style)
        Parameters:
        parent - Parent control
        style - SWT style bit
    • Method Detail

      • refresh

        public abstract void refresh()
        Tells the IEventEditor to refresh all days in its display.
      • fireInsert

        public 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.
      • addItemInsertHandler

        public void addItemInsertHandler​(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)
      • removeItemInsertHandler

        public void removeItemInsertHandler​(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)
      • getDefaultEventDuration

        public int getDefaultEventDuration()
        Returns the default duration of a new event, in hours.
        Returns:
        int the number of hours a new event occupies by default.
      • setDefaultEventDuration

        public void setDefaultEventDuration​(int defaultEventDuration)
        Sets the default duration of a new event, in hours.
        Parameters:
        defaultEventDuration - int the number of hours a new event occupies by default.
      • incrementHour

        private java.util.Date incrementHour​(java.util.Date date,
                                             int increment)