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