author | Claus Gittinger <cg@exept.de> |
Mon, 21 May 2007 14:21:20 +0200 | |
changeset 7797 | b0bbe7932d47 |
parent 7499 | 6bb22d2d1ad9 |
child 7833 | 75997a5142bb |
permissions | -rw-r--r-- |
2626 | 1 |
" |
2 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
13 |
|
2221 | 14 |
ApplicationModel subclass:#VersionDiffBrowser |
2856 | 15 |
instanceVariableNames:'classChangeSet diffTextView boxAVisible boxBVisible boxMVisible |
16 |
classIfSingleClassDiff versionAIfSingleClassDiff |
|
3147 | 17 |
versionBIfSingleClassDiff changedLabelHolder diffTextLabelA |
18 |
diffTextLabelB methodText methodsChanged methodsChangedSelection |
|
19 |
methodsOnlyInA methodsOnlyInASelection methodsOnlyInB |
|
5182 | 20 |
methodsOnlyInBSelection onlyInALabelHolder onlyInBLabelHolder |
21 |
classHolder versionAHolder versionBHolder' |
|
2221 | 22 |
classVariableNames:'' |
23 |
poolDictionaries:'' |
|
24 |
category:'Interface-Browsers' |
|
25 |
! |
|
26 |
||
2497 | 27 |
HierarchicalItem subclass:#ClassChangeSet |
2695 | 28 |
instanceVariableNames:'classBeingCompared labelA labelB diffSet onlyInA onlyInB |
2856 | 29 |
changedMethods versionA versionB' |
2497 | 30 |
classVariableNames:'' |
31 |
poolDictionaries:'' |
|
32 |
privateIn:VersionDiffBrowser |
|
33 |
! |
|
34 |
||
2626 | 35 |
!VersionDiffBrowser class methodsFor:'documentation'! |
36 |
||
37 |
copyright |
|
38 |
" |
|
39 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
40 |
All Rights Reserved |
|
41 |
||
42 |
This software is furnished under a license and may be used |
|
43 |
only in accordance with the terms of that license and with the |
|
44 |
inclusion of the above copyright notice. This software may not |
|
45 |
be provided or otherwise made available to, or used by, any |
|
46 |
other person. No title to or ownership of the software is |
|
47 |
hereby transferred. |
|
48 |
" |
|
49 |
||
50 |
! |
|
51 |
||
52 |
documentation |
|
53 |
" |
|
54 |
This is not yet finished (work in progress). |
|
55 |
||
56 |
A browser to show differences between class versions, |
|
57 |
allowing easy comparison; will also eventually add capabilities |
|
58 |
to checkIn / load classes into / from the repository. |
|
59 |
||
60 |
[see also:] |
|
61 |
||
62 |
[instance variables:] |
|
63 |
||
64 |
[class variables:] |
|
65 |
" |
|
66 |
||
67 |
||
68 |
! ! |
|
2221 | 69 |
|
70 |
!VersionDiffBrowser class methodsFor:'interface specs'! |
|
71 |
||
72 |
windowSpec |
|
73 |
"This resource specification was automatically generated |
|
74 |
by the UIPainter of ST/X." |
|
75 |
||
76 |
"Do not manually edit this!! If it is corrupted, |
|
77 |
the UIPainter may not be able to read the specification." |
|
78 |
||
79 |
" |
|
80 |
UIPainter new openOnClass:VersionDiffBrowser andSelector:#windowSpec |
|
81 |
VersionDiffBrowser new openInterface:#windowSpec |
|
82 |
VersionDiffBrowser open |
|
83 |
" |
|
84 |
||
85 |
<resource: #canvas> |
|
86 |
||
87 |
^ |
|
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
88 |
#(FullSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
89 |
name: windowSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
90 |
window: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
91 |
(WindowSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
92 |
label: 'Version DiffBrowser' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
93 |
name: 'Version DiffBrowser' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
94 |
min: (Point 10 10) |
7396 | 95 |
bounds: (Rectangle 0 0 865 504) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
96 |
menu: mainMenu |
2221 | 97 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
98 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
99 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
100 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
101 |
(VariableVerticalPanelSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
102 |
name: 'VariableVerticalPanel1' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
103 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
104 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
105 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
106 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
107 |
(HorizontalPanelViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
108 |
name: 'TopHorizontalPanel' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
109 |
horizontalLayout: fit |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
110 |
verticalLayout: fit |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
111 |
horizontalSpace: 3 |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
112 |
verticalSpace: 3 |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
113 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
114 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
115 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
116 |
(ViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
117 |
name: 'BoxA' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
118 |
level: 0 |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
119 |
visibilityChannel: boxAVisible |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
120 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
121 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
122 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
123 |
(LabelSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
124 |
label: 'Only in A' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
125 |
name: 'OnlyInALabel' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
126 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
127 |
translateLabel: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
128 |
labelChannel: onlyInALabelHolder |
2221 | 129 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
130 |
(SequenceViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
131 |
name: 'ListA' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
132 |
layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
133 |
model: methodsOnlyInASelection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
134 |
menu: menuA |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
135 |
hasHorizontalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
136 |
hasVerticalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
137 |
miniScrollerHorizontal: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
138 |
valueChangeSelector: methodsOnlyInASelectionChanged |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
139 |
useIndex: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
140 |
sequenceList: methodsOnlyInA |
2221 | 141 |
) |
142 |
) |
|
143 |
||
144 |
) |
|
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
145 |
extent: (Point 286 252) |
2221 | 146 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
147 |
(ViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
148 |
name: 'BoxM' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
149 |
visibilityChannel: boxMVisible |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
150 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
151 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
152 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
153 |
(LabelSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
154 |
label: 'Changed' |
7396 | 155 |
name: 'ChangedLabel' |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
156 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
157 |
translateLabel: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
158 |
labelChannel: changedLabelHolder |
2221 | 159 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
160 |
(SequenceViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
161 |
name: 'ListM' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
162 |
layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
163 |
model: methodsChangedSelection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
164 |
menu: menuM |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
165 |
hasHorizontalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
166 |
hasVerticalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
167 |
miniScrollerHorizontal: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
168 |
valueChangeSelector: methodsChangedSelectionChanged |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
169 |
useIndex: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
170 |
sequenceList: methodsChanged |
2221 | 171 |
) |
172 |
) |
|
173 |
||
174 |
) |
|
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
175 |
extent: (Point 286 252) |
2221 | 176 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
177 |
(ViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
178 |
name: 'BoxB' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
179 |
visibilityChannel: boxBVisible |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
180 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
181 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
182 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
183 |
(LabelSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
184 |
label: 'Only in B' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
185 |
name: 'OnlyInBLabel' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
186 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 20 0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
187 |
translateLabel: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
188 |
labelChannel: onlyInBLabelHolder |
2221 | 189 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
190 |
(SequenceViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
191 |
name: 'ListB' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
192 |
layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 -3 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
193 |
model: methodsOnlyInBSelection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
194 |
menu: menuB |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
195 |
hasHorizontalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
196 |
hasVerticalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
197 |
miniScrollerHorizontal: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
198 |
valueChangeSelector: methodsOnlyInBSelectionChanged |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
199 |
useIndex: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
200 |
sequenceList: methodsOnlyInB |
2221 | 201 |
) |
202 |
) |
|
203 |
||
204 |
) |
|
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
205 |
extent: (Point 287 252) |
2221 | 206 |
) |
207 |
) |
|
208 |
||
209 |
) |
|
210 |
) |
|
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
211 |
(ViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
212 |
name: 'Box4' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
213 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
214 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
215 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
216 |
(ViewSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
217 |
name: 'diffTextViewBox' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
218 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
219 |
initiallyInvisible: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
220 |
component: |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
221 |
(SpecCollection |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
222 |
collection: ( |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
223 |
(LabelSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
224 |
label: 'A' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
225 |
name: 'DiffTextLabelA' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
226 |
layout: (LayoutFrame 0 0 0 0 0 0.5 20 0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
227 |
translateLabel: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
228 |
labelChannel: diffTextLabelA |
2221 | 229 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
230 |
(LabelSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
231 |
label: 'B' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
232 |
name: 'DiffTextLabelB' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
233 |
layout: (LayoutFrame 0 0.5 0 0 0 1 20 0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
234 |
translateLabel: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
235 |
labelChannel: diffTextLabelB |
2221 | 236 |
) |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
237 |
(ArbitraryComponentSpec |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
238 |
name: 'diffTextView' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
239 |
layout: (LayoutFrame 0 0.0 20 0.0 0 1.0 0 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
240 |
hasBorder: false |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
241 |
component: diffTextView |
2221 | 242 |
) |
243 |
) |
|
244 |
||
245 |
) |
|
246 |
) |
|
7364
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
247 |
(CodeViewSpec |
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
248 |
name: 'singleTextView' |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
249 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
250 |
model: methodText |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
251 |
hasHorizontalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
252 |
hasVerticalScrollBar: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
253 |
miniScrollerHorizontal: true |
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
254 |
isReadOnly: true |
2221 | 255 |
) |
256 |
) |
|
257 |
||
258 |
) |
|
259 |
) |
|
260 |
) |
|
261 |
||
262 |
) |
|
5150
4a469455c4b4
Remove max windowsize constraint from windowSpecs.
Stefan Vogel <sv@exept.de>
parents:
4653
diff
changeset
|
263 |
handles: (Any 0.5 1.0) |
2221 | 264 |
) |
265 |
) |
|
266 |
||
267 |
) |
|
268 |
) |
|
269 |
! ! |
|
270 |
||
271 |
!VersionDiffBrowser class methodsFor:'menu specs'! |
|
272 |
||
273 |
mainMenu |
|
274 |
"This resource specification was automatically generated |
|
275 |
by the MenuEditor of ST/X." |
|
276 |
||
277 |
"Do not manually edit this!! If it is corrupted, |
|
278 |
the MenuEditor may not be able to read the specification." |
|
279 |
||
280 |
" |
|
281 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#mainMenu |
|
282 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser mainMenu)) startUp |
|
283 |
" |
|
284 |
||
285 |
<resource: #menu> |
|
286 |
||
287 |
^ |
|
7419
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
288 |
#(Menu |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
289 |
( |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
290 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
291 |
label: 'File' |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
292 |
translateLabel: true |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
293 |
submenu: |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
294 |
(Menu |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
295 |
( |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
296 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
297 |
label: 'Create PatchFile...' |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
298 |
itemValue: createPatchFile |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
299 |
translateLabel: true |
2469 | 300 |
) |
7419
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
301 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
302 |
label: '-' |
2469 | 303 |
) |
7419
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
304 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
305 |
label: 'Exit' |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
306 |
itemValue: closeRequest |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
307 |
translateLabel: true |
2221 | 308 |
) |
309 |
) |
|
310 |
nil |
|
311 |
nil |
|
312 |
) |
|
313 |
) |
|
7419
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
314 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
315 |
label: 'Help' |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
316 |
translateLabel: true |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
317 |
startGroup: conditionalRight |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
318 |
submenu: |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
319 |
(Menu |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
320 |
( |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
321 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
322 |
label: 'Documentation' |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
323 |
itemValue: openDocumentation |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
324 |
translateLabel: true |
2221 | 325 |
) |
7419
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
326 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
327 |
label: '-' |
2221 | 328 |
) |
7419
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
329 |
(MenuItem |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
330 |
label: 'About this Application...' |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
331 |
itemValue: openAboutThisApplication |
e4e108674fe6
conditionalRight in startGroup
Claus Gittinger <cg@exept.de>
parents:
7396
diff
changeset
|
332 |
translateLabel: true |
2221 | 333 |
) |
334 |
) |
|
335 |
nil |
|
336 |
nil |
|
337 |
) |
|
338 |
) |
|
339 |
) |
|
340 |
nil |
|
341 |
nil |
|
342 |
) |
|
343 |
! |
|
344 |
||
345 |
menuA |
|
346 |
"This resource specification was automatically generated |
|
347 |
by the MenuEditor of ST/X." |
|
348 |
||
349 |
"Do not manually edit this!! If it is corrupted, |
|
350 |
the MenuEditor may not be able to read the specification." |
|
351 |
||
352 |
" |
|
353 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#menu1 |
|
354 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menu1)) startUp |
|
355 |
" |
|
356 |
||
357 |
<resource: #menu> |
|
358 |
||
359 |
^ |
|
360 |
#(#Menu |
|
361 |
#( |
|
362 |
#(#MenuItem |
|
3322 | 363 |
#label: 'Apply' |
2221 | 364 |
#translateLabel: true |
3322 | 365 |
#value: #applySelectedChangeInA |
3753 | 366 |
#enabled: #hasChangeSelectedInA |
3322 | 367 |
) |
368 |
#(#MenuItem |
|
369 |
#label: 'Browse' |
|
370 |
#translateLabel: true |
|
371 |
#value: #browseClassInA |
|
3753 | 372 |
#enabled: #hasChangeSelectedInA |
2221 | 373 |
) |
2465 | 374 |
#(#MenuItem |
375 |
#label: '-' |
|
376 |
) |
|
377 |
#(#MenuItem |
|
3322 | 378 |
#label: 'Inspect' |
2465 | 379 |
#translateLabel: true |
3322 | 380 |
#value: #inspectSelectedChangeInA |
381 |
#choiceValue: 'nil "UndefinedObject" ' |
|
3753 | 382 |
#enabled: #hasChangeSelectedInA |
2465 | 383 |
) |
2221 | 384 |
) |
385 |
nil |
|
386 |
nil |
|
387 |
) |
|
388 |
! |
|
389 |
||
390 |
menuB |
|
391 |
"This resource specification was automatically generated |
|
392 |
by the MenuEditor of ST/X." |
|
393 |
||
394 |
"Do not manually edit this!! If it is corrupted, |
|
395 |
the MenuEditor may not be able to read the specification." |
|
396 |
||
397 |
" |
|
398 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#menuB |
|
399 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menuB)) startUp |
|
400 |
" |
|
401 |
||
402 |
<resource: #menu> |
|
403 |
||
404 |
^ |
|
405 |
#(#Menu |
|
406 |
#( |
|
407 |
#(#MenuItem |
|
3322 | 408 |
#label: 'Apply' |
2221 | 409 |
#translateLabel: true |
3322 | 410 |
#value: #applySelectedChangeInB |
3753 | 411 |
#enabled: #hasChangeSelectedInB |
3322 | 412 |
) |
413 |
#(#MenuItem |
|
414 |
#label: 'Browse' |
|
415 |
#translateLabel: true |
|
416 |
#value: #browseClassInB |
|
3753 | 417 |
#enabled: #hasChangeSelectedInB |
2221 | 418 |
) |
2465 | 419 |
#(#MenuItem |
420 |
#label: '-' |
|
421 |
) |
|
422 |
#(#MenuItem |
|
3322 | 423 |
#label: 'Inspect' |
2465 | 424 |
#translateLabel: true |
3322 | 425 |
#value: #inspectSelectedChangeInB |
426 |
#choiceValue: 'nil "UndefinedObject" ' |
|
3753 | 427 |
#enabled: #hasChangeSelectedInA |
2465 | 428 |
) |
2221 | 429 |
) |
430 |
nil |
|
431 |
nil |
|
432 |
) |
|
433 |
! |
|
434 |
||
435 |
menuM |
|
436 |
"This resource specification was automatically generated |
|
437 |
by the MenuEditor of ST/X." |
|
438 |
||
439 |
"Do not manually edit this!! If it is corrupted, |
|
440 |
the MenuEditor may not be able to read the specification." |
|
441 |
||
442 |
" |
|
443 |
MenuEditor new openOnClass:VersionDiffBrowser andSelector:#menu1 |
|
444 |
(Menu new fromLiteralArrayEncoding:(VersionDiffBrowser menu1)) startUp |
|
445 |
" |
|
446 |
||
447 |
<resource: #menu> |
|
448 |
||
449 |
^ |
|
450 |
#(#Menu |
|
451 |
#( |
|
452 |
#(#MenuItem |
|
3322 | 453 |
#label: 'Browse' |
2221 | 454 |
#translateLabel: true |
3322 | 455 |
#value: #browseClassInM |
3753 | 456 |
#enabled: #hasChangeSelectedInM |
2221 | 457 |
) |
2465 | 458 |
#(#MenuItem |
459 |
#label: '-' |
|
460 |
) |
|
461 |
#(#MenuItem |
|
3322 | 462 |
#label: 'Inspect both' |
2465 | 463 |
#translateLabel: true |
3322 | 464 |
#value: #inspectSelectedChangeInM |
465 |
#choiceValue: 'nil "UndefinedObject" ' |
|
3753 | 466 |
#enabled: #hasChangeSelectedInM |
2465 | 467 |
) |
2221 | 468 |
) |
469 |
nil |
|
470 |
nil |
|
471 |
) |
|
472 |
! ! |
|
473 |
||
2695 | 474 |
!VersionDiffBrowser class methodsFor:'plugIn spec'! |
475 |
||
476 |
aspectSelectors |
|
477 |
"This resource specification was automatically generated |
|
478 |
by the UIPainter of ST/X." |
|
479 |
||
480 |
"Do not manually edit this. If it is corrupted, |
|
481 |
the UIPainter may not be able to read the specification." |
|
482 |
||
483 |
"Return a description of exported aspects; |
|
484 |
these can be connected to aspects of an embedding application |
|
485 |
(if this app is embedded in a subCanvas)." |
|
486 |
||
487 |
^ #( |
|
488 |
#changedLabelHolder |
|
489 |
#onlyInALabelHolder |
|
490 |
#onlyInBLabelHolder |
|
491 |
). |
|
492 |
||
493 |
! ! |
|
494 |
||
2221 | 495 |
!VersionDiffBrowser class methodsFor:'startup'! |
496 |
||
2695 | 497 |
openOnClass:aClass againstVersion:aVersionA |
3147 | 498 |
" |
499 |
create an VersionDiffBrowser instance and set the class change set of the |
|
500 |
browser. The class diff set is generated from classes current against some version |
|
501 |
via the source code manager . |
|
2507 | 502 |
|
3147 | 503 |
<return: VersionDiffBrowser> |
504 |
" |
|
2497 | 505 |
|theBrowser| |
2224 | 506 |
|
2497 | 507 |
theBrowser := self new. |
508 |
theBrowser allButOpen. |
|
2695 | 509 |
theBrowser setupForClass:aClass againstVersion:aVersionA. |
2497 | 510 |
theBrowser openWindow. |
511 |
^ theBrowser. |
|
2224 | 512 |
|
2695 | 513 |
" |
514 |
self openOnClass:Array againstVersion:'1.116' |
|
515 |
self openOnClass:Array againstVersion:nil - against the version on which Array is based upon |
|
516 |
self openOnClass:Array againstVersion:#newest - against the newest repository version |
|
517 |
||
518 |
self openOnClass:VersionDiffBrowser againstVersion:nil |
|
519 |
self openOnClass:VersionDiffBrowser againstVersion:#newest |
|
520 |
" |
|
521 |
! |
|
522 |
||
2949 | 523 |
openOnClass:classA labelA:aLabelA andClass:classB labelB:aLabelB title:ignoredTitle |
3147 | 524 |
" |
525 |
create an VersionDiffBrowser instance and set the class change set of the |
|
526 |
browser. The class diff set is generated from two classes. |
|
2949 | 527 |
|
3147 | 528 |
<return: VersionDiffBrowser> |
529 |
" |
|
2949 | 530 |
^ self |
531 |
openOnClass:classA labelA:aLabelA andClass:classB labelB:aLabelB title:ignoredTitle ifSame:nil |
|
532 |
! |
|
533 |
||
534 |
openOnClass:classA labelA:aLabelA andClass:classB labelB:aLabelB title:ignoredTitle ifSame:sameAction |
|
3147 | 535 |
" |
536 |
create an VersionDiffBrowser instance and set the class change set of the |
|
537 |
browser. The class diff set is generated from two classes. |
|
2949 | 538 |
|
3147 | 539 |
<return: VersionDiffBrowser> |
540 |
" |
|
2949 | 541 |
|theBrowser| |
542 |
||
543 |
theBrowser := self new. |
|
544 |
theBrowser allButOpen. |
|
545 |
theBrowser setupForClass:classA labelA:aLabelA andClass:classB labelB:aLabelB. |
|
546 |
||
547 |
sameAction notNil ifTrue:[ |
|
548 |
"/ check if same ... |
|
549 |
(theBrowser classChangeSet methodsOnlyInA isEmpty |
|
550 |
and:[theBrowser classChangeSet methodsOnlyInB isEmpty |
|
551 |
and:[theBrowser classChangeSet diffSet isEmpty]]) ifTrue:[ |
|
552 |
sameAction value. |
|
553 |
^ self "/ do not open |
|
554 |
] |
|
555 |
]. |
|
556 |
theBrowser openWindow. |
|
557 |
^ theBrowser. |
|
558 |
! |
|
559 |
||
2695 | 560 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
3147 | 561 |
" |
562 |
create an VersionDiffBrowser instance and set the class change set of the |
|
563 |
browser. The class diff set is generated from two source files. |
|
2695 | 564 |
|
3147 | 565 |
<return: VersionDiffBrowser> |
566 |
" |
|
2716
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
567 |
^ self |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
568 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
569 |
title:nil |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
570 |
! |
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
571 |
|
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
572 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle |
3147 | 573 |
" |
574 |
create an VersionDiffBrowser instance and set the class change set of the |
|
575 |
browser. The class diff set is generated from two source files. |
|
2716
8451e7057f00
some common startup protocol between DiffViewer and VersionDiffBrowser
Claus Gittinger <cg@exept.de>
parents:
2714
diff
changeset
|
576 |
|
3147 | 577 |
<return: VersionDiffBrowser> |
578 |
" |
|
2849 | 579 |
^ self openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle ifSame:nil |
580 |
! |
|
581 |
||
582 |
openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle ifSame:sameAction |
|
3147 | 583 |
" |
584 |
create an VersionDiffBrowser instance and set the class change set of the |
|
585 |
browser. The class diff set is generated from two source files. |
|
2849 | 586 |
|
3147 | 587 |
<return: VersionDiffBrowser> |
588 |
" |
|
7396 | 589 |
|theBrowser diffs theOnlyDifference theOnlyChange hasChangedMethods classChangeSet| |
2695 | 590 |
|
591 |
theBrowser := self new. |
|
592 |
theBrowser allButOpen. |
|
593 |
theBrowser setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB. |
|
2849 | 594 |
sameAction notNil ifTrue:[ |
2853 | 595 |
"/ check if same ... |
7396 | 596 |
classChangeSet := theBrowser classChangeSet. |
597 |
(classChangeSet methodsOnlyInA isEmpty |
|
598 |
and:[classChangeSet methodsOnlyInB isEmpty]) ifTrue:[ |
|
599 |
diffs := classChangeSet diffSet. |
|
3853
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
600 |
|
7396 | 601 |
hasChangedMethods := diffs changed notEmpty. |
602 |
hasChangedMethods ifTrue:[ |
|
3853
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
603 |
diffs changed size == 1 ifTrue:[ |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
604 |
theOnlyDifference := diffs changed first. |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
605 |
theOnlyChange := theOnlyDifference first. |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
606 |
(theOnlyChange isMethodChange |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
607 |
and:[ (theOnlyChange selector == #version) |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
608 |
and:[ theOnlyChange changeClass isMeta ]]) ifTrue:[ |
7396 | 609 |
hasChangedMethods := false |
3853
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
610 |
] |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
611 |
] |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
612 |
]. |
f3ce00da9b68
ignore any changes in the version method, when compating
Claus Gittinger <cg@exept.de>
parents:
3843
diff
changeset
|
613 |
|
7396 | 614 |
(hasChangedMethods not |
3756 | 615 |
and:[diffs onlyInArg isEmpty |
616 |
and:[diffs onlyInReceiver isEmpty]]) ifTrue:[ |
|
617 |
sameAction value. |
|
618 |
^ self "/ do not open |
|
3682
a17c1e10caa5
fixed versions-are-the-same check
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
619 |
]. |
2853 | 620 |
] |
2849 | 621 |
]. |
2695 | 622 |
theBrowser openWindow. |
623 |
^ theBrowser. |
|
7396 | 624 |
|
625 |
"Modified: / 13-10-2006 / 01:01:05 / cg" |
|
2224 | 626 |
! |
627 |
||
2497 | 628 |
openOnClass:aClass versionA:aVersionA versionB:aVersionB |
3147 | 629 |
" |
630 |
create an VersionDiffBrowser instance and set the class change set of the |
|
631 |
browser. The class diff set is generated from two class versions via |
|
632 |
the source code manager . |
|
2507 | 633 |
|
3147 | 634 |
<return: VersionDiffBrowser> |
635 |
" |
|
2497 | 636 |
|theBrowser| |
2221 | 637 |
|
2497 | 638 |
theBrowser := self new. |
639 |
theBrowser allButOpen. |
|
2695 | 640 |
theBrowser setupForClass:aClass versionA:aVersionA versionB:aVersionB. |
2497 | 641 |
theBrowser openWindow. |
642 |
^ theBrowser. |
|
2221 | 643 |
|
644 |
" |
|
645 |
self openOnClass:Array versionA:'1.116' versionB:'1.113' |
|
646 |
" |
|
3678 | 647 |
! |
648 |
||
649 |
openOnDiffSet:diffSet labelA:aLabelA labelB:aLabelB title:ignoredTitle |
|
650 |
|theBrowser| |
|
651 |
||
652 |
theBrowser := self new. |
|
653 |
theBrowser allButOpen. |
|
654 |
theBrowser setupForDiffSet:diffSet labelA:aLabelA labelB:aLabelB. |
|
655 |
theBrowser window label:ignoredTitle. |
|
656 |
theBrowser openWindow. |
|
657 |
^ theBrowser. |
|
5520 | 658 |
! |
659 |
||
660 |
openOnDiffsBetweenFile:file1 and:file2 |
|
661 |
|set1 set2 diffset theBrowser| |
|
662 |
||
663 |
set1 := ChangeSet fromFile:file1. |
|
664 |
set2 := ChangeSet fromFile:file2. |
|
665 |
diffset := set1 diffSetsAgainst:set2. |
|
666 |
||
667 |
theBrowser := self new. |
|
668 |
theBrowser allButOpen. |
|
669 |
theBrowser setupForDiffSet:diffset labelA:file1 asFilename baseName labelB:file2 asFilename baseName. |
|
670 |
theBrowser window label:('%1 vs. %2' bindWith:file1 asFilename baseName with:file2 asFilename baseName). |
|
671 |
theBrowser openWindow. |
|
672 |
^ theBrowser. |
|
673 |
||
674 |
" |
|
675 |
VersionDiffBrowser |
|
676 |
openOnDiffsBetweenFile:'/phys/exept/tmp/ws/Workflow::BlockDescription.st' |
|
677 |
and:'/phys/exept/tmp/workflowClasses/Workflow::BlockDescription.st' |
|
678 |
" |
|
2221 | 679 |
! ! |
680 |
||
681 |
!VersionDiffBrowser methodsFor:'accessing'! |
|
682 |
||
2497 | 683 |
changeSetA |
3147 | 684 |
" |
685 |
gets the change set which contains only the new methods |
|
686 |
in versionA of the class |
|
2221 | 687 |
|
3147 | 688 |
<return: ChangeSet> |
689 |
" |
|
2221 | 690 |
|
2497 | 691 |
^ self classChangeSet methodsOnlyInA |
2221 | 692 |
! |
693 |
||
2497 | 694 |
changeSetB |
3147 | 695 |
" |
696 |
gets the change set which contains only the new methods |
|
697 |
in versionB of the class |
|
2497 | 698 |
|
3147 | 699 |
<return: ChangeSet> |
700 |
" |
|
2497 | 701 |
|
702 |
^ self classChangeSet methodsOnlyInB |
|
703 |
! |
|
704 |
||
2856 | 705 |
class:aClass versionA:revA versionB:revB |
706 |
classIfSingleClassDiff := aClass. |
|
707 |
versionAIfSingleClassDiff := revA. |
|
708 |
versionBIfSingleClassDiff := revB. |
|
709 |
! |
|
710 |
||
2497 | 711 |
classBeingCompared |
3147 | 712 |
" |
713 |
gets the class from the change set which is compared. |
|
2224 | 714 |
|
3147 | 715 |
<return: Class> |
716 |
" |
|
2497 | 717 |
^ self classChangeSet classBeingCompared |
718 |
! |
|
719 |
||
720 |
classChangeSet |
|
3147 | 721 |
" |
722 |
returns the class change set which is the model of the version diff browser. |
|
2224 | 723 |
|
3147 | 724 |
<return: ClassChangeSet> |
725 |
" |
|
2507 | 726 |
^ classChangeSet |
727 |
! |
|
2497 | 728 |
|
2507 | 729 |
classChangeSet:aClassChangeSet |
3147 | 730 |
" |
731 |
sets the class change set which is the model of the version diff browser. |
|
732 |
The labels, the lists, the visibility and the selection of the lists must be reseted |
|
733 |
when a new change set is given. |
|
2497 | 734 |
|
3147 | 735 |
<return: self> |
736 |
" |
|
2507 | 737 |
classChangeSet := aClassChangeSet. |
2501 | 738 |
self updateLabels. |
739 |
self updateLists. |
|
740 |
self resetSelectionHolders. |
|
741 |
! |
|
2224 | 742 |
|
2507 | 743 |
selectedChangeInA |
3147 | 744 |
" |
745 |
gets the selected method change for the 'method only in version A'. |
|
2507 | 746 |
|
3147 | 747 |
<return: MethodChange | nil> |
748 |
" |
|
2507 | 749 |
|sel change| |
750 |
||
751 |
sel := self methodsOnlyInASelection value. |
|
752 |
sel notNil ifTrue:[ |
|
3753 | 753 |
change := self changeSetA at:sel. |
2507 | 754 |
]. |
3753 | 755 |
^ change |
2507 | 756 |
! |
757 |
||
758 |
selectedChangeInB |
|
3147 | 759 |
" |
760 |
gets the selected method change for the 'method only in version B'. |
|
2507 | 761 |
|
3147 | 762 |
<return: MethodChange | nil> |
763 |
" |
|
2507 | 764 |
|sel change| |
765 |
||
766 |
sel := self methodsOnlyInBSelection value. |
|
767 |
sel notNil ifTrue:[ |
|
768 |
change := (self changeSetB at:sel). |
|
769 |
]. |
|
3753 | 770 |
^ change |
2507 | 771 |
! |
772 |
||
773 |
selectedChangesInM |
|
3147 | 774 |
" |
775 |
get the two method changes for the selected 'changed method'. |
|
2507 | 776 |
|
3147 | 777 |
<return: <Array with:MethodChange with:MethodChange | nil>> |
778 |
" |
|
2745 | 779 |
|sel changeA changeB theTwoChanges| |
2507 | 780 |
|
781 |
sel := self methodsChangedSelection value. |
|
782 |
sel notNil ifTrue:[ |
|
2745 | 783 |
theTwoChanges := self classChangeSet methodsChanged at:sel. |
3753 | 784 |
"/ changeA := theTwoChanges first. |
785 |
"/ changeB := theTwoChanges second. |
|
786 |
"/ ^ Array with:changeA with:changeB. |
|
787 |
^ theTwoChanges. |
|
2507 | 788 |
]. |
3753 | 789 |
^ #(nil nil) |
2507 | 790 |
! |
791 |
||
2221 | 792 |
versionA |
3147 | 793 |
" |
794 |
gets the first class version to be compared |
|
2221 | 795 |
|
3147 | 796 |
<return: String> |
797 |
" |
|
2731 | 798 |
classChangeSet isNil ifTrue:[^ 'A']. |
799 |
^ classChangeSet labelA |
|
2221 | 800 |
! |
801 |
||
802 |
versionB |
|
3147 | 803 |
" |
804 |
gets the second class version to be compared |
|
2221 | 805 |
|
3147 | 806 |
<return: String> |
807 |
" |
|
2731 | 808 |
classChangeSet isNil ifTrue:[^ 'B']. |
809 |
^ classChangeSet labelB |
|
2221 | 810 |
! ! |
811 |
||
812 |
!VersionDiffBrowser methodsFor:'actions'! |
|
813 |
||
814 |
methodsChangedSelectionChanged |
|
3147 | 815 |
" |
816 |
the selection in the list of the 'changed methods' changed. |
|
817 |
Reset the selection of the two other lists and calc the method change. |
|
2507 | 818 |
|
3147 | 819 |
<return: self> |
820 |
" |
|
2695 | 821 |
|sel idxA idxB changeA changeB methodsChanged| |
2221 | 822 |
|
823 |
sel := self methodsChangedSelection value. |
|
824 |
sel notNil ifTrue:[ |
|
825 |
self methodsOnlyInASelection value:nil. |
|
826 |
self methodsOnlyInBSelection value:nil. |
|
2695 | 827 |
methodsChanged := self classChangeSet methodsChanged. |
828 |
changeA := (methodsChanged at:sel) first. |
|
829 |
changeB := (methodsChanged at:sel) second. |
|
2501 | 830 |
self withReadCursorDo:[ |
3051 | 831 |
self diffTextView text1:changeA prettyPrintedSource text2:changeB prettyPrintedSource. |
2501 | 832 |
self diffTextView moveToNextChanged |
2377 | 833 |
]. |
2221 | 834 |
self showDiffTextView. |
835 |
] |
|
2377 | 836 |
|
837 |
"Modified: / 3.9.1999 / 15:01:30 / ps" |
|
2221 | 838 |
! |
839 |
||
840 |
methodsOnlyInASelectionChanged |
|
3147 | 841 |
" |
842 |
the selection in the list of the 'method only in version A' changed. |
|
843 |
Reset the selection of the two other lists and show the method in |
|
844 |
the text view. |
|
2507 | 845 |
|
3147 | 846 |
<return: self> |
847 |
" |
|
2221 | 848 |
|change sel| |
849 |
||
850 |
sel := self methodsOnlyInASelection value. |
|
851 |
sel notNil ifTrue:[ |
|
852 |
self methodsOnlyInBSelection value:nil. |
|
853 |
self methodsChangedSelection value:nil. |
|
2497 | 854 |
change := self changeSetA at:sel. |
3051 | 855 |
self methodText value:(change prettyPrintedSource). |
2221 | 856 |
self showSingleTextView. |
857 |
] |
|
858 |
! |
|
859 |
||
860 |
methodsOnlyInBSelectionChanged |
|
3147 | 861 |
" |
862 |
the selection in the list of the 'method only in version B' changed. |
|
863 |
Reset the selection of the two other lists and show the method in |
|
864 |
the text view. |
|
2507 | 865 |
|
3147 | 866 |
<return: self> |
867 |
" |
|
2221 | 868 |
|change sel| |
869 |
||
870 |
sel := self methodsOnlyInBSelection value. |
|
871 |
sel notNil ifTrue:[ |
|
872 |
self methodsOnlyInASelection value:nil. |
|
873 |
self methodsChangedSelection value:nil. |
|
2497 | 874 |
change := self changeSetB at:sel. |
3051 | 875 |
self methodText value:(change prettyPrintedSource). |
2221 | 876 |
self showSingleTextView. |
877 |
] |
|
878 |
! ! |
|
879 |
||
880 |
!VersionDiffBrowser methodsFor:'aspects'! |
|
881 |
||
2585 | 882 |
boxAVisible |
2745 | 883 |
boxAVisible isNil ifTrue:[ |
884 |
boxAVisible := true asValue. |
|
2585 | 885 |
]. |
2745 | 886 |
^ boxAVisible. |
2585 | 887 |
! |
888 |
||
889 |
boxBVisible |
|
2745 | 890 |
boxBVisible isNil ifTrue:[ |
891 |
boxBVisible := true asValue. |
|
2585 | 892 |
]. |
2745 | 893 |
^ boxBVisible. |
2585 | 894 |
! |
895 |
||
896 |
boxMVisible |
|
2745 | 897 |
boxMVisible isNil ifTrue:[ |
898 |
boxMVisible := true asValue. |
|
2585 | 899 |
]. |
2745 | 900 |
^ boxMVisible. |
2585 | 901 |
! |
902 |
||
2221 | 903 |
changedLabelHolder |
3147 | 904 |
" |
905 |
aspect for the label of the changed method box. |
|
2221 | 906 |
|
3147 | 907 |
<return: ValueHolder on: nil> |
908 |
" |
|
2221 | 909 |
|
3147 | 910 |
changedLabelHolder isNil ifTrue:[ |
911 |
changedLabelHolder := ValueHolder new. |
|
2221 | 912 |
]. |
3147 | 913 |
^ changedLabelHolder. |
2221 | 914 |
! |
915 |
||
916 |
diffTextLabelA |
|
3147 | 917 |
" |
918 |
aspect for the label for version A. |
|
2221 | 919 |
|
3147 | 920 |
<return: ValueHolder on: nil> |
921 |
" |
|
2221 | 922 |
|
3147 | 923 |
diffTextLabelA isNil ifTrue:[ |
924 |
diffTextLabelA := ValueHolder new. |
|
2221 | 925 |
]. |
3147 | 926 |
^ diffTextLabelA. |
2221 | 927 |
! |
928 |
||
929 |
diffTextLabelB |
|
3147 | 930 |
" |
931 |
aspect for the label for version B. |
|
2221 | 932 |
|
3147 | 933 |
<return: ValueHolder on: nil> |
934 |
" |
|
2221 | 935 |
|
3147 | 936 |
diffTextLabelB isNil ifTrue:[ |
937 |
diffTextLabelB := ValueHolder new. |
|
2221 | 938 |
]. |
3147 | 939 |
^ diffTextLabelB. |
2221 | 940 |
! |
941 |
||
2497 | 942 |
diffTextView |
3147 | 943 |
" |
944 |
return the component for the diff text view. |
|
2497 | 945 |
|
3147 | 946 |
<return: HVScrollableView> |
947 |
" |
|
7364
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
948 |
|v| |
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
949 |
|
2497 | 950 |
diffTextView isNil ifTrue:[ |
7364
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
951 |
v := DiffTextView basicNew. |
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
952 |
v textViewClass:CodeView. |
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
953 |
v initialize. |
2497 | 954 |
diffTextView := HVScrollableView |
7364
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
955 |
forView:v |
2497 | 956 |
miniScrollerH:true miniScrollerV:false. |
957 |
diffTextView addNextPreviousButtons. |
|
958 |
]. |
|
959 |
^ diffTextView |
|
7364
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
960 |
|
e7613aec8035
use codeViews (instead of TextViews)
Claus Gittinger <cg@exept.de>
parents:
7108
diff
changeset
|
961 |
"Modified: / 06-10-2006 / 14:30:42 / cg" |
2497 | 962 |
! |
963 |
||
2221 | 964 |
methodText |
3147 | 965 |
" |
966 |
aspect for the text in the method text view. |
|
2221 | 967 |
|
3147 | 968 |
<return: ValueHolder on: nil> |
969 |
" |
|
2221 | 970 |
|
3147 | 971 |
methodText isNil ifTrue:[ |
972 |
methodText := ValueHolder new. |
|
2221 | 973 |
]. |
3147 | 974 |
^ methodText. |
2221 | 975 |
! |
976 |
||
977 |
methodsChanged |
|
3147 | 978 |
" |
979 |
aspect for the 'changed method' list. |
|
2221 | 980 |
|
3147 | 981 |
<return: List> |
982 |
" |
|
2221 | 983 |
|
3147 | 984 |
methodsChanged isNil ifTrue:[ |
985 |
methodsChanged := List new. |
|
2221 | 986 |
]. |
3147 | 987 |
^ methodsChanged. |
2221 | 988 |
! |
989 |
||
990 |
methodsChangedSelection |
|
3147 | 991 |
" |
992 |
aspect for the selection holder of 'changed method'-list. |
|
2221 | 993 |
|
3147 | 994 |
<return: ValueHolder on: nil> |
995 |
" |
|
2221 | 996 |
|
3147 | 997 |
methodsChangedSelection isNil ifTrue:[ |
998 |
methodsChangedSelection := ValueHolder new. |
|
2221 | 999 |
]. |
3147 | 1000 |
^ methodsChangedSelection. |
2221 | 1001 |
! |
1002 |
||
1003 |
methodsOnlyInA |
|
6828 | 1004 |
"aspect for the 'method only in version A' list." |
2221 | 1005 |
|
3147 | 1006 |
methodsOnlyInA isNil ifTrue:[ |
1007 |
methodsOnlyInA := List new. |
|
2221 | 1008 |
]. |
3147 | 1009 |
^ methodsOnlyInA. |
6828 | 1010 |
|
1011 |
"Modified: / 25-07-2006 / 11:14:43 / cg" |
|
2221 | 1012 |
! |
1013 |
||
1014 |
methodsOnlyInASelection |
|
6828 | 1015 |
"aspect for the selection holder of 'method only in version A'-list." |
2221 | 1016 |
|
3147 | 1017 |
methodsOnlyInASelection isNil ifTrue:[ |
1018 |
methodsOnlyInASelection := ValueHolder new. |
|
2221 | 1019 |
]. |
3147 | 1020 |
^ methodsOnlyInASelection. |
6828 | 1021 |
|
1022 |
"Modified: / 25-07-2006 / 11:14:53 / cg" |
|
2221 | 1023 |
! |
1024 |
||
1025 |
methodsOnlyInB |
|
6828 | 1026 |
"aspect for the 'method only in version B' list" |
2221 | 1027 |
|
3147 | 1028 |
methodsOnlyInB isNil ifTrue:[ |
1029 |
methodsOnlyInB := List new. |
|
2221 | 1030 |
]. |
3147 | 1031 |
^ methodsOnlyInB. |
6828 | 1032 |
|
1033 |
"Modified: / 25-07-2006 / 11:14:48 / cg" |
|
2221 | 1034 |
! |
1035 |
||
1036 |
methodsOnlyInBSelection |
|
6828 | 1037 |
"aspect for the selection holder of 'method only in version B'-list." |
2221 | 1038 |
|
3147 | 1039 |
methodsOnlyInBSelection isNil ifTrue:[ |
1040 |
methodsOnlyInBSelection := ValueHolder new. |
|
2221 | 1041 |
]. |
3147 | 1042 |
^ methodsOnlyInBSelection. |
6828 | 1043 |
|
1044 |
"Modified: / 25-07-2006 / 11:15:00 / cg" |
|
2221 | 1045 |
! |
1046 |
||
1047 |
onlyInALabelHolder |
|
6828 | 1048 |
"aspect for the label for 'method only in version A'." |
2221 | 1049 |
|
3147 | 1050 |
onlyInALabelHolder isNil ifTrue:[ |
1051 |
onlyInALabelHolder := ValueHolder new. |
|
2221 | 1052 |
]. |
3147 | 1053 |
^ onlyInALabelHolder. |
6828 | 1054 |
|
1055 |
"Modified: / 25-07-2006 / 11:15:12 / cg" |
|
2221 | 1056 |
! |
1057 |
||
1058 |
onlyInBLabelHolder |
|
6828 | 1059 |
"aspect for the label for 'method only in version B'." |
2221 | 1060 |
|
3147 | 1061 |
onlyInBLabelHolder isNil ifTrue:[ |
1062 |
onlyInBLabelHolder := ValueHolder new. |
|
2221 | 1063 |
]. |
3147 | 1064 |
^ onlyInBLabelHolder. |
6828 | 1065 |
|
1066 |
"Modified: / 25-07-2006 / 11:15:07 / cg" |
|
2221 | 1067 |
! ! |
1068 |
||
2725 | 1069 |
!VersionDiffBrowser methodsFor:'aspects-exported'! |
2695 | 1070 |
|
1071 |
changedLabelHolder:aValueHolder |
|
1072 |
builder aspectAt:#changedLabelHolder put:aValueHolder. |
|
1073 |
||
1074 |
! |
|
1075 |
||
1076 |
classHolder:aValueHolder |
|
5182 | 1077 |
classHolder notNil ifTrue:[ |
1078 |
classHolder removeDependent:self |
|
2695 | 1079 |
]. |
5182 | 1080 |
classHolder := aValueHolder. |
1081 |
classHolder notNil ifTrue:[ |
|
1082 |
classHolder addDependent:self |
|
2695 | 1083 |
] |
1084 |
! |
|
1085 |
||
1086 |
onlyInALabelHolder:aValueHolder |
|
1087 |
builder aspectAt:#onlyInALabelHolder put:aValueHolder. |
|
1088 |
! |
|
1089 |
||
1090 |
onlyInBLabelHolder:aValueHolder |
|
1091 |
builder aspectAt:#onlyInBLabelHolder put:aValueHolder. |
|
1092 |
! |
|
1093 |
||
1094 |
versionAHolder:aValueHolder |
|
5182 | 1095 |
versionAHolder notNil ifTrue:[ |
1096 |
versionAHolder removeDependent:self |
|
2695 | 1097 |
]. |
5182 | 1098 |
versionAHolder := aValueHolder. |
1099 |
versionAHolder notNil ifTrue:[ |
|
1100 |
versionAHolder addDependent:self |
|
2695 | 1101 |
] |
1102 |
! |
|
1103 |
||
1104 |
versionBHolder:aValueHolder |
|
5182 | 1105 |
versionBHolder notNil ifTrue:[ |
1106 |
versionBHolder removeDependent:self |
|
2695 | 1107 |
]. |
5182 | 1108 |
versionBHolder := aValueHolder. |
1109 |
versionBHolder notNil ifTrue:[ |
|
1110 |
versionBHolder addDependent:self |
|
2695 | 1111 |
] |
1112 |
! ! |
|
1113 |
||
4359 | 1114 |
!VersionDiffBrowser methodsFor:'aspects-menu'! |
1115 |
||
1116 |
canAcceptInCodeView |
|
1117 |
^ self hasChangeSelectedInA |
|
1118 |
or:[self hasChangeSelectedInB |
|
1119 |
or:[self hasChangeSelectedInM]] |
|
1120 |
! |
|
1121 |
||
1122 |
hasChangeSelectedInA |
|
1123 |
^ self selectedChangeInA notNil |
|
1124 |
! |
|
1125 |
||
1126 |
hasChangeSelectedInB |
|
1127 |
^ self selectedChangeInB notNil |
|
1128 |
! |
|
1129 |
||
1130 |
hasChangeSelectedInM |
|
1131 |
^ self methodsChangedSelection value notNil |
|
1132 |
! ! |
|
1133 |
||
2695 | 1134 |
!VersionDiffBrowser methodsFor:'change & update'! |
1135 |
||
1136 |
update:something with:parameter from:changedObject |
|
1137 |
(changedObject == classHolder |
|
1138 |
or:[changedObject == versionAHolder |
|
1139 |
or:[changedObject == versionBHolder]]) ifTrue:[ |
|
1140 |
self setupForClass:(classHolder value) versionA:(versionAHolder value) versionB:(versionBHolder value) |
|
1141 |
. ^ self |
|
1142 |
]. |
|
1143 |
super update:something with:parameter from:changedObject |
|
1144 |
! ! |
|
1145 |
||
2221 | 1146 |
!VersionDiffBrowser methodsFor:'initialization & release'! |
1147 |
||
1148 |
postBuildWith:aBuilder |
|
3147 | 1149 |
" |
1150 |
components which are invisible should be ignored by the panel. |
|
1151 |
Cannot be set via the interface builder. |
|
2221 | 1152 |
|
3147 | 1153 |
<return: self> |
1154 |
" |
|
1155 |
||
3843
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1156 |
(self componentAt:#TopHorizontalPanel) ignoreInvisibleComponents:true. |
6642 | 1157 |
super postBuildWith:aBuilder |
2221 | 1158 |
! ! |
1159 |
||
1160 |
!VersionDiffBrowser methodsFor:'menu action'! |
|
1161 |
||
3344 | 1162 |
applySelectedChangeInA |
3753 | 1163 |
self applyChange:(self selectedChangeInA) |
3344 | 1164 |
! |
1165 |
||
1166 |
applySelectedChangeInB |
|
3753 | 1167 |
self applyChange:(self selectedChangeInB) |
3344 | 1168 |
! |
1169 |
||
2465 | 1170 |
browseChange:aChange |
6828 | 1171 |
"browse the change in aChange" |
7396 | 1172 |
|cls sel m browserClass| |
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1173 |
|
2578
29264fb3847e
avoid debugger in browse-menu
Claus Gittinger <cg@exept.de>
parents:
2536
diff
changeset
|
1174 |
aChange isNil ifTrue:[^ self]. |
7396 | 1175 |
browserClass := UserPreferences systemBrowserClass. |
1176 |
||
2650
447c99ac6f76
oops - inspect & browse menu was broken.
Claus Gittinger <cg@exept.de>
parents:
2626
diff
changeset
|
1177 |
cls := aChange changeClass. |
7396 | 1178 |
aChange isMethodChange ifTrue:[ |
1179 |
sel := aChange changeSelector. |
|
1180 |
"/ (cls compiledMethodAt:sel) isNil ifTrue:[ |
|
1181 |
"/ (self confirm:'Method does not exist.\\Browse Class ?' withCRs) ifTrue:[ |
|
1182 |
"/ browserClass openInClass:cls |
|
1183 |
"/ ]. |
|
1184 |
"/ sel := nil. |
|
1185 |
"/ ] |
|
1186 |
]. |
|
1187 |
browserClass openInClass:cls selector:sel. |
|
6828 | 1188 |
|
7396 | 1189 |
"Modified: / 12-10-2006 / 23:58:40 / cg" |
2465 | 1190 |
! |
1191 |
||
1192 |
browseClassInA |
|
6828 | 1193 |
"browse the selected method." |
1194 |
self browseChange:(self selectedChangeInA). |
|
2507 | 1195 |
|
6828 | 1196 |
"Modified: / 25-07-2006 / 11:14:02 / cg" |
2465 | 1197 |
! |
2221 | 1198 |
|
2465 | 1199 |
browseClassInB |
6828 | 1200 |
"browse the selected method." |
1201 |
self browseChange:(self selectedChangeInB). |
|
2507 | 1202 |
|
6828 | 1203 |
"Modified: / 25-07-2006 / 11:13:58 / cg" |
2465 | 1204 |
! |
1205 |
||
1206 |
browseClassInM |
|
6828 | 1207 |
"browse the selected method." |
1208 |
self browseChange:(self selectedChangesInM first). |
|
2507 | 1209 |
|
6828 | 1210 |
"Modified: / 25-07-2006 / 11:13:54 / cg" |
2465 | 1211 |
! |
1212 |
||
2469 | 1213 |
createPatchFile |
2856 | 1214 |
"create a patchFile, to patch the old version (versionB) into the new version (versionA). |
1215 |
I.e. a little changeFile to transport those changes." |
|
1216 |
||
6828 | 1217 |
|defaultName f oldVersion newVersion vsnMthdA vsnMthdB vsnA vsnB info classBeingCompared| |
2856 | 1218 |
|
1219 |
defaultName := 'patchFile.chg'. |
|
2469 | 1220 |
|
6828 | 1221 |
classBeingCompared := classChangeSet classBeingCompared. |
1222 |
classBeingCompared notNil ifTrue:[ |
|
1223 |
defaultName := classBeingCompared nameWithoutPrefix. |
|
2856 | 1224 |
classChangeSet versionA notNil ifTrue:[ |
1225 |
defaultName := defaultName , '-'. |
|
1226 |
defaultName := defaultName , classChangeSet versionA. |
|
1227 |
classChangeSet versionB notNil ifTrue:[ |
|
1228 |
defaultName := defaultName , '-'. |
|
1229 |
defaultName := defaultName , classChangeSet versionB. |
|
1230 |
]. |
|
1231 |
]. |
|
1232 |
defaultName := defaultName , '.chg'. |
|
1233 |
]. |
|
1234 |
f := Dialog |
|
1235 |
requestFileName:'Name of patchFile:' |
|
1236 |
default:defaultName. |
|
1237 |
self warn:'Sorry: This function is not yet implemented'. |
|
2730 | 1238 |
^ self. |
1239 |
||
3103 | 1240 |
"/ vsnMthdA := self changeSetA |
1241 |
"/ detect:[:ch | ch isMethodChange |
|
1242 |
"/ and:[ch changeClass isMeta |
|
1243 |
"/ and:[ch changeSelector = #version]]] |
|
1244 |
"/ ifNone:nil. |
|
1245 |
"/ vsnMthdB := self changeSetA |
|
1246 |
"/ detect:[:ch | ch isMethodChange |
|
1247 |
"/ and:[ch changeClass isMeta |
|
1248 |
"/ and:[ch changeSelector = #version]]] |
|
1249 |
"/ ifNone:nil. |
|
1250 |
"/ |
|
1251 |
"/ vsnMthdA notNil ifTrue:[ |
|
1252 |
"/ "/ extract the version |
|
1253 |
"/ vsnA := Class revisionStringFromSource:vsnMthdA source. |
|
1254 |
"/ vsnA notNil ifTrue:[ |
|
1255 |
"/ info := Class revisionInfoFromString:vsnA. |
|
1256 |
"/ info notNil ifTrue:[ |
|
1257 |
"/ vsnA := info at:#revision ifAbsent:nil. |
|
1258 |
"/ ] ifFalse:[ |
|
1259 |
"/ vsnA := nil. |
|
1260 |
"/ ]. |
|
1261 |
"/ ]. |
|
1262 |
"/ ]. |
|
1263 |
"/ vsnMthdB notNil ifTrue:[ |
|
1264 |
"/ "/ extract the version |
|
1265 |
"/ vsnB := Class revisionStringFromSource:vsnMthdB source. |
|
1266 |
"/ vsnB notNil ifTrue:[ |
|
1267 |
"/ info := Class revisionInfoFromString:vsnB. |
|
1268 |
"/ info notNil ifTrue:[ |
|
1269 |
"/ vsnB := info at:#revision ifAbsent:nil. |
|
1270 |
"/ ] ifFalse:[ |
|
1271 |
"/ vsnB := nil. |
|
1272 |
"/ ]. |
|
1273 |
"/ ]. |
|
1274 |
"/ ]. |
|
1275 |
"/ |
|
1276 |
"/ (vsnA isNil or:[vsnB isNil or:[vsnA = vsnB]]) ifTrue:[ |
|
1277 |
"/ self warn:'The generated patch file will not be able to validate/update the class version'. |
|
1278 |
"/ ]. |
|
1279 |
"/ |
|
1280 |
"/self halt:'not yet finished'. |
|
6828 | 1281 |
|
1282 |
"Modified: / 25-07-2006 / 11:12:58 / cg" |
|
2469 | 1283 |
! |
1284 |
||
2465 | 1285 |
inspectSelectedChangeInA |
6828 | 1286 |
"inspect the selected method change for the 'method only in version A'." |
2507 | 1287 |
|
2465 | 1288 |
self selectedChangeInA inspect. |
6828 | 1289 |
|
1290 |
"Modified: / 25-07-2006 / 11:13:30 / cg" |
|
2221 | 1291 |
! |
1292 |
||
1293 |
inspectSelectedChangeInB |
|
6828 | 1294 |
"inspect the selected method change for the 'method only in version B'." |
2507 | 1295 |
|
2465 | 1296 |
self selectedChangeInB inspect. |
6828 | 1297 |
|
1298 |
"Modified: / 25-07-2006 / 11:13:22 / cg" |
|
2465 | 1299 |
! |
1300 |
||
1301 |
inspectSelectedChangeInM |
|
6828 | 1302 |
"inspect the two method changes for the selected 'changed method'." |
2507 | 1303 |
|
2465 | 1304 |
|changes| |
1305 |
||
1306 |
changes := self selectedChangesInM. |
|
1307 |
changes do:[:change | |
|
1308 |
change inspect |
|
1309 |
]. |
|
6828 | 1310 |
|
1311 |
"Modified: / 25-07-2006 / 11:13:13 / cg" |
|
2465 | 1312 |
! |
1313 |
||
2501 | 1314 |
mainMenu |
6828 | 1315 |
"if this application runs as an subapplication, |
1316 |
the menu bar should not be used." |
|
2507 | 1317 |
|
2501 | 1318 |
self masterApplication isNil ifTrue:[ |
1319 |
^ self class mainMenu |
|
1320 |
]. |
|
1321 |
^ nil |
|
6828 | 1322 |
|
1323 |
"Modified: / 25-07-2006 / 11:13:44 / cg" |
|
2221 | 1324 |
! ! |
1325 |
||
1326 |
!VersionDiffBrowser methodsFor:'private'! |
|
1327 |
||
3753 | 1328 |
acceptInLeftView |
1329 |
|change| |
|
1330 |
||
1331 |
change := self selectedChangesInM first. |
|
1332 |
self applyChange:change |
|
1333 |
! |
|
1334 |
||
1335 |
acceptInRightView |
|
1336 |
|change| |
|
1337 |
||
1338 |
change := self selectedChangesInM second. |
|
1339 |
self applyChange:change |
|
1340 |
! |
|
1341 |
||
1342 |
acceptInSingleView |
|
1343 |
|change| |
|
1344 |
||
1345 |
change := self selectedChangeInA. |
|
1346 |
change isNil ifTrue:[ |
|
1347 |
change := self selectedChangeInB |
|
1348 |
]. |
|
1349 |
self applyChange:change |
|
1350 |
! |
|
1351 |
||
2745 | 1352 |
addAcceptToTextViewMenus |
3147 | 1353 |
" |
1354 |
add to the standard diff text view or single text views menu an accept entry. |
|
1355 |
The acceptAction will fetch the corresponding change and apply it |
|
1356 |
(not the shown text) |
|
2745 | 1357 |
|
3147 | 1358 |
<return: self> |
1359 |
" |
|
2745 | 1360 |
|
3684
e478c26e5c5b
copySelection must be enabled (sigh - must rewrite TextView
Claus Gittinger <cg@exept.de>
parents:
3682
diff
changeset
|
1361 |
|m diffTextView leftView rightView singleView| |
2745 | 1362 |
|
1363 |
diffTextView := self diffTextView. |
|
1364 |
leftView := diffTextView leftTextView. |
|
1365 |
rightView := diffTextView rightTextView. |
|
3843
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1366 |
singleView := self componentAt:#singleTextView. |
2745 | 1367 |
|
1368 |
(Array |
|
1369 |
with:leftView |
|
1370 |
with:rightView |
|
1371 |
with:singleView) |
|
1372 |
do:[:v | |
|
1373 |
m := v editMenu. |
|
1374 |
(m selectorAt:#accept) isNil ifTrue:[ |
|
3684
e478c26e5c5b
copySelection must be enabled (sigh - must rewrite TextView
Claus Gittinger <cg@exept.de>
parents:
3682
diff
changeset
|
1375 |
m addLabels:(resources array:#('-' 'Accept')) |
2745 | 1376 |
selectors:(Array with:nil with:#accept) |
1377 |
after:#copySelection. |
|
1378 |
]. |
|
1379 |
m |
|
1380 |
actionAt:#accept |
|
1381 |
put:[ |
|
1382 |
v == singleView ifTrue:[ |
|
3753 | 1383 |
self acceptInSingleView |
1384 |
] ifFalse:[ |
|
1385 |
v == leftView ifTrue:[ |
|
1386 |
self acceptInLeftView |
|
2745 | 1387 |
] ifFalse:[ |
3753 | 1388 |
self acceptInRightView |
2745 | 1389 |
]. |
1390 |
]. |
|
1391 |
]. |
|
1392 |
m selectorAt:#accept put:nil. |
|
3684
e478c26e5c5b
copySelection must be enabled (sigh - must rewrite TextView
Claus Gittinger <cg@exept.de>
parents:
3682
diff
changeset
|
1393 |
m enable:#copySelection. |
3753 | 1394 |
m setEnable:#accept to:[self halt. self canAcceptInCodeView]. |
2745 | 1395 |
v menuHolder:m. |
1396 |
v menuMessage:#value. |
|
1397 |
] |
|
1398 |
! |
|
1399 |
||
3753 | 1400 |
applyChange:change |
1401 |
change notNil ifTrue:[ |
|
1402 |
change apply |
|
1403 |
] |
|
1404 |
! |
|
1405 |
||
3839 | 1406 |
printStringGenerator |
3147 | 1407 |
" |
1408 |
generate a print string for a change. |
|
2497 | 1409 |
|
3147 | 1410 |
<return: Block> |
1411 |
" |
|
3839 | 1412 |
^ [:aChange | |
3678 | 1413 |
|result mPkg cPkg cls m changeClassName useChangesString |
1414 |
singleComparedClass singleComparedClassesName singleComparedMetaclassesName| |
|
1415 |
||
1416 |
(singleComparedClass := self classBeingCompared) notNil ifTrue:[ |
|
1417 |
singleComparedClassesName := singleComparedClass name. |
|
1418 |
singleComparedMetaclassesName := singleComparedClass theMetaclass name. |
|
1419 |
]. |
|
2585 | 1420 |
|
2507 | 1421 |
aChange isClassDefinitionChange ifTrue:[ |
2585 | 1422 |
result := aChange printStringWithoutClassName |
2497 | 1423 |
] ifFalse:[ |
2507 | 1424 |
aChange isDoIt ifTrue:[ |
1425 |
result := aChange source , ' (doIt)' |
|
2497 | 1426 |
] ifFalse:[ |
3329
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1427 |
useChangesString := false. |
2585 | 1428 |
changeClassName := aChange className. |
3678 | 1429 |
changeClassName = singleComparedClassesName ifTrue:[ |
2585 | 1430 |
result := aChange printStringWithoutClassName. |
3329
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1431 |
useChangesString := true. |
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1432 |
] ifFalse:[ |
3678 | 1433 |
changeClassName = singleComparedMetaclassesName ifTrue:[ |
3329
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1434 |
result := aChange printString. |
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1435 |
useChangesString := true. |
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1436 |
]. |
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1437 |
]. |
30435f09bc6f
better list-items for metaclass changes
Claus Gittinger <cg@exept.de>
parents:
3322
diff
changeset
|
1438 |
useChangesString ifTrue:[ |
2745 | 1439 |
aChange isMethodCategoryChange ifTrue:[ |
1440 |
result := result , ' (category)' |
|
1441 |
] ifFalse:[ |
|
1442 |
aChange isMethodChange ifTrue:[ |
|
1443 |
cls := aChange changeClass. |
|
1444 |
cls notNil ifTrue:[ |
|
1445 |
m := cls compiledMethodAt:aChange selector. |
|
1446 |
(m notNil |
|
1447 |
and:[m package ~= cls package]) ifTrue:[ |
|
1448 |
result := aChange printStringWithoutClassName , ' [' , m package , ']'. |
|
1449 |
]. |
|
2497 | 1450 |
]. |
2745 | 1451 |
] |
2497 | 1452 |
] |
1453 |
] ifFalse:[ |
|
6272 | 1454 |
|
2497 | 1455 |
"/ include name in private class changes |
6272 | 1456 |
(changeClassName notNil |
1457 |
and:[singleComparedClassesName notNil |
|
1458 |
and:[changeClassName startsWith:(singleComparedClassesName , '::')]]) ifTrue:[ |
|
3678 | 1459 |
result := (changeClassName copyFrom:(singleComparedClassesName size + 3)) , ' ' , aChange printStringWithoutClassName |
2497 | 1460 |
] ifFalse:[ |
2507 | 1461 |
result := aChange printString |
2497 | 1462 |
] |
1463 |
] |
|
1464 |
] |
|
1465 |
]. |
|
1466 |
result |
|
1467 |
]. |
|
1468 |
! |
|
1469 |
||
2501 | 1470 |
resetSelectionHolders |
3147 | 1471 |
" |
1472 |
reset all selection holders when a new change set is given. |
|
1473 |
First set the selection to nil. |
|
2507 | 1474 |
|
3147 | 1475 |
<return: self> |
1476 |
" |
|
2501 | 1477 |
|
1478 |
self methodsChangedSelection value:nil. |
|
1479 |
self methodsOnlyInASelection value:nil. |
|
1480 |
self methodsOnlyInBSelection value:nil. |
|
2507 | 1481 |
self diffTextView text1:'' text2:''. |
1482 |
self methodText value:''. |
|
1483 |
||
1484 |
"/ self methodsChangedSelectionChanged. |
|
1485 |
"/ self methodsOnlyInASelectionChanged. |
|
1486 |
"/ self methodsOnlyInBSelectionChanged. |
|
2501 | 1487 |
! |
1488 |
||
2221 | 1489 |
showDiffTextView |
3147 | 1490 |
" |
1491 |
if a method change is selected, then show the diff text view. |
|
1492 |
Add an accept entry to the popup menu. |
|
2507 | 1493 |
|
3147 | 1494 |
<return: self> |
1495 |
" |
|
2694 | 1496 |
|
3843
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1497 |
(self componentAt:#diffTextViewBox) raise; beVisible. |
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1498 |
(self componentAt:#singleTextView) beInvisible. |
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1499 |
(self componentAt:#diffTextView) realizeAllSubViews. |
2694 | 1500 |
|
2465 | 1501 |
self addAcceptToTextViewMenus. |
2221 | 1502 |
! |
1503 |
||
1504 |
showSingleTextView |
|
3147 | 1505 |
" |
1506 |
if a method is selected which is only in version A or B of the class, |
|
1507 |
then show the text view. |
|
1508 |
Add an accept entry to the popup menu. |
|
2507 | 1509 |
|
3147 | 1510 |
<return: self> |
1511 |
" |
|
2507 | 1512 |
|
3843
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1513 |
(self componentAt:#singleTextView) raise; beVisible. |
673fbeb191c9
builder componentAt: -> self componentAt:
Claus Gittinger <cg@exept.de>
parents:
3839
diff
changeset
|
1514 |
(self componentAt:#diffTextViewBox) beInvisible. |
2501 | 1515 |
self addAcceptToTextViewMenus. |
2221 | 1516 |
! |
1517 |
||
2497 | 1518 |
updateLabels |
3147 | 1519 |
" |
1520 |
update the labels of the diff text view. Show the version numbers |
|
1521 |
of the class. |
|
2221 | 1522 |
|
3147 | 1523 |
<return: self> |
1524 |
" |
|
2221 | 1525 |
|
2694 | 1526 |
|theVersionA theVersionB builder| |
2224 | 1527 |
|
2694 | 1528 |
builder := self builder. |
2497 | 1529 |
(theVersionA := self versionA) notNil ifTrue:[ |
1530 |
self diffTextLabelA value:theVersionA. |
|
2726 | 1531 |
self onlyInALabelHolder value:('Only in ' , theVersionA). |
7396 | 1532 |
(self componentAt:#OnlyInALabel) |
1533 |
foregroundColor:Color white; |
|
1534 |
backgroundColor:Color green darkened. |
|
2224 | 1535 |
]. |
2497 | 1536 |
(theVersionB :=self versionB) notNil ifTrue:[ |
1537 |
self diffTextLabelB value:theVersionB. |
|
2726 | 1538 |
self onlyInBLabelHolder value:('Only in ' , theVersionB). |
7396 | 1539 |
(self componentAt:#OnlyInBLabel) |
1540 |
foregroundColor:Color white; |
|
1541 |
backgroundColor:Color red darkened. |
|
2224 | 1542 |
]. |
7396 | 1543 |
|
1544 |
self changedLabelHolder value:('Different'). |
|
1545 |
||
1546 |
"Modified: / 13-10-2006 / 01:07:08 / cg" |
|
2224 | 1547 |
! |
1548 |
||
1549 |
updateLists |
|
3839 | 1550 |
|classChangeSet listOnlyInA listOnlyInB listChanged printStringGenerator sortBlockForChangeLists| |
2230
5e10eebb1de2
move change-compare code to where it belongs (Change-hierarchy)
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1551 |
|
2585 | 1552 |
classChangeSet := self classChangeSet. |
1553 |
||
3839 | 1554 |
printStringGenerator := self printStringGenerator. |
1555 |
sortBlockForChangeLists := [:a :b | (printStringGenerator value:a) < (printStringGenerator value:b)]. |
|
1556 |
||
2731 | 1557 |
listOnlyInA := self methodsOnlyInA. |
1558 |
listOnlyInA removeAll. |
|
1559 |
classChangeSet notNil ifTrue:[ |
|
3839 | 1560 |
classChangeSet methodsOnlyInA sort:sortBlockForChangeLists. |
1561 |
listOnlyInA addAll: (classChangeSet methodsOnlyInA collect:printStringGenerator). |
|
2731 | 1562 |
]. |
2585 | 1563 |
|
2731 | 1564 |
listOnlyInB := self methodsOnlyInB. |
1565 |
listOnlyInB removeAll. |
|
1566 |
classChangeSet notNil ifTrue:[ |
|
3839 | 1567 |
classChangeSet methodsOnlyInB sort:sortBlockForChangeLists. |
1568 |
listOnlyInB addAll: (classChangeSet methodsOnlyInB collect:printStringGenerator). |
|
2731 | 1569 |
]. |
2221 | 1570 |
|
2731 | 1571 |
listChanged := self methodsChanged. |
1572 |
listChanged removeAll. |
|
1573 |
classChangeSet notNil ifTrue:[ |
|
3839 | 1574 |
classChangeSet methodsChanged sort:[:a :b | sortBlockForChangeLists value:a first value:b first]. |
1575 |
listChanged addAll: (classChangeSet methodsChanged collect:[:arr| printStringGenerator value:(arr first)]). |
|
2731 | 1576 |
]. |
2221 | 1577 |
|
2731 | 1578 |
self boxAVisible value:(listOnlyInA notEmpty). |
1579 |
self boxBVisible value:(listOnlyInB notEmpty). |
|
2221 | 1580 |
|
2731 | 1581 |
self boxMVisible value:(listChanged isEmpty |
1582 |
and: [(listOnlyInA notEmpty |
|
1583 |
or:[listOnlyInB notEmpty])]) not. |
|
2221 | 1584 |
! ! |
1585 |
||
2501 | 1586 |
!VersionDiffBrowser methodsFor:'setup'! |
1587 |
||
2695 | 1588 |
setupForClass:aClass againstVersion:aVersionA |
3147 | 1589 |
" |
1590 |
compute the class change set for the class aClass of its current version against the repository version A. |
|
1591 |
When setting the class change set, the labels, list etc. of the receiver |
|
1592 |
are updated. |
|
2695 | 1593 |
|
3147 | 1594 |
<return: self> |
1595 |
" |
|
2731 | 1596 |
|changeSet| |
1597 |
||
2745 | 1598 |
aClass isNil ifTrue:[ |
1599 |
changeSet := nil |
|
1600 |
] ifFalse:[ |
|
1601 |
aClass isNameSpace ifFalse:[ |
|
1602 |
aClass isLoaded ifTrue:[ |
|
1603 |
changeSet := (ClassChangeSet newForClass:aClass againstVersion:aVersionA). |
|
1604 |
] |
|
1605 |
]. |
|
2731 | 1606 |
]. |
2856 | 1607 |
self classChangeSet:changeSet. |
2857
0c467f6b1741
handle case if invoked without versionString
Claus Gittinger <cg@exept.de>
parents:
2856
diff
changeset
|
1608 |
aVersionA isNil ifTrue:[ |
0c467f6b1741
handle case if invoked without versionString
Claus Gittinger <cg@exept.de>
parents:
2856
diff
changeset
|
1609 |
self class:aClass versionA:'rep' versionB:'current'. |
0c467f6b1741
handle case if invoked without versionString
Claus Gittinger <cg@exept.de>
parents:
2856
diff
changeset
|
1610 |
] ifFalse:[ |
0c467f6b1741
handle case if invoked without versionString
Claus Gittinger <cg@exept.de>
parents:
2856
diff
changeset
|
1611 |
self class:aClass versionA:aVersionA versionB:(aVersionA , 'm'). |
0c467f6b1741
handle case if invoked without versionString
Claus Gittinger <cg@exept.de>
parents:
2856
diff
changeset
|
1612 |
] |
2695 | 1613 |
! |
1614 |
||
2949 | 1615 |
setupForClass:classA labelA:aLabelA andClass:classB labelB:aLabelB |
3147 | 1616 |
" |
1617 |
generate the class change set from the two classes A and B. |
|
1618 |
When setting the class change set, the labels, list etc. of the receiver |
|
1619 |
are updated. |
|
2949 | 1620 |
|
3147 | 1621 |
<return: self> |
1622 |
" |
|
2949 | 1623 |
|changeSet| |
1624 |
||
1625 |
changeSet := (ClassChangeSet newForClass:classA labelA:aLabelA andClass:classB labelB:aLabelB). |
|
1626 |
self classChangeSet:changeSet |
|
1627 |
! |
|
1628 |
||
2510 | 1629 |
setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
3147 | 1630 |
" |
1631 |
generate the class change set from the two source files A and B. |
|
1632 |
When setting the class change set, the labels, list etc. of the receiver |
|
1633 |
are updated. |
|
2510 | 1634 |
|
3147 | 1635 |
<return: self> |
1636 |
" |
|
2731 | 1637 |
|changeSet| |
1638 |
||
7499 | 1639 |
(aClass isRealNameSpace not) ifTrue:[ |
2731 | 1640 |
aClass isLoaded ifTrue:[ |
1641 |
changeSet := (ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB). |
|
1642 |
] |
|
1643 |
]. |
|
1644 |
self classChangeSet:changeSet |
|
7499 | 1645 |
|
1646 |
"Modified: / 10-11-2006 / 17:15:26 / cg" |
|
2510 | 1647 |
! |
1648 |
||
2501 | 1649 |
setupForClass:aClass versionA:aVersionA versionB:aVersionB |
3147 | 1650 |
" |
1651 |
compute the class change set for the class aClass and the versions A and B. |
|
1652 |
When setting the class change set, the labels, list etc. of the receiver |
|
1653 |
are updated. |
|
2501 | 1654 |
|
3147 | 1655 |
<return: self> |
1656 |
" |
|
2731 | 1657 |
|changeSet| |
1658 |
||
1659 |
aClass isNameSpace ifFalse:[ |
|
1660 |
aClass isLoaded ifTrue:[ |
|
1661 |
changeSet := (ClassChangeSet newForClass:aClass versionA:aVersionA versionB:aVersionB). |
|
1662 |
] |
|
1663 |
]. |
|
2856 | 1664 |
self classChangeSet:changeSet. |
1665 |
self class:aClass versionA:aVersionA versionB:aVersionB. |
|
3678 | 1666 |
! |
1667 |
||
1668 |
setupForDiffSet:diffSet labelA:aLabelA labelB:aLabelB |
|
1669 |
|changeSet| |
|
1670 |
||
1671 |
changeSet := (ClassChangeSet new diffSet:diffSet; labelA:aLabelA; labelB:aLabelB). |
|
1672 |
self classChangeSet:changeSet |
|
2501 | 1673 |
! ! |
1674 |
||
2497 | 1675 |
!VersionDiffBrowser::ClassChangeSet class methodsFor:'instance creation'! |
1676 |
||
2695 | 1677 |
changeSetForClass:aClass |
3756 | 1678 |
"return a ChangeSet for the class aClass and its current source. |
1679 |
The source is generated into a stream and then the change set is generated |
|
1680 |
from the source stream. |
|
2695 | 1681 |
|
3756 | 1682 |
<return: ChangeSet|nil> |
1683 |
" |
|
2695 | 1684 |
|
3756 | 1685 |
^ ChangeSet forExistingClass:aClass. |
2695 | 1686 |
! |
1687 |
||
2497 | 1688 |
changeSetForClass:aClass andRevision:aVersion |
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1689 |
"return a ChangeSet for the class aClass and version aVersion. |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1690 |
The version from the class source stream is checked out from the repositiory |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1691 |
into a source stream. Then the change set is generated from the source stream. |
2497 | 1692 |
|
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1693 |
<return: ChangeSet|nil> |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1694 |
" |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1695 |
|
2497 | 1696 |
|theSourceCodeManager theSourceStream theChangeSet| |
1697 |
||
7108 | 1698 |
theSourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:aClass. |
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1699 |
[ |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1700 |
theSourceStream := theSourceCodeManager getSourceStreamFor:aClass revision:aVersion. |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1701 |
theSourceStream notNil |
3763 | 1702 |
ifTrue:[theChangeSet := ChangeSet fromStream:theSourceStream] |
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1703 |
] ensure:[ |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1704 |
theSourceStream notNil ifTrue:[theSourceStream close] |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1705 |
]. |
2497 | 1706 |
^theChangeSet |
7108 | 1707 |
|
1708 |
"Modified: / 12-09-2006 / 14:24:51 / cg" |
|
2497 | 1709 |
! |
1710 |
||
1711 |
changeSetForClass:aClass andSource:aSource |
|
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1712 |
"return a ChangeSet for the class aClass and source aSource. |
4638
79734f7bdfc4
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4359
diff
changeset
|
1713 |
The source is converted to a stream and then the change set is generated |
79734f7bdfc4
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4359
diff
changeset
|
1714 |
from the source stream. |
4653
0a97ce41f5bd
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
4638
diff
changeset
|
1715 |
Raise an error if the source stream cannot be opened |
2497 | 1716 |
|
4653
0a97ce41f5bd
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
4638
diff
changeset
|
1717 |
<return: ChangeSet>" |
4638
79734f7bdfc4
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4359
diff
changeset
|
1718 |
|
2497 | 1719 |
|theChangeSet theSourceStream| |
1720 |
||
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1721 |
[ |
4653
0a97ce41f5bd
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
4638
diff
changeset
|
1722 |
theSourceStream := aSource readStream. |
0a97ce41f5bd
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
4638
diff
changeset
|
1723 |
theChangeSet := ChangeSet fromStream:(theSourceStream := aSource readStream) |
3594
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1724 |
] ensure:[ |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1725 |
theSourceStream notNil ifTrue:[ |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1726 |
theSourceStream close |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1727 |
] |
12071dccbbe4
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3344
diff
changeset
|
1728 |
]. |
4653
0a97ce41f5bd
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
4638
diff
changeset
|
1729 |
^ theChangeSet |
2497 | 1730 |
! |
1731 |
||
2695 | 1732 |
newForClass:aClass againstVersion:aVersionA |
1733 |
"return a ClassChangeSet for the class aClass against some verison in the repository. |
|
1734 |
A new instance of ClassChangeSet is generated containing |
|
1735 |
the correspondenting changes. |
|
1736 |
||
1737 |
<return: ClassChangeSet> |
|
1738 |
" |
|
2710
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1739 |
|theChangeSetA theChangeSetB theClassChangeSet versionCompared diffSet| |
2695 | 1740 |
|
1741 |
theClassChangeSet := self new. |
|
1742 |
theClassChangeSet classBeingCompared:aClass. |
|
1743 |
versionCompared := aVersionA. |
|
1744 |
aVersionA isNil ifTrue:[ |
|
1745 |
theClassChangeSet labelA:(versionCompared := aClass revision). |
|
2856 | 1746 |
theClassChangeSet versionA:versionCompared. |
2695 | 1747 |
] ifFalse:[ |
1748 |
aVersionA == #newest ifTrue:[ |
|
2776 | 1749 |
theClassChangeSet labelA:(VersionDiffBrowser resources string:'newest'). |
2695 | 1750 |
] ifFalse:[ |
1751 |
theClassChangeSet labelA:versionCompared. |
|
2856 | 1752 |
theClassChangeSet versionA:versionCompared. |
2695 | 1753 |
] |
1754 |
]. |
|
2776 | 1755 |
theClassChangeSet labelB:(VersionDiffBrowser resources string:'current'). |
2695 | 1756 |
theChangeSetA := self changeSetForClass: aClass andRevision: versionCompared. |
1757 |
theChangeSetB := self changeSetForClass: aClass. |
|
1758 |
theChangeSetA isNil |
|
1759 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1760 |
theChangeSetB isNil |
|
1761 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2710
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1762 |
"/ if we are comparing a private class, prune out other changes |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1763 |
aClass isPrivate ifTrue:[ |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1764 |
theChangeSetA removeAllSuchThat:[:aChange | |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1765 |
aChange className ~= aClass name |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1766 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1767 |
theChangeSetB removeAllSuchThat:[:aChange | |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1768 |
aChange className ~= aClass name |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1769 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1770 |
]. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1771 |
self activityNotification:'generating diff-set...'. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1772 |
diffSet := theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB). |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1773 |
self activityNotification:nil. |
88a97fa1d140
allow comparing private classes
Claus Gittinger <cg@exept.de>
parents:
2697
diff
changeset
|
1774 |
^ diffSet |
2695 | 1775 |
! |
1776 |
||
2949 | 1777 |
newForClass:classA labelA:aLabelA andClass:classB labelB:aLabelB |
1778 |
"return a ClassChangeSet for two classes. |
|
1779 |
A new instance of ClassChangeSet is generated containing the correspondenting changes. |
|
1780 |
||
1781 |
<return: ClassChangeSet> |
|
1782 |
" |
|
1783 |
|aStream sourceA sourceB theChangeSetA theChangeSetB theClassChangeSet| |
|
1784 |
||
1785 |
theClassChangeSet := self new. |
|
1786 |
theClassChangeSet classBeingCompared:classA. |
|
1787 |
theClassChangeSet labelA:aLabelA. |
|
1788 |
theClassChangeSet labelB:aLabelB. |
|
1789 |
||
1790 |
aStream := '' writeStream. |
|
1791 |
Method flushSourceStreamCache. |
|
1792 |
classA fileOutOn:aStream withTimeStamp:false. |
|
1793 |
sourceA := aStream contents asString. |
|
1794 |
||
1795 |
aStream := '' writeStream. |
|
1796 |
Method flushSourceStreamCache. |
|
1797 |
classB fileOutOn:aStream withTimeStamp:false. |
|
1798 |
sourceB := aStream contents asString. |
|
1799 |
||
1800 |
theChangeSetA:=self changeSetForClass:classA andSource:sourceA. |
|
1801 |
theChangeSetB:=self changeSetForClass:classB andSource:sourceB. |
|
1802 |
theChangeSetA isNil |
|
1803 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1804 |
theChangeSetB isNil |
|
1805 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
1806 |
||
1807 |
"/ just in case (if comparing a class against another), |
|
1808 |
"/ unify the classes of the changes (to avoid that all changes are detected as different) |
|
1809 |
||
1810 |
theChangeSetB do:[:eachChange | |
|
1811 |
eachChange isMethodChange ifTrue:[ |
|
1812 |
eachChange changeClass isMeta ifTrue:[ |
|
1813 |
eachChange changeClass ~~ classA theMetaclass ifTrue:[ |
|
1814 |
eachChange changeClass:classA theMetaclass. |
|
1815 |
] |
|
1816 |
] ifFalse:[ |
|
1817 |
eachChange changeClass ~~ classA theNonMetaclass ifTrue:[ |
|
1818 |
eachChange changeClass:classA theNonMetaclass. |
|
1819 |
] |
|
1820 |
]. |
|
1821 |
]. |
|
1822 |
]. |
|
1823 |
"/ remove all #initialize doIts |
|
1824 |
theChangeSetA := theChangeSetA select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]]. |
|
1825 |
theChangeSetB := theChangeSetB select:[:eachChange | eachChange isDoIt not or:[eachChange isInitialize not]]. |
|
1826 |
||
1827 |
^theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
|
1828 |
! |
|
1829 |
||
2497 | 1830 |
newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1831 |
"return a ClassChangeSet for the class aClass and the two sources. |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1832 |
The two classes are compared via the source files. A new instance of |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1833 |
ClassChangeSet is generated containing the correspondenting changes. |
2497 | 1834 |
|
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1835 |
<return: ClassChangeSet> |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1836 |
" |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1837 |
|
4128 | 1838 |
|theChangeSetA theChangeSetB theClassChangeSet className metaClassName| |
2497 | 1839 |
|
1840 |
theClassChangeSet := self new. |
|
1841 |
theClassChangeSet classBeingCompared:aClass. |
|
1842 |
theClassChangeSet labelA:aLabelA. |
|
1843 |
theClassChangeSet labelB:aLabelB. |
|
1844 |
theChangeSetA:=self changeSetForClass:aClass andSource:aSourceA. |
|
1845 |
theChangeSetB:=self changeSetForClass:aClass andSource:aSourceB. |
|
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1846 |
|
4128 | 1847 |
className := aClass name. |
1848 |
metaClassName := aClass class name. |
|
1849 |
||
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1850 |
aClass isPrivate ifTrue:[ |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1851 |
theChangeSetA := theChangeSetA select:[:change | change isMethodChange not |
4128 | 1852 |
or:[change className = className or:[change className = metaClassName]]]. |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1853 |
theChangeSetA := theChangeSetA select:[:change | change isClassDefinitionChange not |
4128 | 1854 |
or:[change className = className or:[change className = metaClassName]]]. |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1855 |
theChangeSetA := theChangeSetA select:[:change | change isDoIt not |
4128 | 1856 |
or:[change receiverClassName = className or:[change receiverClassName = metaClassName]]]. |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1857 |
theChangeSetB := theChangeSetB select:[:change | change isMethodChange not |
4128 | 1858 |
or:[change className = className or:[change className = metaClassName]]]. |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1859 |
theChangeSetB := theChangeSetB select:[:change | change isClassDefinitionChange not |
4128 | 1860 |
or:[change className = className or:[change className = metaClassName]]]. |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1861 |
theChangeSetB := theChangeSetB select:[:change | change isDoIt not |
4128 | 1862 |
or:[change receiverClassName = className or:[change receiverClassName = metaClassName]]]. |
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1863 |
"/ there might be more needed... |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1864 |
]. |
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1865 |
|
2497 | 1866 |
theChangeSetA isNil |
1867 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1868 |
theChangeSetB isNil |
|
1869 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2947 | 1870 |
|
3730
717e425e843e
allow for private classes to be compared
Claus Gittinger <cg@exept.de>
parents:
3687
diff
changeset
|
1871 |
^ theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
2465 | 1872 |
! |
1873 |
||
2497 | 1874 |
newForClass:aClass versionA:aVersionA versionB:aVersionB |
1875 |
"return a ClassChangeSet for the class aClass and the two versions. |
|
1876 |
The two class version are checked out from the repository and then being |
|
1877 |
compared. A new instance of ClassChangeSet is generated containing |
|
1878 |
the correspondenting changes. |
|
1879 |
||
1880 |
<return: ClassChangeSet> |
|
1881 |
" |
|
1882 |
|theChangeSetA theChangeSetB theClassChangeSet| |
|
1883 |
||
1884 |
theClassChangeSet := self new. |
|
1885 |
theClassChangeSet classBeingCompared:aClass. |
|
2856 | 1886 |
theClassChangeSet versionA:aVersionA. |
1887 |
theClassChangeSet versionB:aVersionB. |
|
2497 | 1888 |
theClassChangeSet labelA:aVersionA. |
1889 |
theClassChangeSet labelB:aVersionB. |
|
1890 |
theChangeSetA := self changeSetForClass: aClass andRevision: aVersionA. |
|
1891 |
theChangeSetB := self changeSetForClass: aClass andRevision: aVersionB. |
|
1892 |
theChangeSetA isNil |
|
1893 |
ifTrue: [theChangeSetA := ChangeSet new]. |
|
1894 |
theChangeSetB isNil |
|
1895 |
ifTrue: [theChangeSetB := ChangeSet new]. |
|
2695 | 1896 |
^theClassChangeSet diffSet:(theChangeSetA diffSetsAgainst:theChangeSetB) |
2497 | 1897 |
! ! |
1898 |
||
1899 |
!VersionDiffBrowser::ClassChangeSet methodsFor:'accessing'! |
|
1900 |
||
1901 |
classBeingCompared |
|
3756 | 1902 |
"returns the value of the class which is compared" |
2497 | 1903 |
|
1904 |
^ classBeingCompared |
|
1905 |
! |
|
2221 | 1906 |
|
2497 | 1907 |
classBeingCompared:something |
3756 | 1908 |
"set the value of the class which is compared" |
2497 | 1909 |
|
1910 |
classBeingCompared := something. |
|
1911 |
! |
|
1912 |
||
2695 | 1913 |
diffSet |
3756 | 1914 |
"returns a diffSet containing the different changes. |
1915 |
it responds to: |
|
2695 | 1916 |
|
3756 | 1917 |
changed OrderedCollection of arrays containing ChangeSets for methods |
1918 |
which are changed and exists in the class versionA and versionB |
|
1919 |
onlyInArg ChangeSet for the methods which exists only in the class versionB |
|
1920 |
onlyInReceiver ChangeSet for the methods which exists only in the class versionA |
|
1921 |
" |
|
1922 |
||
2695 | 1923 |
^ diffSet |
1924 |
! |
|
1925 |
||
1926 |
diffSet:something |
|
3756 | 1927 |
"sets the diffSet containing the different changes. |
1928 |
it responds to: |
|
2695 | 1929 |
|
3756 | 1930 |
changed OrderedCollection of arrays containing ChangeSets for methods |
1931 |
which are changed and exists in the class versionA and versionB |
|
1932 |
onlyInArg ChangeSet for the methods which exists only in the class versionB |
|
1933 |
onlyInReceiver ChangeSet for the methods which exists only in the class versionA |
|
1934 |
" |
|
2695 | 1935 |
|
1936 |
diffSet := something. |
|
1937 |
! |
|
1938 |
||
2497 | 1939 |
labelA |
3756 | 1940 |
"returns the label for the class versionA" |
2497 | 1941 |
|
1942 |
^ labelA |
|
1943 |
! |
|
1944 |
||
1945 |
labelA:something |
|
3756 | 1946 |
"sets the label for the class versionA" |
2497 | 1947 |
|
1948 |
labelA := something. |
|
1949 |
! |
|
1950 |
||
1951 |
labelB |
|
3756 | 1952 |
"returns the label for the class versionB" |
2497 | 1953 |
|
1954 |
^ labelB |
|
1955 |
! |
|
2465 | 1956 |
|
2497 | 1957 |
labelB:something |
3756 | 1958 |
"sets the label for the class versionB" |
2497 | 1959 |
|
1960 |
labelB := something. |
|
1961 |
! |
|
1962 |
||
1963 |
methodsChanged |
|
3756 | 1964 |
"returns an OrderedCollection of arrays containing ChangeSets for methods |
1965 |
which are changed and exists in the class versionA and versionB |
|
2497 | 1966 |
|
3756 | 1967 |
<return: OrderedCollection of Array(2)> |
1968 |
" |
|
1969 |
||
1970 |
^ self diffSet changed |
|
2497 | 1971 |
! |
1972 |
||
1973 |
methodsOnlyInA |
|
3756 | 1974 |
"returns a ChangeSet for the methods which exists only in the class versionA" |
2497 | 1975 |
|
3756 | 1976 |
^ self diffSet onlyInReceiver |
2497 | 1977 |
! |
1978 |
||
1979 |
methodsOnlyInB |
|
3756 | 1980 |
"returns a ChangeSet for the methods which exists only in the class versionB" |
2497 | 1981 |
|
3756 | 1982 |
^ self diffSet onlyInArg |
2856 | 1983 |
! |
1984 |
||
1985 |
versionA |
|
1986 |
^ versionA |
|
1987 |
! |
|
1988 |
||
1989 |
versionA:something |
|
1990 |
versionA := something. |
|
1991 |
! |
|
1992 |
||
1993 |
versionB |
|
1994 |
^ versionB |
|
1995 |
! |
|
1996 |
||
1997 |
versionB:something |
|
1998 |
versionB := something. |
|
2221 | 1999 |
! ! |
2000 |
||
2001 |
!VersionDiffBrowser class methodsFor:'documentation'! |
|
2002 |
||
2003 |
version |
|
7499 | 2004 |
^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.78 2006-11-10 16:26:04 cg Exp $' |
2221 | 2005 |
! ! |