BrowserView.st
changeset 204 6f4460d5a09d
parent 201 3331e9abc9f0
child 213 4b8b25b6baa1
equal deleted inserted replaced
203:de8d39d459fd 204:6f4460d5a09d
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 StandardSystemView subclass:#BrowserView
    13 StandardSystemView subclass:#BrowserView
    14 	 instanceVariableNames:'classCategoryListView classListView methodCategoryListView
    14 	 instanceVariableNames:'classCategoryListView classListView methodCategoryListView
    15                 methodListView classMethodListView codeView classToggle
    15 		methodListView classMethodListView codeView classToggle
    16                 instanceToggle currentClassCategory currentClassHierarchy
    16 		instanceToggle currentClassCategory currentClassHierarchy
    17                 currentClass currentMethodCategory currentMethod currentSelector
    17 		currentClass currentMethodCategory currentMethod currentSelector
    18                 showInstance actualClass fullClass lastMethodCategory aspect
    18 		showInstance actualClass fullClass lastMethodCategory aspect
    19                 variableListView fullProtocol lockUpdates autoSearch myLabel
    19 		variableListView fullProtocol lockUpdates autoSearch myLabel
    20                 acceptClass'
    20 		acceptClass'
    21 	 classVariableNames:'CheckForInstancesWhenRemovingClasses RememberAspect DefaultIcon'
    21 	 classVariableNames:'CheckForInstancesWhenRemovingClasses RememberAspect DefaultIcon'
    22 	 poolDictionaries:''
    22 	 poolDictionaries:''
    23 	 category:'Interface-Browsers'
    23 	 category:'Interface-Browsers'
    24 !
    24 !
    25 
    25 
   197 			    ^ self
   197 			    ^ self
   198 			].
   198 			].
   199 			"compare the source codes"
   199 			"compare the source codes"
   200 			currentMethod notNil ifTrue:[
   200 			currentMethod notNil ifTrue:[
   201 			    changedMethod source = codeView contents ifFalse:[
   201 			    changedMethod source = codeView contents ifFalse:[
   202 				self warnLabel:'the code shown may not up to date'.
   202 				self warnLabel:'method has changed - the code shown may be obsolete'.
   203 			    ]
   203 			    ]
   204 			].
   204 			].
   205 			^ self    
   205 			^ self    
   206 		    ].
   206 		    ].
   207 		    ^ self
   207 		    ^ self
   274 
   274 
   275 !BrowserView methodsFor:'class category list menu'!
   275 !BrowserView methodsFor:'class category list menu'!
   276 
   276 
   277 classCategoryCheckinEach
   277 classCategoryCheckinEach
   278     self withWaitCursorDo:[
   278     self withWaitCursorDo:[
   279         |logMessage|
   279 	|logMessage|
   280 
   280 
   281         logMessage := Dialog 
   281 	logMessage := Dialog 
   282                          request:'enter a log message (used for all):' 
   282 			 request:'enter a log message (used for all):' 
   283                          initialAnswer:''  
   283 			 initialAnswer:''  
   284                          onCancel:nil.
   284 			 onCancel:nil.
   285 
   285 
   286         logMessage notNil ifTrue:[
   286 	logMessage notNil ifTrue:[
   287             Smalltalk allClassesInCategory:currentClassCategory do:[:aClass |
   287 	    Smalltalk allClassesInCategory:currentClassCategory do:[:aClass |
   288                 self busyLabel:'checking in %1' with:aClass name.
   288 		self busyLabel:'checking in %1' with:aClass name.
   289                 SourceCodeManager checkinClass:aClass logMessage:logMessage.
   289 		SourceCodeManager checkinClass:aClass logMessage:logMessage.
   290                 self normalLabel.
   290 		self normalLabel.
   291             ]
   291 	    ]
   292         ].
   292 	].
   293         self normalLabel.
   293 	self normalLabel.
   294     ]
   294     ]
   295 
   295 
   296     "Created: 23.11.1995 / 11:41:38 / cg"
   296     "Created: 23.11.1995 / 11:41:38 / cg"
   297     "Modified: 23.11.1995 / 18:43:34 / cg"
   297     "Modified: 23.11.1995 / 18:43:34 / cg"
   298 !
   298 !
   404 classCategoryMenu
   404 classCategoryMenu
   405     |labels selectors|
   405     |labels selectors|
   406 
   406 
   407     (device ctrlDown 
   407     (device ctrlDown 
   408     and:[currentClassCategory notNil]) ifTrue:[
   408     and:[currentClassCategory notNil]) ifTrue:[
   409         labels :=  #(
   409 	labels :=  #(
   410                        'checkin each'
   410 		       'checkin each'
   411                     ).
   411 		    ).
   412         selectors := #(
   412 	selectors := #(
   413                        classCategoryCheckinEach
   413 		       classCategoryCheckinEach
   414                      ).
   414 		     ).
   415     ] ifFalse:[
   415     ] ifFalse:[
   416         currentClassCategory isNil ifTrue:[
   416 	currentClassCategory isNil ifTrue:[
   417             labels := #(
   417 	    labels := #(
   418                         'spawn full class'
   418 			'spawn full class'
   419                         '-'
   419 			'-'
   420                         'update'
   420 			'update'
   421                         'find class ...'
   421 			'find class ...'
   422                         'find method ...'
   422 			'find method ...'
   423                         '-'
   423 			'-'
   424                         'new class category ...'
   424 			'new class category ...'
   425                        ).
   425 		       ).
   426             selectors := #(
   426 	    selectors := #(
   427                         classCategorySpawnFullClass
   427 			classCategorySpawnFullClass
   428                         nil
   428 			nil
   429                         classCategoryUpdate
   429 			classCategoryUpdate
   430                         classCategoryFindClass
   430 			classCategoryFindClass
   431                         classCategoryFindMethod
   431 			classCategoryFindMethod
   432                         nil
   432 			nil
   433                         classCategoryNewCategory
   433 			classCategoryNewCategory
   434                        ).
   434 		       ).
   435         ] ifFalse:[
   435 	] ifFalse:[
   436             labels := #(
   436 	    labels := #(
   437                         'fileOut'
   437 			'fileOut'
   438                         'fileOut each'
   438 			'fileOut each'
   439 "/
   439 "/
   440 "/                      'fileOut binary'
   440 "/                      'fileOut binary'
   441 "/
   441 "/
   442                         'printOut' 
   442 			'printOut' 
   443                         'printOut protocol'
   443 			'printOut protocol'
   444                         '-'
   444 			'-'
   445                         'clone'
   445 			'clone'
   446                         'SPAWN_CATEGORY'
   446 			'SPAWN_CATEGORY'
   447                         'spawn full class'
   447 			'spawn full class'
   448                         '-'
   448 			'-'
   449                         'update'
   449 			'update'
   450                         'find class ...'
   450 			'find class ...'
   451                         'find method ...'
   451 			'find method ...'
   452                         '-'
   452 			'-'
   453                         'new class category ...'
   453 			'new class category ...'
   454                         'rename ...'
   454 			'rename ...'
   455                         'remove'
   455 			'remove'
   456                        ).
   456 		       ).
   457             selectors := #(
   457 	    selectors := #(
   458                        classCategoryFileOut
   458 		       classCategoryFileOut
   459                        classCategoryFileOutEach
   459 		       classCategoryFileOutEach
   460                        classCategoryPrintOut
   460 		       classCategoryPrintOut
   461                        classCategoryPrintOutProtocol
   461 		       classCategoryPrintOutProtocol
   462                        nil
   462 		       nil
   463                        classCategoryClone
   463 		       classCategoryClone
   464                        classCategorySpawn
   464 		       classCategorySpawn
   465                        classCategorySpawnFullClass
   465 		       classCategorySpawnFullClass
   466                        nil
   466 		       nil
   467                        classCategoryUpdate
   467 		       classCategoryUpdate
   468                        classCategoryFindClass
   468 		       classCategoryFindClass
   469                        classCategoryFindMethod
   469 		       classCategoryFindMethod
   470                        nil
   470 		       nil
   471                        classCategoryNewCategory
   471 		       classCategoryNewCategory
   472                        classCategoryRename
   472 		       classCategoryRename
   473                        classCategoryRemove
   473 		       classCategoryRemove
   474                        ).
   474 		       ).
   475         ].
   475 	].
   476     ].
   476     ].
   477 
   477 
   478     ^ PopUpMenu labels:(resources array:labels)
   478     ^ PopUpMenu labels:(resources array:labels)
   479                 selectors:selectors
   479 		selectors:selectors
   480 
   480 
   481     "Created: 14.9.1995 / 10:50:17 / claus"
   481     "Created: 14.9.1995 / 10:50:17 / claus"
   482     "Modified: 23.11.1995 / 18:37:06 / cg"
   482     "Modified: 23.11.1995 / 18:37:06 / cg"
   483 !
   483 !
   484 
   484 
  1348      ^ self
  1348      ^ self
  1349 !
  1349 !
  1350 
  1350 
  1351 classRefs
  1351 classRefs
  1352     self doClassMenu:[:currentClass |
  1352     self doClassMenu:[:currentClass |
  1353         self withSearchCursorDo:[
  1353 	self withSearchCursorDo:[
  1354             SystemBrowser browseReferendsOf:currentClass name asSymbol
  1354 	    SystemBrowser browseReferendsOf:currentClass name asSymbol
  1355         ]
  1355 	]
  1356     ]
  1356     ]
  1357 
  1357 
  1358     "Created: 23.11.1995 / 14:11:43 / cg"
  1358     "Created: 23.11.1995 / 14:11:43 / cg"
  1359 !
  1359 !
  1360 
  1360 
  1555     "a powerful tool, when trying to learn more about where
  1555     "a powerful tool, when trying to learn more about where
  1556      a class is used. This one searches all uses of a class,
  1556      a class is used. This one searches all uses of a class,
  1557      and shows a list of uses - try it and like it"
  1557      and shows a list of uses - try it and like it"
  1558 
  1558 
  1559     self doClassMenu:[:currentClass |
  1559     self doClassMenu:[:currentClass |
  1560         self withSearchCursorDo:[
  1560 	self withSearchCursorDo:[
  1561             SystemBrowser browseUsesOf:currentClass
  1561 	    SystemBrowser browseUsesOf:currentClass
  1562         ]
  1562 	]
  1563     ]
  1563     ]
  1564 
  1564 
  1565     "Created: 23.11.1995 / 14:11:47 / cg"
  1565     "Created: 23.11.1995 / 14:11:47 / cg"
  1566 !
  1566 !
  1567 
  1567 
  1622 
  1622 
  1623 classCheckin
  1623 classCheckin
  1624     "check a class into the source repository"
  1624     "check a class into the source repository"
  1625 
  1625 
  1626     self doClassMenu:[:currentClass |
  1626     self doClassMenu:[:currentClass |
  1627         |logMessage|
  1627 	|logMessage|
  1628 
  1628 
  1629         logMessage := Dialog 
  1629 	logMessage := Dialog 
  1630                          request:'enter a log message:' 
  1630 			 request:'enter a log message:' 
  1631                          initialAnswer:''  
  1631 			 initialAnswer:''  
  1632                          onCancel:nil.
  1632 			 onCancel:nil.
  1633         logMessage notNil ifTrue:[
  1633 	logMessage notNil ifTrue:[
  1634             self busyLabel:'checking in %1' with:currentClass name.
  1634 	    self busyLabel:'checking in %1' with:currentClass name.
  1635             SourceCodeManager checkinClass:currentClass logMessage:logMessage.
  1635 	    SourceCodeManager checkinClass:currentClass logMessage:logMessage.
  1636             aspect == #revisionInfo ifTrue:[
  1636 	    aspect == #revisionInfo ifTrue:[
  1637                 self classListUpdate
  1637 		self classListUpdate
  1638             ].
  1638 	    ].
  1639             self normalLabel.
  1639 	    self normalLabel.
  1640         ]
  1640 	]
  1641     ]
  1641     ]
  1642 
  1642 
  1643     "Created: 23.11.1995 / 11:41:38 / cg"
  1643     "Created: 23.11.1995 / 11:41:38 / cg"
  1644     "Modified: 23.11.1995 / 18:34:42 / cg"
  1644     "Modified: 23.11.1995 / 18:34:42 / cg"
  1645 !
  1645 !
  1687 
  1687 
  1688 classRevisionInfo
  1688 classRevisionInfo
  1689     "show current classes revision info in codeView"
  1689     "show current classes revision info in codeView"
  1690 
  1690 
  1691     self doClassMenu:[:currentClass |
  1691     self doClassMenu:[:currentClass |
  1692         |aStream info info2 s|
  1692 	|aStream info info2 s|
  1693 
  1693 
  1694         aStream := WriteStream on:(String new:200).
  1694 	aStream := WriteStream on:(String new:200).
  1695         currentClass notNil ifTrue:[
  1695 	currentClass notNil ifTrue:[
  1696             info := currentClass revisionInfo.
  1696 	    info := currentClass revisionInfo.
  1697             info notNil ifTrue:[
  1697 	    info notNil ifTrue:[
  1698                 s := info at:#repositoryPath ifAbsent:nil.
  1698 		s := info at:#repositoryPath ifAbsent:nil.
  1699                 s notNil ifTrue:[
  1699 		s notNil ifTrue:[
  1700                     aStream nextPut:'Source repository : ' , s; cr
  1700 		    aStream nextPut:'Source repository : ' , s; cr
  1701                 ].
  1701 		].
  1702                 aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
  1702 		aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
  1703                 aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
  1703 		aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
  1704                 aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
  1704 		aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
  1705                 aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
  1705 		aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
  1706 
  1706 
  1707                 (info2 := currentClass sourceCodeInfo) notNil ifTrue:[
  1707 		(info2 := currentClass sourceCodeInfo) notNil ifTrue:[
  1708                     aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
  1708 		    aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
  1709                     aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
  1709 		    aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
  1710                 ].
  1710 		].
  1711                 aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
  1711 		aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
  1712                 aStream cr.
  1712 		aStream cr.
  1713 
  1713 
  1714                 SourceCodeManager notNil ifTrue:[
  1714 		SourceCodeManager notNil ifTrue:[
  1715                     aStream nextPutAll:'Repository revisions:'; cr; cr.
  1715 		    aStream nextPutAll:'Repository revisions:'; cr; cr.
  1716                     SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
  1716 		    SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
  1717                 ]
  1717 		]
  1718             ]
  1718 	    ]
  1719         ].
  1719 	].
  1720         codeView contents:(aStream contents).
  1720 	codeView contents:(aStream contents).
  1721 
  1721 
  1722         codeView modified:false.
  1722 	codeView modified:false.
  1723         codeView acceptAction:nil.
  1723 	codeView acceptAction:nil.
  1724         codeView explainAction:nil.
  1724 	codeView explainAction:nil.
  1725         methodListView notNil ifTrue:[
  1725 	methodListView notNil ifTrue:[
  1726             methodListView deselect
  1726 	    methodListView deselect
  1727         ].
  1727 	].
  1728         aspect := #revisionInfo. 
  1728 	aspect := #revisionInfo. 
  1729         self normalLabel
  1729 	self normalLabel
  1730     ]
  1730     ]
  1731 
  1731 
  1732     "Created: 14.11.1995 / 16:43:15 / cg"
  1732     "Created: 14.11.1995 / 16:43:15 / cg"
  1733     "Modified: 23.11.1995 / 11:33:37 / cg"
  1733     "Modified: 23.11.1995 / 11:33:37 / cg"
  1734 ! !
  1734 ! !
  1782     self switchToClass:nil
  1782     self switchToClass:nil
  1783 !
  1783 !
  1784 
  1784 
  1785 classListUpdate
  1785 classListUpdate
  1786     RememberAspect ifTrue:[
  1786     RememberAspect ifTrue:[
  1787         aspect == #hierarchy ifTrue:[
  1787 	aspect == #hierarchy ifTrue:[
  1788             ^ self classHierarchy
  1788 	    ^ self classHierarchy
  1789         ].
  1789 	].
  1790         aspect == #classInstVars ifTrue:[
  1790 	aspect == #classInstVars ifTrue:[
  1791             ^ self classClassInstVars
  1791 	    ^ self classClassInstVars
  1792         ].
  1792 	].
  1793         aspect == #comment ifTrue:[
  1793 	aspect == #comment ifTrue:[
  1794             ^ self classComment
  1794 	    ^ self classComment
  1795         ].
  1795 	].
  1796         aspect == #primitiveDefinitions ifTrue:[
  1796 	aspect == #primitiveDefinitions ifTrue:[
  1797             ^ self classPrimitiveDefinitions
  1797 	    ^ self classPrimitiveDefinitions
  1798         ].
  1798 	].
  1799         aspect == #primitiveFunctions ifTrue:[
  1799 	aspect == #primitiveFunctions ifTrue:[
  1800             ^ self classPrimitiveFunctions
  1800 	    ^ self classPrimitiveFunctions
  1801         ].
  1801 	].
  1802         aspect == #primitiveVariables ifTrue:[
  1802 	aspect == #primitiveVariables ifTrue:[
  1803             ^ self classPrimitiveVariables
  1803 	    ^ self classPrimitiveVariables
  1804         ].
  1804 	].
  1805         aspect == #revisionInfo ifTrue:[
  1805 	aspect == #revisionInfo ifTrue:[
  1806             ^ self classRevisionInfo
  1806 	    ^ self classRevisionInfo
  1807         ].
  1807 	].
  1808     ].
  1808     ].
  1809     self classDefinition
  1809     self classDefinition
  1810 
  1810 
  1811     "Created: 23.11.1995 / 11:28:58 / cg"
  1811     "Created: 23.11.1995 / 11:28:58 / cg"
  1812     "Modified: 23.11.1995 / 11:36:08 / cg"
  1812     "Modified: 23.11.1995 / 11:36:08 / cg"
  1836 
  1836 
  1837 classSelectionChanged
  1837 classSelectionChanged
  1838     |oldMethodCategory oldMethod oldSelector|
  1838     |oldMethodCategory oldMethod oldSelector|
  1839 
  1839 
  1840     self withWaitCursorDo:[
  1840     self withWaitCursorDo:[
  1841         oldMethodCategory := currentMethodCategory.
  1841 	oldMethodCategory := currentMethodCategory.
  1842         oldMethod := currentMethod.
  1842 	oldMethod := currentMethod.
  1843         oldSelector := currentSelector.
  1843 	oldSelector := currentSelector.
  1844 
  1844 
  1845         showInstance ifTrue:[
  1845 	showInstance ifTrue:[
  1846             actualClass := acceptClass := currentClass
  1846 	    actualClass := acceptClass := currentClass
  1847         ] ifFalse:[
  1847 	] ifFalse:[
  1848             actualClass := acceptClass := currentClass class
  1848 	    actualClass := acceptClass := currentClass class
  1849         ].
  1849 	].
  1850         currentMethodCategory := nil.
  1850 	currentMethodCategory := nil.
  1851         currentMethod := nil.
  1851 	currentMethod := nil.
  1852         currentSelector := nil.
  1852 	currentSelector := nil.
  1853 
  1853 
  1854         self updateVariableList.
  1854 	self updateVariableList.
  1855         self updateMethodCategoryList.
  1855 	self updateMethodCategoryList.
  1856 
  1856 
  1857         oldMethodCategory notNil ifTrue:[
  1857 	oldMethodCategory notNil ifTrue:[
  1858             methodCategoryListView selectElement:oldMethodCategory.
  1858 	    methodCategoryListView selectElement:oldMethodCategory.
  1859             methodCategoryListView hasSelection ifTrue:[
  1859 	    methodCategoryListView hasSelection ifTrue:[
  1860                 currentMethodCategory := oldMethodCategory.
  1860 		currentMethodCategory := oldMethodCategory.
  1861                 self methodCategorySelectionChanged
  1861 		self methodCategorySelectionChanged
  1862             ]
  1862 	    ]
  1863         ].
  1863 	].
  1864         self updateMethodList.
  1864 	self updateMethodList.
  1865         self updateCodeView.
  1865 	self updateCodeView.
  1866 
  1866 
  1867         fullClass ifTrue:[
  1867 	fullClass ifTrue:[
  1868             codeView acceptAction:[:theCode |
  1868 	    codeView acceptAction:[:theCode |
  1869                 codeView cursor:Cursor execute.
  1869 		codeView cursor:Cursor execute.
  1870                 Object abortSignal catch:[
  1870 		Object abortSignal catch:[
  1871                     self compileCode:theCode asString.
  1871 		    self compileCode:theCode asString.
  1872                     codeView modified:false.
  1872 		    codeView modified:false.
  1873                 ].
  1873 		].
  1874                 codeView cursor:Cursor normal.
  1874 		codeView cursor:Cursor normal.
  1875             ].
  1875 	    ].
  1876         ] ifFalse:[
  1876 	] ifFalse:[
  1877 "/            self classDefinition.
  1877 "/            self classDefinition.
  1878 self classListUpdate.
  1878 self classListUpdate.
  1879             codeView acceptAction:[:theCode |
  1879 	    codeView acceptAction:[:theCode |
  1880                 codeView cursor:Cursor execute.
  1880 		codeView cursor:Cursor execute.
  1881                 Object abortSignal catch:[
  1881 		Object abortSignal catch:[
  1882                     (Compiler evaluate:theCode asString notifying:codeView compile:false)
  1882 		    (Compiler evaluate:theCode asString notifying:codeView compile:false)
  1883                     isBehavior ifTrue:[
  1883 		    isBehavior ifTrue:[
  1884                         self classCategoryUpdate.
  1884 			self classCategoryUpdate.
  1885                         self updateClassListWithScroll:false.
  1885 			self updateClassListWithScroll:false.
  1886                         codeView modified:false.
  1886 			codeView modified:false.
  1887                     ].
  1887 		    ].
  1888                 ].
  1888 		].
  1889                 codeView cursor:Cursor normal.
  1889 		codeView cursor:Cursor normal.
  1890             ].
  1890 	    ].
  1891         ].
  1891 	].
  1892         codeView explainAction:nil.
  1892 	codeView explainAction:nil.
  1893 
  1893 
  1894         classCategoryListView notNil ifTrue:[
  1894 	classCategoryListView notNil ifTrue:[
  1895             (currentClassCategory = currentClass category) ifFalse:[
  1895 	    (currentClassCategory = currentClass category) ifFalse:[
  1896                 currentClassCategory := currentClass category.
  1896 		currentClassCategory := currentClass category.
  1897                 classCategoryListView selectElement:currentClassCategory
  1897 		classCategoryListView selectElement:currentClassCategory
  1898             ]
  1898 	    ]
  1899         ].
  1899 	].
  1900 
  1900 
  1901         self setDoitActionForClass
  1901 	self setDoitActionForClass
  1902     ]
  1902     ]
  1903 
  1903 
  1904     "Created: 23.11.1995 / 11:32:03 / cg"
  1904     "Created: 23.11.1995 / 11:32:03 / cg"
  1905 !
  1905 !
  1906 
  1906 
  3583     self methodCategorySelectionChanged.
  3583     self methodCategorySelectionChanged.
  3584     aspect := nil.
  3584     aspect := nil.
  3585 
  3585 
  3586     "if there is only one method, show it right away"
  3586     "if there is only one method, show it right away"
  3587     methodListView list size == 1 ifTrue:[
  3587     methodListView list size == 1 ifTrue:[
  3588         methodListView selection:1.
  3588 	methodListView selection:1.
  3589         self methodSelection:1
  3589 	self methodSelection:1
  3590 "/    ] ifFalse:[
  3590 "/    ] ifFalse:[
  3591 "/      oldSelector notNil ifTrue:[
  3591 "/      oldSelector notNil ifTrue:[
  3592 "/          methodListView selectElement:oldSelector.
  3592 "/          methodListView selectElement:oldSelector.
  3593 "/          methodListView hasSelection ifTrue:[
  3593 "/          methodListView hasSelection ifTrue:[
  3594 "/              self methodSelection:methodListView selection.
  3594 "/              self methodSelection:methodListView selection.
  3601 
  3601 
  3602 methodCategorySelectionChanged
  3602 methodCategorySelectionChanged
  3603     "method category selection has changed - update dependent views"
  3603     "method category selection has changed - update dependent views"
  3604 
  3604 
  3605     self withWaitCursorDo:[
  3605     self withWaitCursorDo:[
  3606         currentMethod := currentSelector := nil.
  3606 	currentMethod := currentSelector := nil.
  3607 
  3607 
  3608         self updateMethodList.
  3608 	self updateMethodList.
  3609         self updateCodeView.
  3609 	self updateCodeView.
  3610 
  3610 
  3611         currentMethodCategory notNil ifTrue:[
  3611 	currentMethodCategory notNil ifTrue:[
  3612             methodCategoryListView selectElement:currentMethodCategory
  3612 	    methodCategoryListView selectElement:currentMethodCategory
  3613         ].
  3613 	].
  3614 
  3614 
  3615         self setAcceptAndExplainActionsForMethod.
  3615 	self setAcceptAndExplainActionsForMethod.
  3616         self hilightMethodsInMethodCategoryList:false inMethodList:true.
  3616 	self hilightMethodsInMethodCategoryList:false inMethodList:true.
  3617     ]
  3617     ]
  3618 
  3618 
  3619     "Created: 23.11.1995 / 14:17:38 / cg"
  3619     "Created: 23.11.1995 / 14:17:38 / cg"
  3620     "Modified: 23.11.1995 / 14:19:49 / cg"
  3620     "Modified: 23.11.1995 / 14:19:49 / cg"
  3621 !
  3621 !
  3843 methodLocalSuperSends
  3843 methodLocalSuperSends
  3844     "launch a browser showing super sends in current class & subclasses"
  3844     "launch a browser showing super sends in current class & subclasses"
  3845 
  3845 
  3846     self checkClassSelected ifFalse:[^ self].
  3846     self checkClassSelected ifFalse:[^ self].
  3847     self withSearchCursorDo:[
  3847     self withSearchCursorDo:[
  3848         SystemBrowser browseSuperCallsUnder:currentClass
  3848 	SystemBrowser browseSuperCallsUnder:currentClass
  3849     ]
  3849     ]
  3850 
  3850 
  3851     "Created: 23.11.1995 / 12:03:57 / cg"
  3851     "Created: 23.11.1995 / 12:03:57 / cg"
  3852     "Modified: 23.11.1995 / 14:12:15 / cg"
  3852     "Modified: 23.11.1995 / 14:12:15 / cg"
  3853 !
  3853 !
  3884      searchLabels searchSelectors
  3884      searchLabels searchSelectors
  3885      sepLocalLabels sepLocalSelectors
  3885      sepLocalLabels sepLocalSelectors
  3886      localSearchLabels localSearchSelectors|
  3886      localSearchLabels localSearchSelectors|
  3887 
  3887 
  3888     device ctrlDown ifTrue:[
  3888     device ctrlDown ifTrue:[
  3889         "/ 'secret' developpers menu
  3889 	"/ 'secret' developpers menu
  3890 
  3890 
  3891         currentMethod isNil ifTrue:[
  3891 	currentMethod isNil ifTrue:[
  3892             methodListView flash.
  3892 	    methodListView flash.
  3893             ^ nil
  3893 	    ^ nil
  3894         ].
  3894 	].
  3895         labels := #(
  3895 	labels := #(
  3896                         'inspect method'
  3896 			'inspect method'
  3897                         'compile to machine code'
  3897 			'compile to machine code'
  3898                         'decompile'
  3898 			'decompile'
  3899                         '-'
  3899 			'-'
  3900                         'make private'
  3900 			'make private'
  3901                         'make protected'
  3901 			'make protected'
  3902                         'make public'
  3902 			'make public'
  3903                    ).
  3903 		   ).
  3904         selectors := #(
  3904 	selectors := #(
  3905                         methodInspect
  3905 			methodInspect
  3906                         methodSTCCompile
  3906 			methodSTCCompile
  3907                         methodDecompile
  3907 			methodDecompile
  3908                         nil
  3908 			nil
  3909                         methodMakePrivate
  3909 			methodMakePrivate
  3910                         methodMakeProtected
  3910 			methodMakeProtected
  3911                         methodMakePublic
  3911 			methodMakePublic
  3912                       )
  3912 		      )
  3913     ] ifFalse:[
  3913     ] ifFalse:[
  3914 
  3914 
  3915         sepLocalLabels := sepLocalSelectors := #().
  3915 	sepLocalLabels := sepLocalSelectors := #().
  3916 
  3916 
  3917         searchLabels := #(
  3917 	searchLabels := #(
  3918                                     'senders ...'
  3918 				    'senders ...'
  3919                                     'implementors ...'
  3919 				    'implementors ...'
  3920                                     'globals ...'
  3920 				    'globals ...'
  3921                                     'string search ...'
  3921 				    'string search ...'
  3922                                     'apropos ...'
  3922 				    'apropos ...'
  3923                         ).
  3923 			).
  3924         searchSelectors := #(
  3924 	searchSelectors := #(
  3925                                     methodSenders
  3925 				    methodSenders
  3926                                     methodImplementors
  3926 				    methodImplementors
  3927                                     methodGlobalReferends
  3927 				    methodGlobalReferends
  3928                                     methodStringSearch
  3928 				    methodStringSearch
  3929                                     methodAproposSearch
  3929 				    methodAproposSearch
  3930                             ).
  3930 			    ).
  3931 
  3931 
  3932         currentClass notNil ifTrue:[
  3932 	currentClass notNil ifTrue:[
  3933             localSearchLabels := #(
  3933 	    localSearchLabels := #(
  3934                                     '-'
  3934 				    '-'
  3935                                     'local senders ...'
  3935 				    'local senders ...'
  3936                                     'local implementors ...'
  3936 				    'local implementors ...'
  3937                                     'local super sends ...'
  3937 				    'local super sends ...'
  3938                                     'local string search ...'
  3938 				    'local string search ...'
  3939                                     'local apropos ...'
  3939 				    'local apropos ...'
  3940                                 ).
  3940 				).
  3941             localSearchSelectors := #(
  3941 	    localSearchSelectors := #(
  3942                                     nil
  3942 				    nil
  3943                                     methodLocalSenders
  3943 				    methodLocalSenders
  3944                                     methodLocalImplementors
  3944 				    methodLocalImplementors
  3945                                     methodLocalSuperSends
  3945 				    methodLocalSuperSends
  3946                                     methodLocalStringSearch
  3946 				    methodLocalStringSearch
  3947                                     methodLocalAproposSearch
  3947 				    methodLocalAproposSearch
  3948                                   ).
  3948 				  ).
  3949         ] ifFalse:[
  3949 	] ifFalse:[
  3950             localSearchLabels := localSearchSelectors := #()
  3950 	    localSearchLabels := localSearchSelectors := #()
  3951         ].
  3951 	].
  3952 
  3952 
  3953         currentMethodCategory notNil ifTrue:[
  3953 	currentMethodCategory notNil ifTrue:[
  3954             sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  3954 	    sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  3955 
  3955 
  3956             newLabels :=           #(
  3956 	    newLabels :=           #(
  3957                                     'new method' 
  3957 				    'new method' 
  3958                                     ).
  3958 				    ).
  3959 
  3959 
  3960             newSelectors :=    #(
  3960 	    newSelectors :=    #(
  3961                                     methodNewMethod
  3961 				    methodNewMethod
  3962                                  ).
  3962 				 ).
  3963         ] ifFalse:[
  3963 	] ifFalse:[
  3964             newLabels := newSelectors := #()
  3964 	    newLabels := newSelectors := #()
  3965         ].
  3965 	].
  3966 
  3966 
  3967         currentMethod notNil ifTrue:[
  3967 	currentMethod notNil ifTrue:[
  3968             fileLabels :=           #(
  3968 	    fileLabels :=           #(
  3969                                     'fileOut'
  3969 				    'fileOut'
  3970                                     'printOut'
  3970 				    'printOut'
  3971                                     '-'
  3971 				    '-'
  3972                                     'SPAWN_METHOD'
  3972 				    'SPAWN_METHOD'
  3973                                     '-'
  3973 				    '-'
  3974                                     ).
  3974 				    ).
  3975 
  3975 
  3976             fileSelectors :=    #(
  3976 	    fileSelectors :=    #(
  3977                                     methodFileOut
  3977 				    methodFileOut
  3978                                     methodPrintOut
  3978 				    methodPrintOut
  3979                                     nil
  3979 				    nil
  3980                                     methodSpawn
  3980 				    methodSpawn
  3981                                     nil
  3981 				    nil
  3982                                  ).
  3982 				 ).
  3983 
  3983 
  3984             sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  3984 	    sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
  3985 
  3985 
  3986             mthdLabels :=           #(
  3986 	    mthdLabels :=           #(
  3987                                     'change category ...' 
  3987 				    'change category ...' 
  3988                                     'remove'
  3988 				    'remove'
  3989                                     ).
  3989 				    ).
  3990 
  3990 
  3991             mthdSelectors :=    #(
  3991 	    mthdSelectors :=    #(
  3992                                     methodChangeCategory
  3992 				    methodChangeCategory
  3993                                     methodRemove
  3993 				    methodRemove
  3994                                  ).
  3994 				 ).
  3995 
  3995 
  3996             currentMethod isWrapped ifTrue:[
  3996 	    currentMethod isWrapped ifTrue:[
  3997                 brkLabels := #(
  3997 		brkLabels := #(
  3998                                     'remove break/trace' 
  3998 				    'remove break/trace' 
  3999                                     '-'
  3999 				    '-'
  4000                               ).
  4000 			      ).
  4001 
  4001 
  4002                 brkSelectors := #(
  4002 		brkSelectors := #(
  4003                                     methodRemoveBreakOrTrace
  4003 				    methodRemoveBreakOrTrace
  4004                                     nil
  4004 				    nil
  4005                                  )
  4005 				 )
  4006             ] ifFalse:[
  4006 	    ] ifFalse:[
  4007                 brkLabels := #(
  4007 		brkLabels := #(
  4008                                     'breakpoint' 
  4008 				    'breakpoint' 
  4009                                     'trace' 
  4009 				    'trace' 
  4010                                     'trace sender' 
  4010 				    'trace sender' 
  4011                                     '-'
  4011 				    '-'
  4012                               ).
  4012 			      ).
  4013 
  4013 
  4014                 brkSelectors := #(
  4014 		brkSelectors := #(
  4015                                     methodBreakPoint
  4015 				    methodBreakPoint
  4016                                     methodTrace
  4016 				    methodTrace
  4017                                     methodTraceSender
  4017 				    methodTraceSender
  4018                                     nil
  4018 				    nil
  4019                                  )
  4019 				 )
  4020             ]
  4020 	    ]
  4021         ] ifFalse:[
  4021 	] ifFalse:[
  4022             fileLabels := fileSelectors := #().
  4022 	    fileLabels := fileSelectors := #().
  4023             brkLabels := brkSelectors := #().
  4023 	    brkLabels := brkSelectors := #().
  4024             mthdLabels := mthdSelectors := #().
  4024 	    mthdLabels := mthdSelectors := #().
  4025         ].
  4025 	].
  4026 
  4026 
  4027 
  4027 
  4028 
  4028 
  4029         labels :=
  4029 	labels :=
  4030                     fileLabels ,
  4030 		    fileLabels ,
  4031                     searchLabels ,
  4031 		    searchLabels ,
  4032                     localSearchLabels ,
  4032 		    localSearchLabels ,
  4033                     sepLocalLabels ,
  4033 		    sepLocalLabels ,
  4034                     brkLabels ,
  4034 		    brkLabels ,
  4035                     newLabels ,
  4035 		    newLabels ,
  4036                     mthdLabels.
  4036 		    mthdLabels.
  4037 
  4037 
  4038         selectors :=
  4038 	selectors :=
  4039                     fileSelectors ,
  4039 		    fileSelectors ,
  4040                     searchSelectors ,
  4040 		    searchSelectors ,
  4041                     localSearchSelectors ,
  4041 		    localSearchSelectors ,
  4042                     sepLocalSelectors ,
  4042 		    sepLocalSelectors ,
  4043                     brkSelectors ,
  4043 		    brkSelectors ,
  4044                     newSelectors ,
  4044 		    newSelectors ,
  4045                     mthdSelectors.
  4045 		    mthdSelectors.
  4046 
  4046 
  4047 "
  4047 "
  4048         labels := #(
  4048 	labels := #(
  4049                                     'fileOut'
  4049 				    'fileOut'
  4050                                     'printOut'
  4050 				    'printOut'
  4051                                     '-'
  4051 				    '-'
  4052                                     'SPAWN_METHOD'
  4052 				    'SPAWN_METHOD'
  4053                                     '-'
  4053 				    '-'
  4054                                     'senders ...'
  4054 				    'senders ...'
  4055                                     'implementors ...'
  4055 				    'implementors ...'
  4056                                     'globals ...'
  4056 				    'globals ...'
  4057                                     'string search ...'
  4057 				    'string search ...'
  4058                                     'apropos ...'
  4058 				    'apropos ...'
  4059                                     '-'
  4059 				    '-'
  4060                                     'local senders ...'
  4060 				    'local senders ...'
  4061                                     'local implementors ...'
  4061 				    'local implementors ...'
  4062                                     'local string search ...'
  4062 				    'local string search ...'
  4063                                     'local apropos ...'
  4063 				    'local apropos ...'
  4064                                     '-'
  4064 				    '-'
  4065                                     'breakpoint' 
  4065 				    'breakpoint' 
  4066                                     'trace' 
  4066 				    'trace' 
  4067                                     'trace sender' 
  4067 				    'trace sender' 
  4068                                     '-'
  4068 				    '-'
  4069                                     'new method' 
  4069 				    'new method' 
  4070                                     'change category ...' 
  4070 				    'change category ...' 
  4071                                     'remove'
  4071 				    'remove'
  4072                                 ).
  4072 				).
  4073          selectors := #(
  4073 	 selectors := #(
  4074                                     methodFileOut
  4074 				    methodFileOut
  4075                                     methodPrintOut
  4075 				    methodPrintOut
  4076                                     nil
  4076 				    nil
  4077                                     methodSpawn
  4077 				    methodSpawn
  4078                                     nil
  4078 				    nil
  4079                                     methodSenders
  4079 				    methodSenders
  4080                                     methodImplementors
  4080 				    methodImplementors
  4081                                     methodGlobalReferends
  4081 				    methodGlobalReferends
  4082                                     methodStringSearch
  4082 				    methodStringSearch
  4083                                     methodAproposSearch
  4083 				    methodAproposSearch
  4084                                     nil
  4084 				    nil
  4085                                     methodLocalSenders
  4085 				    methodLocalSenders
  4086                                     methodLocalImplementors
  4086 				    methodLocalImplementors
  4087                                     methodLocalStringSearch
  4087 				    methodLocalStringSearch
  4088                                     methodLocalAproposSearch
  4088 				    methodLocalAproposSearch
  4089                                     nil
  4089 				    nil
  4090                                     methodBreakPoint
  4090 				    methodBreakPoint
  4091                                     methodTrace
  4091 				    methodTrace
  4092                                     methodTraceSender
  4092 				    methodTraceSender
  4093                                     nil
  4093 				    nil
  4094                                     methodNewMethod
  4094 				    methodNewMethod
  4095                                     methodChangeCategory
  4095 				    methodChangeCategory
  4096                                     methodRemove
  4096 				    methodRemove
  4097                                   )
  4097 				  )
  4098 "
  4098 "
  4099     ].
  4099     ].
  4100     m := PopUpMenu
  4100     m := PopUpMenu
  4101          labels:(resources array:labels)
  4101 	 labels:(resources array:labels)
  4102          selectors:selectors.
  4102 	 selectors:selectors.
  4103 
  4103 
  4104     currentMethod notNil ifTrue:[
  4104     currentMethod notNil ifTrue:[
  4105         currentMethod isPrivate ifTrue:[
  4105 	currentMethod isPrivate ifTrue:[
  4106             m disable:#methodMakePrivate
  4106 	    m disable:#methodMakePrivate
  4107         ].
  4107 	].
  4108         currentMethod isProtected ifTrue:[
  4108 	currentMethod isProtected ifTrue:[
  4109             m disable:#methodMakeProtected
  4109 	    m disable:#methodMakeProtected
  4110         ].
  4110 	].
  4111         currentMethod isPublic ifTrue:[
  4111 	currentMethod isPublic ifTrue:[
  4112             m disable:#methodMakePublic
  4112 	    m disable:#methodMakePublic
  4113         ].
  4113 	].
  4114     ].
  4114     ].
  4115     currentMethod notNil ifTrue:[
  4115     currentMethod notNil ifTrue:[
  4116         (currentMethod code notNil
  4116 	(currentMethod code notNil
  4117         or:[Compiler canCreateMachineCode not]) ifTrue:[
  4117 	or:[Compiler canCreateMachineCode not]) ifTrue:[
  4118             m disable:#methodSTCCompile
  4118 	    m disable:#methodSTCCompile
  4119         ].
  4119 	].
  4120         currentMethod byteCode isNil ifTrue:[
  4120 	currentMethod byteCode isNil ifTrue:[
  4121             m disable:#methodDecompile
  4121 	    m disable:#methodDecompile
  4122         ].
  4122 	].
  4123     ].
  4123     ].
  4124     ^ m
  4124     ^ m
  4125 
  4125 
  4126     "Created: 23.11.1995 / 12:02:29 / cg"
  4126     "Created: 23.11.1995 / 12:02:29 / cg"
  4127 !
  4127 !
  4439 
  4439 
  4440 methodSelectionChanged
  4440 methodSelectionChanged
  4441     "method selection has changed - update dependent views"
  4441     "method selection has changed - update dependent views"
  4442 
  4442 
  4443     self withWaitCursorDo:[
  4443     self withWaitCursorDo:[
  4444         |index cls|
  4444 	|index cls|
  4445 
  4445 
  4446         self updateCodeView.
  4446 	self updateCodeView.
  4447         aspect := nil.
  4447 	aspect := nil.
  4448         self setAcceptAndExplainActionsForMethod.
  4448 	self setAcceptAndExplainActionsForMethod.
  4449 
  4449 
  4450         "
  4450 	"
  4451          if there is any autoSearch string, do the search
  4451 	 if there is any autoSearch string, do the search
  4452         "
  4452 	"
  4453         autoSearch notNil ifTrue:[
  4453 	autoSearch notNil ifTrue:[
  4454             codeView searchFwd:autoSearch startingAtLine:1 col:0 ifAbsent:[]
  4454 	    codeView searchFwd:autoSearch startingAtLine:1 col:0 ifAbsent:[]
  4455         ].
  4455 	].
  4456 
  4456 
  4457         fullProtocol ifTrue:[
  4457 	fullProtocol ifTrue:[
  4458             "
  4458 	    "
  4459              remove any bold attribute from classList
  4459 	     remove any bold attribute from classList
  4460             "
  4460 	    "
  4461             1 to:classListView list size do:[:i |
  4461 	    1 to:classListView list size do:[:i |
  4462                 classListView attributeAt:i remove:#bold.
  4462 		classListView attributeAt:i remove:#bold.
  4463             ].
  4463 	    ].
  4464             "
  4464 	    "
  4465              boldify the class where this method is implemented
  4465 	     boldify the class where this method is implemented
  4466             "
  4466 	    "
  4467             currentMethod notNil ifTrue:[
  4467 	    currentMethod notNil ifTrue:[
  4468                 cls := currentMethod who at:1.
  4468 		cls := currentMethod who at:1.
  4469                 index := classListView list indexOf:(cls name).
  4469 		index := classListView list indexOf:(cls name).
  4470                 (index == 0 
  4470 		(index == 0 
  4471                  and:[cls isMeta
  4471 		 and:[cls isMeta
  4472                  and:[cls name endsWith:'class']]) ifTrue:[
  4472 		 and:[cls name endsWith:'class']]) ifTrue:[
  4473                     index := classListView list indexOf:(cls name copyWithoutLast:5).
  4473 		    index := classListView list indexOf:(cls name copyWithoutLast:5).
  4474                 ].
  4474 		].
  4475                 index ~~ 0 ifTrue:[
  4475 		index ~~ 0 ifTrue:[
  4476                     classListView attributeAt:index add:#bold.
  4476 		    classListView attributeAt:index add:#bold.
  4477                 ].
  4477 		].
  4478                 currentClass := acceptClass := cls.
  4478 		currentClass := acceptClass := cls.
  4479             ]
  4479 	    ]
  4480         ].
  4480 	].
  4481     ]
  4481     ]
  4482 
  4482 
  4483     "Created: 23.11.1995 / 14:17:44 / cg"
  4483     "Created: 23.11.1995 / 14:17:44 / cg"
  4484 !
  4484 !
  4485 
  4485 
  4690 
  4690 
  4691 updateCodeView
  4691 updateCodeView
  4692     |code|
  4692     |code|
  4693 
  4693 
  4694     fullClass ifTrue:[
  4694     fullClass ifTrue:[
  4695         currentClass notNil ifTrue:[
  4695 	currentClass notNil ifTrue:[
  4696             code := currentClass source.
  4696 	    code := currentClass source.
  4697         ]
  4697 	]
  4698     ] ifFalse:[
  4698     ] ifFalse:[
  4699         currentMethod notNil ifTrue:[
  4699 	currentMethod notNil ifTrue:[
  4700             (codeView acceptAction isNil
  4700 	    (codeView acceptAction isNil
  4701             and:[actualClass notNil 
  4701 	    and:[actualClass notNil 
  4702             and:[currentMethodCategory notNil]]) ifTrue:[
  4702 	    and:[currentMethodCategory notNil]]) ifTrue:[
  4703                 self setAcceptAndExplainActionsForMethod.
  4703 		self setAcceptAndExplainActionsForMethod.
  4704             ].
  4704 	    ].
  4705 
  4705 
  4706             code := currentMethod source.
  4706 	    code := currentMethod source.
  4707 
  4707 
  4708         ]
  4708 	]
  4709     ].
  4709     ].
  4710     codeView contents:code.
  4710     codeView contents:code.
  4711     codeView modified:false.
  4711     codeView modified:false.
  4712 
  4712 
  4713     self normalLabel.
  4713     self normalLabel.
  4773 
  4773 
  4774     |string|
  4774     |string|
  4775 
  4775 
  4776     string := self askForSelectorTitle:title.
  4776     string := self askForSelectorTitle:title.
  4777     string notNil ifTrue:[
  4777     string notNil ifTrue:[
  4778         self withSearchCursorDo:[
  4778 	self withSearchCursorDo:[
  4779             SystemBrowser perform:selector with:string
  4779 	    SystemBrowser perform:selector with:string
  4780         ]
  4780 	]
  4781     ].
  4781     ].
  4782 
  4782 
  4783     "Created: 23.11.1995 / 14:11:34 / cg"
  4783     "Created: 23.11.1995 / 14:11:34 / cg"
  4784 !
  4784 !
  4785 
  4785 
  4789 
  4789 
  4790     |string|
  4790     |string|
  4791 
  4791 
  4792     string := self askForSelectorTitle:title.
  4792     string := self askForSelectorTitle:title.
  4793     string notNil ifTrue:[
  4793     string notNil ifTrue:[
  4794         self withSearchCursorDo:[
  4794 	self withSearchCursorDo:[
  4795             SystemBrowser perform:selector with:string with:arg
  4795 	    SystemBrowser perform:selector with:string with:arg
  4796         ]
  4796 	]
  4797     ].
  4797     ].
  4798 
  4798 
  4799     "Created: 23.11.1995 / 14:11:38 / cg"
  4799     "Created: 23.11.1995 / 14:11:38 / cg"
  4800 !
  4800 !
  4801 
  4801 
  4802 busyLabel:what with:someArgument
  4802 busyLabel:what with:someArgument
  4803     "set the title for some warning"
  4803     "set the title for some warning"
  4804 
  4804 
  4805     self label:('System Browser - ' , (resources string:what with:someArgument))
  4805     self label:('System Browser - ' , (resources string:what with:someArgument))
       
  4806 !
       
  4807 
       
  4808 checkSelectionChangeAllowedWithCompare:compareOffered
       
  4809     "return true, if selection change is ok;
       
  4810      its not ok, if code has been changed.
       
  4811      in this case, return the result of a user query"
       
  4812 
       
  4813     |action labels values|
       
  4814 
       
  4815     codeView modified ifFalse:[
       
  4816 	^ true
       
  4817     ].
       
  4818 
       
  4819     compareOffered ifTrue:[
       
  4820 	labels := #('abort' 'compare' 'accept' 'continue').
       
  4821 	values := #(false #compare #accept true).
       
  4822     ] ifFalse:[
       
  4823 	labels := #('abort' 'accept' 'continue').
       
  4824 	values := #(false #accept true).
       
  4825     ].
       
  4826 
       
  4827     action := OptionBox 
       
  4828 		  request:(resources at:'text has not been accepted.\\Your modifications will be lost when continuing.') withCRs
       
  4829 		  label:(resources string:'Attention')
       
  4830 		  form:(WarningBox iconBitmap)
       
  4831 		  buttonLabels:(resources array:labels)
       
  4832 		  values:values
       
  4833 		  default:true.
       
  4834     action ~~ #accept ifTrue:[
       
  4835 	^ action
       
  4836     ].
       
  4837     codeView accept. 
       
  4838     ^ true
       
  4839 
       
  4840     "Created: 24.11.1995 / 10:54:46 / cg"
  4806 !
  4841 !
  4807 
  4842 
  4808 checkSelectionChangeAllowed
  4843 checkSelectionChangeAllowed
  4809     "return true, if selection change is ok;
  4844     "return true, if selection change is ok;
  4810      its not ok, if code has been changed.
  4845      its not ok, if code has been changed.
  4811      in this case, return the result of a user query"
  4846      in this case, return the result of a user query"
  4812 
  4847 
  4813     |action|
  4848     |what m src v|
  4814 
  4849 
  4815     codeView modified ifFalse:[
  4850     currentMethod notNil ifTrue:[
  4816 	^ true
  4851 	m := actualClass compiledMethodAt:currentSelector.
  4817     ].
  4852 	(src := m source) = codeView contents ifFalse:[
  4818     action := OptionBox 
  4853 	    what := self checkSelectionChangeAllowedWithCompare:true.
  4819 		  request:(resources at:'text has not been accepted.\\Your modifications will be lost when continuing.') withCRs
  4854 	    what == #compare ifTrue:[
  4820 		  label:(resources string:'Attention')
  4855 		v := DiffTextView 
  4821 		  form:(WarningBox iconBitmap)
  4856 			openOn:codeView contents label:'code here (to be accepted ?)'
  4822 		  buttonLabels:(resources array:#('abort' 'accept' 'continue'))
  4857 			and:src label:'methods actual code'.
  4823 		  values:#(false #accept true)
  4858 		v label:'comparing method versions'.
  4824 		  default:true.
  4859 		^ false
  4825     action ~~ #accept ifTrue:[
  4860 	    ].
  4826 	^ action
  4861 	    ^ what
  4827     ].
  4862 	]
  4828     codeView accept. ^ true
  4863     ].
       
  4864 
       
  4865     ^ self checkSelectionChangeAllowedWithCompare:false
       
  4866 
       
  4867     "Created: 24.11.1995 / 11:03:33 / cg"
       
  4868     "Modified: 24.11.1995 / 11:05:49 / cg"
  4829 !
  4869 !
  4830 
  4870 
  4831 classHierarchyDo:aBlock
  4871 classHierarchyDo:aBlock
  4832     "eavluate the 2-arg block for every class,
  4872     "eavluate the 2-arg block for every class,
  4833      starting at Object; passing class and nesting level to the block."
  4873      starting at Object; passing class and nesting level to the block."
  5289 
  5329 
  5290 allClassOrInstVarRefsTitle:title access:access mods:modifications
  5330 allClassOrInstVarRefsTitle:title access:access mods:modifications
  5291     "show an enterbox for instVar to search for"
  5331     "show an enterbox for instVar to search for"
  5292 
  5332 
  5293     self doClassMenu:[:currentClass |
  5333     self doClassMenu:[:currentClass |
  5294         |box|
  5334 	|box|
  5295 
  5335 
  5296         box := self enterBoxForVariableSearch:title.
  5336 	box := self enterBoxForVariableSearch:title.
  5297         box action:[:aVariableName |
  5337 	box action:[:aVariableName |
  5298             |homeClass|
  5338 	    |homeClass|
  5299 
  5339 
  5300             aVariableName isEmpty ifFalse:[
  5340 	    aVariableName isEmpty ifFalse:[
  5301                 self withSearchCursorDo:[
  5341 		self withSearchCursorDo:[
  5302                     homeClass := self findClassOfVariable:aVariableName accessWith:access.
  5342 		    homeClass := self findClassOfVariable:aVariableName accessWith:access.
  5303                     access == #classVarNames ifTrue:[
  5343 		    access == #classVarNames ifTrue:[
  5304                         SystemBrowser 
  5344 			SystemBrowser 
  5305                             browseClassRefsTo:aVariableName 
  5345 			    browseClassRefsTo:aVariableName 
  5306                             under:homeClass 
  5346 			    under:homeClass 
  5307                             modificationsOnly:modifications
  5347 			    modificationsOnly:modifications
  5308                     ] ifFalse:[
  5348 		    ] ifFalse:[
  5309                         SystemBrowser 
  5349 			SystemBrowser 
  5310                             browseInstRefsTo:aVariableName 
  5350 			    browseInstRefsTo:aVariableName 
  5311                             under:homeClass 
  5351 			    under:homeClass 
  5312                             modificationsOnly:modifications
  5352 			    modificationsOnly:modifications
  5313                     ]
  5353 		    ]
  5314                 ]
  5354 		]
  5315             ]
  5355 	    ]
  5316         ].
  5356 	].
  5317         box showAtPointer
  5357 	box showAtPointer
  5318     ]
  5358     ]
  5319 
  5359 
  5320     "Created: 23.11.1995 / 14:13:24 / cg"
  5360     "Created: 23.11.1995 / 14:13:24 / cg"
  5321 !
  5361 !
  5322 
  5362 
  5368 
  5408 
  5369 classVarRefsOrModsTitle:title mods:mods
  5409 classVarRefsOrModsTitle:title mods:mods
  5370     "show an enterbox for classVar to search for"
  5410     "show an enterbox for classVar to search for"
  5371 
  5411 
  5372     self doClassMenu:[:currentClass |
  5412     self doClassMenu:[:currentClass |
  5373         |box|
  5413 	|box|
  5374 
  5414 
  5375         box := self enterBoxForVariableSearch:title.
  5415 	box := self enterBoxForVariableSearch:title.
  5376         box action:[:aString |
  5416 	box action:[:aString |
  5377             aString notEmpty ifTrue:[
  5417 	    aString notEmpty ifTrue:[
  5378                 self withSearchCursorDo:[
  5418 		self withSearchCursorDo:[
  5379                     SystemBrowser 
  5419 		    SystemBrowser 
  5380                            browseClassRefsTo:aString
  5420 			   browseClassRefsTo:aString
  5381                            in:(Array with:currentClass)
  5421 			   in:(Array with:currentClass)
  5382                            modificationsOnly:mods 
  5422 			   modificationsOnly:mods 
  5383                 ]
  5423 		]
  5384             ]
  5424 	    ]
  5385         ].
  5425 	].
  5386         box showAtPointer
  5426 	box showAtPointer
  5387     ]
  5427     ]
  5388 
  5428 
  5389     "Created: 23.11.1995 / 14:12:56 / cg"
  5429     "Created: 23.11.1995 / 14:12:56 / cg"
  5390 !
  5430 !
  5391 
  5431 
  5421 
  5461 
  5422 instVarRefsOrModsTitle:title mods:mods
  5462 instVarRefsOrModsTitle:title mods:mods
  5423     "show an enterbox for instvar to search for"
  5463     "show an enterbox for instvar to search for"
  5424 
  5464 
  5425     self doClassMenu:[:currentClass |
  5465     self doClassMenu:[:currentClass |
  5426         |box|
  5466 	|box|
  5427 
  5467 
  5428         box := self enterBoxForVariableSearch:title.
  5468 	box := self enterBoxForVariableSearch:title.
  5429         box action:[:aString |
  5469 	box action:[:aString |
  5430             aString notEmpty ifTrue:[
  5470 	    aString notEmpty ifTrue:[
  5431                 self withSearchCursorDo:[
  5471 		self withSearchCursorDo:[
  5432                     SystemBrowser 
  5472 		    SystemBrowser 
  5433                         browseInstRefsTo:aString
  5473 			browseInstRefsTo:aString
  5434                         in:(Array with:currentClass)
  5474 			in:(Array with:currentClass)
  5435                         modificationsOnly:mods 
  5475 			modificationsOnly:mods 
  5436                 ]
  5476 		]
  5437             ]
  5477 	    ]
  5438         ].
  5478 	].
  5439         box showAtPointer
  5479 	box showAtPointer
  5440     ]
  5480     ]
  5441 
  5481 
  5442     "Created: 23.11.1995 / 14:12:40 / cg"
  5482     "Created: 23.11.1995 / 14:12:40 / cg"
  5443 !
  5483 !
  5444 
  5484 
  5655 
  5695 
  5656     name := variableListView selectionValue.
  5696     name := variableListView selectionValue.
  5657     name isNil ifTrue:[^ self].
  5697     name isNil ifTrue:[^ self].
  5658 
  5698 
  5659     self withSearchCursorDo:[
  5699     self withSearchCursorDo:[
  5660         |classes filter any|
  5700 	|classes filter any|
  5661 
  5701 
  5662         classes := Array with:actualClass.
  5702 	classes := Array with:actualClass.
  5663         currentClassHierarchy notNil ifTrue:[
  5703 	currentClassHierarchy notNil ifTrue:[
  5664             classes := classes , actualClass allSuperclasses.
  5704 	    classes := classes , actualClass allSuperclasses.
  5665             redefinedSelectors := IdentitySet new.
  5705 	    redefinedSelectors := IdentitySet new.
  5666         ].
  5706 	].
  5667 
  5707 
  5668         filter := SystemBrowser filterToSearchRefsTo:name classVars:showInstance not modificationsOnly:false. 
  5708 	filter := SystemBrowser filterToSearchRefsTo:name classVars:showInstance not modificationsOnly:false. 
  5669 
  5709 
  5670         any := false.
  5710 	any := false.
  5671         "
  5711 	"
  5672          highlight the method that ref this variable
  5712 	 highlight the method that ref this variable
  5673         "
  5713 	"
  5674         classes do:[:someClass |
  5714 	classes do:[:someClass |
  5675             (fullProtocol
  5715 	    (fullProtocol
  5676             and:[classListView valueIsInSelection:(someClass name)]) ifFalse:[
  5716 	    and:[classListView valueIsInSelection:(someClass name)]) ifFalse:[
  5677                 someClass methodArray with:someClass selectorArray 
  5717 		someClass methodArray with:someClass selectorArray 
  5678                 do:[:method :selector |
  5718 		do:[:method :selector |
  5679 
  5719 
  5680                     (inCat
  5720 		    (inCat
  5681                     or:[methodListView list notNil
  5721 		    or:[methodListView list notNil
  5682                         and:[methodListView list includes:selector]])
  5722 			and:[methodListView list includes:selector]])
  5683                     ifTrue:[
  5723 		    ifTrue:[
  5684                         (redefinedSelectors isNil
  5724 			(redefinedSelectors isNil
  5685                         or:[(redefinedSelectors includes:selector) not])
  5725 			or:[(redefinedSelectors includes:selector) not])
  5686                        ifTrue:[
  5726 		       ifTrue:[
  5687                            (filter value:someClass value:method value:selector) ifTrue:[
  5727 			   (filter value:someClass value:method value:selector) ifTrue:[
  5688                                |idx cat|
  5728 			       |idx cat|
  5689 
  5729 
  5690                                (inCat
  5730 			       (inCat
  5691                                and:[methodCategoryListView notNil 
  5731 			       and:[methodCategoryListView notNil 
  5692                                and:[methodCategoryListView list notNil]]) ifTrue:[
  5732 			       and:[methodCategoryListView list notNil]]) ifTrue:[
  5693                                    cat := method category.
  5733 				   cat := method category.
  5694                                    "
  5734 				   "
  5695                                     highlight the methodCategory
  5735 				    highlight the methodCategory
  5696                                    "
  5736 				   "
  5697                                    idx := methodCategoryListView list indexOf:cat.
  5737 				   idx := methodCategoryListView list indexOf:cat.
  5698                                    idx ~~ 0 ifTrue:[
  5738 				   idx ~~ 0 ifTrue:[
  5699                                        methodCategoryListView attributeAt:idx put:#bold.
  5739 				       methodCategoryListView attributeAt:idx put:#bold.
  5700                                    ].
  5740 				   ].
  5701                                ].
  5741 			       ].
  5702 
  5742 
  5703                                (inMethods
  5743 			       (inMethods
  5704                                and:[methodListView notNil 
  5744 			       and:[methodListView notNil 
  5705                                and:[methodListView list notNil]]) ifTrue:[
  5745 			       and:[methodListView list notNil]]) ifTrue:[
  5706                                    "
  5746 				   "
  5707                                     highlight the method
  5747 				    highlight the method
  5708                                    "
  5748 				   "
  5709                                    idx := methodListView list indexOf:selector.
  5749 				   idx := methodListView list indexOf:selector.
  5710                                    idx ~~ 0 ifTrue:[
  5750 				   idx ~~ 0 ifTrue:[
  5711                                        methodListView attributeAt:idx put:#bold.
  5751 				       methodListView attributeAt:idx put:#bold.
  5712                                    ].
  5752 				   ].
  5713                                    any := true
  5753 				   any := true
  5714                                ].
  5754 			       ].
  5715                            ].
  5755 			   ].
  5716                            redefinedSelectors notNil ifTrue:[
  5756 			   redefinedSelectors notNil ifTrue:[
  5717                                redefinedSelectors add:selector
  5757 			       redefinedSelectors add:selector
  5718                            ]
  5758 			   ]
  5719                         ]
  5759 			]
  5720                     ]
  5760 		    ]
  5721                 ]
  5761 		]
  5722             ]
  5762 	    ]
  5723         ].
  5763 	].
  5724         any ifTrue:[
  5764 	any ifTrue:[
  5725             self setSearchPattern:name
  5765 	    self setSearchPattern:name
  5726         ]
  5766 	]
  5727     ]
  5767     ]
  5728 
  5768 
  5729     "Created: 23.11.1995 / 14:12:08 / cg"
  5769     "Created: 23.11.1995 / 14:12:08 / cg"
  5730 !
  5770 !
  5731 
  5771 
  5818 ! !
  5858 ! !
  5819 
  5859 
  5820 !BrowserView class methodsFor:'documentation'!
  5860 !BrowserView class methodsFor:'documentation'!
  5821 
  5861 
  5822 version
  5862 version
  5823 ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.48 1995-11-23 17:50:00 cg Exp $'! !
  5863 ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.49 1995-11-24 10:30:53 cg Exp $'! !
  5824 BrowserView initialize!
  5864 BrowserView initialize!