"Change Set: append-bf
Date: 12 October 2000
Author: Bert Freudenberg
A little enhancement for append areas: Now the text after the leading '+'
is preserved and will be inserted after each append operation. For
example, '+_' will insert a horizontal rule after each entry."
You can try it at http://balloon.cs.uni-magdeburg.de:8888/bert/4
-- Bert
'From Squeak2.7 of 5 January 2000 [latest update: #1770] on 12 October 2000 at
10:46:42 am'!
"Change Set: append-bf
Date: 12 October
2000
Author: Bert Freudenberg
A little enhancement for append areas:
Now the text after the leading '+' is preserved and will be inserted after each append
operation. For example, '+_' will insert a horizontal rule after each entry."!
!IdFormatter class methodsFor: 'instance creation' stamp: 'bf 10/12/2000 10:37'!
saveAppend
| instance |
instance _ self new.
instance idBlock: [:text | '+'].
instance startBlock: [:id | ''].
instance endBlock: [:id | ''].
instance transitionBlock: [:idOld :idNew | ''].
instance formatter: [:text
:request :page :book |
request temp ifNil: [request temp: Dictionary
new].
(request temp includesKey: 'appendId') ifFalse: [request temp at:
'appendId' put: 0].
request temp at: 'appendId' put: ((request temp at:
'appendId') + 1).
((request temp at: 'appendId') asString = (request
appendId))
ifTrue: [
((page settings at:
'saveFormatter' ifAbsent: [book settings at: 'saveFormatter']) format: (request
append) request: request page: page book: book) withBlanksTrimmed, String cr,
text, String cr,
'+', text, String cr]
ifFalse: ['+', text, String cr]].
^instance! !