public abstract class Item
extends java.lang.Object
implements java.lang.Cloneable
Appointment
.Modifier | Constructor and Description |
---|---|
protected |
Item()
Initializes a new instance of the
Item class. |
Modifier and Type | Method and Description |
---|---|
void |
addItemListener(ItemListener listener)
Adds a
ItemListener to the item. |
abstract Item |
clone()
Creates a clone of this item.
|
protected void |
copyOccurrence(Item master)
Called by the recurrence whenever a new occurrence is being
generated in order to populate the fields of the instance
from the master item.
|
protected ItemState |
createState()
Creates an item state corresponding to the concrete type of this item.
|
boolean |
getAffectsLayout()
Gets a value indicating whether this item affects the layout
of other items when displayed in scheduling controls.
|
abstract boolean |
getAllDayEvent()
Gets a value indicating whether the item represents an all day event.
|
abstract boolean |
getAllowChangeEnd()
Gets a value indicating whether users are allowed to change the item's end time.
|
abstract boolean |
getAllowChangeStart()
Gets a value indicating whether users are allowed to change the item's start time.
|
abstract boolean |
getAllowMove()
Gets a value indicating whether users are allowed to move the item.
|
boolean |
getAlwaysOnTop()
Gets a value indicating whether this item is always processed
last when displayed in scheduling controls.
|
abstract ResourceList<Contact> |
getContacts()
Gets a list with all contacts associated with this item.
|
abstract java.lang.String |
getDescriptionText()
Gets the description displayed for this item by scheduling controls.
|
abstract DateTime |
getEndTime()
Gets the item's scheduled end time.
|
abstract java.lang.String |
getHeaderText()
Gets the header text displayed for this item by scheduling controls.
|
boolean |
getHideAdornments()
Gets a value indicating whether the item adornments (if any)
should not be drawing in scheduling controls.
|
boolean |
getHideShadow()
Gets a value indicating whether the item shadow (if any) should
not be drawn in scheduling controls.
|
abstract java.lang.String |
getId()
Gets the string identifier of this item.
|
boolean |
getIsAffectedByLayout()
Gets a value indicating whether this item is affected by the
layout of other items when displayed in scheduling controls.
|
abstract Location |
getLocation()
Gets the location associated with this item.
|
abstract boolean |
getLocked()
Gets a value indicating whether users are forbidden to modify this item.
|
int |
getOccurrenceIndex()
Gets the index of a repeating occurrence of a recurring item.
|
abstract Style |
getPointedSelectedStyle()
Gets the style associated with the item.
|
abstract Style |
getPointedStyle()
Gets the style associated with the item.
|
int |
getPriority()
Gets the priority of this item.
|
Recurrence |
getRecurrence()
Gets the recurrence pattern of this item.
|
RecurrenceState |
getRecurrenceState()
Gets the recurrence state of this item.
|
abstract Reminder |
getReminder()
Gets the reminder for this item.
|
abstract ResourceList<Resource> |
getResources()
Gets a list with all resources associated with this item.
|
abstract Style |
getSelectedStyle()
Gets the selected style associated with the item.
|
abstract DateTime |
getStartTime()
Gets the item's scheduled start time.
|
abstract Style |
getStyle()
Gets a style associated with the item.
|
abstract java.lang.Object |
getTag()
Gets custom data associated with the item.
|
abstract Task |
getTask()
Gets the task associated with this item.
|
java.lang.Object |
getViewData()
Gets a view-specific data attached to the item.
|
abstract boolean |
getVisible()
Gets a flag indicating whether the item is visible or not.
|
int |
hashCode()
Returns a hash code for this item.
|
void |
loadFrom(org.w3c.dom.Element element,
XmlSerializationContext context)
Loads item data from an XML document.
|
void |
loadFrom(JsonObject obj,
JsonSerializationContext context)
Loads the item from a JSON object.
|
protected void |
onVisualsChanged()
Forces the item to be repainted.
|
void |
removeItemListener(ItemListener listener)
Removes the specified
ItemListener from the item. |
protected void |
restoreState(ItemState state)
Restores the state of this item.
|
protected ItemState |
saveState()
Saves the state of this item.
|
void |
saveTo(org.w3c.dom.Element element,
XmlSerializationContext context)
Saves the item data to an XML document.
|
void |
saveTo(JsonObject obj,
JsonSerializationContext context)
Saves the item as a JSON object.
|
abstract void |
setAllDayEvent(boolean value)
Sets a value indicating whether the item represents an all day event.
|
abstract void |
setAllowChangeEnd(boolean value)
Sets a value indicating whether users are allowed to change the item's end time.
|
abstract void |
setAllowChangeStart(boolean value)
Sets a value indicating whether users are allowed to change the item's start time.
|
abstract void |
setAllowMove(boolean value)
Sets a value indicating whether users are allowed to move the item.
|
abstract void |
setDescriptionText(java.lang.String value)
Sets the description displayed for this item by scheduling controls.
|
abstract void |
setEndTime(DateTime value)
Sets the item's scheduled end time.
|
abstract void |
setHeaderText(java.lang.String value)
Sets the header text displayed for this item by scheduling controls.
|
abstract void |
setId(java.lang.String value)
Sets the string identifier of this item.
|
abstract void |
setLocation(Location value)
Sets the location associated with this item.
|
abstract void |
setLocked(boolean value)
Sets a value indicating whether users are forbidden to modify this item.
|
abstract void |
setPointedSelectedStyle(Style value)
Sets the style associated with the item.
|
abstract void |
setPointedStyle(Style value)
Sets the style associated with the item.
|
void |
setPriority(int value)
Sets the priority of this item.
|
void |
setRecurrence(Recurrence value)
Sets the recurrence pattern of this item.
|
abstract void |
setReminder(Reminder value)
Sets the reminder for this item.
|
abstract void |
setSelectedStyle(Style value)
Sets the selected style associated with the item.
|
abstract void |
setStartTime(DateTime value)
Sets the item's scheduled start time.
|
abstract void |
setStyle(Style value)
Sets a style associated with the item.
|
abstract void |
setTag(java.lang.Object value)
Sets custom data associated with the item.
|
abstract void |
setTask(Task value)
Sets the task associated with this item.
|
void |
setViewData(java.lang.Object value)
Sets a view-specific data attached to the item.
|
abstract void |
setVisible(boolean value)
Sets a flag indicating whether the item is visible or not.
|
protected Item()
Item
class.public int hashCode()
hashCode
in class java.lang.Object
public abstract Item clone()
The clone of a recurring item is not an occurrence but an ordinary item. Aside from this, the clone is an exact duplicate of the original item.
clone
in class java.lang.Object
protected ItemState createState()
This method is used by the undo/redo system to create an ItemState
-derived
object that corresponds to the item class. Custom item classes must override
createState()
in order to implement undo/redo support for any additional
members they define. This method should be overridden together with saveState()
and restoreState(com.mindfusion.scheduling.model.ItemState)
.
ItemState
or a derived class.protected ItemState saveState()
This method is used by the undo/redo system to save the state of an item. Custom
item classes must override saveState()
in order to implement undo/redo support
for any additional members they define. This method should be overridden together
with createState()
and restoreState(com.mindfusion.scheduling.model.ItemState)
.
ItemState
that represents the current state of the item.protected void restoreState(ItemState state)
This method is used by the undo/redo system to restore an item to a previous
state. Custom item classes must override restoreState(com.mindfusion.scheduling.model.ItemState)
in order to implement
undo/redo support for any additional members they define. This method should
be overridden together with createState()
and saveState()
.
state
- An ItemState
that represents previous state of the item.public void saveTo(org.w3c.dom.Element element, XmlSerializationContext context)
element
- Allows adding data to the XML document.context
- The context object contains the file format revision number
of the schedule being loaded. It also provides methods that
facilitate reading and writing various data types from and
to the XML document.public void loadFrom(org.w3c.dom.Element element, XmlSerializationContext context)
element
- Allows reading data from the XML document.context
- The context object contains the file format revision number
of the schedule being loaded. It also provides methods that
facilitate reading and writing various data types from and
to the XML document.public void saveTo(JsonObject obj, JsonSerializationContext context)
obj
- A JsonObject instance to contain the serialized data.context
- A JsonSerializationContext object providing contextual information about the serialization process and helper serialization methods.public void loadFrom(JsonObject obj, JsonSerializationContext context)
obj
- A JsonObject containing the item's data.context
- A JsonSerializationContext object providing contextual information about the serialization process and helper serialization methods.protected void copyOccurrence(Item master)
This method is usually overridden in classes which derive from Item
or
Appointment
in order to copy the custom fields from the master item to
a particular occurrence. If the method is not overridden, the custom fields for
all occurrences will have their default values and not the value of the master item.
master
- A reference to the master to copy from.protected void onVisualsChanged()
Call this method from within your derived classes when the appearance of the item has been changed.
public abstract ResourceList<Contact> getContacts()
ResourceList
class containing
the Contact
objects associated with the item.public abstract ResourceList<Resource> getResources()
ResourceList
class containing
the resources associated with this item.public abstract Location getLocation()
Location
class.public abstract void setLocation(Location value)
value
- An instance of the Location
class.public abstract Task getTask()
Task
class.public abstract void setTask(Task value)
value
- An instance of the Task
class.public abstract DateTime getStartTime()
This property affects the initial time cell occupied by the item
when it is displayed in a Calendar
component.
DateTime
instance specifying the scheduled time for the item.public abstract void setStartTime(DateTime value)
This property affects the initial time cell occupied by the item
when it is displayed in a Calendar
component.
value
- A DateTime
instance specifying the scheduled time for the item.public abstract DateTime getEndTime()
This property specifies the last time cell occupied by the item
in a Calendar
component.
DateTime
instance.public abstract void setEndTime(DateTime value)
This property specifies the last time cell occupied by the item
in a Calendar
component.
value
- A DateTime
instance.public abstract boolean getAllowChangeStart()
public abstract void setAllowChangeStart(boolean value)
value
- true if the item's start can be modified interactively; otherwise, false.
The default is true.public abstract boolean getAllowChangeEnd()
public abstract void setAllowChangeEnd(boolean value)
value
- true if the item's end can be modified interactively; otherwise, false.
The default is true.public abstract boolean getAllowMove()
public abstract void setAllowMove(boolean value)
value
- true if the item can be moved interactively; otherwise, false.
The default is true.public abstract boolean getAllDayEvent()
All day event items are displayed in a special header area when
the Calendar
displays a timetable view.
public abstract void setAllDayEvent(boolean value)
All day event items are displayed in a special header area when
the Calendar
displays a timetable view.
value
- true if the item is an all day event; otherwise, false.public abstract java.lang.String getHeaderText()
Calendar
components display this value in the header area
of the box that represents an item.
public abstract void setHeaderText(java.lang.String value)
Calendar
components display this value in the header area
of the box that represents an item.
value
- A string specifying the item's header text.public abstract java.lang.String getDescriptionText()
All classes that derive from Item
must implement this property. Components such as
Calendar
display this text in the details area of an item visual representation.
public abstract void setDescriptionText(java.lang.String value)
All classes that derive from Item
must implement this property. Components such as
Calendar
display this text in the details area of an item visual representation.
value
- A string containing the description of this item.public abstract java.lang.String getId()
public abstract void setId(java.lang.String value)
If you need to change its value, make sure the identifier is always unique.
value
- A string whose value uniquely identifies the item.public abstract boolean getLocked()
public abstract void setLocked(boolean value)
value
- false if users are allowed to move the item thus changing its
scheduled time; otherwise, true.public abstract Reminder getReminder()
If the reminder type is Exact
, the
itemReminderTriggered
event is
raised at the time set in the reminder's Time
property.
If the reminder type is Leading
, the
itemReminderTriggered
event is
raised certain amount of time prior to the item's StartTime
,
as specified in the reminder's TimeInterval
property.
Note: Recurring items cannot have leading reminders.
Reminder
class.public abstract void setReminder(Reminder value)
If the reminder type is Exact
, the
itemReminderTriggered
event is
raised at the time set in the reminder's Time
property.
If the reminder type is Leading
, the
itemReminderTriggered
event is
raised certain amount of time prior to the item's StartTime
,
as specified in the reminder's TimeInterval
property.
Note: Recurring items cannot have leading reminders.
value
- An instance of the Reminder
class.public Recurrence getRecurrence()
If this property is set, the item becomes a recurring event and the
Calendar
component displays multiple occurrences of the item.
To detach a previously set recurrence from an item, set this property to null.
Recurrence
class. The default is null.public void setRecurrence(Recurrence value)
If this property is set, the item becomes a recurring event and the
Calendar
component displays multiple occurrences of the item.
To detach a previously set recurrence from an item, set this property to null.
value
- An instance of the Recurrence
class. The default is null.public RecurrenceState getRecurrenceState()
Events raised by the Calendar
component could pass as an argument
an occurrence or an exception of a recurring item. This property lets you
determine the exact state of the item's recurrence state.
RecurrenceState
constants.public int getOccurrenceIndex()
public int getPriority()
Items with higher priority have a better chance to be displayed prior items
with lower priority. If two items start and end at the same time, the item
with higher Priority
will be displayed before the item
with lower Priority
. In other words, this property gives
you control over the order of the items.
public void setPriority(int value)
Items with higher priority have a better chance to be displayed prior items
with lower priority. If two items start and end at the same time, the item
with higher Priority
will be displayed before the item
with lower Priority
. In other words, this property gives
you control over the order of the items.
value
- An integer value, specifying the item's priority.public abstract Style getStyle()
This style is applied to the item when it is neither pointed with the mouse nor selected.
Style
object that defines the appearance of the item.public abstract void setStyle(Style value)
This style is applied to the item when it is neither pointed with the mouse nor selected.
value
- A Style
object that defines the appearance of the item.public abstract Style getSelectedStyle()
This style is applied to the item when it is selected.
Style
object that defines the appearance of the item.public abstract void setSelectedStyle(Style value)
This style is applied to the item when it is selected.
value
- A Style
object that defines the appearance of the item.public abstract Style getPointedStyle()
This style is applied to the item when it is pointed with the mouse.
This property is ignored and Style
is used instead of it when
UseExtendedStyles
is set to false.
Style
object that defines the appearance of the appointment.public abstract void setPointedStyle(Style value)
This style is applied to the item when it is pointed with the mouse.
This property is ignored and Style
is used instead of it when
UseExtendedStyles
is set to false.
value
- A Style
object that defines the appearance of the appointment.public abstract Style getPointedSelectedStyle()
This style is applied to the item when it is pointed with the mouse and selected
at the same time. This property is ignored and SelectedStyle
is used instead of it when UseExtendedStyles
is set to false.
Style
class that defines the appearance of the item.public abstract void setPointedSelectedStyle(Style value)
This style is applied to the item when it is pointed with the mouse and selected
at the same time. This property is ignored and SelectedStyle
is used instead of it when UseExtendedStyles
is set to false.
value
- An instance of the Style
class that defines the appearance of the item.public abstract boolean getVisible()
Invisible items are not drawn at all. You could use this property to hide an item temporarily, or to store additional data in a helper item object that always stays invisible.
public abstract void setVisible(boolean value)
Invisible items are not drawn at all. You could use this property to hide an item temporarily, or to store additional data in a helper item object that always stays invisible.
value
- true if the item is visible; otherwise, false. The default is true.public abstract java.lang.Object getTag()
Use this property to store your custom data.
Object
.public abstract void setTag(java.lang.Object value)
Use this property to store your custom data.
value
- An instance of any class derived from Object
.public boolean getAffectsLayout()
public boolean getIsAffectedByLayout()
public boolean getAlwaysOnTop()
public boolean getHideShadow()
public boolean getHideAdornments()
public java.lang.Object getViewData()
public void setViewData(java.lang.Object value)
public void addItemListener(ItemListener listener)
ItemListener
to the item.listener
- The ItemListener
to be added.public void removeItemListener(ItemListener listener)
ItemListener
from the item.listener
- The listener to be removed.