DoItChange.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 15:23:29 +0200
changeset 4456 df14ee79655a
parent 3492 4e0c2be67618
child 3838 474d8ec95b33
child 4482 96ecc9e89d37
permissions -rw-r--r--
#TUNING by exept class: SourceCodeManagerUtilities changed: #validateConsistencyOfPackage:doClasses:doExtensions:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     1
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     2
 COPYRIGHT (c) 1998 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     3
              All Rights Reserved
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     4
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     5
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     6
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     8
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
     9
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    10
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    11
"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    13
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Change subclass:#DoItChange
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Changes'
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!DoItChange class methodsFor:'documentation'!
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    23
copyright
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    24
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    25
 COPYRIGHT (c) 1998 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    26
              All Rights Reserved
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    28
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    29
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    31
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    32
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    33
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    34
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 784
diff changeset
    35
2126
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    36
!
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    37
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    38
documentation
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    39
"
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    40
    I represent a doIt (typically #initialize-messages) within a changeSet
d3a862c256c0 documentation
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
    41
"
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
! !
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
1132
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    44
!DoItChange methodsFor:'applying'!
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    45
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    46
apply
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    47
    "apply the change"
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    48
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    49
    Compiler evaluate:source.
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    50
! !
Claus Gittinger <cg@exept.de>
parents: 1039
diff changeset
    51
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    52
!DoItChange methodsFor:'comparing'!
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    53
1039
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    54
isInitialize
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    55
    "return true, if the given change represents a #initialize message."
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    56
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    57
    |tree|
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    58
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    59
    tree := Parser parseExpression:source.
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    60
    ^ tree isMessage and:[tree selector == #initialize]
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    61
!
f3081fea9435 added #isInitialize
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    62
784
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    63
sameAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    64
    "return true, if the given change represents the same change as the receiver."
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    65
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    66
    changeB isDoIt ifFalse:[^ false].
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    67
    ^ self sameSourceAs:changeB
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    68
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    69
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    70
! !
1e50cc7fd07d added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
    71
1297
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    72
!DoItChange methodsFor:'printing & storing'!
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    73
1394
392398eeac68 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
    74
printOn:aStream
1297
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    75
    aStream nextPutAll:'DoIt: '.
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    76
    aStream nextPutAll:source.
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    77
! !
9425303f1061 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1154
diff changeset
    78
773
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    79
!DoItChange methodsFor:'queries'!
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    80
1154
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    81
receiverClassName
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    82
    |tree|
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    83
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    84
    tree := Parser parseExpression:source.
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    85
    (tree isNil or:[tree isSymbol]) ifTrue:[^ nil].
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    86
    tree isMessage ifFalse:[^ nil].
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    87
    tree receiver isVariable ifFalse:[^ nil].
1c2809b4abc2 +receiverClassName (to extract the classes name of a Foo initialize doIt)
Claus Gittinger <cg@exept.de>
parents: 1132
diff changeset
    88
    ^ tree receiver name
773
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    89
! !
286439523352 added #isDoIt
Claus Gittinger <cg@exept.de>
parents: 653
diff changeset
    90
3492
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
    91
!DoItChange methodsFor:'testing'!
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
    92
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
    93
isDoIt
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
    94
    ^ true
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
    95
! !
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
    96
2620
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    97
!DoItChange methodsFor:'visiting'!
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    98
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
    99
acceptChangeVisitor:aVisitor
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   100
    ^ aVisitor visitDoItChange:self.
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   101
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   102
    "Created: / 25-11-2011 / 17:15:07 / cg"
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   103
! !
bd9f1ebdaf44 visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents: 2126
diff changeset
   104
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
!DoItChange class methodsFor:'documentation'!
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
version
3492
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   108
    ^ '$Header: /cvs/stx/stx/libbasic3/DoItChange.st,v 1.13 2014-02-19 13:05:08 cg Exp $'
653
b873bb41ef10 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
! !
3492
4e0c2be67618 category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   110