2486 enabled:aState |
2486 enabled:aState |
2487 enabled := aState |
2487 enabled := aState |
2488 ! |
2488 ! |
2489 |
2489 |
2490 resetModification |
2490 resetModification |
2491 "set modification state to false" |
2491 "set the modification state to false" |
2492 |
2492 |
2493 "/ startIdentifier := identifier |
2493 "/ startIdentifier := identifier |
2494 |
2494 |
2495 identifier := startIdentifier := 0. |
2495 identifier := startIdentifier := 0. |
2496 history := OrderedCollection new. |
2496 history := OrderedCollection new. |
2497 ! ! |
2497 ! ! |
2498 |
2498 |
2499 !UIObjectView::UndoHistory methodsFor:'activation & deactivation'! |
2499 !UIObjectView::UndoHistory methodsFor:'activation & deactivation'! |
2500 |
2500 |
2501 withinTransaction:aType text:aTextOrNil do:aBlock |
2501 withinTransaction:aType text:aTextOrNil do:aBlock |
2502 "open a transaction; perform the block; at least close the transaction" |
2502 "open a transaction; perform the block; finally close the transaction" |
2503 |
2503 |
2504 (enabled and:[transaction isNil]) ifTrue:[ |
2504 (enabled and:[transaction isNil]) ifTrue:[ |
2505 transaction := Transaction type:aType text:aTextOrNil. |
2505 transaction := Transaction type:aType text:aTextOrNil. |
2506 |
2506 |
2507 aBlock value. |
2507 aBlock value. |
2508 |
2508 |
2509 transaction isEmpty ifFalse:[ |
2509 transaction isEmpty ifFalse:[ |
2510 identifier := identifier + 1. |
2510 identifier := identifier + 1. |
2511 transaction identifier:identifier. |
2511 transaction identifier:identifier. |
2512 history addLast:transaction. |
2512 history addLast:transaction. |
2513 history size > (self class maxHistorySize) ifTrue:[history removeFirst] |
2513 history size > (self class maxHistorySize) ifTrue:[history removeFirst]. |
|
2514 Transcript showCR:aTextOrNil. |
2514 ]. |
2515 ]. |
2515 transaction := nil |
2516 transaction := nil |
2516 |
2517 |
2517 ] ifFalse:[ |
2518 ] ifFalse:[ |
2518 aBlock value |
2519 aBlock value |
2634 "Created: / 30.10.2001 / 13:45:28 / cg" |
2635 "Created: / 30.10.2001 / 13:45:28 / cg" |
2635 "Modified: / 30.10.2001 / 13:46:33 / cg" |
2636 "Modified: / 30.10.2001 / 13:46:33 / cg" |
2636 ! |
2637 ! |
2637 |
2638 |
2638 undoLast:nTransactions |
2639 undoLast:nTransactions |
2639 "undo last n transactions; an open transaction will be closed; |
2640 "undo the last n transactions; an open transaction will be closed; |
2640 transactions during undo are disabled" |
2641 transactions during undo are disabled" |
2641 |
2642 |
2642 |repeatTimes transaction actions| |
2643 |repeatTimes transaction actions| |
2643 |
2644 |
2644 transaction := nil. |
2645 transaction := nil. |