Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When the user adds an item in the Timeline or Details components (such as adding a Chapter
to a Part, or a Note to a Scene), the AddItemCommand is executed. Based on the
type of AppEvent (e.g. AppEvent.ADD_CHAPTER or AppEvent.ADD_NOTE), it will add the
appropriate item and select it in the SelectionContext.
Extend SimpleCommand
Get the AppEvent from
the Notification body
Retrieve the SelectionContext from its transient
Proxy
If the type of the
AppEvent is ADD_PART, get the selected Story, call
its getNewPart() method, then
call the SelectionContext’s
selectStory() method with
null followed by the selected
Story, causing the view hierarchy to redraw with the new Part
shown