Class DefaultScheduleModel
java.lang.Object
com.codename1.scheduling.AbstractScheduleModel
com.codename1.scheduling.DefaultScheduleModel
- All Implemented Interfaces:
ScheduleModel
A schedule held in memory, which accepts every edit.
Override updateItem, createItem or removeItem to validate a change
or to send it somewhere before it is accepted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItem(ScheduleItem item) addItems(List<ScheduleItem> all) Adds several items and fires one change.Removes every item and keeps the resources.createItem(long start, long end, String resourceId) Creates an item for a range the user dragged out on empty space.voidgetItems(long from, long to, List<ScheduleItem> out) Adds every item with any part inside[from, to)toout.The resources, in the order they are shown.booleanbooleanremoveItem(ScheduleItem item) Removes an item.setCreationEnabled(boolean v) Whether dragging on empty space makes an item.setDefaultDuration(long millis) The length of an item created by a tap, where there is no range.booleanupdateItem(ScheduleItem item, long start, long end, String resourceId) Moves or resizes an item, and gives it to another resource whenresourceIddiffers from the one it has.Methods inherited from class AbstractScheduleModel
addChangeListener, fireChanged, removeChangeListener, setVisibleRange
-
Constructor Details
-
DefaultScheduleModel
public DefaultScheduleModel()
-
-
Method Details
-
addResource
-
removeResource
-
addItem
-
addItems
Adds several items and fires one change. -
clearItems
Removes every item and keeps the resources. -
getAllItems
-
getItem
-
setCreationEnabled
Whether dragging on empty space makes an item. On by default. -
isCreationEnabled
public boolean isCreationEnabled() -
setDefaultDuration
The length of an item created by a tap, where there is no range. -
getResources
Description copied from interface:ScheduleModelThe resources, in the order they are shown. Empty for a schedule that is one person's. -
getItems
Description copied from interface:ScheduleModelAdds every item with any part inside[from, to)toout. -
updateItem
Description copied from interface:ScheduleModelMoves or resizes an item, and gives it to another resource when
resourceIddiffers from the one it has.Returns
false when the model refuses the change; the view puts the item back
- Specified by:
updateItemin interfaceScheduleModel- Overrides:
updateItemin classAbstractScheduleModel
-
createItem
Description copied from interface:ScheduleModelCreates an item for a range the user dragged out on empty space.
Returns
the new item, or null when the model does not create items this way
- Specified by:
createItemin interfaceScheduleModel- Overrides:
createItemin classAbstractScheduleModel
-
removeItem
Description copied from interface:ScheduleModelRemoves an item.
Returns
false when the model refuses
- Specified by:
removeItemin interfaceScheduleModel- Overrides:
removeItemin classAbstractScheduleModel
-