MCLazyPropertyDictionary.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 11 Jul 2023 12:59:07 +0100
branchjv
changeset 1174 f0a16c301971
parent 1095 87f223484bc3
permissions -rw-r--r--
Make `ProjectDefinition >> #monticelloTimestamps_code` an extension in `stx:goodies/monticello` ...and convert it to use (not so) new annotation-based extension mechanism.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1095
87f223484bc3 Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 634
diff changeset
     1
"{ Encoding: utf8 }"
87f223484bc3 Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 634
diff changeset
     2
267
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:goodies/monticello' }"
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
Dictionary subclass:#MCLazyPropertyDictionary
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:'tokens'
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
634
5a72e7e81794 category change
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
     9
	category:'SCM-Monticello-St/X support'
267
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!MCLazyPropertyDictionary class methodsFor:'instance creation'!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
withTokens: anArray
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
    ^self new setTokens: anArray
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
    "Created: / 28-10-2010 / 15:20:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
! !
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!MCLazyPropertyDictionary methodsFor:'accessing'!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
at: key ifAbsent: block
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
    tokens ifNotNil:[self associate].
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
    ^super at: key ifAbsent:block
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
    "Created: / 28-10-2010 / 15:24:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
! !
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
!MCLazyPropertyDictionary methodsFor:'initialization'!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
setTokens: anArray
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
    tokens := anArray
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
    "Created: / 28-10-2010 / 15:20:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
! !
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!MCLazyPropertyDictionary methodsFor:'private'!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
associate
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        tokens pairWiseDo: [:key :value | 
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
                                        | tmp |
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
                                        tmp := value.
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
                                        value isString ifFalse: [tmp := value collect: [:ea | MCLazyPropertyDictionary withTokens: ea]].
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
                                        value = 'nil' ifTrue: [tmp := ''].
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
                                        self at: key put: tmp].
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
        tokens := nil.
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    "Created: / 28-10-2010 / 15:23:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!MCLazyPropertyDictionary class methodsFor:'documentation'!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
version
634
5a72e7e81794 category change
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
    59
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyPropertyDictionary.st,v 1.3 2012-09-11 21:22:36 cg Exp $'
267
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
version_CVS
634
5a72e7e81794 category change
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
    63
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCLazyPropertyDictionary.st,v 1.3 2012-09-11 21:22:36 cg Exp $'
267
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
!
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
version_SVN
1095
87f223484bc3 Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 634
diff changeset
    67
    ^ '§Id: MCLazyPropertyDictionary.st 23 2010-10-29 14:41:24Z vranyj1 §'
267
6296aec0f1bb initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
! !