public class DayEditor extends AbstractEventEditor implements IEventEditor
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Calendar |
calendar |
protected TimeSlice |
daysHeader |
static int |
NO_HEADER
NO_HEADER constant.
|
(package private) org.eclipse.swt.events.MouseAdapter |
selectCompositeTableOnMouseDownAdapter |
DISPLAYED_HOURS
Constructor and Description |
---|
DayEditor(org.eclipse.swt.widgets.Composite parent,
int style)
Constructor DayEditor.
|
Modifier and Type | Method and Description |
---|---|
void |
addItemDeleteHandler(CalendarableItemEventHandler handler)
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 handler)
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 hand editing of
calendarable events, by sending it one of the messages defined in the
CalendarableItemInsertHandler abstract class. |
void |
addKeyListener(org.eclipse.swt.events.KeyListener listener) |
void |
addMouseListener(org.eclipse.swt.events.MouseListener listener) |
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. |
protected org.eclipse.swt.graphics.Point[] |
computeColumns(int day,
int numberOfColumns,
org.eclipse.swt.widgets.Control[] gridRows) |
boolean |
fireDelete(CalendarableItem item)
Requests that the event editor delete the specified CalendarableItem's
data.
|
boolean |
fireEdit(CalendarableItem toEdit)
Fire the itemEdit event.
|
protected void |
fireMouseDoubleClickEvent(org.eclipse.swt.events.MouseEvent e) |
protected void |
fireMouseDownEvent(org.eclipse.swt.events.MouseEvent e) |
protected void |
fireMouseUpEvent(org.eclipse.swt.events.MouseEvent e) |
protected CalendarableItem |
getAllDayCalendarableAt(int day,
int row)
Find the all day event that is positioned at the specified day and row in
viewport coordinates
|
int |
getDefaultStartHour() |
protected CalendarableItem |
getFirstCalendarableAt(int day,
int row)
(non-API) Method getFirstCalendarableAt.
|
int |
getNumberOfDays()
Method getNumberOfDays.
|
int |
getNumberOfDivisionsInHour()
Returns the numberOfDivisionsInHour.
|
DayEditorSelection |
getSelection()
Method getSelection.
|
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.
|
protected void |
refreshColumnHeaders(java.util.LinkedList<org.eclipse.swt.custom.CLabel> columns)
(non-API) Method initializeColumnHeaders.
|
void |
removeItemDeleteHandler(CalendarableItemEventHandler handler)
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 handler)
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 hand editing of
calendarable events, by sending it one of the messages defined in the
CalendarableItemInsertHandler abstract class. |
void |
removeKeyListener(org.eclipse.swt.events.KeyListener listener) |
void |
removeMouseListener(org.eclipse.swt.events.MouseListener listener) |
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 |
setBackground(org.eclipse.swt.graphics.Color color) |
void |
setDefaultStartHour(int defaultStartHour) |
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.
|
boolean |
setFocus() |
void |
setMenu(org.eclipse.swt.widgets.Menu menu) |
void |
setSelection(CalendarableItem newSelection)
Method selectCalendarable.
|
void |
setStartDate(java.util.Date startDate)
Set the start date for this event editor.
|
void |
setTimeBreakdown(int numberOfDays,
int numberOfDivisionsInHour)
Method setTimeBreakdown.
|
void |
showEventsWithPrecision(boolean option) |
addItemInsertHandler, fireEvents, fireInsert, getDefaultEventDuration, removeItemInsertHandler, setDefaultEventDuration
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addMenuDetectListener, 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, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeMenuDetectListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addItemInsertHandler, fireInsert, removeItemInsertHandler
protected TimeSlice daysHeader
public static final int NO_HEADER
java.util.Calendar calendar
org.eclipse.swt.events.MouseAdapter selectCompositeTableOnMouseDownAdapter
public DayEditor(org.eclipse.swt.widgets.Composite parent, int style)
parent
- style
- DayEditor.NO_HEADER or SWT.NO_TRIM means not to display a header.public void setTimeBreakdown(int numberOfDays, int numberOfDivisionsInHour)
IEventEditor
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).
setTimeBreakdown
in interface IEventEditor
numberOfDays
- The number of days to display.numberOfDivisionsInHour
- 1 == one line per hour; 2 == every 1/2 hour; 4 = every 1/4
hour; etc...IEventEditor.setTimeBreakdown(int,
int)
public void setMenu(org.eclipse.swt.widgets.Menu menu)
setMenu
in class org.eclipse.swt.widgets.Control
Control.setMenu(org.eclipse.swt.widgets.Menu)
public void addKeyListener(org.eclipse.swt.events.KeyListener listener)
addKeyListener
in class org.eclipse.swt.widgets.Control
Control.addKeyListener(org.eclipse.swt.events.KeyListener)
public void removeKeyListener(org.eclipse.swt.events.KeyListener listener)
removeKeyListener
in class org.eclipse.swt.widgets.Control
Control.removeKeyListener(org.eclipse.swt.events.KeyListener)
public void addMouseListener(org.eclipse.swt.events.MouseListener listener)
addMouseListener
in class org.eclipse.swt.widgets.Control
public void removeMouseListener(org.eclipse.swt.events.MouseListener listener)
removeMouseListener
in class org.eclipse.swt.widgets.Control
protected void fireMouseDownEvent(org.eclipse.swt.events.MouseEvent e)
protected void fireMouseUpEvent(org.eclipse.swt.events.MouseEvent e)
protected void fireMouseDoubleClickEvent(org.eclipse.swt.events.MouseEvent e)
protected CalendarableItem getFirstCalendarableAt(int day, int row)
day
- The day offsetrow
- The row offset in DayRow coordinatesprotected CalendarableItem getAllDayCalendarableAt(int day, int row)
day
- row
- public void setSelection(CalendarableItem newSelection)
newSelection
- The Calendarable to select.public DayEditorSelection getSelection()
public void addSelectionChangeListener(CalendarableSelectionChangeListener l)
CalendarableSelectionChangeListener
interface.
selectionChanged
is called when the selection changes.
addSelectionChangeListener
in interface IEventEditor
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableSelectionChangeListener
,
removeSelectionChangeListener(org.eclipse.nebula.widgets.compositetable.day.CalendarableSelectionChangeListener)
,
SelectionChangeEvent
public boolean fireEdit(CalendarableItem toEdit)
toEdit
- The CalendarableItem to edit.public void addItemEditHandler(CalendarableItemEventHandler handler)
CalendarableItemInsertHandler
abstract class.
itemInserted
is called when the CalendarableItem is inserted.
addItemEditHandler
in interface IEventEditor
handler
- the handler which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableItemInsertHandler
,
AbstractEventEditor.removeItemInsertHandler(org.eclipse.nebula.widgets.compositetable.day.CalendarableItemEventHandler)
public void removeItemEditHandler(CalendarableItemEventHandler handler)
CalendarableItemInsertHandler
abstract class.
itemInserted
is called when the CalendarableItem is inserted.
removeItemEditHandler
in interface IEventEditor
handler
- the handler which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableItemInsertHandler
,
AbstractEventEditor.removeItemInsertHandler(org.eclipse.nebula.widgets.compositetable.day.CalendarableItemEventHandler)
public boolean fireDelete(CalendarableItem item)
IEventEditor
fireDelete
in interface IEventEditor
item
- The CalendarableItem to delete.IEventEditor.fireDelete(org.eclipse.nebula.widgets.compositetable.timeeditor.CalendarableItem)
public void addItemDeleteHandler(CalendarableItemEventHandler handler)
CalendarableItemEventHandler
abstract
class.
itemDeleted
is called when the CalendarableItem is deleted.
addItemDeleteHandler
in interface IEventEditor
handler
- the handler which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableItemEventHandler
,
#removeDeleteItemHandler
public void removeItemDeleteHandler(CalendarableItemEventHandler handler)
CalendarableItemEventHandler
abstract
class.
itemDeleted
is called when the CalendarableItem is deleted.
removeItemDeleteHandler
in interface IEventEditor
handler
- the handler which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableItemEventHandler
,
#addDeleteItemHandler
public void addItemDisposeHandler(CalendarableItemEventHandler handler)
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.
addItemDisposeHandler
in interface IEventEditor
handler
- the handler which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableItemEventHandler
,
#removeCalendarableItemDisposeHandler
public void removeItemDisposeHandler(CalendarableItemEventHandler handler)
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.
removeItemDisposeHandler
in interface IEventEditor
handler
- the handler which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableItemEventHandler
,
#removeDeleteListener
public void removeSelectionChangeListener(CalendarableSelectionChangeListener l)
CalendarableSelectionChangeListener
interface.
selectionChanged
is called when the selection changes.
removeSelectionChangeListener
in interface IEventEditor
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- CalendarableSelectionChangeListener
,
addSelectionChangeListener(org.eclipse.nebula.widgets.compositetable.day.CalendarableSelectionChangeListener)
,
SelectionChangeEvent
public int getDefaultStartHour()
public void setDefaultStartHour(int defaultStartHour)
defaultStartHour
- The defaultStartHour to set.public void setEventCountProvider(EventCountProvider eventCountProvider)
IEventEditor
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.
setEventCountProvider
in interface IEventEditor
eventCountProvider
- The eventCountProvider to set.public void setEventContentProvider(EventContentProvider eventContentProvider)
IEventEditor
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.
setEventContentProvider
in interface IEventEditor
eventContentProvider
- The eventContentProvider to set.public void setStartDate(java.util.Date startDate)
IEventEditor
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.
setStartDate
in interface IEventEditor
startDate
- The date representing what slice of time to visualize in the editor.
null is not permitted. Passing null will result in undefined behavior.IEventEditor.setStartDate(java.util.Date)
public java.util.Date getStartDate()
IEventEditor
getStartDate
in interface IEventEditor
null
if no start date has been specified yet.IEventEditor.getStartDate()
public void refresh(java.util.Date date)
IEventEditor
refresh
in interface IEventEditor
date
- The date to refresh or null to refresh everything.IEventEditor.refresh(java.util.Date)
public void refresh()
AbstractEventEditor
refresh
in interface IEventEditor
refresh
in class AbstractEventEditor
AbstractEventEditor.refresh()
public int getNumberOfDays()
IEventEditor
getNumberOfDays
in interface IEventEditor
IEventEditor.getNumberOfDays()
public int getNumberOfDivisionsInHour()
IEventEditor
getNumberOfDivisionsInHour
in interface IEventEditor
IEventEditor.getNumberOfDivisionsInHour()
protected void refreshColumnHeaders(java.util.LinkedList<org.eclipse.swt.custom.CLabel> columns)
columns
- A LinkedList of CLabels representing the column objectsprotected org.eclipse.swt.graphics.Point[] computeColumns(int day, int numberOfColumns, org.eclipse.swt.widgets.Control[] gridRows)
public void setBackground(org.eclipse.swt.graphics.Color color)
setBackground
in class org.eclipse.swt.widgets.Control
Control.setBackground(org.eclipse.swt.graphics.Color)
public boolean setFocus()
setFocus
in class org.eclipse.swt.widgets.Composite
Composite.setFocus()
public void showEventsWithPrecision(boolean option)