BrowserView.st
changeset 2840 9806b72e36f9
parent 2833 5bceae325a3e
child 2859 52d100fdd8e6
equal deleted inserted replaced
2839:a9e69d353cb8 2840:9806b72e36f9
   955         ].
   955         ].
   956     ]
   956     ]
   957 
   957 
   958     "Created: / 4.1.1997 / 13:54:00 / cg"
   958     "Created: / 4.1.1997 / 13:54:00 / cg"
   959     "Modified: / 30.7.1998 / 17:33:03 / cg"
   959     "Modified: / 30.7.1998 / 17:33:03 / cg"
   960     "Modified: / 27.10.1998 / 12:02:05 / ps"!
   960     "Modified: / 27.10.1998 / 12:02:05 / ps"
       
   961 !
   961 
   962 
   962 refetchClass
   963 refetchClass
   963     "after a class definition change in another browser,
   964     "after a class definition change in another browser,
   964      this is sent to update (otherwise, we'd still refer to the obsolete class)"
   965      this is sent to update (otherwise, we'd still refer to the obsolete class)"
   965 
   966 
   971 "/    ] ifFalse:[
   972 "/    ] ifFalse:[
   972 "/        actualClass := currentClass class
   973 "/        actualClass := currentClass class
   973 "/    ].
   974 "/    ].
   974 
   975 
   975     "Created: / 8.2.1996 / 13:22:27 / cg"
   976     "Created: / 8.2.1996 / 13:22:27 / cg"
   976     "Modified: / 17.6.1998 / 16:51:14 / cg"!
   977     "Modified: / 17.6.1998 / 16:51:14 / cg"
       
   978 !
   977 
   979 
   978 update:something with:someArgument from:changedObject
   980 update:something with:someArgument from:changedObject
   979     "enqueue a delayed update"
   981     "enqueue a delayed update"
   980 
   982 
   981     |argList sensor|
   983     |argList sensor|
  1049             ].
  1051             ].
  1050         ].
  1052         ].
  1051     ]
  1053     ]
  1052 
  1054 
  1053     "Created: 14.9.1995 / 10:55:20 / claus"
  1055     "Created: 14.9.1995 / 10:55:20 / claus"
  1054     "Modified: 14.9.1995 / 10:59:31 / claus"!
  1056     "Modified: 14.9.1995 / 10:59:31 / claus"
       
  1057 !
  1055 
  1058 
  1056 classCategoryFileOut
  1059 classCategoryFileOut
  1057     "create a file 'categoryName.st' consisting of all classes in current category
  1060     "create a file 'categoryName.st' consisting of all classes in current category
  1058      into the current projects defaultDirectory."
  1061      into the current projects defaultDirectory."
  1059 
  1062 
  1437                     ].
  1440                     ].
  1438 
  1441 
  1439         box showAtPointer.
  1442         box showAtPointer.
  1440     ] valueWithRestart
  1443     ] valueWithRestart
  1441 
  1444 
  1442     "Modified: / 25.1.2000 / 21:51:59 / cg"!
  1445     "Modified: / 25.1.2000 / 21:51:59 / cg"
       
  1446 !
  1443 
  1447 
  1444 classCategoryMenu
  1448 classCategoryMenu
  1445 
  1449 
  1446     <resource: #keyboard ( #Find #Cmdn) >
  1450     <resource: #keyboard ( #Find #Cmdn) >
  1447     <resource: #programMenu >
  1451     <resource: #programMenu >
  1642             aClass printOutProtocolOn:printStream.
  1646             aClass printOutProtocolOn:printStream.
  1643             printStream close
  1647             printStream close
  1644         ]
  1648         ]
  1645     ]
  1649     ]
  1646 
  1650 
  1647     "Modified: 16.1.1997 / 20:22:12 / cg"!
  1651     "Modified: 16.1.1997 / 20:22:12 / cg"
       
  1652 !
  1648 
  1653 
  1649 classCategoryRemove
  1654 classCategoryRemove
  1650     "remove all classes in current category"
  1655     "remove all classes in current category"
  1651 
  1656 
  1652     |count overallCount t classesToRemove subclassesRemoved box t2|
  1657     |count overallCount t classesToRemove subclassesRemoved box t2|
  1795             brwsr := SystemBrowser browseClassCategory:currentClassCategory.
  1800             brwsr := SystemBrowser browseClassCategory:currentClassCategory.
  1796             brwsr environment:environment
  1801             brwsr environment:environment
  1797         ]
  1802         ]
  1798     ]
  1803     ]
  1799 
  1804 
  1800     "Modified: 18.8.1997 / 15:42:58 / cg"!
  1805     "Modified: 18.8.1997 / 15:42:58 / cg"
       
  1806 !
  1801 
  1807 
  1802 classCategorySpawnExtensions
  1808 classCategorySpawnExtensions
  1803     "create a new SystemBrowser browsing all extensions"
  1809     "create a new SystemBrowser browsing all extensions"
  1804 
  1810 
  1805     self withBusyCursorDo:[
  1811     self withBusyCursorDo:[
  1838             brwsr switchToClassNamed:(currentClass name)
  1844             brwsr switchToClassNamed:(currentClass name)
  1839         ]
  1845         ]
  1840 " "
  1846 " "
  1841     ]
  1847     ]
  1842 
  1848 
  1843     "Modified: 18.8.1997 / 15:43:01 / cg"!
  1849     "Modified: 18.8.1997 / 15:43:01 / cg"
       
  1850 !
  1844 
  1851 
  1845 classCategoryUpdate
  1852 classCategoryUpdate
  1846     "update class category list and dependants"
  1853     "update class category list and dependants"
  1847 
  1854 
  1848     |oldClass oldClassName oldMethodCategory newClass|
  1855     |oldClass oldClassName oldMethodCategory newClass|
  1884         ].
  1891         ].
  1885 
  1892 
  1886         self updateNamespaceList
  1893         self updateNamespaceList
  1887     ]
  1894     ]
  1888 
  1895 
  1889     "Modified: / 10.4.1998 / 12:25:38 / cg"! !
  1896     "Modified: / 10.4.1998 / 12:25:38 / cg"
       
  1897 ! !
  1890 
  1898 
  1891 !BrowserView methodsFor:'class category source administration'!
  1899 !BrowserView methodsFor:'class category source administration'!
  1892 
  1900 
  1893 classCategoryCheckinEach
  1901 classCategoryCheckinEach
  1894     (self checkSelectionChangeAllowedWithCompare:false) ifFalse:[^ self].
  1902     (self checkSelectionChangeAllowedWithCompare:false) ifFalse:[^ self].
  2386             self normalLabel.
  2394             self normalLabel.
  2387         ]
  2395         ]
  2388     ]
  2396     ]
  2389 
  2397 
  2390     "Modified: / 16.1.1998 / 17:12:24 / stefan"
  2398     "Modified: / 16.1.1998 / 17:12:24 / stefan"
  2391     "Modified: / 10.4.1998 / 12:25:34 / cg"!
  2399     "Modified: / 10.4.1998 / 12:25:34 / cg"
       
  2400 !
  2392 
  2401 
  2393 classCategorySelectionChanged
  2402 classCategorySelectionChanged
  2394     "class category has changed - update dependent views"
  2403     "class category has changed - update dependent views"
  2395 
  2404 
  2396     self withBusyCursorDo:[
  2405     self withBusyCursorDo:[
  2461         newList add:'* all *'; add:'* hierarchy *'.
  2470         newList add:'* all *'; add:'* hierarchy *'.
  2462     ].
  2471     ].
  2463 
  2472 
  2464     ^ newList asOrderedCollection sort.
  2473     ^ newList asOrderedCollection sort.
  2465 
  2474 
  2466     "Modified: 5.1.1997 / 17:12:01 / cg"!
  2475     "Modified: 5.1.1997 / 17:12:01 / cg"
       
  2476 !
  2467 
  2477 
  2468 renameCurrentClassCategoryTo:aString
  2478 renameCurrentClassCategoryTo:aString
  2469     "helper - do the rename"
  2479     "helper - do the rename"
  2470 
  2480 
  2471     |any categories|
  2481     |any categories|
  2559         self updateMethodCategoryList.
  2569         self updateMethodCategoryList.
  2560         self switchToMethodNamed:aSelectorString.
  2570         self switchToMethodNamed:aSelectorString.
  2561     ].
  2571     ].
  2562 
  2572 
  2563     "Modified: / 1.9.1995 / 01:39:58 / claus"
  2573     "Modified: / 1.9.1995 / 01:39:58 / claus"
  2564     "Modified: / 25.1.2000 / 20:43:35 / cg"!
  2574     "Modified: / 25.1.2000 / 20:43:35 / cg"
       
  2575 !
  2565 
  2576 
  2566 updateClassCategoryList
  2577 updateClassCategoryList
  2567     self updateClassCategoryListWithScroll:true.
  2578     self updateClassCategoryListWithScroll:true.
  2568 
  2579 
  2569     "Modified: 8.1.1997 / 10:58:06 / cg"
  2580     "Modified: 8.1.1997 / 10:58:06 / cg"
  2941         ].
  2952         ].
  2942         aspect := #definition.
  2953         aspect := #definition.
  2943         self normalLabel
  2954         self normalLabel
  2944     ]
  2955     ]
  2945 
  2956 
  2946     "Modified: / 18.7.1998 / 22:52:50 / cg"!
  2957     "Modified: / 18.7.1998 / 22:52:50 / cg"
       
  2958 !
  2947 
  2959 
  2948 classDerivedInstancesInspect
  2960 classDerivedInstancesInspect
  2949     "inspect the current classes derived instances"
  2961     "inspect the current classes derived instances"
  2950 
  2962 
  2951     |insts|
  2963     |insts|
  3328 classMakePublic
  3340 classMakePublic
  3329     "change a class from private to public;
  3341     "change a class from private to public;
  3330      check if a public class with the same name exists,
  3342      check if a public class with the same name exists,
  3331      before doing this."
  3343      before doing this."
  3332 
  3344 
  3333     (Smalltalk classNamed:(currentClass nameWithoutPrefix)) notNil ifTrue:[
  3345     |ns baseName|
  3334 	self warn:(resources
  3346 
  3335 			string:'a public class named ''%1'' already exists.\\Please remove/rename that one first,\or rename the private class ''%1'' here\and try again.'
  3347     baseName := currentClass nameWithoutPrefix.
  3336 			with:currentClass nameWithoutPrefix) withCRs.
  3348     (ns := currentClass topOwningClass nameSpace) ~~ Smalltalk ifTrue:[
  3337 	^ self
  3349         ns := Dialog confirmWithCancel:(resources string:'Make public in ''Smalltalk'' or in its nameSpace ''%1'' ?' with:ns name)
  3338     ].
  3350                 labels:(Array with:'cancel' with:'in Smalltalk' with:'in ' , ns name)
  3339 
  3351                 values:(Array with:nil with:Smalltalk with:ns)
  3340     currentClass makePublic
  3352                 default:3.
       
  3353         ns isNil ifTrue:[^ self].
       
  3354     ].
       
  3355 
       
  3356     (ns classNamed:baseName) notNil ifTrue:[
       
  3357         self warn:(resources
       
  3358                         string:'A public class named ''%1'' already exists in %2.\\Please remove/rename that one first,\or rename the private class ''%1'' here\and try again.'
       
  3359                         with:baseName with:ns name) withCRs.
       
  3360         ^ self
       
  3361     ].
       
  3362 
       
  3363     currentClass makePublicIn:ns
  3341 
  3364 
  3342     "Modified: 3.7.1997 / 13:26:21 / cg"
  3365     "Modified: 3.7.1997 / 13:26:21 / cg"
  3343 !
  3366 !
  3344 
  3367 
  3345 classMenu
  3368 classMenu
  4075         ]
  4098         ]
  4076     ].
  4099     ].
  4077     self doClassMenu:[:currentClass | aBlock value:currentClass value:sel]
  4100     self doClassMenu:[:currentClass | aBlock value:currentClass value:sel]
  4078 
  4101 
  4079     "Modified: 17.6.1996 / 16:51:49 / stefan"
  4102     "Modified: 17.6.1996 / 16:51:49 / stefan"
  4080     "Modified: 18.8.1997 / 15:44:01 / cg"! !
  4103     "Modified: 18.8.1997 / 15:44:01 / cg"
       
  4104 ! !
  4081 
  4105 
  4082 !BrowserView methodsFor:'class list source administration'!
  4106 !BrowserView methodsFor:'class list source administration'!
  4083 
  4107 
  4084 classCheckin
  4108 classCheckin
  4085     "check a class into the source repository"
  4109     "check a class into the source repository"
  4712                     ]
  4736                     ]
  4713                 ]
  4737                 ]
  4714             ]
  4738             ]
  4715         ]
  4739         ]
  4716     ].
  4740     ].
  4717     ^ classes!
  4741     ^ classes
       
  4742 !
  4718 
  4743 
  4719 allClassesInCategory:aCategory
  4744 allClassesInCategory:aCategory
  4720     |classes|
  4745     |classes|
  4721 
  4746 
  4722     currentNamespace = '* all *' ifTrue:[
  4747     currentNamespace = '* all *' ifTrue:[
  4745         ]
  4770         ]
  4746     ].
  4771     ].
  4747     ^ classes
  4772     ^ classes
  4748 
  4773 
  4749     "Created: 23.12.1996 / 10:26:28 / cg"
  4774     "Created: 23.12.1996 / 10:26:28 / cg"
  4750     "Modified: 23.12.1996 / 11:33:13 / cg"!
  4775     "Modified: 23.12.1996 / 11:33:13 / cg"
       
  4776 !
  4751 
  4777 
  4752 allClassesInCategory:aCategory do:aBlock
  4778 allClassesInCategory:aCategory do:aBlock
  4753     |classes|
  4779     |classes|
  4754 
  4780 
  4755     classes := self allClassesInCategory:aCategory.
  4781     classes := self allClassesInCategory:aCategory.
  4788             aBlock value:aClass
  4814             aBlock value:aClass
  4789         ]
  4815         ]
  4790     ]
  4816     ]
  4791 
  4817 
  4792     "Created: / 16.1.1997 / 20:18:47 / cg"
  4818     "Created: / 16.1.1997 / 20:18:47 / cg"
  4793     "Modified: / 18.6.1998 / 15:06:23 / cg"!
  4819     "Modified: / 18.6.1998 / 15:06:23 / cg"
       
  4820 !
  4794 
  4821 
  4795 changeCurrentClass:newClass
  4822 changeCurrentClass:newClass
  4796     "change the current class to some other class;
  4823     "change the current class to some other class;
  4797      keep instance protocol as it was.
  4824      keep instance protocol as it was.
  4798      This does not update any views."
  4825      This does not update any views."
  5030 
  5057 
  5031     actualClass notNil ifTrue:[
  5058     actualClass notNil ifTrue:[
  5032         self addToClassHistory: actualClass name asString
  5059         self addToClassHistory: actualClass name asString
  5033     ]
  5060     ]
  5034 
  5061 
  5035     "Modified: / 10.2.2000 / 14:14:18 / cg"!
  5062     "Modified: / 10.2.2000 / 14:14:18 / cg"
       
  5063 !
  5036 
  5064 
  5037 classSelectionChanged
  5065 classSelectionChanged
  5038     |oldMethodCategory oldMethod oldSelector|
  5066     |oldMethodCategory oldMethod oldSelector|
  5039 
  5067 
  5040     self withBusyCursorDo:[
  5068     self withBusyCursorDo:[
  5102 
  5130 
  5103         self setDoitActionForClass
  5131         self setDoitActionForClass
  5104     ]
  5132     ]
  5105 
  5133 
  5106     "Created: / 23.11.1995 / 11:32:03 / cg"
  5134     "Created: / 23.11.1995 / 11:32:03 / cg"
  5107     "Modified: / 24.2.2000 / 15:50:17 / cg"!
  5135     "Modified: / 24.2.2000 / 15:50:17 / cg"
       
  5136 !
  5108 
  5137 
  5109 classTemplateFor:aSuperClass in:categoryString namespace:isNameSpace private:isPrivate
  5138 classTemplateFor:aSuperClass in:categoryString namespace:isNameSpace private:isPrivate
  5110     "return a class definition template - be smart in what is offered initially"
  5139     "return a class definition template - be smart in what is offered initially"
  5111 
  5140 
  5112     |cat name nameProto namePrefix i existingNames withNameSpaceDirective
  5141     |cat name nameProto namePrefix i existingNames withNameSpaceDirective
  5474     ].
  5503     ].
  5475 
  5504 
  5476     ^ listOfClassNames
  5505     ^ listOfClassNames
  5477 
  5506 
  5478     "Created: 10.1.1997 / 13:57:34 / cg"
  5507     "Created: 10.1.1997 / 13:57:34 / cg"
  5479     "Modified: 22.3.1997 / 14:03:36 / cg"!
  5508     "Modified: 22.3.1997 / 14:03:36 / cg"
       
  5509 !
  5480 
  5510 
  5481 listOfClassNameHierarchyOf:aClass
  5511 listOfClassNameHierarchyOf:aClass
  5482     "return a hierarchy class-list"
  5512     "return a hierarchy class-list"
  5483 
  5513 
  5484     |startClass classes thisOne|
  5514     |startClass classes thisOne|
  5496         classes := classes , startClass allSubclassesInOrder
  5526         classes := classes , startClass allSubclassesInOrder
  5497     ].
  5527     ].
  5498     ^ classes collect:[:c | self displayedClassNameOf:c "c name"]
  5528     ^ classes collect:[:c | self displayedClassNameOf:c "c name"]
  5499 
  5529 
  5500     "Created: 10.1.1997 / 14:01:06 / cg"
  5530     "Created: 10.1.1997 / 14:01:06 / cg"
  5501     "Modified: 30.7.1997 / 17:47:24 / cg"!
  5531     "Modified: 30.7.1997 / 17:47:24 / cg"
       
  5532 !
  5502 
  5533 
  5503 renameCurrentClassTo:newNameString
  5534 renameCurrentClassTo:newNameString
  5504     "helper - do the class-rename"
  5535     "helper - do the class-rename"
  5505 
  5536 
  5506     self doClassMenu:[:currentClass |
  5537     self doClassMenu:[:currentClass |
  5686         className := className copyReplaceAll:$. with:$/
  5717         className := className copyReplaceAll:$. with:$/
  5687     ].
  5718     ].
  5688     self switchToClassNamed:className.
  5719     self switchToClassNamed:className.
  5689     self classSelectionChanged.
  5720     self classSelectionChanged.
  5690 
  5721 
  5691     "Modified: / 22.2.1999 / 18:55:25 / cg"!
  5722     "Modified: / 22.2.1999 / 18:55:25 / cg"
       
  5723 !
  5692 
  5724 
  5693 switchToClassNamed:aString
  5725 switchToClassNamed:aString
  5694     |meta str theClass newCat element idx l|
  5726     |meta str theClass newCat element idx l|
  5695 
  5727 
  5696     meta := false.
  5728     meta := false.
  5821 
  5853 
  5822     brwsr := SystemBrowser openInClass:actualClass selector:currentSelector.
  5854     brwsr := SystemBrowser openInClass:actualClass selector:currentSelector.
  5823     brwsr environment:environment
  5855     brwsr environment:environment
  5824 
  5856 
  5825     "Created: 13.12.1995 / 15:05:12 / cg"
  5857     "Created: 13.12.1995 / 15:05:12 / cg"
  5826     "Modified: 13.12.1995 / 15:06:26 / cg"!
  5858     "Modified: 13.12.1995 / 15:06:26 / cg"
       
  5859 !
  5827 
  5860 
  5828 classMethodFileOutAll
  5861 classMethodFileOutAll
  5829     "fileout all methods into one source file"
  5862     "fileout all methods into one source file"
  5830 
  5863 
  5831     |list classString selectorString cls mth outStream fileName append
  5864     |list classString selectorString cls mth outStream fileName append
  6010                        methodChangeCategory methodMove methodRemove 
  6043                        methodChangeCategory methodMove methodRemove 
  6011                       )
  6044                       )
  6012     ].
  6045     ].
  6013     ^ m
  6046     ^ m
  6014 
  6047 
  6015     "Modified: / 7.8.1998 / 17:13:47 / cg"! !
  6048     "Modified: / 7.8.1998 / 17:13:47 / cg"
       
  6049 ! !
  6016 
  6050 
  6017 !BrowserView methodsFor:'class-method stuff'!
  6051 !BrowserView methodsFor:'class-method stuff'!
  6018 
  6052 
  6019 classFromClassMethodString:aString
  6053 classFromClassMethodString:aString
  6020     "helper for classMethod-list - extract class name from the string"
  6054     "helper for classMethod-list - extract class name from the string"
  6160 
  6194 
  6161     self setDoitActionForClass
  6195     self setDoitActionForClass
  6162 
  6196 
  6163     "Modified: / 31.8.1995 / 11:56:02 / claus"
  6197     "Modified: / 31.8.1995 / 11:56:02 / claus"
  6164     "Modified: / 17.6.1996 / 16:51:28 / stefan"
  6198     "Modified: / 17.6.1996 / 16:51:28 / stefan"
  6165     "Modified: / 24.12.1999 / 02:10:45 / cg"!
  6199     "Modified: / 24.12.1999 / 02:10:45 / cg"
       
  6200 !
  6166 
  6201 
  6167 classNameFromClassMethodString:aString
  6202 classNameFromClassMethodString:aString
  6168     "helper for classMethod-list - extract the class name from the string"
  6203     "helper for classMethod-list - extract the class name from the string"
  6169 
  6204 
  6170     |pos s words clsName|
  6205     |pos s words clsName|
  6524     Smalltalk addDependent:self.
  6559     Smalltalk addDependent:self.
  6525 
  6560 
  6526     "create a history"
  6561     "create a history"
  6527     self class classHistory.
  6562     self class classHistory.
  6528 
  6563 
  6529     environment := Smalltalk.!
  6564     environment := Smalltalk.
       
  6565 !
  6530 
  6566 
  6531 postRealize
  6567 postRealize
  6532     |v checkBlock|
  6568     |v checkBlock|
  6533 
  6569 
  6534     super postRealize.
  6570     super postRealize.
  7243 
  7279 
  7244     box label:(resources string:'copy methods').
  7280     box label:(resources string:'copy methods').
  7245     box action:[:aString | self copyMethodsFromClass:aString].
  7281     box action:[:aString | self copyMethodsFromClass:aString].
  7246     box showAtPointer
  7282     box showAtPointer
  7247 
  7283 
  7248     "Modified: 16.1.1997 / 00:01:20 / cg"!
  7284     "Modified: 16.1.1997 / 00:01:20 / cg"
       
  7285 !
  7249 
  7286 
  7250 methodCategoryCreateAccessMethods
  7287 methodCategoryCreateAccessMethods
  7251     "create access methods for instvars.
  7288     "create access methods for instvars.
  7252      If no variable is selected, for all instvars;
  7289      If no variable is selected, for all instvars;
  7253      otherwise for that selected instvar."
  7290      otherwise for that selected instvar."
  7621 
  7658 
  7622 "/        self updateMethodCategoryListWithScroll:false.
  7659 "/        self updateMethodCategoryListWithScroll:false.
  7623 "/        self updateMethodListWithScroll:false
  7660 "/        self updateMethodListWithScroll:false
  7624     ]
  7661     ]
  7625 
  7662 
  7626     "Modified: / 1.2.1998 / 16:10:03 / cg"!
  7663     "Modified: / 1.2.1998 / 16:10:03 / cg"
       
  7664 !
  7627 
  7665 
  7628 methodCategoryCreateDocumentationMethods
  7666 methodCategoryCreateDocumentationMethods
  7629     "create empty documentation methods"
  7667     "create empty documentation methods"
  7630 
  7668 
  7631     |cls fn txt|
  7669     |cls fn txt|
  7731 
  7769 
  7732 "/        self updateMethodCategoryListWithScroll:false.
  7770 "/        self updateMethodCategoryListWithScroll:false.
  7733 "/        self updateMethodListWithScroll:false
  7771 "/        self updateMethodListWithScroll:false
  7734     ]
  7772     ]
  7735 
  7773 
  7736     "Modified: / 1.2.1998 / 16:10:03 / cg"!
  7774     "Modified: / 1.2.1998 / 16:10:03 / cg"
       
  7775 !
  7737 
  7776 
  7738 methodCategoryCreateUpdateMethod
  7777 methodCategoryCreateUpdateMethod
  7739     "create an update:with:from: method
  7778     "create an update:with:from: method
  7740      (I'm tired of typing)"
  7779      (I'm tired of typing)"
  7741 
  7780 
  7853         outStream close.
  7892         outStream close.
  7854         self normalLabel.
  7893         self normalLabel.
  7855     ].
  7894     ].
  7856 
  7895 
  7857     "Modified: / 7.6.1996 / 09:03:56 / stefan"
  7896     "Modified: / 7.6.1996 / 09:03:56 / stefan"
  7858     "Modified: / 28.10.1997 / 14:37:32 / cg"!
  7897     "Modified: / 28.10.1997 / 14:37:32 / cg"
       
  7898 !
  7859 
  7899 
  7860 methodCategoryMenu
  7900 methodCategoryMenu
  7861     <resource: #keyboard (#Cmdn)>
  7901     <resource: #keyboard (#Cmdn)>
  7862     <resource: #programMenu >
  7902     <resource: #programMenu >
  7863 
  7903 
  7980                       )
  8020                       )
  7981     ].
  8021     ].
  7982 
  8022 
  7983     ^ m
  8023     ^ m
  7984 
  8024 
  7985     "Modified: / 10.2.2000 / 13:38:58 / cg"!
  8025     "Modified: / 10.2.2000 / 13:38:58 / cg"
       
  8026 !
  7986 
  8027 
  7987 methodCategoryNewCategory
  8028 methodCategoryNewCategory
  7988     "show the enter box to add a new method category.
  8029     "show the enter box to add a new method category.
  7989      Offer existing superclass categories in box to help avoiding
  8030      Offer existing superclass categories in box to help avoiding
  7990      useless typing."
  8031      useless typing."
  8213                 category:(box aspectFor:#fieldValue) value
  8254                 category:(box aspectFor:#fieldValue) value
  8214         ]
  8255         ]
  8215     ]
  8256     ]
  8216 
  8257 
  8217     "Modified: / 16.1.1997 / 20:15:51 / cg"
  8258     "Modified: / 16.1.1997 / 20:15:51 / cg"
  8218     "Modified: / 19.12.1997 / 12:27:42 / stefan"!
  8259     "Modified: / 19.12.1997 / 12:27:42 / stefan"
       
  8260 !
  8219 
  8261 
  8220 copyMethodsFromClass:class category:category
  8262 copyMethodsFromClass:class category:category
  8221     currentClass notNil ifTrue:[
  8263     currentClass notNil ifTrue:[
  8222 	Object abortSignal catch:[
  8264 	Object abortSignal catch:[
  8223 	    class methodDictionary do:[:aMethod |
  8265 	    class methodDictionary do:[:aMethod |
  8639         label:(resources string:'code here')
  8681         label:(resources string:'code here')
  8640         and:method source asString string
  8682         and:method source asString string
  8641         label:'method compare'.      
  8683         label:'method compare'.      
  8642     v label:'comparing with ' , className , ' ' , methodName.
  8684     v label:'comparing with ' , className , ' ' , methodName.
  8643 
  8685 
  8644     "Modified: 7.11.1996 / 18:53:55 / cg"!
  8686     "Modified: 7.11.1996 / 18:53:55 / cg"
       
  8687 !
  8645 
  8688 
  8646 methodCompareWithPreviousVersion
  8689 methodCompareWithPreviousVersion
  8647     "compare with previous version"
  8690     "compare with previous version"
  8648 
  8691 
  8649     |prev v|
  8692     |prev v|
  8744                         classified:currentMethodCategory.
  8787                         classified:currentMethodCategory.
  8745 
  8788 
  8746     (copiedMethod isNil or:[copiedMethod == #Error]) ifTrue:[
  8789     (copiedMethod isNil or:[copiedMethod == #Error]) ifTrue:[
  8747         self warn:'not copied - compilation failed due to an error'.
  8790         self warn:'not copied - compilation failed due to an error'.
  8748         ^ self
  8791         ^ self
  8749     ].!
  8792     ].
       
  8793 !
  8750 
  8794 
  8751 methodDecompile
  8795 methodDecompile
  8752     "decompile the current methods bytecodes.
  8796     "decompile the current methods bytecodes.
  8753      The Decompiler is delivered as an extra, and not normally
  8797      The Decompiler is delivered as an extra, and not normally
  8754      avaliable with the system."
  8798      avaliable with the system."
  8835 
  8879 
  8836     newText := tree printString.
  8880     newText := tree printString.
  8837     codeView contents:newText.
  8881     codeView contents:newText.
  8838     codeView modified:true.
  8882     codeView modified:true.
  8839 
  8883 
  8840     "Modified: / 22.11.1999 / 11:53:55 / cg"!
  8884     "Modified: / 22.11.1999 / 11:53:55 / cg"
       
  8885 !
  8841 
  8886 
  8842 methodGlobalReferends
  8887 methodGlobalReferends
  8843     "launch an enterBox for global symbol to search for"
  8888     "launch an enterBox for global symbol to search for"
  8844 
  8889 
  8845     self askForSearchTitle:'global variable to search users of:' 
  8890     self askForSearchTitle:'global variable to search users of:' 
  9372     ].
  9417     ].
  9373 
  9418 
  9374     self methodRemove
  9419     self methodRemove
  9375 
  9420 
  9376     "Created: 13.12.1995 / 10:56:42 / cg"
  9421     "Created: 13.12.1995 / 10:56:42 / cg"
  9377     "Modified: 25.6.1997 / 13:58:56 / cg"!
  9422     "Modified: 25.6.1997 / 13:58:56 / cg"
       
  9423 !
  9378 
  9424 
  9379 methodNewImageSpec
  9425 methodNewImageSpec
  9380     "open a BitmapEditor"
  9426     "open a BitmapEditor"
  9381 
  9427 
  9382     |specSel|
  9428     |specSel|
 10548             onToggle turnOn.
 10594             onToggle turnOn.
 10549             offToggle turnOff.
 10595             offToggle turnOff.
 10550         ]
 10596         ]
 10551     ]
 10597     ]
 10552 
 10598 
 10553     "Modified: / 31.3.1998 / 23:40:04 / cg"!
 10599     "Modified: / 31.3.1998 / 23:40:04 / cg"
       
 10600 !
 10554 
 10601 
 10555 processName
 10602 processName
 10556     "the name of my process - for the processMonitor only"
 10603     "the name of my process - for the processMonitor only"
 10557 
 10604 
 10558     ^ 'System Browser'.
 10605     ^ 'System Browser'.
 10721         ].
 10768         ].
 10722     ].
 10769     ].
 10723     self normalLabel.
 10770     self normalLabel.
 10724 
 10771 
 10725     "Created: / 23.11.1995 / 14:16:43 / cg"
 10772     "Created: / 23.11.1995 / 14:16:43 / cg"
 10726     "Modified: / 10.2.2000 / 14:15:03 / cg"! !
 10773     "Modified: / 10.2.2000 / 14:15:03 / cg"
       
 10774 ! !
 10727 
 10775 
 10728 !BrowserView methodsFor:'namespace menu'!
 10776 !BrowserView methodsFor:'namespace menu'!
 10729 
 10777 
 10730 nameSpaceCheckInEach
 10778 nameSpaceCheckInEach
 10731     |classes|
 10779     |classes|
 10839             self changeNameSpaceTo:'* all *'.
 10887             self changeNameSpaceTo:'* all *'.
 10840             namespaceList contents:'* all *'
 10888             namespaceList contents:'* all *'
 10841         ]
 10889         ]
 10842     ].
 10890     ].
 10843 
 10891 
 10844     "Modified: 18.8.1997 / 15:44:31 / cg"!
 10892     "Modified: 18.8.1997 / 15:44:31 / cg"
       
 10893 !
 10845 
 10894 
 10846 nameSpaceRemoveAllClasses
 10895 nameSpaceRemoveAllClasses
 10847     "remove all classes in that nameSpace - but only after confirmation"
 10896     "remove all classes in that nameSpace - but only after confirmation"
 10848 
 10897 
 10849     |classes|
 10898     |classes|
 10866         classes copy do:[:cls |
 10915         classes copy do:[:cls |
 10867             environment removeClass:cls.
 10916             environment removeClass:cls.
 10868         ]
 10917         ]
 10869     ]
 10918     ]
 10870 
 10919 
 10871     "Modified: / 3.2.1999 / 20:18:13 / cg"! !
 10920     "Modified: / 3.2.1999 / 20:18:13 / cg"
       
 10921 ! !
 10872 
 10922 
 10873 !BrowserView methodsFor:'namespace stuff'!
 10923 !BrowserView methodsFor:'namespace stuff'!
 10874 
 10924 
 10875 changeNameSpaceTo:nsName
 10925 changeNameSpaceTo:nsName
 10876     |n selectedClass str selectedCategory l newCat|
 10926     |n selectedClass str selectedCategory l newCat|
 10918             ]
 10968             ]
 10919         ].
 10969         ].
 10920     ]
 10970     ]
 10921 
 10971 
 10922     "Created: 3.1.1997 / 11:11:13 / cg"
 10972     "Created: 3.1.1997 / 11:11:13 / cg"
 10923     "Modified: 29.1.1997 / 18:33:42 / cg"!
 10973     "Modified: 29.1.1997 / 18:33:42 / cg"
       
 10974 !
 10924 
 10975 
 10925 displayedClassNameOf:aClass
 10976 displayedClassNameOf:aClass
 10926     "depending on the current nameSpace, either show a classes
 10977     "depending on the current nameSpace, either show a classes
 10927      fullname or its name without the namespace prefix (if its in the current)"
 10978      fullname or its name without the namespace prefix (if its in the current)"
 10928 
 10979 
 11002     ].
 11053     ].
 11003 
 11054 
 11004     ^ Array with:currentNamespace
 11055     ^ Array with:currentNamespace
 11005 
 11056 
 11006     "Created: 26.10.1996 / 11:25:39 / cg"
 11057     "Created: 26.10.1996 / 11:25:39 / cg"
 11007     "Modified: 20.12.1996 / 19:18:18 / cg"!
 11058     "Modified: 20.12.1996 / 19:18:18 / cg"
       
 11059 !
 11008 
 11060 
 11009 setListOfNamespaces
 11061 setListOfNamespaces
 11010     |l hasSmalltalk|
 11062     |l hasSmalltalk|
 11011 
 11063 
 11012     namespaceList isNil ifTrue:[ ^ self ].
 11064     namespaceList isNil ifTrue:[ ^ self ].
 11394             ]
 11446             ]
 11395         ]
 11447         ]
 11396     ]
 11448     ]
 11397 
 11449 
 11398     "Created: / 18.6.1998 / 16:39:44 / cg"
 11450     "Created: / 18.6.1998 / 16:39:44 / cg"
 11399     "Modified: / 5.8.1998 / 00:29:54 / cg"!
 11451     "Modified: / 5.8.1998 / 00:29:54 / cg"
       
 11452 !
 11400 
 11453 
 11401 busyLabel:what with:someArgument
 11454 busyLabel:what with:someArgument
 11402     "set the title for some warning"
 11455     "set the title for some warning"
 11403 
 11456 
 11404     self topView
 11457     self topView
 11451                 self information:'This methods functionality is already inherited from ', implClass name.
 11504                 self information:'This methods functionality is already inherited from ', implClass name.
 11452             ] 
 11505             ] 
 11453         ]        
 11506         ]        
 11454     ].
 11507     ].
 11455 
 11508 
 11456     "Modified: / 18.2.2000 / 11:34:12 / cg"!
 11509     "Modified: / 18.2.2000 / 11:34:12 / cg"
       
 11510 !
 11457 
 11511 
 11458 checkSelectionChangeAllowed
 11512 checkSelectionChangeAllowed
 11459     "return true, if selection change is ok;
 11513     "return true, if selection change is ok;
 11460      its not ok, if code has been changed.
 11514      its not ok, if code has been changed.
 11461      in this case, return the result of a user query"
 11515      in this case, return the result of a user query"
 11666             aBlock value:aNilSubclass value:0
 11720             aBlock value:aNilSubclass value:0
 11667         ]
 11721         ]
 11668     ].
 11722     ].
 11669 
 11723 
 11670     "Created: 28.5.1996 / 13:46:23 / cg"
 11724     "Created: 28.5.1996 / 13:46:23 / cg"
 11671     "Modified: 5.1.1997 / 18:44:50 / cg"!
 11725     "Modified: 5.1.1997 / 18:44:50 / cg"
       
 11726 !
 11672 
 11727 
 11673 classesInFullProtocolHierarchy:aClass do:aBlock
 11728 classesInFullProtocolHierarchy:aClass do:aBlock
 11674     "evaluate aBlock for all non-striked out classes in
 11729     "evaluate aBlock for all non-striked out classes in
 11675      the hierarchy"
 11730      the hierarchy"
 11676 
 11731 
 11840 !
 11895 !
 11841 
 11896 
 11842 environment
 11897 environment
 11843     "allows me to browse something different from Smalltalk (a SnapShotImage for example)"
 11898     "allows me to browse something different from Smalltalk (a SnapShotImage for example)"
 11844 
 11899 
 11845     ^ environment ? Smalltalk!
 11900     ^ environment ? Smalltalk
       
 11901 !
 11846 
 11902 
 11847 environment:anEnvironment
 11903 environment:anEnvironment
 11848     "allows me to browse something different from Smalltalk (a SnapShotImage for example)"
 11904     "allows me to browse something different from Smalltalk (a SnapShotImage for example)"
 11849 
 11905 
 11850     environment := anEnvironment!
 11906     environment := anEnvironment
       
 11907 !
 11851 
 11908 
 11852 extractClassAndSelectorFromSelectionInto:aBlock
 11909 extractClassAndSelectorFromSelectionInto:aBlock
 11853     "given a string which can be either 'class>>sel' or
 11910     "given a string which can be either 'class>>sel' or
 11854      'class sel', extract className and selector, and call aBlock with
 11911      'class sel', extract className and selector, and call aBlock with
 11855     the result."
 11912     the result."
 11990     ] ifFalse:[
 12047     ] ifFalse:[
 11991 "/        Transcript showCR:'starting search in ' , homeClass name.
 12048 "/        Transcript showCR:'starting search in ' , homeClass name.
 11992     ].
 12049     ].
 11993     ^ homeClass
 12050     ^ homeClass
 11994 
 12051 
 11995     "Modified: / 25.10.1997 / 20:26:25 / cg"!
 12052     "Modified: / 25.10.1997 / 20:26:25 / cg"
       
 12053 !
 11996 
 12054 
 11997 hideMethodCategoryList
 12055 hideMethodCategoryList
 11998     classCategoryListView isNil ifTrue:[
 12056     classCategoryListView isNil ifTrue:[
 11999 	classListView notNil ifTrue:[
 12057 	classListView notNil ifTrue:[
 12000 	    methodCategoryListView superView extent:0.0 @ 1.0.
 12058 	    methodCategoryListView superView extent:0.0 @ 1.0.
 12107         ].
 12165         ].
 12108         cls removeDependent:self.
 12166         cls removeDependent:self.
 12109         meta removeDependent:self.
 12167         meta removeDependent:self.
 12110     ].
 12168     ].
 12111 
 12169 
 12112     "Created: 13.12.1995 / 15:32:21 / cg"!
 12170     "Created: 13.12.1995 / 15:32:21 / cg"
       
 12171 !
 12113 
 12172 
 12114 releaseMethod
 12173 releaseMethod
 12115     currentMethod notNil ifTrue:[
 12174     currentMethod notNil ifTrue:[
 12116 	currentMethod removeDependent:self.
 12175 	currentMethod removeDependent:self.
 12117 	currentMethod isWrapped ifTrue:[
 12176 	currentMethod isWrapped ifTrue:[
 12479 "/                                in:codeView contents
 12538 "/                                in:codeView contents
 12480 "/                                forClass:actualClass)
 12539 "/                                forClass:actualClass)
 12481 "/        ]
 12540 "/        ]
 12482 "/    ].
 12541 "/    ].
 12483 
 12542 
 12484     "Modified: / 10.2.2000 / 14:17:14 / cg"!
 12543     "Modified: / 10.2.2000 / 14:17:14 / cg"
       
 12544 !
 12485 
 12545 
 12486 setDoitActionForClass
 12546 setDoitActionForClass
 12487     "tell the codeView what to do on doIt"
 12547     "tell the codeView what to do on doIt"
 12488 
 12548 
 12489     "set self for doits. This allows accessing the current class
 12549     "set self for doits. This allows accessing the current class
 13222         ].
 13282         ].
 13223         box showAtPointer
 13283         box showAtPointer
 13224     ]
 13284     ]
 13225 
 13285 
 13226     "Created: / 25.10.1997 / 20:12:52 / cg"
 13286     "Created: / 25.10.1997 / 20:12:52 / cg"
 13227     "Modified: / 25.10.1997 / 21:10:34 / cg"!
 13287     "Modified: / 25.10.1997 / 21:10:34 / cg"
       
 13288 !
 13228 
 13289 
 13229 varTypeInfo
 13290 varTypeInfo
 13230     "show typical usage of a variable"
 13291     "show typical usage of a variable"
 13231 
 13292 
 13232     |name idx classes values value msg cut names instCount subInstCount box
 13293     |name idx classes values value msg cut names instCount subInstCount box
 13780     oldSelection notNil ifTrue:[
 13841     oldSelection notNil ifTrue:[
 13781         variableListView setSelectElement:oldSelection.
 13842         variableListView setSelectElement:oldSelection.
 13782         self hilightMethodsInMethodCategoryList:true inMethodList:true.
 13843         self hilightMethodsInMethodCategoryList:true inMethodList:true.
 13783     ]
 13844     ]
 13784 
 13845 
 13785     "Modified: / 17.9.1998 / 13:45:02 / cg"! !
 13846     "Modified: / 17.9.1998 / 13:45:02 / cg"
       
 13847 ! !
 13786 
 13848 
 13787 !BrowserView class methodsFor:'documentation'!
 13849 !BrowserView class methodsFor:'documentation'!
 13788 
 13850 
 13789 version
 13851 version
 13790     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.647 2000-11-08 16:04:35 cg Exp $'
 13852     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.648 2000-11-14 13:41:56 cg Exp $'
 13791 ! !
 13853 ! !
 13792 BrowserView initialize!
 13854 BrowserView initialize!