Class CalendarableItem
- java.lang.Object
-
- org.eclipse.nebula.widgets.compositetable.timeeditor.ModelObject
-
- org.eclipse.nebula.widgets.compositetable.timeeditor.CalendarableItem
-
public class CalendarableItem extends ModelObject
This class represents an event that can be displayed on a calendar.- Since:
- 3.2
-
-
Field Summary
Fields Modifier and Type Field Description private booleanallDayEventstatic java.lang.StringBINDING_KEY(Non-API)static java.util.ComparatorcomparatorA comparator for CalendarableItem objectsprivate intcontinuedprivate ICalendarableItemControlcontrolprivate java.lang.Objectdatastatic java.lang.StringDATA_KEY(Non-API)private java.util.MapdataMapprivate java.util.DateendTimeprivate org.eclipse.swt.graphics.Imageimageprivate org.eclipse.swt.graphics.PointlowerRightPositionInDayRowCoordinatesstatic java.lang.StringPROP_ALL_DAY_EVENTA constant representing the name of the allDayEvent property.static java.lang.StringPROP_CONTINUEDA constant representing the name of the continued property.static java.lang.StringPROP_DATAA constant representing the name of the data property.private static java.lang.StringPROP_DATEstatic java.lang.StringPROP_END_TIMEA constant representing the name of the endTime property.static java.lang.StringPROP_IMAGEA constant representing the name of the image property.static java.lang.StringPROP_START_TIMEA constant representing the name of the startTime property.static java.lang.StringPROP_TEXTA constant representing the name of the text property.static java.lang.StringPROP_TOOL_TIP_TEXTA constant representing the name of the toolTipText property.private java.util.DatestartTimeprivate java.lang.Stringtextprivate java.lang.StringtoolTipTextprivate org.eclipse.swt.graphics.PointupperLeftPositionInDayRowCoordinates
-
Constructor Summary
Constructors Constructor Description CalendarableItem(java.util.Date day)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetContinued()ICalendarableItemControlgetControl()(non-API) Returns the UI control for this CalendarableItem.java.lang.ObjectgetData()Returns the application defined widget data associated with the receiver, or null if it has not been set.java.lang.ObjectgetData(java.lang.String key)Returns the application defined property of the receiver with the specified name, or null if it has not been set.java.util.DategetDate()java.util.DategetEndTime()Returns the event's end time.org.eclipse.swt.graphics.ImagegetImage()Return the IEvent's image ornull.org.eclipse.swt.graphics.PointgetLowerRightPositionInDayRowCoordinates()(non-API)java.util.DategetStartTime()Gets the event's start time.java.lang.StringgetText()Returns the widget text.java.lang.StringgetToolTipText()Returns the receiver's tool tip text, or null if it has not been set.org.eclipse.swt.graphics.PointgetUpperLeftPositionInDayRowCoordinates()(non-API)booleanisAllDayEvent()Returns if this Calenderable represents an all-day event.voidsetAllDayEvent(boolean allDayEvent)Sets if this Calenderable represents an all-day event.voidsetContinued(int continued)Sets the "To be continued..." bitmask indicating that this event is continued on the next or previous days respectively.voidsetControl(ICalendarableItemControl control)(non-API) Set the UI control for this CalendarableItem.voidsetData(java.lang.Object data)Sets the application defined widget data associated with the receiver to be the argument.voidsetData(java.lang.String key, java.lang.Object data)Sets the application defined property of the receiver with the specified name to the given value.voidsetDate(java.util.Date date)private java.util.DatesetDateComponentOf(java.util.Date source, java.util.Date into)voidsetEndTime(java.util.Date endTime)Sets the event's end time.voidsetImage(org.eclipse.swt.graphics.Image image)Set the IEvent's Image.voidsetLowerRightPositionInDayRowCoordinates(org.eclipse.swt.graphics.Point lowerRightPositionInDayRowCoordinates)(non-API) Sets the lower right position of the bounding box.voidsetStartTime(java.util.Date startTime)Sets the event's start time.voidsetText(java.lang.String string)Sets the contents of the receiver to the given string.private java.util.DatesetTimeComponentOf(java.util.Date source, java.util.Date into)voidsetToolTipText(java.lang.String string)Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.voidsetUpperLeftPositionInDayRowCoordinates(org.eclipse.swt.graphics.Point upperLeftPositionInDayRowCoordinates)(non-API) Sets the upper left position of the bounding box and initializes the lower right position to be the same as the upper left if the lower right has not yet been set.-
Methods inherited from class org.eclipse.nebula.widgets.compositetable.timeeditor.ModelObject
addPropertyChangeListener, addPropertyChangeListener, append, firePropertyChange, firePropertyChange, firePropertyChange, remove, removePropertyChangeListener, removePropertyChangeListener, setId
-
-
-
-
Field Detail
-
PROP_DATE
private static final java.lang.String PROP_DATE
- See Also:
- Constant Field Values
-
PROP_TOOL_TIP_TEXT
public static final java.lang.String PROP_TOOL_TIP_TEXT
A constant representing the name of the toolTipText property.- See Also:
- Constant Field Values
-
PROP_DATA
public static final java.lang.String PROP_DATA
A constant representing the name of the data property.- See Also:
- Constant Field Values
-
PROP_TEXT
public static final java.lang.String PROP_TEXT
A constant representing the name of the text property.- See Also:
- Constant Field Values
-
PROP_IMAGE
public static final java.lang.String PROP_IMAGE
A constant representing the name of the image property.- See Also:
- Constant Field Values
-
PROP_END_TIME
public static final java.lang.String PROP_END_TIME
A constant representing the name of the endTime property.- See Also:
- Constant Field Values
-
PROP_START_TIME
public static final java.lang.String PROP_START_TIME
A constant representing the name of the startTime property.- See Also:
- Constant Field Values
-
PROP_ALL_DAY_EVENT
public static final java.lang.String PROP_ALL_DAY_EVENT
A constant representing the name of the allDayEvent property.- See Also:
- Constant Field Values
-
PROP_CONTINUED
public static final java.lang.String PROP_CONTINUED
A constant representing the name of the continued property.- See Also:
- Constant Field Values
-
comparator
public static final java.util.Comparator comparator
A comparator for CalendarableItem objects
-
allDayEvent
private boolean allDayEvent
-
startTime
private java.util.Date startTime
-
endTime
private java.util.Date endTime
-
image
private org.eclipse.swt.graphics.Image image
-
text
private java.lang.String text
-
toolTipText
private java.lang.String toolTipText
-
data
private java.lang.Object data
-
dataMap
private java.util.Map dataMap
-
upperLeftPositionInDayRowCoordinates
private org.eclipse.swt.graphics.Point upperLeftPositionInDayRowCoordinates
-
lowerRightPositionInDayRowCoordinates
private org.eclipse.swt.graphics.Point lowerRightPositionInDayRowCoordinates
-
control
private ICalendarableItemControl control
-
continued
private int continued
-
BINDING_KEY
public static final java.lang.String BINDING_KEY
(Non-API)- See Also:
- Constant Field Values
-
DATA_KEY
public static final java.lang.String DATA_KEY
(Non-API)- See Also:
- Constant Field Values
-
-
Method Detail
-
isAllDayEvent
public boolean isAllDayEvent()
Returns if this Calenderable represents an all-day event.- Returns:
- true if this is an all-day event; false otherwise.
-
setAllDayEvent
public void setAllDayEvent(boolean allDayEvent)
Sets if this Calenderable represents an all-day event.- Parameters:
allDayEvent- true if this is an all-day event; false otherwise.
-
getDate
public java.util.Date getDate()
- Returns:
- Returns the date on which the event falls.
-
setDate
public void setDate(java.util.Date date)
- Parameters:
date- Sets the date on which the event falls. Ignores the time component of the date that is passed in.
-
setDateComponentOf
private java.util.Date setDateComponentOf(java.util.Date source, java.util.Date into)- Parameters:
source-into-
-
setTimeComponentOf
private java.util.Date setTimeComponentOf(java.util.Date source, java.util.Date into)- Parameters:
source-into-
-
getStartTime
public java.util.Date getStartTime()
Gets the event's start time. This value is ignored if this is an all-day event.- Returns:
- the start time for the event.
-
setStartTime
public void setStartTime(java.util.Date startTime)
Sets the event's start time. This value is ignored if this is an all-day event.- Parameters:
startTime- the event's start time.
-
getEndTime
public java.util.Date getEndTime()
Returns the event's end time. This value is ignored if this is an all-day event.- Returns:
- the event's end time. This value is ignored if this is an all-day event.
-
setEndTime
public void setEndTime(java.util.Date endTime)
Sets the event's end time. This value is ignored if this is an all-day event.- Parameters:
endTime- the event's end time. This value is ignored if this is an all-day event.
-
getImage
public org.eclipse.swt.graphics.Image getImage()
Return the IEvent's image ornull.- Returns:
- the image of the label or null
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
Set the IEvent's Image. The valuenullclears it.- Parameters:
image- the image to be displayed in the label or null- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getText
public java.lang.String getText()
Returns the widget text.The text for a text widget is the characters in the widget, or an empty string if this has never been set.
- Returns:
- the widget text
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setText
public void setText(java.lang.String string)
Sets the contents of the receiver to the given string. If the receiver has style SINGLE and the argument contains multiple lines of text, the result of this operation is undefined and may vary from platform to platform.- Parameters:
string- the new text- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the string is null
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getToolTipText
public java.lang.String getToolTipText()
Returns the receiver's tool tip text, or null if it has not been set.- Returns:
- the receiver's tool tip text
- Throws:
org.eclipse.swt.SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setToolTipText
public void setToolTipText(java.lang.String string)
Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.- Parameters:
string- the new tool tip text (or null)- Throws:
org.eclipse.swt.SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getData
public java.lang.Object getData()
Returns the application defined widget data associated with the receiver, or null if it has not been set. The widget data is a single, unnamed field that is stored with every widget.Applications may put arbitrary objects in this field. If the object stored in the widget data needs to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
- Returns:
- the widget data
- See Also:
setData(Object)
-
setData
public void setData(java.lang.Object data)
Sets the application defined widget data associated with the receiver to be the argument. The widget data is a single, unnamed field that is stored with every widget.Applications may put arbitrary objects in this field. If the object stored in the widget data needs to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
- Parameters:
data- the widget data- See Also:
getData()
-
setData
public void setData(java.lang.String key, java.lang.Object data)Sets the application defined property of the receiver with the specified name to the given value.Applications may associate arbitrary objects with the receiver in this fashion.
- Parameters:
key- the name of the propertyvalue- the new value for the property- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the key is null
- See Also:
getData(String)
-
getData
public java.lang.Object getData(java.lang.String key)
Returns the application defined property of the receiver with the specified name, or null if it has not been set.Applications may have associated arbitrary objects with the receiver in this fashion.
- Parameters:
key- the name of the property- Returns:
- the value of the property or null if it has not been set
- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the key is null
- See Also:
setData(String, Object)
-
getUpperLeftPositionInDayRowCoordinates
public org.eclipse.swt.graphics.Point getUpperLeftPositionInDayRowCoordinates()
(non-API)- Returns:
- Returns the upperLeftPositionInDayRowCoordinates.
-
setUpperLeftPositionInDayRowCoordinates
public void setUpperLeftPositionInDayRowCoordinates(org.eclipse.swt.graphics.Point upperLeftPositionInDayRowCoordinates)
(non-API) Sets the upper left position of the bounding box and initializes the lower right position to be the same as the upper left if the lower right has not yet been set. If the lower right has been set, it is left as it is.- Parameters:
upperLeftPositionInDayRowCoordinates- The upperLeftPositionInDayRowCoordinates to set.
-
getLowerRightPositionInDayRowCoordinates
public org.eclipse.swt.graphics.Point getLowerRightPositionInDayRowCoordinates()
(non-API)- Returns:
- Returns the lowerRightPositionInDayRowCoordinates.
-
setLowerRightPositionInDayRowCoordinates
public void setLowerRightPositionInDayRowCoordinates(org.eclipse.swt.graphics.Point lowerRightPositionInDayRowCoordinates)
(non-API) Sets the lower right position of the bounding box.- Parameters:
lowerRightPositionInDayRowCoordinates- The lowerRightPositionInDayRowCoordinates to set.
-
getControl
public ICalendarableItemControl getControl()
(non-API) Returns the UI control for this CalendarableItem.- Returns:
- The UI control for this CalendarableItem or null if there is none.
-
setControl
public void setControl(ICalendarableItemControl control)
(non-API) Set the UI control for this CalendarableItem.- Parameters:
control- The control to set.
-
setContinued
public void setContinued(int continued)
Sets the "To be continued..." bitmask indicating that this event is continued on the next or previous days respectively.- Parameters:
continued- One or both of SWT.TOP or SWT.BOTTOM
-
getContinued
public int getContinued()
- Returns:
- The continued bitmask; one or both of SWT.TOP or SWT.BOTTOM
-
-