VersionDiffBrowser.st
changeset 2731 5628e2514bfa
parent 2730 0bf87aa1ac49
child 2745 8fa3af64f96e
equal deleted inserted replaced
2730:0bf87aa1ac49 2731:5628e2514bfa
   660 "
   660 "
   661 gets the first class version to be compared
   661 gets the first class version to be compared
   662 
   662 
   663 <return: String>
   663 <return: String>
   664 "
   664 "
   665     ^ self classChangeSet labelA
   665     classChangeSet isNil ifTrue:[^ 'A'].
   666 
   666     ^ classChangeSet labelA
   667 !
   667 !
   668 
   668 
   669 versionB
   669 versionB
   670 "
   670 "
   671 gets the second class version to be compared
   671 gets the second class version to be compared
   672 
   672 
   673 <return: String>
   673 <return: String>
   674 "
   674 "
   675     ^ self classChangeSet labelB
   675     classChangeSet isNil ifTrue:[^ 'B'].
   676 
   676     ^ classChangeSet labelB
   677 ! !
   677 ! !
   678 
   678 
   679 !VersionDiffBrowser methodsFor:'actions'!
   679 !VersionDiffBrowser methodsFor:'actions'!
   680 
   680 
   681 methodsChangedSelectionChanged
   681 methodsChangedSelectionChanged
  1321 to the list methodsOnlyInA or methodsOnlyInB.
  1321 to the list methodsOnlyInA or methodsOnlyInB.
  1322 Methods which are changed from version A to B go to the list methodsChanged.
  1322 Methods which are changed from version A to B go to the list methodsChanged.
  1323 
  1323 
  1324 <return: self>
  1324 <return: self>
  1325 "
  1325 "
  1326     |classChangeSet|
  1326     |classChangeSet listOnlyInA listOnlyInB listChanged|
  1327 
  1327 
  1328     classChangeSet := self classChangeSet.
  1328     classChangeSet := self classChangeSet.
  1329 
  1329 
  1330     self methodsOnlyInA 
  1330     listOnlyInA := self methodsOnlyInA. 
  1331         removeAll; addAll: (classChangeSet methodsOnlyInA collect:self generator).
  1331     listOnlyInA removeAll.
  1332 
  1332     classChangeSet notNil ifTrue:[
  1333     self methodsOnlyInB 
  1333         listOnlyInA addAll: (classChangeSet methodsOnlyInA collect:self generator).
  1334         removeAll; addAll: (classChangeSet methodsOnlyInB collect:self generator).
  1334     ].
  1335 
  1335 
  1336     self methodsChanged 
  1336     listOnlyInB := self methodsOnlyInB. 
  1337         removeAll; addAll: (classChangeSet methodsChanged collect:[:arr| self generator value:(arr first)]).
  1337     listOnlyInB removeAll.
  1338 
  1338     classChangeSet notNil ifTrue:[
  1339     self boxAVisible value:(self methodsOnlyInA notEmpty).
  1339         listOnlyInB addAll: (classChangeSet methodsOnlyInB collect:self generator).
  1340     self boxBVisible value:(self methodsOnlyInB notEmpty).
  1340     ].
  1341 
  1341 
  1342     self boxMVisible value:(self methodsChanged isEmpty 
  1342     listChanged := self methodsChanged. 
  1343                             and: [(self methodsOnlyInA notEmpty 
  1343     listChanged removeAll.
  1344                                   or:[self methodsOnlyInB notEmpty])]) not.
  1344     classChangeSet notNil ifTrue:[
       
  1345         listChanged addAll: (classChangeSet methodsChanged collect:[:arr| self generator value:(arr first)]).
       
  1346     ].
       
  1347 
       
  1348     self boxAVisible value:(listOnlyInA notEmpty).
       
  1349     self boxBVisible value:(listOnlyInB notEmpty).
       
  1350 
       
  1351     self boxMVisible value:(listChanged isEmpty 
       
  1352                             and: [(listOnlyInA notEmpty 
       
  1353                                   or:[listOnlyInB notEmpty])]) not.
  1345 ! !
  1354 ! !
  1346 
  1355 
  1347 !VersionDiffBrowser methodsFor:'setup'!
  1356 !VersionDiffBrowser methodsFor:'setup'!
  1348 
  1357 
  1349 setupForClass:aClass againstVersion:aVersionA
  1358 setupForClass:aClass againstVersion:aVersionA
  1352 When setting the class change set, the labels, list etc. of the receiver
  1361 When setting the class change set, the labels, list etc. of the receiver
  1353 are updated.
  1362 are updated.
  1354 
  1363 
  1355 <return: self>
  1364 <return: self>
  1356 "
  1365 "
  1357     self classChangeSet:(ClassChangeSet newForClass:aClass againstVersion:aVersionA)
  1366     |changeSet|
       
  1367 
       
  1368     aClass isNameSpace ifFalse:[
       
  1369         aClass isLoaded ifTrue:[
       
  1370             changeSet := (ClassChangeSet newForClass:aClass againstVersion:aVersionA).
       
  1371         ]
       
  1372     ].
       
  1373     self classChangeSet:changeSet
  1358 !
  1374 !
  1359 
  1375 
  1360 setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB
  1376 setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB
  1361 "
  1377 "
  1362 generate the class change set from the two source files A and B.
  1378 generate the class change set from the two source files A and B.
  1363 When setting the class change set, the labels, list etc. of the receiver
  1379 When setting the class change set, the labels, list etc. of the receiver
  1364 are updated.
  1380 are updated.
  1365 
  1381 
  1366 <return: self>
  1382 <return: self>
  1367 "
  1383 "
  1368     self classChangeSet:(ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB)
  1384     |changeSet|
       
  1385 
       
  1386     aClass isNameSpace ifFalse:[
       
  1387         aClass isLoaded ifTrue:[
       
  1388             changeSet := (ClassChangeSet newForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB).
       
  1389         ]
       
  1390     ].
       
  1391     self classChangeSet:changeSet
  1369 !
  1392 !
  1370 
  1393 
  1371 setupForClass:aClass versionA:aVersionA versionB:aVersionB
  1394 setupForClass:aClass versionA:aVersionA versionB:aVersionB
  1372 "
  1395 "
  1373 compute the class change set for the class aClass and the versions A and B.
  1396 compute the class change set for the class aClass and the versions A and B.
  1374 When setting the class change set, the labels, list etc. of the receiver
  1397 When setting the class change set, the labels, list etc. of the receiver
  1375 are updated.
  1398 are updated.
  1376 
  1399 
  1377 <return: self>
  1400 <return: self>
  1378 "
  1401 "
  1379     self classChangeSet:(ClassChangeSet newForClass:aClass versionA:aVersionA versionB:aVersionB)
  1402     |changeSet|
       
  1403 
       
  1404     aClass isNameSpace ifFalse:[
       
  1405         aClass isLoaded ifTrue:[
       
  1406             changeSet := (ClassChangeSet newForClass:aClass versionA:aVersionA versionB:aVersionB).
       
  1407         ]
       
  1408     ].
       
  1409     self classChangeSet:changeSet
  1380 ! !
  1410 ! !
  1381 
  1411 
  1382 !VersionDiffBrowser methodsFor:'values'!
  1412 !VersionDiffBrowser methodsFor:'values'!
  1383 
  1413 
  1384 addAcceptToTextViewMenus
  1414 addAcceptToTextViewMenus
  1689 ! !
  1719 ! !
  1690 
  1720 
  1691 !VersionDiffBrowser class methodsFor:'documentation'!
  1721 !VersionDiffBrowser class methodsFor:'documentation'!
  1692 
  1722 
  1693 version
  1723 version
  1694     ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.31 2000-08-22 21:01:39 cg Exp $'
  1724     ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.32 2000-08-23 12:19:43 cg Exp $'
  1695 ! !
  1725 ! !