http://code.google.com/p/pharo/issues/list?thanks=1801 On Jan 13, 2010, at 7:18 AM, John M McIntosh wrote:
Yes, it's in the category "Sophie-Undo"
If I consider the class AbstractUndoRecord We hung 67 subclasses off it, which gives you an idea of the complexity of we what were doing (60 some UI actions), but also the fact it could handle it..
UndoManager class comment:
UndoManager manages execution and storing of UndoRecords through #doAndAddRecord:. It allows hierarchical grouping of UndoRecords through #openRecordGroup, #openRecordGroupNamed: and #closeRecordGroup. Undo and redo is invoked by #undo and #redo.
See UndoManagerTest for someExamples.
Structure: undoHistory OrderedCollection -- holds UndoRecords for undo redoHistory OrderedCollection -- holds UndoRecords for redo maxHistoryLength Integer -- Old UndoRecords in undoHistory are removed to keep it within given limits (0 for no Limit) groupStack OrderedCollection -- temporary dataStructure to manage hierarchical grouping of UndoRecords by #openRecordGroup and closeRecordGroup historyInvalid Boolean -- flag to indicate, that the history is invalid and it must be deleted including the groupStack
On 2010-01-12, at 9:52 PM, Martin McClure wrote:
John M McIntosh wrote:
[...]
PS if anyone is interested the Undo/Redo Logic that Impara did for Sophie was very well received, easy to use, and we could build a book from scratch then undo the entire creation, then redo it. This sounds complex, it was. However the framework made it easy, one piece at a time... Perhaps someone should harvest that since it *was* generic.
Ooh, nice. A good undo/redo framework would be *so* *very* good to have. I'm afraid I can't be the one to harvest it, not anytime soon anyhow, but I hope someone picks it up.
Regards,
-Martin
AbstractUndoRecord #() SophieAddContentRootRecord #('contentRoot' 'book') SophieAddDeleteStickyRecord #('sticky' 'page') SophieAddStickyRecord #() SophieDeleteStickyRecord #() SophieAddEmbedBookRecord #('book' 'bookToEmbed') SophieAddLeafNodeRecord #('book' 'leafNode' 'contentIndexPosition') SophieAddStickiesRecord #('stickies' 'book') SophieApplyFrameLocationStyleAttributesRecord #('bookModel' 'anchor' 'styleAttributes' 'oldStyleAttributes' 'page') SophieApplyPageTemplateRecord #('page' 'template' 'undoData' 'redoData' 'allRemovedFrames') SophieApplyParagraphStyleAttributesRecord #('book' 'marker' 'styleAttributes' 'oldStylesAttributes') SophieApplyParagraphStyleRecord #('book' 'marker' 'style' 'oldStyles') SophieApplyStyleToRangeRecord #('book' 'marker' 'styleAttributes' 'oldRangesStylesCollection') SophieBookExtentUndoRecord #('bookModel' 'newExtent' 'oldExtent') SophieBookStatisticRecord #('book' 'newStatistic' 'oldStatistic') SophieDeleteContentRangeRecord #('book' 'marker' 'positionAfter' 'partialTree') SophieEmbeddedBookUndoRecord #('ebook' 'embeddedBookResource' 'embeddedBookMapEntry') SophieEmbeddedLinkedToBookUndoRecord #('ebook' 'embeddedBookMapEntry' 'embeddedBookResource') SophieFrameRecord #('bookModel' 'frame') SophieFrameZOrderRecord #('page' 'forward') SophieFrameStyleUndoRecord #('bookModel' 'frame' 'attributes' 'state') SophieFrameToTemplateRecord #('bookModel' 'frame' 'page' 'zIndex' 'reversed') SophieInsertCharacterRecord #('book' 'character' 'position' 'positionAfter' 'style') SophieInsertPageBreakRecord #('book' 'position' 'marker') SophieInsertParagraphBreakRecord #('book' 'position' 'marker' 'characterStyle') SophieLinkActionRecord #('book' 'target' 'action' 'actionIndex') SophieLinkActionAddRecord #() SophieLinkActionRemoveRecord #() SophieLinkRecord #('book' 'target') SophieFrameTriggerCleanupRecord #('cleanupStuff') SophieLinkActionCloneRecord #('source' 'oldActions') SophieMarkerAddDeleteRecord #('marker' 'book') SophieMarkerAddMarkersRecord #() SophieMarkerAddRecord #() SophieMarkerDeleteRecord #('actions' 'markerSet') SophieMarkerRangeRecord #('book' 'marker' 'newStart' 'newStop' 'oldStart' 'oldStop') SophiePageRecord #('bookModel' 'page') SophieFlowOrderChangeRecord #('frame' 'index' 'flow') SophiePageStyleRecord #('styleAttributes') SophiePageUndoRecord #('spine' 'index' 'page') SophieInsertPageRecord #() SophieMovePageRecord #('oldIndex') SophiePasteFromImporterRecord #('book' 'importer' 'position' 'marker' 'partialTree') SophiePromoteTemplateOverridesRecord #('book' 'pageTemplateFrame' 'page' 'frameMap' 'deletedTemplateFrames' 'overrideFrames' 'templateFrameFramesFromOverideFrames' 'frameOverrides' 'frameStyleOverrides' 'frameActionsOverrides' 'oldTemplateFrameFrames' 'oldPageFlowMap' 'oldTemplateFlowMap' 'oldPageTemplate' 'newTemplateFrameFrames' 'newPageFlowMap' 'newPageTemplate' 'allRemovedFrames' 'removedOverrideFrameContents') SophieRegisterFlowRecord #('spine' 'flowID' 'content' 'contentID' 'flow') SophieRemoveContentRootRecord #('contentRoot' 'book') SophieRemoveFlowRecord #('spine' 'flow') SophieRemoveFrameRecord #('bookModel' 'page' 'frame' 'wasLocalOverride') SophieRemoveLeafNodeRecord #('book' 'leafNode' 'oldContentIndexPosition') SophieRemovePagesRecord #('spine' 'indices' 'pages') SophieReplaceLibraryTemplateRecord #('book' 'template' 'newTemplate') SophieReplaceTemplateRecord #('book' 'template' 'oldTemplateCopy' 'newTemplate') SophieResourceUndoRecord #('resources') SophieResourceDeleteRecord #('player') SophieResourceImportStreamRecord #('resourceManager' 'mimeType' 'stream') SophieResourceImportURIRecord #('resourceManager' 'uri') SophieResourceLinkToURIRecord #() SophieResourceStoreRecord #('book' 'object' 'metaKey') SophieSpineStateDeltaRecord #('book' 'spine' 'addedPages' 'removedPages') SophieSpineStateRecord #('book' 'spine' 'prevState' 'postState') SophieTimelineUndoRecord #('timelinePlayer') SophieTimelineUndoAbstractEventsRecord #('events') SophieTimelineUndoAddEventsRecord #() SophieTimelineUndoDeleteEventsRecord #() SophieTimelineUndoAddTimeline #('timeline' 'book') SophieTimelineUndoDeleteTimeline #() SophieTimelineUndoEventsMoveRecord #('undoData') SophieTriggerObjectCleanupRecord #('triggerObject' 'undoInformations') SophieUpdateLibraryStyleRecord #('book' 'newStyle' 'styleName' 'oldStyle') UndoRecord #('undoable' 'doMessage' 'undoMessage' 'description') SophieFrameUndoRecord #('bookModel' 'frame') SophieLibraryResourceUndoRecord #('bookModel') SophiePageInvalidationRecord #('bookModel' 'page') SophieFrameAlignmentUndoRecord #('groupFrame' 'framesAndOldPositions' 'framesAndNewPositions') SophieTriggerMarkerUndoRecord #('bookModel' 'marker') UndoRecordWithPostMessage #('postMessage') UndoRecordGroup #('description' 'subRecords') SophieFrameGroupUndoRecord #('frameGroup' 'bookModel')
-- =========================================================================== John M. McIntosh <johnmci@smalltalkconsulting.com> Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project