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