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