Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public abstract class AbstractScheduleModel
- Object
- AbstractScheduleModel
ImplementsScheduleModel
Known subtypesCalendarScheduleModel, DefaultScheduleModel
The listener list and the refusals every read-only model shares.
A subclass has to supply getResources and getItems. Every edit is
refused until the matching method is overridden.
Constructors
public AbstractScheduleModel() |
Methods
public void setVisibleRange(long from, long to) | Told by a view whenever the range it shows changes, with a margin around it. |
public boolean updateItem(ScheduleItem item, long start, long end, String resourceId) | Moves or resizes an item, and gives it to another resource when resourceId differs from the one it has. |
public ScheduleItem createItem(long start, long end, String resourceId) | Creates an item for a range the user dragged out on empty space. |
public boolean removeItem(ScheduleItem item) | Removes an item. |
public void addChangeListener(ScheduleChangeListener l) | |
public void removeChangeListener(ScheduleChangeListener l) | |
protected void fireChanged() | Tells every listener the model changed. |
Inherited methods
Constructor details
AbstractScheduleModel
public AbstractScheduleModel()Method details
setVisibleRange
public void setVisibleRange(long from, long to)Told by a view whenever the range it shows changes, with a margin
around it. A model that keeps everything in memory ignores it.
updateItem
public boolean updateItem(ScheduleItem item, long start, long end, String resourceId)Moves or resizes an item, and gives it to another resource when
resourceId differs from the one it has.Returns
false when the model refuses the change; the view puts the item back
createItem
public ScheduleItem createItem(long start, long end, String resourceId)Creates 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
removeItem
public boolean removeItem(ScheduleItem item)Removes an item.
Returns
false when the model refuses
addChangeListener
public void addChangeListener(ScheduleChangeListener l)removeChangeListener
public void removeChangeListener(ScheduleChangeListener l)fireChanged
protected void fireChanged()Tells every listener the model changed.