66
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
Object subclass:#MCPatchOperation
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Patching'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCPatchOperation methodsFor:'accessing'!
|
|
12 |
|
|
13 |
annotations
|
|
14 |
^self annotations: Preferences defaultAnnotationRequests
|
|
15 |
!
|
|
16 |
|
|
17 |
annotations: requests
|
|
18 |
"Answer a string for an annotation pane, trying to fulfill the annotation requests.
|
|
19 |
These might include anything that
|
|
20 |
Preferences defaultAnnotationRequests
|
|
21 |
might return. Which includes anything in
|
|
22 |
Preferences annotationInfo
|
|
23 |
To edit these, use:"
|
|
24 |
"Preferences editAnnotations"
|
|
25 |
|
|
26 |
^String streamContents: [ :s | self printAnnotations: requests on: s ].
|
|
27 |
!
|
|
28 |
|
|
29 |
definition
|
|
30 |
^ self subclassResponsibility
|
|
31 |
!
|
|
32 |
|
|
33 |
inverse
|
|
34 |
self subclassResponsibility
|
|
35 |
!
|
|
36 |
|
|
37 |
prefixForOperation: aSymbol
|
|
38 |
aSymbol == #insert ifTrue: [^ '+'].
|
|
39 |
aSymbol == #remove ifTrue: [^ '-'].
|
|
40 |
^ ' '
|
|
41 |
!
|
|
42 |
|
|
43 |
printAnnotations: requests on: aStream
|
|
44 |
"Add a string for an annotation pane, trying to fulfill the annotation requests.
|
|
45 |
These might include anything that
|
|
46 |
Preferences defaultAnnotationRequests
|
|
47 |
might return. Which includes anything in
|
|
48 |
Preferences annotationInfo
|
|
49 |
To edit these, use:"
|
|
50 |
"Preferences editAnnotations"
|
|
51 |
|
|
52 |
self definition printAnnotations: requests on: aStream.
|
|
53 |
!
|
|
54 |
|
|
55 |
source
|
|
56 |
^ self sourceText
|
|
57 |
!
|
|
58 |
|
|
59 |
sourceString
|
|
60 |
^self sourceText asString
|
|
61 |
!
|
|
62 |
|
|
63 |
sourceText
|
|
64 |
| builder |
|
|
65 |
builder := (Preferences diffsWithPrettyPrint and: [ self targetClass notNil and: [ self isClassPatch not ] ])
|
|
66 |
ifTrue:
|
|
67 |
[PrettyTextDiffBuilder
|
|
68 |
from: self fromSource
|
|
69 |
to: self toSource
|
|
70 |
inClass: self targetClass]
|
|
71 |
ifFalse: [TextDiffBuilder from: self fromSource to: self toSource].
|
|
72 |
^builder buildDisplayPatch.
|
|
73 |
!
|
|
74 |
|
|
75 |
summary
|
|
76 |
^ self definition summary, self summarySuffix
|
|
77 |
!
|
|
78 |
|
|
79 |
summarySuffix
|
|
80 |
^ ''
|
|
81 |
! !
|
|
82 |
|
|
83 |
!MCPatchOperation methodsFor:'as yet unclassified'!
|
|
84 |
|
|
85 |
isClassPatch
|
|
86 |
^false
|
|
87 |
!
|
|
88 |
|
|
89 |
targetClass
|
|
90 |
self subclassResponsibility.
|
|
91 |
! !
|
|
92 |
|
|
93 |
!MCPatchOperation methodsFor:'comparing'!
|
|
94 |
|
|
95 |
<= other
|
|
96 |
^ self definition <= other definition
|
|
97 |
! !
|
|
98 |
|
|
99 |
!MCPatchOperation methodsFor:'testing'!
|
|
100 |
|
|
101 |
isAddition
|
|
102 |
^ false
|
|
103 |
!
|
|
104 |
|
|
105 |
isModification
|
|
106 |
^ false
|
|
107 |
!
|
|
108 |
|
|
109 |
isRemoval
|
|
110 |
^ false
|
|
111 |
! !
|
|
112 |
|
|
113 |
!MCPatchOperation class methodsFor:'documentation'!
|
|
114 |
|
|
115 |
version
|
254
|
116 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatchOperation.st,v 1.2 2011-08-20 11:48:13 cg Exp $'
|
|
117 |
!
|
|
118 |
|
|
119 |
version_CVS
|
|
120 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatchOperation.st,v 1.2 2011-08-20 11:48:13 cg Exp $'
|
|
121 |
!
|
|
122 |
|
|
123 |
version_SVN
|
|
124 |
^ '§Id: MCPatchOperation.st 5 2010-08-29 07:30:29Z vranyj1 §'
|
66
|
125 |
! !
|