#UI_ENHANCEMENT by cg
class: UndoSupport
added:
#addUndoFirst:
#isInTransaction
#transactionNotEmpty
--- a/UndoSupport.st Thu Apr 28 22:54:03 2016 +0200
+++ b/UndoSupport.st Sun May 01 09:42:25 2016 +0200
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libbasic2' }"
+"{ NameSpace: Smalltalk }"
+
Object subclass:#UndoSupport
instanceVariableNames:'actionPerformer transaction undoList redoList
infoOfCurrentTransaction undoLimit'
@@ -106,6 +108,20 @@
redoList := OrderedCollection new.
! !
+!UndoSupport methodsFor:'queries'!
+
+isInTransaction
+ ^ transaction notNil
+
+ "Created: / 30-04-2016 / 20:31:04 / cg"
+!
+
+transactionNotEmpty
+ ^ transaction notEmptyOrNil
+
+ "Created: / 30-04-2016 / 20:47:53 / cg"
+! !
+
!UndoSupport methodsFor:'undo & again'!
addUndo:action
@@ -114,6 +130,14 @@
].
!
+addUndoFirst:action
+ transaction notNil ifTrue:[
+ transaction addFirst:action
+ ].
+
+ "Created: / 30-04-2016 / 20:50:53 / cg"
+!
+
closeTransactionAndAddTo:aList
|actionToAdd lastAction canCombine|
@@ -263,5 +287,6 @@
!UndoSupport class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/UndoSupport.st,v 1.10 2009-05-04 14:42:09 cg Exp $'
+ ^ '$Header$'
! !
+