Tools__NewSystemBrowser.st
branchjv
changeset 13530 2269bce1636d
parent 13491 b3afe831ff0a
parent 13512 16ba5d93100b
child 13595 36f49da4fa11
equal deleted inserted replaced
13529:4e89429bee91 13530:2269bce1636d
    12 "{ Package: 'stx:libtool' }"
    12 "{ Package: 'stx:libtool' }"
    13 
    13 
    14 "{ NameSpace: Tools }"
    14 "{ NameSpace: Tools }"
    15 
    15 
    16 SystemBrowser subclass:#NewSystemBrowser
    16 SystemBrowser subclass:#NewSystemBrowser
    17 	instanceVariableNames:'navigationState bufferNameList selectedBuffer buffers
    17 	instanceVariableNames:'environment navigationState bufferNameList selectedBuffer buffers
    18 		bufferUsageOrder browserCanvas immediateUpdate showClassPackages
    18 		bufferUsageOrder browserCanvas immediateUpdate showClassPackages
    19 		lastMethodCategory lastMethodMoveClass browserCanvasType
    19 		lastMethodCategory lastMethodMoveClass browserCanvasType
    20 		syntaxColoringProcessRunning syntaxColoringProcess
    20 		syntaxColoringProcessRunning syntaxColoringProcess
    21 		methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
    21 		methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
    22 		isEmbedded'
    22 		isEmbedded'
 18110 	aBlock value:className value:singleClass value:doWhat.
 18110 	aBlock value:className value:singleClass value:doWhat.
 18111     ].
 18111     ].
 18112     ^ className
 18112     ^ className
 18113 
 18113 
 18114     "Modified: / 29-08-2013 / 12:24:28 / cg"
 18114     "Modified: / 29-08-2013 / 12:24:28 / cg"
       
 18115     "Modified: / 04-09-2013 / 17:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 18115 !
 18116 !
 18116 
 18117 
 18117 enterBoxTitle:title okText:okText label:label
 18118 enterBoxTitle:title okText:okText label:label
 18118     "convenient method: setup an enterBox"
 18119     "convenient method: setup an enterBox"
 18119 
 18120 
 18132 
 18133 
 18133 !NewSystemBrowser methodsFor:'accessing'!
 18134 !NewSystemBrowser methodsFor:'accessing'!
 18134 
 18135 
 18135 buffersDo:aBlock
 18136 buffersDo:aBlock
 18136     buffers notNil ifTrue:[ buffers do:aBlock ]
 18137     buffers notNil ifTrue:[ buffers do:aBlock ]
       
 18138 !
       
 18139 
       
 18140 environment
       
 18141     ^ environment
       
 18142 
       
 18143     "Created: / 03-09-2013 / 19:18:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 18144 !
       
 18145 
       
 18146 environment:env
       
 18147     environment := env.
 18137 !
 18148 !
 18138 
 18149 
 18139 isEmbeddedBrowser
 18150 isEmbeddedBrowser
 18140     "allows the inspector to disable certain menu items (+ buffer)"
 18151     "allows the inspector to disable certain menu items (+ buffer)"
 18141 
 18152 
 20818 
 20829 
 20819 	classes := self selectedClassesValue.
 20830 	classes := self selectedClassesValue.
 20820 	classes isEmptyOrNil ifTrue:[
 20831 	classes isEmptyOrNil ifTrue:[
 20821 	    false
 20832 	    false
 20822 	] ifFalse:[
 20833 	] ifFalse:[
 20823 	    classes
 20834 	    classes conform: [:cls | self hasGitRepositoryFor: cls theNonMetaclass package]
 20824 		allSatisfy:
       
 20825 		    [:cls | self hasGitRepositoryFor: cls theNonMetaclass package]
       
 20826 	]
 20835 	]
 20827     ]
 20836     ]
 20828 
 20837 
 20829     "Created: / 23-07-2012 / 13:33:07 / cg"
 20838     "Created: / 23-07-2012 / 13:33:07 / cg"
 20830 !
 20839 !
 20835 
 20844 
 20836 	classes := self selectedClassesValue.
 20845 	classes := self selectedClassesValue.
 20837 	classes isEmptyOrNil ifTrue:[
 20846 	classes isEmptyOrNil ifTrue:[
 20838 	    false
 20847 	    false
 20839 	] ifFalse:[
 20848 	] ifFalse:[
 20840 	    classes
 20849 	    classes conform:[:cls | self hasMercurialRepositoryFor: cls theNonMetaclass package]
 20841 		allSatisfy:
       
 20842 		    [:cls | self hasMercurialRepositoryFor: cls theNonMetaclass package]
       
 20843 	]
 20850 	]
 20844     ]
 20851     ]
 20845 
 20852 
 20846     "Created: / 19-01-2012 / 16:14:57 / cg"
 20853     "Created: / 19-01-2012 / 16:14:57 / cg"
 20847 !
 20854 !
 20852 
 20859 
 20853 	classes := self selectedClassesValue.
 20860 	classes := self selectedClassesValue.
 20854 	classes isEmptyOrNil ifTrue:[
 20861 	classes isEmptyOrNil ifTrue:[
 20855 	    false
 20862 	    false
 20856 	] ifFalse:[
 20863 	] ifFalse:[
 20857 	    classes
 20864 	    classes conform: [:cls | self hasPerforceRepositoryFor: cls theNonMetaclass package]
 20858 		allSatisfy:
       
 20859 		    [:cls | self hasPerforceRepositoryFor: cls theNonMetaclass package]
       
 20860 	]
 20865 	]
 20861     ]
 20866     ]
 20862 
 20867 
 20863     "Created: / 19-04-2011 / 14:13:52 / cg"
 20868     "Created: / 19-04-2011 / 14:13:52 / cg"
 20864 !
 20869 !
 20866 hasClassesSelectedAndSubversionRepositoryExists
 20871 hasClassesSelectedAndSubversionRepositoryExists
 20867     | classes |
 20872     | classes |
 20868 
 20873 
 20869     classes := self selectedClassesValue.
 20874     classes := self selectedClassesValue.
 20870     classes size = 0 ifTrue:[^false].
 20875     classes size = 0 ifTrue:[^false].
 20871     ^ classes
 20876     ^ classes conform: [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
 20872 	allSatisfy:
       
 20873 	    [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
       
 20874 
 20877 
 20875     "Modified: / 28-02-2012 / 16:55:03 / cg"
 20878     "Modified: / 28-02-2012 / 16:55:03 / cg"
 20876 !
 20879 !
 20877 
 20880 
 20878 hasClassesSelectedAndSubversionRepositoryExistsHolder
 20881 hasClassesSelectedAndSubversionRepositoryExistsHolder
 20881 
 20884 
 20882 	classes := self selectedClassesValue.
 20885 	classes := self selectedClassesValue.
 20883 	classes isEmptyOrNil ifTrue:[
 20886 	classes isEmptyOrNil ifTrue:[
 20884 	    false
 20887 	    false
 20885 	] ifFalse:[
 20888 	] ifFalse:[
 20886 	    classes
 20889 	    classes conform: [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
 20887 		allSatisfy:
       
 20888 		    [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
       
 20889 	]
 20890 	]
 20890     ]
 20891     ]
 20891 
 20892 
 20892     "Modified: / 28-02-2012 / 16:55:12 / cg"
 20893     "Modified: / 28-02-2012 / 16:55:12 / cg"
 20893 !
 20894 !
 20956     selectedNamespaces size == 0 ifTrue:[^ false].
 20957     selectedNamespaces size == 0 ifTrue:[^ false].
 20957     ^ (selectedNamespaces
 20958     ^ (selectedNamespaces
 20958 	contains:[:nm |
 20959 	contains:[:nm |
 20959 	    |ns|
 20960 	    |ns|
 20960 
 20961 
 20961 	    ns := Smalltalk at:nm asSymbol ifAbsent:nil.
 20962 	    ns := environment at:nm asSymbol ifAbsent:nil.
 20962 	    ns notNil
 20963 	    ns notNil
 20963 	    and:[ns allClasses size ~~ 0]
 20964 	    and:[ns allClasses size ~~ 0]
 20964 	]
 20965 	]
 20965       ) not
 20966       ) not
 20966 !
 20967 !
 22398     |codeView s selClass|
 22399     |codeView s selClass|
 22399 
 22400 
 22400     ^ (codeView := self codeView) hasSelection
 22401     ^ (codeView := self codeView) hasSelection
 22401     and:[ (s := codeView selectionAsString) isValidSmalltalkIdentifier
 22402     and:[ (s := codeView selectionAsString) isValidSmalltalkIdentifier
 22402     and:[ s isUppercaseFirst
 22403     and:[ s isUppercaseFirst
 22403     and:[ (Smalltalk includesKey:s) not
 22404     and:[ (environment includesKey:s) not
 22404     and:[ (selClass := self theSingleSelectedClass) notNil
 22405     and:[ (selClass := self theSingleSelectedClass) notNil
 22405     and:[ (selClass theNonMetaclass classVarNames includes:s) not ]]]]]
 22406     and:[ (selClass theNonMetaclass classVarNames includes:s) not ]]]]]
 22406 
 22407 
 22407     "Modified: / 23-07-2011 / 12:29:26 / cg"
 22408     "Modified: / 23-07-2011 / 12:29:26 / cg"
 22408 !
 22409 !
 22670 
 22671 
 22671     (self hasSingleWordSelectedInCodeView) ifFalse:[^ nil].
 22672     (self hasSingleWordSelectedInCodeView) ifFalse:[^ nil].
 22672     selection := self selectionInCodeView.
 22673     selection := self selectionInCodeView.
 22673 
 22674 
 22674     selection := selection withoutSeparators.
 22675     selection := selection withoutSeparators.
 22675     cls := Smalltalk classNamed:selection.
 22676     cls := environment classNamed:selection.
 22676     ^ cls
 22677     ^ cls
 22677 !
 22678 !
 22678 
 22679 
 22679 shiftNotPressedHolder
 22680 shiftNotPressedHolder
 22680     ^ [ self window sensor shiftDown not ]
 22681     ^ [ self window sensor shiftDown not ]
 23480     something == #visitedClassHistory ifTrue:[
 23481     something == #visitedClassHistory ifTrue:[
 23481 	self visitedClassesHistory contents:(self class visitedClassNamesHistory).
 23482 	self visitedClassesHistory contents:(self class visitedClassNamesHistory).
 23482 	^ self.
 23483 	^ self.
 23483     ].
 23484     ].
 23484 
 23485 
 23485     changedObject == Smalltalk ifTrue:[
 23486     changedObject == environment ifTrue:[
 23486 	codeAspect := self codeAspect.
 23487 	codeAspect := self codeAspect.
 23487 	isForAspect := (codeAspect == something)
 23488 	isForAspect := (codeAspect == something)
 23488 		       and:[ something == #classDefinition
 23489 		       and:[ something == #classDefinition
 23489 			     or:[ something == #classComment
 23490 			     or:[ something == #classComment
 23490 			     or:[ something == #classHierarchy
 23491 			     or:[ something == #classHierarchy
 23502 	something == #methodInClass ifTrue:[
 23503 	something == #methodInClass ifTrue:[
 23503 	    codeAspect == SyntaxHighlighter codeAspectMethod ifTrue:[
 23504 	    codeAspect == SyntaxHighlighter codeAspectMethod ifTrue:[
 23504 		mthd := self theSingleSelectedMethod.
 23505 		mthd := self theSingleSelectedMethod.
 23505 		(mthd notNil and:[aParameter third == mthd])
 23506 		(mthd notNil and:[aParameter third == mthd])
 23506 		ifTrue:[
 23507 		ifTrue:[
       
 23508 self enqueueDelayedMethodTrapChanged:nil.
 23507 		    mthd mclass notNil ifTrue:[
 23509 		    mthd mclass notNil ifTrue:[
 23508 			"/ mhmh - Smalltalk tells me that a method has changed,
 23510 			"/ mhmh - Smalltalk tells me that a method has changed,
 23509 			"/ but my selectedMethod has not yet been updated
 23511 			"/ but my selectedMethod has not yet been updated
 23510 			"/ (the methodList seems to be behind me in the dependency chain).
 23512 			"/ (the methodList seems to be behind me in the dependency chain).
 23511 			"/ simply ignore this update here (assuming that the methodList will trigger
 23513 			"/ simply ignore this update here (assuming that the methodList will trigger
 23518 	    ].
 23520 	    ].
 23519 	    ^ self
 23521 	    ^ self
 23520 	].
 23522 	].
 23521 
 23523 
 23522 	something == #methodTrap ifTrue:[
 23524 	something == #methodTrap ifTrue:[
 23523 	    self enqueueDelayedMethodTrapChanged.
 23525 	    self enqueueDelayedMethodTrapChanged:aParameter.
 23524 	    ^ self
 23526 	    ^ self
 23525 	].
 23527 	].
 23526 
 23528 
 23527 	something == #methodCoverageInfo ifTrue:[
 23529 	something == #methodCoverageInfo ifTrue:[
 23528 	    self theSingleSelectedMethod == aParameter ifTrue:[
 23530 	    self theSingleSelectedMethod == aParameter ifTrue:[
 23928     "Created: / 22-02-2008 / 09:00:56 / janfrog"
 23930     "Created: / 22-02-2008 / 09:00:56 / janfrog"
 23929     "Modified: / 25-10-2009 / 15:06:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 23931     "Modified: / 25-10-2009 / 15:06:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 23930     "Modified: / 02-07-2011 / 18:33:22 / cg"
 23932     "Modified: / 02-07-2011 / 18:33:22 / cg"
 23931 ! !
 23933 ! !
 23932 
 23934 
       
 23935 !NewSystemBrowser methodsFor:'initialization'!
       
 23936 
       
 23937 initialize
       
 23938     super initialize.
       
 23939     environment := Smalltalk
       
 23940 
       
 23941     "Created: / 03-09-2013 / 19:13:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 23942 ! !
       
 23943 
 23933 !NewSystemBrowser methodsFor:'menu actions-browse'!
 23944 !NewSystemBrowser methodsFor:'menu actions-browse'!
 23934 
 23945 
 23935 browseClassesReferringToAnyPool:poolsArg in:doWhat
 23946 browseClassesReferringToAnyPool:poolsArg in:doWhat
 23936     "open a dialog asking for a poolname; search for classes importing that pool."
 23947     "open a dialog asking for a poolname; search for classes importing that pool."
 23937 
 23948 
 23944 		collect:[:poolOrName |
 23955 		collect:[:poolOrName |
 23945 		    |p|
 23956 		    |p|
 23946 		    poolOrName isSharedPool ifTrue:[
 23957 		    poolOrName isSharedPool ifTrue:[
 23947 			poolOrName
 23958 			poolOrName
 23948 		    ] ifFalse:[
 23959 		    ] ifFalse:[
 23949 			p := Smalltalk classNamed:poolNameString.
 23960 			p := environment classNamed:poolNameString.
 23950 			(p notNil and:[p isSharedPool]) ifTrue:[
 23961 			(p notNil and:[p isSharedPool]) ifTrue:[
 23951 			    p
 23962 			    p
 23952 			] ifFalse:[
 23963 			] ifFalse:[
 23953 			    nil
 23964 			    nil
 23954 			]
 23965 			]
 23957 		  thenSelect:[:p | p notNil].
 23968 		  thenSelect:[:p | p notNil].
 23958     pools isEmptyOrNil ifTrue:[
 23969     pools isEmptyOrNil ifTrue:[
 23959 	^ self
 23970 	^ self
 23960     ].
 23971     ].
 23961 
 23972 
 23962     classes := Smalltalk allClasses
 23973     classes := environment allClasses
 23963 		select:[:cls |
 23974 		select:[:cls |
 23964 			cls isMeta not and:[(cls sharedPools includesAny:pools)]
 23975 			cls isMeta not and:[(cls sharedPools includesAny:pools)]
 23965 		].
 23976 		].
 23966 
 23977 
 23967     classes size == 0 ifTrue:[
 23978     classes size == 0 ifTrue:[
 24058     inputField entryCompletionBlock:[:contents |
 24069     inputField entryCompletionBlock:[:contents |
 24059 	|s what|
 24070 	|s what|
 24060 
 24071 
 24061 	s := contents withoutSpaces.
 24072 	s := contents withoutSpaces.
 24062 	box topView withWaitCursorDo:[
 24073 	box topView withWaitCursorDo:[
 24063 	    what := Smalltalk selectorCompletion:s.
 24074 	    what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:environment.
 24064 	    inputField contents:what first.
 24075 	    inputField contents:what first.
 24065 	    (what at:2) size ~~ 1 ifTrue:[
 24076 	    (what at:2) size ~~ 1 ifTrue:[
 24066 		self window beep
 24077 		self window beep
 24067 	    ]
 24078 	    ]
 24068 	]
 24079 	]
 24093 	    self warn:'No selector entered for search'.
 24104 	    self warn:'No selector entered for search'.
 24094 	    ^ self.
 24105 	    ^ self.
 24095 	].
 24106 	].
 24096 	self rememberSearchPattern:sel.
 24107 	self rememberSearchPattern:sel.
 24097     ].
 24108     ].
       
 24109 
       
 24110     "Modified: / 04-09-2013 / 17:40:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 24098 !
 24111 !
 24099 
 24112 
 24100 browseMenuAllSubclassesOf
 24113 browseMenuAllSubclassesOf
 24101     "add a new buffer on all subclasses of an entered class"
 24114     "add a new buffer on all subclasses of an entered class"
 24102 
 24115 
 24112 		searchBlock := [ Behavior allSubInstances select:[:cls | cls superclass isNil] ].
 24125 		searchBlock := [ Behavior allSubInstances select:[:cls | cls superclass isNil] ].
 24113 	    ] ifFalse:[
 24126 	    ] ifFalse:[
 24114 		className includesMatchCharacters ifTrue:[
 24127 		className includesMatchCharacters ifTrue:[
 24115 		    className := self askForClassNameMatching:className.
 24128 		    className := self askForClassNameMatching:className.
 24116 		].
 24129 		].
 24117 		class := (Smalltalk classNamed:className) theNonMetaclass.
 24130 		class := (environment classNamed:className) theNonMetaclass.
 24118 		searchBlock := [ class allSubclasses ]
 24131 		searchBlock := [ class allSubclasses ]
 24119 	    ].
 24132 	    ].
 24120 
 24133 
 24121 	    self
 24134 	    self
 24122 		spawnClassBrowserForSearch:searchBlock
 24135 		spawnClassBrowserForSearch:searchBlock
 24141     "add a new buffer on all classes that have been autoloaded"
 24154     "add a new buffer on all classes that have been autoloaded"
 24142 
 24155 
 24143     |searchBlock|
 24156     |searchBlock|
 24144 
 24157 
 24145     searchBlock := [
 24158     searchBlock := [
 24146 			(Smalltalk allClassesForWhich:[:someClass | someClass wasAutoloaded])
 24159 			(environment allClassesForWhich:[:someClass | someClass wasAutoloaded])
 24147 			    asOrderedCollection
 24160 			    asOrderedCollection
 24148 		   ].
 24161 		   ].
 24149 
 24162 
 24150     self
 24163     self
 24151 	spawnClassBrowserForSearch:searchBlock
 24164 	spawnClassBrowserForSearch:searchBlock
 24203     "open a browser / add a new buffer on all methods extending a class
 24216     "open a browser / add a new buffer on all methods extending a class
 24204      (i.e. methods where the packageID is different from their classes packageID)"
 24217      (i.e. methods where the packageID is different from their classes packageID)"
 24205 
 24218 
 24206     ^ self
 24219     ^ self
 24207 	browseMenuClassExtensionsFor:nil
 24220 	browseMenuClassExtensionsFor:nil
 24208 	in:Smalltalk allClasses
 24221 	in:environment allClasses
 24209 	label:'All Class Extensions'
 24222 	label:'All Class Extensions'
 24210 	openAs:openHow
 24223 	openAs:openHow
 24211 !
 24224 !
 24212 
 24225 
 24213 browseMenuClassesDefiningVariable
 24226 browseMenuClassesDefiningVariable
 24226     ].
 24239     ].
 24227 
 24240 
 24228     allInstVariables := Set new.
 24241     allInstVariables := Set new.
 24229     allClassVariables := Set new.
 24242     allClassVariables := Set new.
 24230     allClassInstVariables := Set new.
 24243     allClassInstVariables := Set new.
 24231     Smalltalk allClassesDo:[:cls |
 24244     environment allClassesDo:[:cls |
 24232 	cls isMeta ifFalse:[
 24245 	cls isMeta ifFalse:[
 24233 	    allInstVariables addAll:(cls instVarNames).
 24246 	    allInstVariables addAll:(cls instVarNames).
 24234 	    allClassVariables addAll:(cls classVarNames).
 24247 	    allClassVariables addAll:(cls classVarNames).
 24235 	    allClassInstVariables addAll:(cls class instVarNames).
 24248 	    allClassInstVariables addAll:(cls class instVarNames).
 24236 	].
 24249 	].
 24272 
 24285 
 24273     box entryCompletionBlock:[:contents |
 24286     box entryCompletionBlock:[:contents |
 24274 	|s what m|
 24287 	|s what m|
 24275 
 24288 
 24276 	s := contents withoutSpaces.
 24289 	s := contents withoutSpaces.
 24277 	what := Smalltalk classnameCompletion:s.
 24290 	what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:environment .
 24278 	box contents:what first.
 24291 	box contents:what first.
 24279 	(what at:2) size ~~ 1 ifTrue:[
 24292 	(what at:2) size ~~ 1 ifTrue:[
 24280 	    self builder window beep
 24293 	    self builder window beep
 24281 	].
 24294 	].
 24282 	box listView list:(list select:[:entry | s match:entry]).
 24295 	box listView list:(list select:[:entry | s match:entry]).
 24295     ] ifFalse:[
 24308     ] ifFalse:[
 24296 	varNamesToSearch := varNamesToSearch asSet.
 24309 	varNamesToSearch := varNamesToSearch asSet.
 24297 	checkFilterBlock := [:v | varNamesToSearch includes:v]
 24310 	checkFilterBlock := [:v | varNamesToSearch includes:v]
 24298     ].
 24311     ].
 24299 
 24312 
 24300     classes := Smalltalk allClasses select:[:cls |
 24313     classes := environment allClasses select:[:cls |
 24301 		    cls isMeta not
 24314 		    cls isMeta not
 24302 		    and:[(cls instVarNames contains:checkFilterBlock)
 24315 		    and:[(cls instVarNames contains:checkFilterBlock)
 24303 			 or:[(cls classVarNames contains:checkFilterBlock)
 24316 			 or:[(cls classVarNames contains:checkFilterBlock)
 24304 			     or:[cls class instVarNames contains:checkFilterBlock]]]
 24317 			     or:[cls class instVarNames contains:checkFilterBlock]]]
 24305 	       ].
 24318 	       ].
 24321     ].
 24334     ].
 24322     brwsr selectClasses:classes.
 24335     brwsr selectClasses:classes.
 24323 
 24336 
 24324     "Created: / 01-03-2000 / 11:12:38 / cg"
 24337     "Created: / 01-03-2000 / 11:12:38 / cg"
 24325     "Modified: / 29-08-2013 / 12:23:08 / cg"
 24338     "Modified: / 29-08-2013 / 12:23:08 / cg"
       
 24339     "Modified: / 04-09-2013 / 17:40:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 24326 !
 24340 !
 24327 
 24341 
 24328 browseMenuClassesForWhich: aFilter label: label
 24342 browseMenuClassesForWhich: aFilter label: label
 24329     "add a new buffer on all shared pools"
 24343     "add a new buffer on all shared pools"
 24330 
 24344 
 24333     searchBlock := [
 24347     searchBlock := [
 24334 			|classes|
 24348 			|classes|
 24335 
 24349 
 24336 			classes := OrderedCollection new.
 24350 			classes := OrderedCollection new.
 24337 
 24351 
 24338 			Smalltalk allClassesDo:[:eachClass |
 24352 			environment allClassesDo:[:eachClass |
 24339 			    (aFilter value: eachClass) ifTrue:[
 24353 			    (aFilter value: eachClass) ifTrue:[
 24340 				classes add:eachClass
 24354 				classes add:eachClass
 24341 			    ]
 24355 			    ]
 24342 			].
 24356 			].
 24343 			classes
 24357 			classes
 24440 	[
 24454 	[
 24441 	    |appHistory|
 24455 	    |appHistory|
 24442 
 24456 
 24443 	    appHistory := ApplicationModel recentlyOpenedApplications.
 24457 	    appHistory := ApplicationModel recentlyOpenedApplications.
 24444 	    appHistory
 24458 	    appHistory
 24445 		collect:[:nm | Smalltalk classNamed:nm]
 24459 		collect:[:nm | environment classNamed:nm]
 24446 		as:OrderedCollection
 24460 		as:OrderedCollection
 24447 	].
 24461 	].
 24448 
 24462 
 24449     ^ self spawnClassBrowserForSearch:searchBlock sortBy:nil in:openHow label:'Recently opened applications'
 24463     ^ self spawnClassBrowserForSearch:searchBlock sortBy:nil in:openHow label:'Recently opened applications'
 24450 
 24464 
 24491 
 24505 
 24492     box entryCompletionBlock:[:contents |
 24506     box entryCompletionBlock:[:contents |
 24493 	|s what m|
 24507 	|s what m|
 24494 
 24508 
 24495 	s := contents withoutSpaces.
 24509 	s := contents withoutSpaces.
 24496 	what := DoWhatIMeanSupport poolnameCompletion:s inEnvironment:Smalltalk.
 24510 	what := DoWhatIMeanSupport poolnameCompletion:s inEnvironment:environment.
 24497 	box contents:what first.
 24511 	box contents:what first.
 24498 	(what at:2) size ~~ 1 ifTrue:[
 24512 	(what at:2) size ~~ 1 ifTrue:[
 24499 	    self builder window beep
 24513 	    self builder window beep
 24500 	].
 24514 	].
 24501 	box listView list:(list select:[:entry | s match:entry]).
 24515 	box listView list:(list select:[:entry | s match:entry]).
 24505     box showAtPointer.
 24519     box showAtPointer.
 24506 
 24520 
 24507     poolNameString isEmptyOrNil ifTrue:[
 24521     poolNameString isEmptyOrNil ifTrue:[
 24508 	^ self
 24522 	^ self
 24509     ].
 24523     ].
 24510     pool := Smalltalk classNamed:poolNameString.
 24524     pool := environment classNamed:poolNameString.
 24511     pool isNil ifTrue:[
 24525     pool isNil ifTrue:[
 24512 	Dialog warn:'No such pool: ', poolNameString.
 24526 	Dialog warn:'No such pool: ', poolNameString.
 24513 	^ self.
 24527 	^ self.
 24514     ].
 24528     ].
 24515     pool isSharedPool ifFalse:[
 24529     pool isSharedPool ifFalse:[
 24522 !
 24536 !
 24523 
 24537 
 24524 browseMenuClassesWithFilter:aFilterBlock label:aLabelString
 24538 browseMenuClassesWithFilter:aFilterBlock label:aLabelString
 24525     |searchBlock|
 24539     |searchBlock|
 24526 
 24540 
 24527     searchBlock := [ Smalltalk allClasses select:aFilterBlock ].
 24541     searchBlock := [ environment allClasses select:aFilterBlock ].
 24528 
 24542 
 24529     ^ self
 24543     ^ self
 24530 	spawnClassBrowserForSearch:searchBlock
 24544 	spawnClassBrowserForSearch:searchBlock
 24531 	sortBy:nil
 24545 	sortBy:nil
 24532 	in:#newBuffer
 24546 	in:#newBuffer
 24568 
 24582 
 24569 	newBrowser := self
 24583 	newBrowser := self
 24570 		    spawnClassExtensionBrowserForSearch:[
 24584 		    spawnClassExtensionBrowserForSearch:[
 24571 			|classes|
 24585 			|classes|
 24572 
 24586 
 24573 			classes := Smalltalk allClassesForWhich:[:someClass |
 24587 			classes := environment allClassesForWhich:[:someClass |
 24574 			    |include|
 24588 			    |include|
 24575 
 24589 
 24576 			    include := false.
 24590 			    include := false.
 24577 			    someClass hasExtensions ifTrue:[
 24591 			    someClass hasExtensions ifTrue:[
 24578 				someClass instAndClassMethodsDo:[:m | m isShadowingExtension ifTrue:[include := true]].
 24592 				someClass instAndClassMethodsDo:[:m | m isShadowingExtension ifTrue:[include := true]].
 24638     withMatch ifTrue:[
 24652     withMatch ifTrue:[
 24639 	stringToSearch := '*' , stringToSearch , '*'
 24653 	stringToSearch := '*' , stringToSearch , '*'
 24640     ].
 24654     ].
 24641 
 24655 
 24642     self withWaitCursorDo:[
 24656     self withWaitCursorDo:[
 24643 	classes := Smalltalk allClasses select:[:cls |
 24657 	classes := environment allClasses select:[:cls |
 24644 			|s m found|
 24658 			|s m found|
 24645 
 24659 
 24646 			(cls isLoaded and:[cls isMeta not]) ifTrue:[
 24660 			(cls isLoaded and:[cls isMeta not]) ifTrue:[
 24647 			    self activityNotification:('searching %1 ...' bindWith:cls name).
 24661 			    self activityNotification:('searching %1 ...' bindWith:cls name).
 24648 			    found := false.
 24662 			    found := false.
 25486     "add a new buffer on all wrapped methods
 25500     "add a new buffer on all wrapped methods
 25487      (i.e. that have a break, trace or watchPoint)"
 25501      (i.e. that have a break, trace or watchPoint)"
 25488 
 25502 
 25489     self
 25503     self
 25490 	spawnMethodBrowserForSearch:[
 25504 	spawnMethodBrowserForSearch:[
 25491 	    Smalltalk allMethodsForWhich:[:m | m isWrapped or:[m isMethodWithBreakpoints]].
 25505 	    environment allMethodsForWhich:[:m | m isWrapped or:[m isMethodWithBreakpoints]].
 25492 	]
 25506 	]
 25493 	sortBy:#class in:#newBuffer
 25507 	sortBy:#class in:#newBuffer
 25494 	label:'BreakPointed Methods'
 25508 	label:'BreakPointed Methods'
 25495 !
 25509 !
 25496 
 25510 
 25600 				val ~~ 0 ifTrue:[
 25614 				val ~~ 0 ifTrue:[
 25601 				    baseName := (globlName copyFrom:val+1) asSymbol.
 25615 				    baseName := (globlName copyFrom:val+1) asSymbol.
 25602 				] ifFalse:[
 25616 				] ifFalse:[
 25603 				    baseName := sym.
 25617 				    baseName := sym.
 25604 				].
 25618 				].
 25605 				(val := Smalltalk at:sym) isBehavior ifTrue:[
 25619 				(val := environment at:sym) isBehavior ifTrue:[
 25606 				    otherKeysReferringToValue := OrderedCollection new.
 25620 				    otherKeysReferringToValue := OrderedCollection new.
 25607 				    Smalltalk keysAndValuesDo:[:k :v | v == val ifTrue:[
 25621 				    environment keysAndValuesDo:[:k :v | v == val ifTrue:[
 25608 									   k ~~ sym ifTrue:[
 25622 									   (k ~~ sym and:[k ~~ #'Parser:PrevClass']) ifTrue:[
 25609 									       otherKeysReferringToValue add:k
 25623 									       otherKeysReferringToValue add:k
 25610 									   ]
 25624 									   ]
 25611 								       ]
 25625 								       ]
 25612 							      ].
 25626 							      ].
 25613 				    otherKeysReferringToValue size > 0 ifTrue:[
 25627 				    otherKeysReferringToValue size > 0 ifTrue:[
 25662 						  ]
 25676 						  ]
 25663 				]
 25677 				]
 25664 			   ].
 25678 			   ].
 25665 		       ].
 25679 		       ].
 25666 		       "/ recollect realClasses from names (in case of class-changes)
 25680 		       "/ recollect realClasses from names (in case of class-changes)
 25667 		       realClasses := classes collect:[:eachClass | Smalltalk at:eachClass name].
 25681 		       realClasses := classes collect:[:eachClass | environment at:eachClass name].
 25668 		       self class
 25682 		       self class
 25669 			       findMethodsIn:realClasses
 25683 			       findMethodsIn:realClasses
 25670 			       where:matchBlock
 25684 			       where:matchBlock
 25671 		   ]
 25685 		   ]
 25672 	searchWhat:#globalName
 25686 	searchWhat:#globalName
 25825 "/                        |defaultId methods methodsInOrder|
 25839 "/                        |defaultId methods methodsInOrder|
 25826 "/
 25840 "/
 25827 "/                        methods := OrderedCollection new.
 25841 "/                        methods := OrderedCollection new.
 25828 "/                        defaultId := PackageId noProjectID.
 25842 "/                        defaultId := PackageId noProjectID.
 25829 "/
 25843 "/
 25830 "/                        Smalltalk allMethodsDo:[:mthd |
 25844 "/                        environment allMethodsDo:[:mthd |
 25831 "/                            mthd package = defaultId ifTrue:[
 25845 "/                            mthd package = defaultId ifTrue:[
 25832 "/                                methods add:mthd.
 25846 "/                                methods add:mthd.
 25833 "/                            ].
 25847 "/                            ].
 25834 "/                        ].
 25848 "/                        ].
 25835 "/                        methods
 25849 "/                        methods
 25845 !
 25859 !
 25846 
 25860 
 25847 browseMenuWritesToGlobal
 25861 browseMenuWritesToGlobal
 25848     "launch an enterBox for global to search for writers"
 25862     "launch an enterBox for global to search for writers"
 25849 
 25863 
 25850     |labelHolder alreadyAsked searchAllLabel|
 25864     |labelHolder|
 25851 
 25865 
 25852     labelHolder := 'Methods writing to global ''%1''' asValue.
 25866     labelHolder := 'Methods writing to global ''%1''' asValue.
 25853     self
 25867     self
 25854 	askForMethodAndSpawnSearchTitle:'Global to search:\(TAB for completion; matchPattern allowed)'
 25868 	askForMethodAndSpawnSearchTitle:'Global to search:\(TAB for completion; matchPattern allowed)'
 25855 	browserLabel:labelHolder
 25869 	browserLabel:labelHolder
 25903 "/                                val ~~ 0 ifTrue:[
 25917 "/                                val ~~ 0 ifTrue:[
 25904 "/                                    baseName := (globlName copyFrom:val+1) asSymbol.
 25918 "/                                    baseName := (globlName copyFrom:val+1) asSymbol.
 25905 "/                                ] ifFalse:[
 25919 "/                                ] ifFalse:[
 25906 "/                                    baseName := sym.
 25920 "/                                    baseName := sym.
 25907 "/                                ].
 25921 "/                                ].
 25908 "/                                (val := Smalltalk at:sym) isBehavior ifTrue:[
 25922 "/                                (val := environment at:sym) isBehavior ifTrue:[
 25909 "/                                    otherKeysReferringToValue := OrderedCollection new.
 25923 "/                                    otherKeysReferringToValue := OrderedCollection new.
 25910 "/                                    Smalltalk keysAndValuesDo:[:k :v | v == val ifTrue:[
 25924 "/                                    environment keysAndValuesDo:[:k :v | v == val ifTrue:[
 25911 "/                                                                           k ~~ sym ifTrue:[
 25925 "/                                                                           k ~~ sym ifTrue:[
 25912 "/                                                                               otherKeysReferringToValue add:k
 25926 "/                                                                               otherKeysReferringToValue add:k
 25913 "/                                                                           ]
 25927 "/                                                                           ]
 25914 "/                                                                       ]
 25928 "/                                                                       ]
 25915 "/                                                              ].
 25929 "/                                                              ].
 25919 "/                                            msg := '''%1'' also refers to that value. Search these references too ?'.
 25933 "/                                            msg := '''%1'' also refers to that value. Search these references too ?'.
 25920 "/                                            searchAllLabel := 'Methods referring to ''%1'' or ''%2''' bindWithArguments:keysReferringToValue.
 25934 "/                                            searchAllLabel := 'Methods referring to ''%1'' or ''%2''' bindWithArguments:keysReferringToValue.
 25921 "/                                        ] ifFalse:[
 25935 "/                                        ] ifFalse:[
 25922 "/                                            searchAllLabel := 'Methods referring to the value of ''%1'''.
 25936 "/                                            searchAllLabel := 'Methods referring to the value of ''%1'''.
 25923 "/                                            otherKeysReferringToValue size <= 3 ifTrue:[
 25937 "/                                            otherKeysReferringToValue size <= 3 ifTrue:[
 25924 "/                                                msg := (otherKeysReferringToValue copyButLast:1) asStringWith:', '.
 25938 "/                                                msg := (otherKeysReferringToValue copyWithoutLast:1) asStringWith:', '.
 25925 "/                                                msg := msg , ' and ' , otherKeysReferringToValue last.
 25939 "/                                                msg := msg , ' and ' , otherKeysReferringToValue last.
 25926 "/                                                msg := msg , ' also refer to that value. Search those references too ?'.
 25940 "/                                                msg := msg , ' also refer to that value. Search those references too ?'.
 25927 "/                                            ] ifFalse:[
 25941 "/                                            ] ifFalse:[
 25928 "/                                                msg := 'There are %2 other globals referring to that value. Search those references too ?'.
 25942 "/                                                msg := 'There are %2 other globals referring to that value. Search those references too ?'.
 25929 "/                                            ]
 25943 "/                                            ]
 25974 			    globals:true
 25988 			    globals:true
 25975 			    poolVars:false
 25989 			    poolVars:false
 25976 			    access:#write.
 25990 			    access:#write.
 25977 
 25991 
 25978 		       "/ recollect realClasses from names (in case of class-changes)
 25992 		       "/ recollect realClasses from names (in case of class-changes)
 25979 		       realClasses := classes collect:[:eachClass | Smalltalk at:eachClass name].
 25993 		       realClasses := classes collect:[:eachClass | environment at:eachClass name].
 25980 		       self class
 25994 		       self class
 25981 			   findMethodsIn:realClasses
 25995 			   findMethodsIn:realClasses
 25982 			   where:matchBlock
 25996 			   where:matchBlock
 25983 		   ]
 25997 		   ]
 25984 	searchWhat:#globalName
 25998 	searchWhat:#globalName
 25997 !
 26011 !
 25998 
 26012 
 25999 browseMethodsForWhich:checkBlock in:openHow label:aString
 26013 browseMethodsForWhich:checkBlock in:openHow label:aString
 26000     |searchBlock|
 26014     |searchBlock|
 26001 
 26015 
 26002     searchBlock := [ Smalltalk allMethodsForWhich:checkBlock ].
 26016     searchBlock := [ environment allMethodsForWhich:checkBlock ].
 26003 
 26017 
 26004     ^ self
 26018     ^ self
 26005 	spawnMethodBrowserForSearch:searchBlock
 26019 	spawnMethodBrowserForSearch:searchBlock
 26006 	sortBy:#class
 26020 	sortBy:#class
 26007 	in:openHow
 26021 	in:openHow
 26108 
 26122 
 26109 findClassesWithoutClassMethod:selector
 26123 findClassesWithoutClassMethod:selector
 26110     |classes|
 26124     |classes|
 26111 
 26125 
 26112     classes := IdentitySet new.
 26126     classes := IdentitySet new.
 26113     Smalltalk allClassesDo:[:eachClass |
 26127     environment allClassesDo:[:eachClass |
 26114 	(eachClass isMeta not
 26128 	(eachClass isMeta not
 26115 	and:[eachClass isLoaded
 26129 	and:[eachClass isLoaded
 26116 	and:[eachClass isNameSpace not
 26130 	and:[eachClass isNameSpace not
 26117 	and:[(eachClass class includesSelector:selector) not]]])
 26131 	and:[(eachClass class includesSelector:selector) not]]])
 26118 	ifTrue:[
 26132 	ifTrue:[
 26738 !
 26752 !
 26739 
 26753 
 26740 categoryMenuNewCategory
 26754 categoryMenuNewCategory
 26741     |box newCategory allClassCategories|
 26755     |box newCategory allClassCategories|
 26742 
 26756 
 26743     allClassCategories := Smalltalk allClassCategories.
 26757     allClassCategories := environment allClassCategories.
 26744 
 26758 
 26745     box := self
 26759     box := self
 26746 		enterBoxTitle:'Name of new class category:'
 26760 		enterBoxTitle:'Name of new class category:'
 26747 		okText:'Create'
 26761 		okText:'Create'
 26748 		label:'Create Category'.
 26762 		label:'Create Category'.
 26941 
 26955 
 26942 	    guess isNil ifTrue:[
 26956 	    guess isNil ifTrue:[
 26943 		guess := eachCategory string.
 26957 		guess := eachCategory string.
 26944 	    ].
 26958 	    ].
 26945 
 26959 
 26946 	    allCategories := Smalltalk allClassCategories asArray sort.
 26960 	    allCategories := environment allClassCategories asArray sort.
 26947 	    combosList := LastCategoryRenames.
 26961 	    combosList := LastCategoryRenames.
 26948 	    (combosList size > 0 and:[combosList includes:eachCategory]) ifFalse:[
 26962 	    (combosList size > 0 and:[combosList includes:eachCategory]) ifFalse:[
 26949 		combosList size == 0 ifTrue:[
 26963 		combosList size == 0 ifTrue:[
 26950 		    combosList := List with:eachCategory
 26964 		    combosList := List with:eachCategory
 26951 		] ifFalse:[
 26965 		] ifFalse:[
 27088     pattern := Dialog request:'Match pattern for categories:' initialAnswer:(self theSingleSelectedCategory ? '').
 27102     pattern := Dialog request:'Match pattern for categories:' initialAnswer:(self theSingleSelectedCategory ? '').
 27089     pattern size == 0 ifTrue:[^ self].
 27103     pattern size == 0 ifTrue:[^ self].
 27090     pattern := pattern string.
 27104     pattern := pattern string.
 27091 
 27105 
 27092     matchingCategories := Set new.
 27106     matchingCategories := Set new.
 27093     Smalltalk allClassesAndMetaclassesDo:[:eachClass |
 27107     environment allClassesAndMetaclassesDo:[:eachClass |
 27094 	|cat|
 27108 	|cat|
 27095 
 27109 
 27096 	cat := eachClass category.
 27110 	cat := eachClass category.
 27097 	(pattern match:cat) ifTrue:[
 27111 	(pattern match:cat) ifTrue:[
 27098 	    matchingCategories add:cat.
 27112 	    matchingCategories add:cat.
 27876 	    ^ self
 27890 	    ^ self
 27877 	].
 27891 	].
 27878 	answer == true ifTrue:[
 27892 	answer == true ifTrue:[
 27879 	    self withWaitCursorDo:[
 27893 	    self withWaitCursorDo:[
 27880 		    aClass unload.
 27894 		    aClass unload.
 27881 		    Smalltalk changed:#classDefinition with:aClass
 27895 		    environment changed:#classDefinition with:aClass
 27882 		].
 27896 		].
 27883 	    ^ self
 27897 	    ^ self
 27884 	]
 27898 	]
 27885     ].
 27899     ].
 27886 
 27900 
 28094 	m := self anySelectedMethod.
 28108 	m := self anySelectedMethod.
 28095 	currentClass := m mclass.
 28109 	currentClass := m mclass.
 28096     ].
 28110     ].
 28097 
 28111 
 28098     LastMethodMoveOrCopyTargetClass notNil ifTrue:[
 28112     LastMethodMoveOrCopyTargetClass notNil ifTrue:[
 28099 	initial := Smalltalk classNamed:LastMethodMoveOrCopyTargetClass.
 28113 	initial := environment classNamed:LastMethodMoveOrCopyTargetClass.
 28100 	initial notNil ifTrue:[
 28114 	initial notNil ifTrue:[
 28101 	    (currentClass notNil and:[currentClass theNonMetaclass name = initial name]) ifTrue:[
 28115 	    (currentClass notNil and:[currentClass theNonMetaclass name = initial name]) ifTrue:[
 28102 		initial := nil
 28116 		initial := nil
 28103 	    ]
 28117 	    ]
 28104 	].
 28118 	].
 28361     classList := self classListGenerator value.
 28375     classList := self classListGenerator value.
 28362     self assert:classList isOrderedCollection.
 28376     self assert:classList isOrderedCollection.
 28363 
 28377 
 28364     className := self searchMenuFindClassToAdd.
 28378     className := self searchMenuFindClassToAdd.
 28365     className isNil ifTrue:[^ self].
 28379     className isNil ifTrue:[^ self].
 28366     class := Smalltalk at:className asSymbol ifAbsent:nil.
 28380     class := environment at:className asSymbol ifAbsent:nil.
 28367     class isNil ifTrue:[
 28381     class isNil ifTrue:[
 28368 	^ self warn:'No such class'
 28382 	^ self warn:'No such class'
 28369     ].
 28383     ].
 28370     classList add:class.
 28384     classList add:class.
 28371     classList sort:[:a :b | a name < b name].
 28385     classList sort:[:a :b | a name < b name].
 28551 		    onCancel:nil
 28565 		    onCancel:nil
 28552 		    list:list.
 28566 		    list:list.
 28553     otherClassName isNil ifTrue:[^ self].
 28567     otherClassName isNil ifTrue:[^ self].
 28554     (otherClassName startsWith:'---- ') ifTrue:[^ self].
 28568     (otherClassName startsWith:'---- ') ifTrue:[^ self].
 28555 
 28569 
 28556     otherClass := Smalltalk classNamed:otherClassName.
 28570     otherClass := environment classNamed:otherClassName.
 28557     otherClass isNil ifTrue:[
 28571     otherClass isNil ifTrue:[
 28558 	self warn:'no such class: ', otherClassName.
 28572 	self warn:'no such class: ', otherClassName.
 28559 	^ self
 28573 	^ self
 28560     ].
 28574     ].
 28561 
 28575 
 28589 	^ self
 28603 	^ self
 28590     ].
 28604     ].
 28591 
 28605 
 28592     currentClassName := currentClass name.
 28606     currentClassName := currentClass name.
 28593     newClassName := currentClassName.
 28607     newClassName := currentClassName.
 28594 "/    (nameSpace := currentClass nameSpace) == Smalltalk ifTrue:[
 28608 "/    (nameSpace := currentClass nameSpace) == environment ifTrue:[
 28595 "/        newClassName := 'CopyOf' , currentClassName.
 28609 "/        newClassName := 'CopyOf' , currentClassName.
 28596 "/    ] ifFalse:[
 28610 "/    ] ifFalse:[
 28597 "/        newClassName := nameSpace name , '::' , 'CopyOf' , currentClass nameWithoutPrefix.
 28611 "/        newClassName := nameSpace name , '::' , 'CopyOf' , currentClass nameWithoutPrefix.
 28598 "/    ].
 28612 "/    ].
 28599 
 28613 
 28601 			request:(resources string:'Copy class %1 as:' with:currentClassName allBold)
 28615 			request:(resources string:'Copy class %1 as:' with:currentClassName allBold)
 28602 			initialAnswer:newClassName.
 28616 			initialAnswer:newClassName.
 28603     (newClassName isEmptyOrNil or:[newClassName withoutSeparators = currentClassName]) ifTrue:[
 28617     (newClassName isEmptyOrNil or:[newClassName withoutSeparators = currentClassName]) ifTrue:[
 28604 	^ self
 28618 	^ self
 28605     ].
 28619     ].
 28606     (Smalltalk classNamed:newClassName) notNil ifTrue:[
 28620     (environment classNamed:newClassName) notNil ifTrue:[
 28607 	(self confirm:(resources string:'A class named: ''%1'' already exists.\\Overwrite ?' with:newClassName) withCRs)
 28621 	(self confirm:(resources string:'A class named: ''%1'' already exists.\\Overwrite ?' with:newClassName) withCRs)
 28608 	    ifFalse:[^ self]
 28622 	    ifFalse:[^ self]
 28609     ].
 28623     ].
 28610     (owningClass := currentClass owningClass) notNil ifTrue:[
 28624     (owningClass := currentClass owningClass) notNil ifTrue:[
 28611 	(newClassName startsWith:(owningClass name , '::')) ifTrue:[
 28625 	(newClassName startsWith:(owningClass name , '::')) ifTrue:[
 28612 	    newClassName := newClassName copyFrom:(owningClass name , '::') size + 1.
 28626 	    newClassName := newClassName withoutPrefix:(owningClass name , '::').
 28613 	    newOwnerClass := owningClass.
 28627 	    newOwnerClass := owningClass.
 28614 	] ifFalse:[
 28628 	] ifFalse:[
 28615 	    (newClassName includes:$:) ifTrue:[
 28629 	    (newClassName includes:$:) ifTrue:[
 28616 		idx := newClassName lastIndexOf:$:.
 28630 		idx := newClassName lastIndexOf:$:.
 28617 		ownerName := newClassName copyTo:idx.
 28631 		ownerName := newClassName copyTo:idx.
 28629 	    newClassName := newClassName copyFrom:idx+1.
 28643 	    newClassName := newClassName copyFrom:idx+1.
 28630 	].
 28644 	].
 28631     ].
 28645     ].
 28632 
 28646 
 28633     ownerName notNil ifTrue:[
 28647     ownerName notNil ifTrue:[
 28634 	(Smalltalk classNamed:ownerName) isNil ifTrue:[
 28648 	(environment classNamed:ownerName) isNil ifTrue:[
 28635 	    (Dialog confirm:(resources
 28649 	    (Dialog confirm:(resources
 28636 				stringWithCRs:'No class or nameSpace named: "%1"\\Create as Namespace ?' with:ownerName))
 28650 				stringWithCRs:'No class or nameSpace named: "%1"\\Create as Namespace ?' with:ownerName))
 28637 	    ifFalse:[
 28651 	    ifFalse:[
 28638 		^ self
 28652 		^ self
 28639 	    ].
 28653 	    ].
 28640 	    newOwnerClass := NameSpace fullName:ownerName.
 28654 	    newOwnerClass := NameSpace fullName:ownerName.
 28641 	].
 28655 	].
 28642 	newOwnerClass := Smalltalk at:ownerName asSymbol.
 28656 	newOwnerClass := environment at:ownerName asSymbol.
 28643 	(newOwnerClass == Smalltalk or:[newOwnerClass isNameSpace]) ifTrue:[
 28657 	(newOwnerClass == Smalltalk or:[newOwnerClass isNameSpace]) ifTrue:[
 28644 	    newOwnerClass == Smalltalk ifFalse:[
 28658 	    newOwnerClass == Smalltalk ifFalse:[
 28645 		newClassName := ownerName , '::' , newClassName.
 28659 		newClassName := ownerName , '::' , newClassName.
 28646 	    ].
 28660 	    ].
 28647 	    newOwnerClass := nil.
 28661 	    newOwnerClass := nil.
 29389 	    "/ we have top refetch, because the class is now obsolete (stupid consequence of not having a
 29403 	    "/ we have top refetch, because the class is now obsolete (stupid consequence of not having a
 29390 	    "/ good become).
 29404 	    "/ good become).
 29391 	    "/ refetch to get the present class (sigh)
 29405 	    "/ refetch to get the present class (sigh)
 29392 	    theClass := Smalltalk at:(eachClass theNonMetaclass name).
 29406 	    theClass := Smalltalk at:(eachClass theNonMetaclass name).
 29393 
 29407 
 29394 	    vars := theClass theMetaclass allInstanceVariableNames asSet.
 29408 	    vars := theClass theMetaclass allInstanceVariableNames asNewSet.
 29395 	    vars removeAll:(Class allInstanceVariableNames).
 29409 	    vars removeAll:(Class allInstanceVariableNames).
 29396 
 29410 
 29397 	    (singletonVarName notNil and:[vars includes:singletonVarName]) ifTrue:[
 29411 	    (singletonVarName notNil and:[vars includes:singletonVarName]) ifTrue:[
 29398 		defaultNameForSingleton := singletonVarName
 29412 		defaultNameForSingleton := singletonVarName
 29399 	    ] ifFalse:[
 29413 	    ] ifFalse:[
 29406 		list:(vars asSortedCollection).
 29420 		list:(vars asSortedCollection).
 29407 	    singletonVar isEmptyOrNil ifTrue:[^ self].
 29421 	    singletonVar isEmptyOrNil ifTrue:[^ self].
 29408 
 29422 
 29409 	    (theClass theMetaclass allInstanceVariableNames asSet includes:singletonVar) ifFalse:[
 29423 	    (theClass theMetaclass allInstanceVariableNames asSet includes:singletonVar) ifFalse:[
 29410 		theClass theMetaclass addInstVarName:singletonVar.
 29424 		theClass theMetaclass addInstVarName:singletonVar.
 29411 		theClass := Smalltalk at:(eachClass theNonMetaclass name).
 29425 		theClass := environment at:(eachClass theNonMetaclass name).
 29412 	    ].
 29426 	    ].
 29413 	    generator createSingletonPatternInstanceCreationMethodsIn:theClass usingVariable:singletonVar
 29427 	    generator createSingletonPatternInstanceCreationMethodsIn:theClass usingVariable:singletonVar
 29414 	].
 29428 	].
 29415 
 29429 
 29416     "Created: / 10-02-2011 / 16:28:36 / cg"
 29430     "Created: / 10-02-2011 / 16:28:36 / cg"
 29554 
 29568 
 29555     name := Dialog request:(resources
 29569     name := Dialog request:(resources
 29556 				string:'Enter name for new parent class of the selected class(es):').
 29570 				string:'Enter name for new parent class of the selected class(es):').
 29557     name isEmpty ifTrue: [^self].
 29571     name isEmpty ifTrue: [^self].
 29558 
 29572 
 29559     existingClass := Smalltalk classNamed:name.
 29573     existingClass := environment classNamed:name.
 29560     existingClass notNil ifTrue:[
 29574     existingClass notNil ifTrue:[
 29561 	(Dialog confirm:(resources
 29575 	(Dialog confirm:(resources
 29562 				string:'A Class named "%1" already exists - make the selected class(es) a subclass of it ?'))
 29576 				string:'A Class named "%1" already exists - make the selected class(es) a subclass of it ?'))
 29563 	ifFalse:[
 29577 	ifFalse:[
 29564 	    ^ self
 29578 	    ^ self
 29778 		    list:list
 29792 		    list:list
 29779 		    entryCompletionBlock:(DoWhatIMeanSupport classNameEntryCompletionBlock).
 29793 		    entryCompletionBlock:(DoWhatIMeanSupport classNameEntryCompletionBlock).
 29780     newOwnerName isNil ifTrue:[^ self].
 29794     newOwnerName isNil ifTrue:[^ self].
 29781     (newOwnerName startsWith:'---- ') ifTrue:[^ self].
 29795     (newOwnerName startsWith:'---- ') ifTrue:[^ self].
 29782 
 29796 
 29783     newOwner := Smalltalk classNamed:newOwnerName.
 29797     newOwner := environment classNamed:newOwnerName.
 29784     newOwner isNil ifTrue:[
 29798     newOwner isNil ifTrue:[
 29785 	(currentClass nameSpace notNil and:[currentClass nameSpace ~~ Smalltalk]) ifTrue:[
 29799 	(currentClass nameSpace notNil and:[currentClass nameSpace ~~ Smalltalk]) ifTrue:[
 29786 	    newOwner := currentClass nameSpace classNamed:newOwnerName
 29800 	    newOwner := currentClass nameSpace classNamed:newOwnerName
 29787 	].
 29801 	].
 29788     ].
 29802     ].
 29793 
 29807 
 29794     classes := self selectedNonMetaclasses.
 29808     classes := self selectedNonMetaclasses.
 29795     classes do:[:eachClass |
 29809     classes do:[:eachClass |
 29796 	eachClass autoload.
 29810 	eachClass autoload.
 29797 	newName := newOwner name , '::' , eachClass nameWithoutPrefix.
 29811 	newName := newOwner name , '::' , eachClass nameWithoutPrefix.
 29798 	(Smalltalk classNamed:newName) notNil ifTrue:[
 29812 	(environment classNamed:newName) notNil ifTrue:[
 29799 	    (Smalltalk classNamed:newName) ~~ eachClass ifTrue:[
 29813 	    (environment classNamed:newName) ~~ eachClass ifTrue:[
 29800 		self warn:'A class named ' , newName , ' already exists.'.
 29814 		self warn:'A class named ' , newName , ' already exists.'.
 29801 		^ self
 29815 		^ self
 29802 	    ].
 29816 	    ].
 29803 	].
 29817 	].
 29804 	(newOwner == eachClass) ifTrue:[
 29818 	(newOwner == eachClass) ifTrue:[
 29835 		    default:3.
 29849 		    default:3.
 29836 	    nsName isEmptyOrNil ifTrue:[^ self].
 29850 	    nsName isEmptyOrNil ifTrue:[^ self].
 29837 	    nsName isNameSpace ifTrue:[
 29851 	    nsName isNameSpace ifTrue:[
 29838 		ns := nsName
 29852 		ns := nsName
 29839 	    ] ifFalse:[
 29853 	    ] ifFalse:[
 29840 		ns := Smalltalk at:nsName.
 29854 		ns := environment at:nsName.
 29841 	    ].
 29855 	    ].
 29842 	].
 29856 	].
 29843 
 29857 
 29844 	(ns classNamed:baseName) notNil ifTrue:[
 29858 	(ns classNamed:baseName) notNil ifTrue:[
 29845 	    self warn:(resources
 29859 	    self warn:(resources
 29863     nsName := self
 29877     nsName := self
 29864 	    askForNameSpace:(resources string:'Make classes public in which Namespace ?')
 29878 	    askForNameSpace:(resources string:'Make classes public in which Namespace ?')
 29865 	    title:(resources string:'Move to Namespace')
 29879 	    title:(resources string:'Move to Namespace')
 29866 	    initialText:(LastNameSpaceMove ? '').
 29880 	    initialText:(LastNameSpaceMove ? '').
 29867     nsName isEmptyOrNil ifTrue:[^ self].
 29881     nsName isEmptyOrNil ifTrue:[^ self].
 29868     ns := Smalltalk at:nsName asSymbol.
 29882     ns := environment at:nsName asSymbol.
 29869     LastNameSpaceMove := nsName.
 29883     LastNameSpaceMove := nsName.
 29870 
 29884 
 29871     self selectedNonMetaclassesDo:[:eachClass |
 29885     self selectedNonMetaclassesDo:[:eachClass |
 29872 	baseName := eachClass nameWithoutPrefix.
 29886 	baseName := eachClass nameWithoutPrefix.
 29873 
 29887 
 29885 !
 29899 !
 29886 
 29900 
 29887 classMenuMoveToCategory
 29901 classMenuMoveToCategory
 29888     |allCategories box|
 29902     |allCategories box|
 29889 
 29903 
 29890     allCategories := Smalltalk allClassCategories asArray sort.
 29904     allCategories := environment allClassCategories asArray sort.
 29891 
 29905 
 29892     box := ListSelectionBox new.
 29906     box := ListSelectionBox new.
 29893     box title:(resources string:'Move class(es) to which category:').
 29907     box title:(resources string:'Move class(es) to which category:').
 29894     box list:allCategories.
 29908     box list:allCategories.
 29895     box okAction:[:sel |
 29909     box okAction:[:sel |
 29900     box initialText:(LastCategoryRenames ? #('')) first.
 29914     box initialText:(LastCategoryRenames ? #('')) first.
 29901     box entryCompletionBlock:[:contents |
 29915     box entryCompletionBlock:[:contents |
 29902 	|s what|
 29916 	|s what|
 29903 
 29917 
 29904 	s := contents withoutLeadingSeparators.
 29918 	s := contents withoutLeadingSeparators.
 29905 	what := Smalltalk classCategoryCompletion:s.
 29919 	what := environment classCategoryCompletion:s.
 29906 	box contents:what first.
 29920 	box contents:what first.
 29907 	(what at:2) size ~~ 1 ifTrue:[
 29921 	(what at:2) size ~~ 1 ifTrue:[
 29908 	    self builder window beep
 29922 	    self builder window beep
 29909 	]
 29923 	]
 29910     ].
 29924     ].
 29924 			askForNameSpace:'Move class(es) to which nameSpace:'
 29938 			askForNameSpace:'Move class(es) to which nameSpace:'
 29925 			title:(resources string:'Move to Namespace')
 29939 			title:(resources string:'Move to Namespace')
 29926 			initialText:(LastNameSpaceMove ? '').
 29940 			initialText:(LastNameSpaceMove ? '').
 29927     newNameSpace size == 0 ifTrue:[^ self].
 29941     newNameSpace size == 0 ifTrue:[^ self].
 29928 
 29942 
 29929     ns := Smalltalk at:newNameSpace asSymbol.
 29943     ns := environment at:newNameSpace asSymbol.
 29930     ns isNil ifTrue:[
 29944     ns isNil ifTrue:[
 29931 	(self confirm:(resources string:'No such nameSpace exists.\\Create "%1" ?' with:newNameSpace) withCRs) ifFalse:[
 29945 	(self confirm:(resources string:'No such nameSpace exists.\\Create "%1" ?' with:newNameSpace) withCRs) ifFalse:[
 29932 	    ^ self
 29946 	    ^ self
 29933 	].
 29947 	].
 29934 	ns := NameSpace name:newNameSpace asSymbol
 29948 	ns := NameSpace name:newNameSpace asSymbol
 30294     dialog accepted ifFalse:[^ self].
 30308     dialog accepted ifFalse:[^ self].
 30295 
 30309 
 30296     language := dialog language.
 30310     language := dialog language.
 30297     newClassName := dialog classNameHolder value withoutSeparators.
 30311     newClassName := dialog classNameHolder value withoutSeparators.
 30298     superclassName := dialog superclassNameHolder value withoutSeparators.
 30312     superclassName := dialog superclassNameHolder value withoutSeparators.
 30299     superclass := Smalltalk classNamed:superclassName.
 30313     superclass := environment classNamed:superclassName.
 30300     package := (dialog packageHolder value ? '') withoutSeparators.
 30314     package := (dialog packageHolder value ? '') withoutSeparators.
 30301     namespaceName := (dialog nameSpaceHolder value ? 'Smalltalk') withoutSeparators.
 30315     namespaceName := (dialog nameSpaceHolder value ? 'Smalltalk') withoutSeparators.
 30302     category := (dialog categoryHolder value ? '* as yet unspecified *') withoutSeparators.
 30316     category := (dialog categoryHolder value ? '* as yet unspecified *') withoutSeparators.
 30303 
 30317 
 30304     (namespaceName = 'Smalltalk') ifTrue:[
 30318     (namespaceName = 'Smalltalk') ifTrue:[
 30627     newNameString = currentClass name ifTrue:[^ self].
 30641     newNameString = currentClass name ifTrue:[^ self].
 30628 
 30642 
 30629     "/ extract owner or namespace, to see if this implies a change
 30643     "/ extract owner or namespace, to see if this implies a change
 30630     newOwnerOrNameSpacePath := OrderedCollection new.
 30644     newOwnerOrNameSpacePath := OrderedCollection new.
 30631 
 30645 
 30632     nsOrOwner := Smalltalk.
 30646     nsOrOwner := environment.
 30633     s := newNameString readStream.
 30647     s := newNameString readStream.
 30634     [s atEnd] whileFalse:[
 30648     [s atEnd] whileFalse:[
 30635 	nextWord := s nextAlphaNumericWord.
 30649 	nextWord := s nextAlphaNumericWord.
 30636 	[s peek == $_] whileTrue:[
 30650 	[s peek == $_] whileTrue:[
 30637 	    nextWord := nextWord , '_' , s nextAlphaNumericWord.
 30651 	    nextWord := nextWord , '_' , s nextAlphaNumericWord.
 30679 	]
 30693 	]
 30680     ].
 30694     ].
 30681 
 30695 
 30682     "/ check if the target already exists - confirm if so.
 30696     "/ check if the target already exists - confirm if so.
 30683 
 30697 
 30684     (cls := Smalltalk classNamed:newNameString) notNil ifTrue:[
 30698     (cls := environment classNamed:newNameString) notNil ifTrue:[
 30685 	(self confirm:(resources string:'Attention: a class named ''%1'' already present (in the ''%2'' category).\\Rename over it ?'
 30699 	(self confirm:(resources string:'Attention: a class named ''%1'' already present (in the ''%2'' category).\\Rename over it ?'
 30686 				 with:newNameString allBold
 30700 				 with:newNameString allBold
 30687 				 with:cls category allBold) withCRs)
 30701 				 with:cls category allBold) withCRs)
 30688 	    ifFalse:[^ self]
 30702 	    ifFalse:[^ self]
 30689     ].
 30703     ].
 30712 	]
 30726 	]
 30713     ].
 30727     ].
 30714 
 30728 
 30715     self busyLabel:('Searching for references to ' , oldSym).
 30729     self busyLabel:('Searching for references to ' , oldSym).
 30716     referingMethods := SystemBrowser
 30730     referingMethods := SystemBrowser
 30717 			    allMethodsIn:(Smalltalk allClasses)
 30731 			    allMethodsIn:(environment allClasses)
 30718 			    where:(SystemBrowser searchBlockForReferendsOf:oldSym).
 30732 			    where:(SystemBrowser searchBlockForReferendsOf:oldSym).
 30719     self normalLabel.
 30733     self normalLabel.
 30720     referingMethods isEmpty ifTrue:[
 30734     referingMethods isEmpty ifTrue:[
 30721 	Smalltalk renameClass:currentClass to:newNameString.
 30735 	Smalltalk renameClass:currentClass to:newNameString.
 30722     ] ifFalse:[
 30736     ] ifFalse:[
 30770 	    ].
 30784 	    ].
 30771 	].
 30785 	].
 30772 	answer == #renameAndRewrite ifTrue:[
 30786 	answer == #renameAndRewrite ifTrue:[
 30773 	    self performRefactoring:(RenameClassRefactoring renameClassNamed:oldSym to:newNameString).
 30787 	    self performRefactoring:(RenameClassRefactoring renameClassNamed:oldSym to:newNameString).
 30774 	    referingMethods := SystemBrowser
 30788 	    referingMethods := SystemBrowser
 30775 			    allMethodsIn:(Smalltalk allClasses)
 30789 			    allMethodsIn:(environment allClasses)
 30776 			    where:(SystemBrowser searchBlockForReferendsOf:newNameString).
 30790 			    where:(SystemBrowser searchBlockForReferendsOf:newNameString).
 30777 	    UserInformation ignoreIn:[
 30791 	    UserInformation ignoreIn:[
 30778 		browser := self
 30792 		browser := self
 30779 			    spawnMethodBrowserFor:referingMethods
 30793 			    spawnMethodBrowserFor:referingMethods
 30780 			    in:#newBuffer
 30794 			    in:#newBuffer
 30788 
 30802 
 30789     askForNewContainer ifTrue:[
 30803     askForNewContainer ifTrue:[
 30790 	(self confirm:(resources string:'Create a new source container for ''%1'' ?' with:newNameString allBold))
 30804 	(self confirm:(resources string:'Create a new source container for ''%1'' ?' with:newNameString allBold))
 30791 	ifTrue:[
 30805 	ifTrue:[
 30792 	    currentClass setClassFilename:nil.
 30806 	    currentClass setClassFilename:nil.
 30793 	    SourceCodeManagerUtilities default createSourceContainerForClass:(Smalltalk at:newNameString asSymbol)
 30807 	    SourceCodeManagerUtilities default createSourceContainerForClass:(environment at:newNameString asSymbol)
 30794 	]
 30808 	]
 30795     ].
 30809     ].
 30796 
 30810 
 30797     "Modified: / 01-06-2012 / 10:30:08 / cg"
 30811     "Modified: / 01-06-2012 / 10:30:08 / cg"
 30798 !
 30812 !
 31078 	]
 31092 	]
 31079     ] ifFalse:[
 31093     ] ifFalse:[
 31080 	(selectedNamespaces := self selectedNamespaces value) size > 0 ifTrue:[
 31094 	(selectedNamespaces := self selectedNamespaces value) size > 0 ifTrue:[
 31081 	    selectedNamespaces size == 1 ifTrue:[
 31095 	    selectedNamespaces size == 1 ifTrue:[
 31082 		selectedNamespaces first ~= BrowserList nameListEntryForALL ifTrue:[
 31096 		selectedNamespaces first ~= BrowserList nameListEntryForALL ifTrue:[
 31083 		    currentNamespace := Smalltalk at:selectedNamespaces first asSymbol.
 31097 		    currentNamespace := environment at:selectedNamespaces first asSymbol.
 31084 		]
 31098 		]
 31085 	    ]
 31099 	    ]
 31086 	]
 31100 	]
 31087     ].
 31101     ].
 31088 
 31102 
 31172 	existingNames size > 0 ifTrue:[
 31186 	existingNames size > 0 ifTrue:[
 31173 	    existingNames := existingNames collect:[:cls | cls name].
 31187 	    existingNames := existingNames collect:[:cls | cls name].
 31174 	]
 31188 	]
 31175     ] ifFalse:[
 31189     ] ifFalse:[
 31176 	namePrefix := ''.
 31190 	namePrefix := ''.
 31177 	existingNames := Smalltalk keys
 31191 	existingNames := environment keys
 31178     ].
 31192     ].
 31179 
 31193 
 31180     name := nsTemplate , nameProto , i printString.
 31194     name := nsTemplate , nameProto , i printString.
 31181     existingNames notNil ifTrue:[
 31195     existingNames notNil ifTrue:[
 31182 	nameUsed := namePrefix , name.
 31196 	nameUsed := namePrefix , name.
 31322 
 31336 
 31323     newMetaclass := newClass class.
 31337     newMetaclass := newClass class.
 31324     newMetaclass instanceVariableNames:(aClass class instanceVariableString).
 31338     newMetaclass instanceVariableNames:(aClass class instanceVariableString).
 31325 
 31339 
 31326     "/ sigh - must refetch in case of changed instVars.
 31340     "/ sigh - must refetch in case of changed instVars.
 31327     newClass := Smalltalk at:realNewClassName.
 31341     newClass := environment at:realNewClassName.
 31328     newMetaclass := newClass class.
 31342     newMetaclass := newClass class.
 31329 
 31343 
 31330     aClass methodDictionary
 31344     aClass methodDictionary
 31331 	keysAndValuesDo:[:sel :mthd |
 31345 	keysAndValuesDo:[:sel :mthd |
 31332 	    newClass compile:(mthd source) classified:(mthd category)
 31346 	    newClass compile:(mthd source) classified:(mthd category)
 31386 	].
 31400 	].
 31387     ].
 31401     ].
 31388 
 31402 
 31389     movedInstMethods notEmpty ifTrue:[
 31403     movedInstMethods notEmpty ifTrue:[
 31390 	aClass theNonMetaclass changed:#projectOrganization.
 31404 	aClass theNonMetaclass changed:#projectOrganization.
 31391 	Smalltalk changed:#projectOrganization with:(Array with:aClass theNonMetaclass with:movedInstMethods).
 31405 	environment changed:#projectOrganization with:(Array with:aClass theNonMetaclass with:movedInstMethods).
 31392     ].
 31406     ].
 31393     movedClassMethods notEmpty ifTrue:[
 31407     movedClassMethods notEmpty ifTrue:[
 31394 	aClass theMetaclass changed:#projectOrganization.
 31408 	aClass theMetaclass changed:#projectOrganization.
 31395 	Smalltalk changed:#projectOrganization with:(Array with:aClass theMetaclass with:movedClassMethods).
 31409 	environment changed:#projectOrganization with:(Array with:aClass theMetaclass with:movedClassMethods).
 31396     ]
 31410     ]
 31397 
 31411 
 31398     "Modified: / 09-03-2012 / 23:41:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 31412     "Modified: / 09-03-2012 / 23:41:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 31399 !
 31413 !
 31400 
 31414 
 31717     classes do:[:eachClass |
 31731     classes do:[:eachClass |
 31718 	|cls|
 31732 	|cls|
 31719 
 31733 
 31720 	cls := eachClass theNonMetaclass.
 31734 	cls := eachClass theNonMetaclass.
 31721 	cls isPrivate ifFalse:[
 31735 	cls isPrivate ifFalse:[
 31722 	    Smalltalk changeCategoryOf:cls to:newCategory.
 31736 	    environment changeCategoryOf:cls to:newCategory.
 31723 	]
 31737 	]
 31724     ].
 31738     ].
 31725 
 31739 
 31726     LastCategoryRenames isNil ifTrue:[
 31740     LastCategoryRenames isNil ifTrue:[
 31727 	LastCategoryRenames := OrderedCollection new.
 31741 	LastCategoryRenames := OrderedCollection new.
 31729     LastCategoryRenames remove:newCategory ifAbsent:nil.
 31743     LastCategoryRenames remove:newCategory ifAbsent:nil.
 31730     LastCategoryRenames addFirst:newCategory.
 31744     LastCategoryRenames addFirst:newCategory.
 31731     LastCategoryRenames size > 10 ifTrue:[
 31745     LastCategoryRenames size > 10 ifTrue:[
 31732 	LastCategoryRenames removeLast.
 31746 	LastCategoryRenames removeLast.
 31733     ].
 31747     ].
       
 31748 
       
 31749     "Modified: / 04-09-2013 / 17:45:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 31734 !
 31750 !
 31735 
 31751 
 31736 moveClasses:classes toProject:newProject
 31752 moveClasses:classes toProject:newProject
 31737     "change the packageID of the given classes
 31753     "change the packageID of the given classes
 31738      (and optionally the packageID of any methods (if they are from different packages)"
 31754      (and optionally the packageID of any methods (if they are from different packages)"
 31786 	    ].
 31802 	    ].
 31787 	].
 31803 	].
 31788 	anyMethodMoved ifTrue:[
 31804 	anyMethodMoved ifTrue:[
 31789 	    theClass changed:#projectOrganization.
 31805 	    theClass changed:#projectOrganization.
 31790 	    theClass theMetaclass changed:#projectOrganization.
 31806 	    theClass theMetaclass changed:#projectOrganization.
 31791 	    Smalltalk changed:#projectOrganization with:(Array with:theClass with:oldProject).
 31807 	    environment changed:#projectOrganization with:(Array with:theClass with:oldProject).
 31792 	].
 31808 	].
 31793     ].
 31809     ].
 31794     anyClassMoved ifTrue:[
 31810     anyClassMoved ifTrue:[
 31795 	Smalltalk changed:#projectOrganization.
 31811 	environment changed:#projectOrganization.
 31796     ].
 31812     ].
 31797     self rememberLastProjectMoveTo:newProject
 31813     self rememberLastProjectMoveTo:newProject
 31798 
 31814 
 31799     "Modified: / 02-08-2013 / 14:26:03 / cg"
 31815     "Modified: / 02-08-2013 / 14:26:03 / cg"
 31800 !
 31816 !
 32358 			].
 32374 			].
 32359 		].
 32375 		].
 32360 
 32376 
 32361 	    symOutsideNamespace := eachNonMetaClassInQuestion name.
 32377 	    symOutsideNamespace := eachNonMetaClassInQuestion name.
 32362 
 32378 
 32363 	    refsHere := findRefs value:(Smalltalk allClasses) value:symOutsideNamespace value:symOutsideNamespace.
 32379 	    refsHere := findRefs value:(environment allClasses) value:symOutsideNamespace value:symOutsideNamespace.
 32364 	    allRefs addAll:refsHere.
 32380 	    allRefs addAll:refsHere.
 32365 
 32381 
 32366 	    (eachNonMetaClassInQuestion nameSpace notNil
 32382 	    (eachNonMetaClassInQuestion nameSpace notNil
 32367 	    and:[ eachNonMetaClassInQuestion nameSpace ~~ Smalltalk ]) ifTrue:[
 32383 	    and:[ eachNonMetaClassInQuestion nameSpace ~~ Smalltalk ]) ifTrue:[
 32368 		symInsideNamespace := eachNonMetaClassInQuestion nameWithoutNameSpacePrefix asSymbol.
 32384 		symInsideNamespace := eachNonMetaClassInQuestion nameWithoutNameSpacePrefix asSymbol.
 35578     currentMethod := self theSingleSelectedMethod.
 35594     currentMethod := self theSingleSelectedMethod.
 35579     cls := currentMethod mclass.
 35595     cls := currentMethod mclass.
 35580     selector := currentMethod selector.
 35596     selector := currentMethod selector.
 35581 
 35597 
 35582     "/ how many senders are there ?
 35598     "/ how many senders are there ?
 35583     senders := SystemBrowser findSendersOf:selector in:(Smalltalk allClasses) ignoreCase:false match:false.
 35599     senders := SystemBrowser findSendersOf:selector in:(environment allClasses) ignoreCase:false match:false.
 35584     nSenders := senders size.
 35600     nSenders := senders size.
 35585 
 35601 
 35586     tree := cls parseTreeFor:selector.
 35602     tree := cls parseTreeFor:selector.
 35587     tree isNil ifTrue:[
 35603     tree isNil ifTrue:[
 35588 	self warn: 'Could not parse the method'.
 35604 	self warn: 'Could not parse the method'.
 35634 			addParameterToMethod:selector
 35650 			addParameterToMethod:selector
 35635 			in:cls
 35651 			in:cls
 35636 			newSelector:newSelector
 35652 			newSelector:newSelector
 35637 			initializer:initializer.
 35653 			initializer:initializer.
 35638 
 35654 
 35639     (self findSendersOf:selector in:(Smalltalk allClasses) andConfirmRefactoring:refactoring) ifTrue:[
 35655     (self findSendersOf:selector in:(environment allClasses) andConfirmRefactoring:refactoring) ifTrue:[
 35640 	self performRefactoring:refactoring.
 35656 	self performRefactoring:refactoring.
 35641 	self switchToSelector:newSelector
 35657 	self switchToSelector:newSelector
 35642     ]
 35658     ]
 35643 
 35659 
 35644     "Modified: / 09-02-2011 / 13:54:16 / cg"
 35660     "Modified: / 09-02-2011 / 13:54:16 / cg"
 35679     |varName cls refactoring|
 35695     |varName cls refactoring|
 35680 
 35696 
 35681     varName := self codeView selectionAsString.
 35697     varName := self codeView selectionAsString.
 35682     (varName isValidSmalltalkIdentifier
 35698     (varName isValidSmalltalkIdentifier
 35683     and:[ varName isUppercaseFirst
 35699     and:[ varName isUppercaseFirst
 35684     and:[ (Smalltalk includesKey:varName) not
 35700     and:[ (environment includesKey:varName) not
 35685     and:[ (cls := self theSingleSelectedClass) notNil
 35701     and:[ (cls := self theSingleSelectedClass) notNil
 35686     and:[ (cls theNonMetaclass classVarNames includes:varName) not
 35702     and:[ (cls theNonMetaclass classVarNames includes:varName) not
 35687     ]]]]) ifFalse:[
 35703     ]]]]) ifFalse:[
 35688 	^ self.
 35704 	^ self.
 35689     ].
 35705     ].
 36096 "/    refactoring model name:('inline %1 into %2' bindWith:inlinedSelector with:selector).
 36112 "/    refactoring model name:('inline %1 into %2' bindWith:inlinedSelector with:selector).
 36097     rslt := self performRefactoring:refactoring.
 36113     rslt := self performRefactoring:refactoring.
 36098     rslt isNil ifTrue:[^ self ].
 36114     rslt isNil ifTrue:[^ self ].
 36099 
 36115 
 36100     senders := self class findSendersOf:inlinedSelector
 36116     senders := self class findSendersOf:inlinedSelector
 36101 		    in:Smalltalk allClasses
 36117 		    in:environment allClasses
 36102 		    ignoreCase:false
 36118 		    ignoreCase:false
 36103 		    match:false.
 36119 		    match:false.
 36104 
 36120 
 36105     senders isEmpty ifTrue:[
 36121     senders isEmpty ifTrue:[
 36106 	(self confirm:('There seem to be no more senders of ', inlinedSelector , '.\\Remove the implementation in ' , cls name , ' ?') withCRs)
 36122 	(self confirm:('There seem to be no more senders of ', inlinedSelector , '.\\Remove the implementation in ' , cls name , ' ?') withCRs)
 36256 	self performRefactoring:refactoring.
 36272 	self performRefactoring:refactoring.
 36257 
 36273 
 36258 	immediateUpdate value:false.
 36274 	immediateUpdate value:false.
 36259 
 36275 
 36260 	"/ must reselect manually here
 36276 	"/ must reselect manually here
 36261 	newClass := Smalltalk classNamed:(mClass name).
 36277 	newClass := environment classNamed:(mClass name).
 36262 	newMethod := newClass compiledMethodAt:mSelector.
 36278 	newMethod := newClass compiledMethodAt:mSelector.
 36263 	newClass ~~ self theSingleSelectedClass ifTrue:[
 36279 	newClass ~~ self theSingleSelectedClass ifTrue:[
 36264 	    self selectClass:newClass.
 36280 	    self selectClass:newClass.
 36265 	].
 36281 	].
 36266 	newMethod ~~ self theSingleSelectedMethod ifTrue:[
 36282 	newMethod ~~ self theSingleSelectedMethod ifTrue:[
 37012 
 37028 
 37013     "Modified: / 20-11-2006 / 12:31:12 / cg"
 37029     "Modified: / 20-11-2006 / 12:31:12 / cg"
 37014 !
 37030 !
 37015 
 37031 
 37016 findSendersOf:selector andConfirmRefactoring:refactoring
 37032 findSendersOf:selector andConfirmRefactoring:refactoring
 37017     ^ self findSendersOf:selector in:(Smalltalk allClasses) andConfirmRefactoring:refactoring
 37033     ^ self findSendersOf:selector in:(environment allClasses) andConfirmRefactoring:refactoring
 37018 
 37034 
 37019     "Modified: / 28-02-2007 / 21:20:23 / cg"
 37035     "Modified: / 28-02-2007 / 21:20:23 / cg"
 37020 !
 37036 !
 37021 
 37037 
 37022 findSendersOf:selector in:aSetOfClasses andConfirmRefactoring:refactoring
 37038 findSendersOf:selector in:aSetOfClasses andConfirmRefactoring:refactoring
 37379 	    InstrumentationInfo allInfosOfClass:cls do:[:info |
 37395 	    InstrumentationInfo allInfosOfClass:cls do:[:info |
 37380 		info cleanInfoWithChange:false
 37396 		info cleanInfoWithChange:false
 37381 	    ]
 37397 	    ]
 37382 	].
 37398 	].
 37383     ].
 37399     ].
 37384     Smalltalk changed:#coverageInfo.
 37400     environment changed:#coverageInfo.
 37385     self showCoverageInformation changed.   "/ to force update
 37401     self showCoverageInformation changed.   "/ to force update
 37386 !
 37402 !
 37387 
 37403 
 37388 commonTraceHelperWith:aSelector with:argumentOrNil clear:doClearAnyPreviousWrap
 37404 commonTraceHelperWith:aSelector with:argumentOrNil clear:doClearAnyPreviousWrap
 37389     "install a break/trace or countPoint for the current method(s).
 37405     "install a break/trace or countPoint for the current method(s).
 37712     "clear all coverage information"
 37728     "clear all coverage information"
 37713 
 37729 
 37714     self withWaitCursorDo:[
 37730     self withWaitCursorDo:[
 37715 	InstrumentedMethod cleanAllInfoWithChange:false
 37731 	InstrumentedMethod cleanAllInfoWithChange:false
 37716     ].
 37732     ].
 37717     Smalltalk changed:#coverageInfo.
 37733     environment changed:#coverageInfo.
 37718     self showCoverageInformation changed.   "/ to force update
 37734     self showCoverageInformation changed.   "/ to force update
 37719 
 37735 
 37720     "Created: / 27-04-2010 / 19:00:32 / cg"
 37736     "Created: / 27-04-2010 / 19:00:32 / cg"
 37721 !
 37737 !
 37722 
 37738 
 38344      "
 38360      "
 38345 
 38361 
 38346     |selectedNameSpaces selectedNameSpaceClasses|
 38362     |selectedNameSpaces selectedNameSpaceClasses|
 38347 
 38363 
 38348     selectedNameSpaces := self selectedNamespaces value.
 38364     selectedNameSpaces := self selectedNamespaces value.
 38349     selectedNameSpaceClasses := Smalltalk allClasses select:[:eachClass |
 38365     selectedNameSpaceClasses := environment allClasses select:[:eachClass |
 38350 								  eachClass isPrivate not
 38366 								  eachClass isPrivate not
 38351 								  and:[selectedNameSpaces includes:eachClass nameSpace name]
 38367 								  and:[selectedNameSpaces includes:eachClass nameSpace name]
 38352 							     ] .
 38368 							     ] .
 38353 
 38369 
 38354     self checkOutClasses:selectedNameSpaceClasses askForRevision:true
 38370     self checkOutClasses:selectedNameSpaceClasses askForRevision:true
 38361 
 38377 
 38362     nm := Dialog request:(resources string:'Name of new NameSpace:').
 38378     nm := Dialog request:(resources string:'Name of new NameSpace:').
 38363     (nm isNil or:[(nm := nm withoutSeparators) size == 0]) ifTrue:[
 38379     (nm isNil or:[(nm := nm withoutSeparators) size == 0]) ifTrue:[
 38364 	^ self
 38380 	^ self
 38365     ].
 38381     ].
 38366     existing := Smalltalk at:nm asSymbol ifAbsent:nil.
 38382     existing := environment at:nm asSymbol ifAbsent:nil.
 38367     existing notNil ifTrue:[
 38383     existing notNil ifTrue:[
 38368 	existing isNameSpace ifTrue:[
 38384 	existing isNameSpace ifTrue:[
 38369 	    self warn:'A NameSpace named ''%1'' alread exists.' with:nm.
 38385 	    self warn:'A NameSpace named ''%1'' alread exists.' with:nm.
 38370 	    ^ self
 38386 	    ^ self
 38371 	].
 38387 	].
 38382     ns isNil ifTrue:[
 38398     ns isNil ifTrue:[
 38383 	self warn:'Could not create new NameSpace ''%1''.' with:nm.
 38399 	self warn:'Could not create new NameSpace ''%1''.' with:nm.
 38384 	^ self
 38400 	^ self
 38385     ].
 38401     ].
 38386     self selectedNamespaces value:(Array with:nm)
 38402     self selectedNamespaces value:(Array with:nm)
       
 38403 
       
 38404     "Modified: / 04-09-2013 / 17:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 38387 !
 38405 !
 38388 
 38406 
 38389 nameSpaceMenuRemove
 38407 nameSpaceMenuRemove
 38390     "remove the selected namespace(s)"
 38408     "remove the selected namespace(s)"
 38391 
 38409 
 38392     self selectedNamespacesValue do:[:nm |
 38410     self selectedNamespacesValue do:[:nm |
 38393 	|ns|
 38411 	|ns|
 38394 
 38412 
 38395 	nm ~= BrowserList nameListEntryForALL ifTrue:[
 38413 	nm ~= BrowserList nameListEntryForALL ifTrue:[
 38396 	    ns := Smalltalk at:nm asSymbol.
 38414 	    ns := environment at:nm asSymbol.
 38397 	    Smalltalk removeClass:ns.
 38415 	    environment removeClass:ns.
 38398 	]
 38416 	]
 38399     ].
 38417     ].
 38400 !
 38418 !
 38401 
 38419 
 38402 nameSpaceMenuRename
 38420 nameSpaceMenuRename
 39010 
 39028 
 39011     setupDefaultType :=
 39029     setupDefaultType :=
 39012 	[:package |
 39030 	[:package |
 39013 	    |classesInPackage|
 39031 	    |classesInPackage|
 39014 
 39032 
 39015 	    classesInPackage := Smalltalk allClassesInPackage:package.
 39033 	    classesInPackage := environment allClassesInPackage:package.
 39016 	    classesInPackage isEmpty ifTrue:[
 39034 	    classesInPackage isEmpty ifTrue:[
 39017 		defaultProjectType := LastNewProjectType ? ProjectDefinition guiApplicationType
 39035 		defaultProjectType := LastNewProjectType ? ProjectDefinition guiApplicationType
 39018 	    ] ifFalse:[
 39036 	    ] ifFalse:[
 39019 		(classesInPackage contains:[:cls | cls isBrowserStartable]) ifTrue:[
 39037 		(classesInPackage contains:[:cls | cls isBrowserStartable]) ifTrue:[
 39020 		    (classesInPackage contains:[:cls | cls isVisualStartable])
 39038 		    (classesInPackage contains:[:cls | cls isVisualStartable])
 39734 	    mgr := SourceCodeManager
 39752 	    mgr := SourceCodeManager
 39735 	] ifFalse:[
 39753 	] ifFalse:[
 39736 	    mgr := SourceCodeManagerUtilities sourceCodeManagerFor:definitionClass
 39754 	    mgr := SourceCodeManagerUtilities sourceCodeManagerFor:definitionClass
 39737 	].
 39755 	].
 39738 
 39756 
 39739 	classes := Smalltalk allClassesInPackage:eachPackageID.
 39757 	classes := environment allClassesInPackage:eachPackageID.
 39740 	classes := classes reject:[:cls | cls isPrivate ].
 39758 	classes := classes reject:[:cls | cls isPrivate ].
 39741 	self checkOutClasses:classes askForRevision:false usingManager: mgr.
 39759 	self checkOutClasses:classes askForRevision:false usingManager: mgr.
 39742     ].
 39760     ].
 39743 "/    self checkOutClasses:(self selectedProjectClasses) askForRevision:false.
 39761 "/    self checkOutClasses:(self selectedProjectClasses) askForRevision:false.
 39744 ^ self.
 39762 ^ self.
 39758 "/        perProjectInfo := SourceCodeManager newestRevisionsInModule:module directory:directory.
 39776 "/        perProjectInfo := SourceCodeManager newestRevisionsInModule:module directory:directory.
 39759 "/        perProjectInfo := perProjectInfo ? #().
 39777 "/        perProjectInfo := perProjectInfo ? #().
 39760 "/        perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
 39778 "/        perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
 39761 "/        perProjectInfo := Dictionary withAssociations:perProjectInfo.
 39779 "/        perProjectInfo := Dictionary withAssociations:perProjectInfo.
 39762 "/
 39780 "/
 39763 "/        classesInImage := Smalltalk allClassesInPackage:eachProject.
 39781 "/        classesInImage := environment allClassesInPackage:eachProject.
 39764 "/        filesInImage := (classesInImage collect:[:cls | cls classBaseFilename]) asSet.
 39782 "/        filesInImage := (classesInImage collect:[:cls | cls classBaseFilename]) asSet.
 39765 "/        "/ any differences ?
 39783 "/        "/ any differences ?
 39766 "/        classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)].
 39784 "/        classesNotInRepository := classesInImage reject:[:cls | (perProjectInfo includesKey:cls classBaseFilename)].
 39767 "/        classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted].
 39785 "/        classesDeletedInRepository := classesInImage select:[:cls | (perProjectInfo at:cls classBaseFilename ifAbsent:nil) == #deleted].
 39768 "/        perProjectInfo := perProjectInfo reject:[:v | v == #deleted].
 39786 "/        perProjectInfo := perProjectInfo reject:[:v | v == #deleted].
 39998 	    otherFiles := containers reject:[:each | (each asFilename hasSuffix:'st') ].
 40016 	    otherFiles := containers reject:[:each | (each asFilename hasSuffix:'st') ].
 39999 	    containers removeAllFoundIn:otherFiles.
 40017 	    containers removeAllFoundIn:otherFiles.
 40000 
 40018 
 40001 	    classesInProject := IdentitySet new.
 40019 	    classesInProject := IdentitySet new.
 40002 	    needExtensionsContainer := false.
 40020 	    needExtensionsContainer := false.
 40003 	    Smalltalk allClassesDo:[:aClass |
 40021 	    environment allClassesDo:[:aClass |
 40004 		(packageToCheck = aClass package) ifTrue:[
 40022 		(packageToCheck = aClass package) ifTrue:[
 40005 		    aClass isPrivate ifFalse:[
 40023 		    aClass isPrivate ifFalse:[
 40006 			classesInProject add:aClass .
 40024 			classesInProject add:aClass .
 40007 		    ]
 40025 		    ]
 40008 		] ifFalse:[
 40026 		] ifFalse:[
 40266 
 40284 
 40267     self projectMenuFileOutAsWithFormat:nil
 40285     self projectMenuFileOutAsWithFormat:nil
 40268 !
 40286 !
 40269 
 40287 
 40270 projectMenuFileOutAsWithFormat:aFormatSymbolOrNil
 40288 projectMenuFileOutAsWithFormat:aFormatSymbolOrNil
 40271     |currentProject selectedProjects suffix saveName fileName "methodsToFileOut fileNameForExtensions" mgr s classesToFileout|
 40289     |currentProject selectedProjects suffix saveName fileName mgr s classesToFileout|
 40272 
 40290 
 40273     selectedProjects := self selectedProjectsValue.
 40291     selectedProjects := self selectedProjectsValue.
 40274     currentProject := self theSingleSelectedProject.
 40292     currentProject := self theSingleSelectedProject.
 40275     currentProject notNil ifTrue:[
 40293     currentProject notNil ifTrue:[
 40276 	fileName := currentProject asString copy replaceAny:' :/' with:$_.
 40294 	fileName := currentProject asString copy replaceAny:' :/' with:$_.
 40277     ] ifFalse:[
 40295     ] ifFalse:[
 40278 	fileName := 'someProjects'
 40296 	fileName := 'someProjects'
 40279     ].
 40297     ].
 40280     aFormatSymbolOrNil == #cypress ifTrue:[
 40298     aFormatSymbolOrNil == #xml ifTrue:[
 40281 	suffix := ''.
 40299 	suffix := '.xml'
 40282     ] ifFalse:[
 40300     ] ifFalse:[
 40283 	aFormatSymbolOrNil == #xml ifTrue:[
       
 40284 	suffix := '.xml'
       
 40285 	] ifFalse:[
       
 40286 	aFormatSymbolOrNil == #sif ifTrue:[
 40301 	aFormatSymbolOrNil == #sif ifTrue:[
 40287 	    suffix := '.sif'
 40302 	    suffix := '.sif'
 40288 	] ifFalse:[
 40303 	] ifFalse:[
 40289 	    aFormatSymbolOrNil == #binary ifTrue:[
 40304 	    aFormatSymbolOrNil == #binary ifTrue:[
 40290 		suffix := '.cls'
 40305 		suffix := '.cls'
 40291 	    ] ifFalse:[
 40306 	    ] ifFalse:[
 40292 		suffix := '.st'
 40307 		suffix := '.st'
 40293 	    ]
 40308 	    ]
 40294 	]
 40309 	]
 40295 	].
       
 40296     ].
 40310     ].
 40297     fileName := fileName , suffix.
 40311     fileName := fileName , suffix.
 40298 
 40312 
 40299     aFormatSymbolOrNil == #binary ifTrue:[
 40313     aFormatSymbolOrNil == #binary ifTrue:[
 40300 	self error:'binary must go into separate files' mayProceed:true.
 40314 	self error:'binary must go into separate files' mayProceed:true.
 40301 	^ self
 40315 	^ self
 40302     ].
 40316     ].
 40303 
 40317 
 40304     aFormatSymbolOrNil == #cypress ifTrue:[
       
 40305 	saveName := Dialog
       
 40306 	    requestDirectoryName: (resources string:'FileOut %1 in:' with:(currentProject ? 'selected projects'))
       
 40307 	    "default: (FileSelectionBox lastFileSelectionDirectory)"
       
 40308     ] ifFalse:[
       
 40309     saveName := Dialog
 40318     saveName := Dialog
 40310 	requestFileNameForSave:(resources string:'FileOut %1 as:' with:(currentProject ? 'selected projects'))
 40319 	requestFileNameForSave:(resources string:'FileOut %1 as:' with:(currentProject ? 'selected projects'))
 40311 	default:fileName
 40320 	default:fileName
 40312 	fromDirectory:(FileSelectionBox lastFileSelectionDirectory).
 40321 	fromDirectory:(FileSelectionBox lastFileSelectionDirectory).
 40313     ].
       
 40314 
 40322 
 40315 "/    fileBox := FileSelectionBox
 40323 "/    fileBox := FileSelectionBox
 40316 "/                    title:(resources string:'FileOut %1 as:' with:(currentProject ? 'selected projects'))
 40324 "/                    title:(resources string:'FileOut %1 as:' with:(currentProject ? 'selected projects'))
 40317 "/                    okText:(resources string:'FileOut')
 40325 "/                    okText:(resources string:'FileOut')
 40318 "/                    abortText:(resources string:'Cancel')
 40326 "/                    abortText:(resources string:'Cancel')
 40339 	mgr := SmalltalkInterchangeFileManager newForFileOut.
 40347 	mgr := SmalltalkInterchangeFileManager newForFileOut.
 40340 	mgr fileName: fileName.
 40348 	mgr fileName: fileName.
 40341 	self selectedProjectClasses do:[:eachClass |
 40349 	self selectedProjectClasses do:[:eachClass |
 40342 	    mgr addClass:eachClass.
 40350 	    mgr addClass:eachClass.
 40343 	].
 40351 	].
 40344 	Smalltalk allClassesDo:[:eachClass |
 40352 	environment allClassesDo:[:eachClass |
 40345 	    eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 40353 	    eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 40346 		|mPckg|
 40354 		|mPckg|
 40347 
 40355 
 40348 		mPckg := mthd package.
 40356 		mPckg := mthd package.
 40349 		mPckg ~= eachClass package ifTrue:[
 40357 		mPckg ~= eachClass package ifTrue:[
 40367 
 40375 
 40368 	classesToFileout do:[:eachClass |
 40376 	classesToFileout do:[:eachClass |
 40369 	    eachClass fileOutOn:s.
 40377 	    eachClass fileOutOn:s.
 40370 	].
 40378 	].
 40371 
 40379 
 40372 	Smalltalk allClassesDo:[:eachClass |
 40380 	environment allClassesDo:[:eachClass |
 40373 	    eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 40381 	    eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 40374 		|mPckg|
 40382 		|mPckg|
 40375 
 40383 
 40376 		mPckg := mthd package.
 40384 		mPckg := mthd package.
 40377 		(mPckg = currentProject and:[mPckg ~= eachClass package]) ifTrue:[
 40385 		(mPckg = currentProject and:[mPckg ~= eachClass package]) ifTrue:[
 40386 	s close.
 40394 	s close.
 40387 	self normalLabel.
 40395 	self normalLabel.
 40388 	^ self.
 40396 	^ self.
 40389     ].
 40397     ].
 40390 
 40398 
 40391     aFormatSymbolOrNil == #cypress ifTrue:[
       
 40392 	mgr := (Smalltalk at:#CypressWriter) new.
       
 40393 	self showMessage: (resources string:'Writing Cypress package...')
       
 40394 		   while: [ mgr writePackage: currentProject asCypressPackage to: saveName asFilename ]
       
 40395 	    inBackground: true.
       
 40396 	^ self
       
 40397     ].
       
 40398 
       
 40399 
       
 40400 
       
 40401     self shouldImplement.
 40399     self shouldImplement.
 40402 
 40400 
 40403     "Modified: / 27-10-2010 / 11:34:45 / cg"
 40401     "Modified: / 27-10-2010 / 11:34:45 / cg"
 40404     "Modified: / 02-10-2012 / 11:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 40405 !
 40402 !
 40406 
 40403 
 40407 projectMenuFileOutBuildSupportFiles
 40404 projectMenuFileOutBuildSupportFiles
 40408     self selectedProjectsDo:[:packageToCheckIn |
 40405     self selectedProjectsDo:[:packageToCheckIn |
 40409 	self projectMenuFileOutBuildSupportFilesForProject:packageToCheckIn
 40406 	self projectMenuFileOutBuildSupportFilesForProject:packageToCheckIn
 40515 	in:dirName
 40512 	in:dirName
 40516 	withFormat:aFormatSymbolOrNil.
 40513 	withFormat:aFormatSymbolOrNil.
 40517 
 40514 
 40518     "/ extensions...
 40515     "/ extensions...
 40519     methodsToFileOut := OrderedCollection new.
 40516     methodsToFileOut := OrderedCollection new.
 40520     Smalltalk allClassesDo:[:eachClass |
 40517     environment allClassesDo:[:eachClass |
 40521 	eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 40518 	eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 40522 	    |mPckg|
 40519 	    |mPckg|
 40523 
 40520 
 40524 	    mPckg := mthd package.
 40521 	    mPckg := mthd package.
 40525 	    (mPckg = currentProject and:[mPckg ~= eachClass package]) ifTrue:[
 40522 	    (mPckg = currentProject and:[mPckg ~= eachClass package]) ifTrue:[
 40580 	    perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aSymbolicTag.
 40577 	    perProjectInfo := SourceCodeManager revisionsInModule:module directory:directory taggedAs:aSymbolicTag.
 40581 	    perProjectInfo := perProjectInfo ? #().
 40578 	    perProjectInfo := perProjectInfo ? #().
 40582 	    perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
 40579 	    perProjectInfo := perProjectInfo select:[:info | info key asFilename hasSuffix:'st'].
 40583 	    perProjectInfo := Dictionary withAssociations:perProjectInfo.
 40580 	    perProjectInfo := Dictionary withAssociations:perProjectInfo.
 40584 
 40581 
 40585 	    classesInImage := Smalltalk allClassesInPackage:eachProject.
 40582 	    classesInImage := environment allClassesInPackage:eachProject.
 40586 	    autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded].
 40583 	    autoloadedClassesInImage := classesInImage reject:[:cls | cls isLoaded].
 40587 	    classesInImage := classesInImage select:[:cls | cls isLoaded and:[cls isPrivate not]].
 40584 	    classesInImage := classesInImage select:[:cls | cls isLoaded and:[cls isPrivate not]].
 40588 "/            filesInImage := classesInImage collect:[:cls | cls classBaseFilename] as:Set.
 40585 "/            filesInImage := classesInImage collect:[:cls | cls classBaseFilename] as:Set.
 40589 "/            autoloadedFilesInImage := autoloadedClassesInImage collect:[:cls | cls classBaseFilename] as:Set.
 40586 "/            autoloadedFilesInImage := autoloadedClassesInImage collect:[:cls | cls classBaseFilename] as:Set.
 40590 "/            "/ any differences ?
 40587 "/            "/ any differences ?
 41143 
 41140 
 41144 	projectDefinitionClass isApplicationDefinition ifTrue:[
 41141 	projectDefinitionClass isApplicationDefinition ifTrue:[
 41145 	    appClassName := Dialog
 41142 	    appClassName := Dialog
 41146 				request:(resources stringWithCRs:'Create initial application class?\(Enter name or cancel)').
 41143 				request:(resources stringWithCRs:'Create initial application class?\(Enter name or cancel)').
 41147 	    appClassName notEmptyOrNil ifTrue:[
 41144 	    appClassName notEmptyOrNil ifTrue:[
 41148 		(appClass := Smalltalk classNamed:appClassName) notNil ifTrue:[
 41145 		(appClass := environment classNamed:appClassName) notNil ifTrue:[
 41149 		    Dialog warn:(resources stringWithCRs:'Application class already exists\(in "%1")' with:appClass package).
 41146 		    Dialog warn:(resources stringWithCRs:'Application class already exists\(in "%1")' with:appClass package).
 41150 		] ifFalse:[
 41147 		] ifFalse:[
 41151 		    theCode := '
 41148 		    theCode := '
 41152 ApplicationModel subclass: #''%1''
 41149 ApplicationModel subclass: #''%1''
 41153     instanceVariableNames:'' ''
 41150     instanceVariableNames:'' ''
 41163 		    ] ifFalse:[
 41160 		    ] ifFalse:[
 41164 			self
 41161 			self
 41165 			    doAcceptClassDefinition:theCode
 41162 			    doAcceptClassDefinition:theCode
 41166 			    usingCompiler:Compiler.
 41163 			    usingCompiler:Compiler.
 41167 		    ].
 41164 		    ].
 41168 		    appClass := Smalltalk classNamed:appClassName.
 41165 		    appClass := environment classNamed:appClassName.
 41169 		    appClass package:package.
 41166 		    appClass package:package.
 41170 		    self classMenuGenerateApplicationCodeForClasses:{ appClass }.
 41167 		    self classMenuGenerateApplicationCodeForClasses:{ appClass }.
 41171 		    appClass instAndClassMethodsDo:[:m | m package:package].
 41168 		    appClass instAndClassMethodsDo:[:m | m package:package].
 41172 		].
 41169 		].
 41173 	    ] ifFalse:[
 41170 	    ] ifFalse:[
 41174 		appClassName := nil "/ for xxx below
 41171 		appClassName := nil "/ for xxx below
 41175 	    ].
 41172 	    ].
 41176 	    defaultStartupClassName := (appClassName ? 'xxx'),'Start'.
 41173 	    defaultStartupClassName := (appClassName ? 'xxx'),'Start'.
 41177 	    (Smalltalk classNamed:defaultStartupClassName) notNil ifTrue:[
 41174 	    (environment classNamed:defaultStartupClassName) notNil ifTrue:[
 41178 		defaultStartupClassName := nil
 41175 		defaultStartupClassName := nil
 41179 	    ].
 41176 	    ].
 41180 	    startupClassName := Dialog
 41177 	    startupClassName := Dialog
 41181 				    request:(resources
 41178 				    request:(resources
 41182 					stringWithCRs:'Create startup class (e.g. main)?\(Enter name or cancel)')
 41179 					stringWithCRs:'Create startup class (e.g. main)?\(Enter name or cancel)')
 41183 				    initialAnswer:defaultStartupClassName.
 41180 				    initialAnswer:defaultStartupClassName.
 41184 	    startupClassName notEmptyOrNil ifTrue:[
 41181 	    startupClassName notEmptyOrNil ifTrue:[
 41185 		(startupClass := Smalltalk classNamed:startupClassName) notNil ifTrue:[
 41182 		(startupClass := environment classNamed:startupClassName) notNil ifTrue:[
 41186 		    Dialog warn:(resources stringWithCRs:'Startup class already exists\(in "%1")' with:startupClass package).
 41183 		    Dialog warn:(resources stringWithCRs:'Startup class already exists\(in "%1")' with:startupClass package).
 41187 		] ifFalse:[
 41184 		] ifFalse:[
 41188 		    theCode := '
 41185 		    theCode := '
 41189 StandaloneStartup subclass: #''%1''
 41186 StandaloneStartup subclass: #''%1''
 41190     instanceVariableNames:'' ''
 41187     instanceVariableNames:'' ''
 41198 			change name:('Create startup class %1' bindWith:startupClassName).
 41195 			change name:('Create startup class %1' bindWith:startupClassName).
 41199 			RefactoryChangeManager performChange:change
 41196 			RefactoryChangeManager performChange:change
 41200 		    ] ifFalse:[
 41197 		    ] ifFalse:[
 41201 			self doAcceptClassDefinition:theCode usingCompiler:Compiler.
 41198 			self doAcceptClassDefinition:theCode usingCompiler:Compiler.
 41202 		    ].
 41199 		    ].
 41203 		    (startupClass := Smalltalk classNamed:startupClassName) notNil ifTrue:[
 41200 		    (startupClass := environment classNamed:startupClassName) notNil ifTrue:[
 41204 			startupClass package:package.
 41201 			startupClass package:package.
 41205 		    ]
 41202 		    ]
 41206 		].
 41203 		].
 41207 
 41204 
 41208 		"/ update the classList, again
 41205 		"/ update the classList, again
 41222 	    self selectClass:(appClass ? startupClass ? projectDefinitionClass).
 41219 	    self selectClass:(appClass ? startupClass ? projectDefinitionClass).
 41223 	]
 41220 	]
 41224     ].
 41221     ].
 41225 
 41222 
 41226     "Modified: / 23-07-2012 / 13:44:04 / cg"
 41223     "Modified: / 23-07-2012 / 13:44:04 / cg"
       
 41224     "Modified: / 04-09-2013 / 17:46:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 41227 !
 41225 !
 41228 
 41226 
 41229 projectMenuProperties
 41227 projectMenuProperties
 41230     |project defClass|
 41228     |project defClass|
 41231 
 41229 
 41318     classesToRemove := IdentitySet new.
 41316     classesToRemove := IdentitySet new.
 41319     methodsToRemove := IdentitySet new.
 41317     methodsToRemove := IdentitySet new.
 41320 
 41318 
 41321     "/ classes ...
 41319     "/ classes ...
 41322     "/ ... and individual methods (extensions)
 41320     "/ ... and individual methods (extensions)
 41323     Smalltalk allClassesDo:[:aClass |
 41321     environment allClassesDo:[:aClass |
 41324 	(aClass package = projectToRemove) ifTrue:[
 41322 	(aClass package = projectToRemove) ifTrue:[
 41325 	    classesToRemove add:aClass.
 41323 	    classesToRemove add:aClass.
 41326 	] ifFalse:[
 41324 	] ifFalse:[
 41327 	    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 41325 	    aClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
 41328 		(mthd package = projectToRemove) ifTrue:[
 41326 		(mthd package = projectToRemove) ifTrue:[
 41524 
 41522 
 41525     (missingName := defClass allClassNames "compiled_classNames"
 41523     (missingName := defClass allClassNames "compiled_classNames"
 41526 	detect:[:aName |
 41524 	detect:[:aName |
 41527 	    |cls|
 41525 	    |cls|
 41528 
 41526 
 41529 	    cls := Smalltalk at:aName asSymbol.
 41527 	    cls := environment at:aName asSymbol.
 41530 	    cls isNil
 41528 	    cls isNil
 41531 	]
 41529 	]
 41532 	ifNone:nil)
 41530 	ifNone:nil)
 41533     notNil ifTrue:[
 41531     notNil ifTrue:[
 41534 	(Dialog confirm:(resources stringWithCRs:'Some class (%1) from the list of compiled classes is missing in the image!!\\Continue anyway ?'
 41532 	(Dialog confirm:(resources stringWithCRs:'Some class (%1) from the list of compiled classes is missing in the image!!\\Continue anyway ?'
 41539     whichFile = 'abbrev.stc' ifTrue:[
 41537     whichFile = 'abbrev.stc' ifTrue:[
 41540 	(defClass compiled_classNames
 41538 	(defClass compiled_classNames
 41541 	    contains:[:aName |
 41539 	    contains:[:aName |
 41542 		|cls|
 41540 		|cls|
 41543 
 41541 
 41544 		cls := Smalltalk at:aName asSymbol.
 41542 		cls := environment at:aName asSymbol.
 41545 		cls notNil and:[cls isLoaded not]
 41543 		cls notNil and:[cls isLoaded not]
 41546 	    ])
 41544 	    ])
 41547 	ifTrue:[
 41545 	ifTrue:[
 41548 	    (Dialog confirm:'Autoload missing class(es) ?\\Notice: generated abbrev.stc file is wrong if autoloaded classes are unloaded' withCRs) ifTrue:[
 41546 	    (Dialog confirm:'Autoload missing class(es) ?\\Notice: generated abbrev.stc file is wrong if autoloaded classes are unloaded' withCRs) ifTrue:[
 41549 		defClass compiled_classNames do:[:aName |
 41547 		defClass compiled_classNames do:[:aName |
 41550 		    (Smalltalk at:aName asSymbol) autoload
 41548 		    (environment at:aName asSymbol) autoload
 41551 		].
 41549 		].
 41552 	    ].
 41550 	    ].
 41553 	].
 41551 	].
 41554     ].
 41552     ].
 41555 
 41553 
 41619 
 41617 
 41620     (missingName := defClass allClassNames "compiled_classNames"
 41618     (missingName := defClass allClassNames "compiled_classNames"
 41621 	detect:[:aName |
 41619 	detect:[:aName |
 41622 	    |cls|
 41620 	    |cls|
 41623 
 41621 
 41624 	    cls := Smalltalk at:aName asSymbol.
 41622 	    cls := environment at:aName asSymbol.
 41625 	    cls isNil
 41623 	    cls isNil
 41626 	]
 41624 	]
 41627 	ifNone:nil)
 41625 	ifNone:nil)
 41628     notNil ifTrue:[
 41626     notNil ifTrue:[
 41629 	(Dialog confirm:(resources stringWithCRs:'Some class (%1) from the list of compiled classes is missing in the image!!\\Continue anyway ?'
 41627 	(Dialog confirm:(resources stringWithCRs:'Some class (%1) from the list of compiled classes is missing in the image!!\\Continue anyway ?'
 41634     whichFile = 'abbrev.stc' ifTrue:[
 41632     whichFile = 'abbrev.stc' ifTrue:[
 41635 	(defClass compiled_classNames
 41633 	(defClass compiled_classNames
 41636 	    contains:[:aName |
 41634 	    contains:[:aName |
 41637 		|cls|
 41635 		|cls|
 41638 
 41636 
 41639 		cls := Smalltalk at:aName asSymbol.
 41637 		cls := environment at:aName asSymbol.
 41640 		cls notNil and:[cls isLoaded not]
 41638 		cls notNil and:[cls isLoaded not]
 41641 	    ])
 41639 	    ])
 41642 	ifTrue:[
 41640 	ifTrue:[
 41643 	    (Dialog confirm:'Autoload missing class(es) ?\\Notice: generated abbrev.stc file is wrong if autoloaded classes are unloaded' withCRs) ifTrue:[
 41641 	    (Dialog confirm:'Autoload missing class(es) ?\\Notice: generated abbrev.stc file is wrong if autoloaded classes are unloaded' withCRs) ifTrue:[
 41644 		defClass compiled_classNames do:[:aName |
 41642 		defClass compiled_classNames do:[:aName |
 41645 		    (Smalltalk at:aName asSymbol) autoload
 41643 		    (environment at:aName asSymbol) autoload
 41646 		].
 41644 		].
 41647 	    ].
 41645 	    ].
 41648 	].
 41646 	].
 41649     ].
 41647     ].
 41650 
 41648 
 41761 
 41759 
 41762 "/            containers := SourceCodeManager getExistingContainersInModule:module package:package.
 41760 "/            containers := SourceCodeManager getExistingContainersInModule:module package:package.
 41763 "/            containers := containers select:[:each | (each startsWith:'.') not].
 41761 "/            containers := containers select:[:each | (each startsWith:'.') not].
 41764 
 41762 
 41765 	    classesInProject := IdentitySet new.
 41763 	    classesInProject := IdentitySet new.
 41766 	    Smalltalk allClassesDo:[:aClass |
 41764 	    environment allClassesDo:[:aClass |
 41767 		(packageToCheck = aClass package) ifTrue:[
 41765 		(packageToCheck = aClass package) ifTrue:[
 41768 		    aClass isPrivate ifFalse:[
 41766 		    aClass isPrivate ifFalse:[
 41769 			aClass isObsolete ifTrue:[
 41767 			aClass isObsolete ifTrue:[
 41770 			    Transcript showCR:'skipping obsolete class: ' , aClass name.
 41768 			    Transcript showCR:'skipping obsolete class: ' , aClass name.
 41771 			] ifFalse:[
 41769 			] ifFalse:[
 41876     projectListView2 := ApplicationSubView new client:projectList2.
 41874     projectListView2 := ApplicationSubView new client:projectList2.
 41877 
 41875 
 41878     projectList1 selectedProjects value:packagesToFindMissing.
 41876     projectList1 selectedProjects value:packagesToFindMissing.
 41879     projectList2 selectedProjects value:#('stx').
 41877     projectList2 selectedProjects value:#('stx').
 41880 
 41878 
 41881     packageHull := [:packageIDs | Smalltalk allProjectIDs select:[:p | packageIDs
 41879     packageHull := [:packageIDs | environment allProjectIDs select:[:p | packageIDs
 41882 									contains:[:packageId |
 41880 									contains:[:packageId |
 41883 									    p = packageId
 41881 									    p = packageId
 41884 									    or:[ (p startsWith:packageId,':')
 41882 									    or:[ (p startsWith:packageId,':')
 41885 									    or:[ (p startsWith:packageId,'/') ]]]
 41883 									    or:[ (p startsWith:packageId,'/') ]]]
 41886 								  ]
 41884 								  ]
 41925     ].
 41923     ].
 41926 
 41924 
 41927     packagesToFindMissing := projectList1 selectedProjects value.
 41925     packagesToFindMissing := projectList1 selectedProjects value.
 41928     packagesToFindCalled := projectList2 selectedProjects value.
 41926     packagesToFindCalled := projectList2 selectedProjects value.
 41929 
 41927 
 41930     classesToFindMissing := Smalltalk allClasses select:[:cls |
 41928     classesToFindMissing := environment allClasses select:[:cls |
 41931 				|p|
 41929 				|p|
 41932 
 41930 
 41933 				p := cls package.
 41931 				p := cls package.
 41934 				p notNil
 41932 				p notNil
 41935 				    and:[cls isPrivate not
 41933 				    and:[cls isPrivate not
 41937 										or:[(p startsWith:(p2,'/'))
 41935 										or:[(p startsWith:(p2,'/'))
 41938 										or:[p startsWith:(p2,':')]]]]]
 41936 										or:[p startsWith:(p2,':')]]]]]
 41939 			    ].
 41937 			    ].
 41940     classesToFindMissing := classesToFindMissing asOrderedCollection sort:[:a :b | a name < b name].
 41938     classesToFindMissing := classesToFindMissing asOrderedCollection sort:[:a :b | a name < b name].
 41941 
 41939 
 41942     classesToFindCalled := Smalltalk allClasses select:[:cls |
 41940     classesToFindCalled := environment allClasses select:[:cls |
 41943 				|p|
 41941 				|p|
 41944 
 41942 
 41945 				p := cls package.
 41943 				p := cls package.
 41946 				p notNil
 41944 				p notNil
 41947 				    and:[cls isPrivate not
 41945 				    and:[cls isPrivate not
 42072 selectedProjectsDo:aBlock
 42070 selectedProjectsDo:aBlock
 42073     |selectedProjects allProjects|
 42071     |selectedProjects allProjects|
 42074 
 42072 
 42075     selectedProjects := self selectedProjects value ? #().
 42073     selectedProjects := self selectedProjects value ? #().
 42076     (selectedProjects includes:(BrowserList nameListEntryForALL)) ifTrue:[
 42074     (selectedProjects includes:(BrowserList nameListEntryForALL)) ifTrue:[
 42077 	allProjects := Smalltalk allClasses collect:[:eachClass | eachClass package] as:Set.
 42075 	allProjects := environment allClasses collect:[:eachClass | eachClass package] as:Set.
 42078 	selectedProjects := allProjects select:[:each| each notNil].
 42076 	selectedProjects := allProjects select:[:each| each notNil].
 42079     ].
 42077     ].
 42080     selectedProjects := selectedProjects asOrderedCollection.
 42078     selectedProjects := selectedProjects asOrderedCollection.
 42081     selectedProjects sort do:aBlock
 42079     selectedProjects sort do:aBlock
 42082 !
 42080 !
 42125 	where is: #newBrowser - open a new browser showing the projects
 42123 	where is: #newBrowser - open a new browser showing the projects
 42126 	where is: #newBuffer  - add a new buffer showing the projects"
 42124 	where is: #newBuffer  - add a new buffer showing the projects"
 42127 
 42125 
 42128     |classes title|
 42126     |classes title|
 42129 
 42127 
 42130     classes := Smalltalk allClasses
 42128     classes := environment allClasses
 42131 		select:[:each | (projects includes:each package) not].
 42129 		reject:[:each | (projects includes:each package) ].
 42132 
 42130 
 42133     projects size == 1 ifTrue:[
 42131     projects size == 1 ifTrue:[
 42134 	title := 'Extensions for Project ''' , projects first , ''''
 42132 	title := 'Extensions for Project ''' , projects first , ''''
 42135     ] ifFalse:[
 42133     ] ifFalse:[
 42136 	title := 'Extensions for Projects'
 42134 	title := 'Extensions for Projects'
 42434 		    list:list
 42432 		    list:list
 42435 		    entryCompletionBlock:(DoWhatIMeanSupport classNameEntryCompletionBlock).
 42433 		    entryCompletionBlock:(DoWhatIMeanSupport classNameEntryCompletionBlock).
 42436     newClassName isNil ifTrue:[^ self].
 42434     newClassName isNil ifTrue:[^ self].
 42437     (newClassName startsWith:'---- ') ifTrue:[^ self].
 42435     (newClassName startsWith:'---- ') ifTrue:[^ self].
 42438 
 42436 
 42439     newClass := Smalltalk classNamed:newClassName.
 42437     newClass := environment classNamed:newClassName.
 42440     newClass isNil ifTrue:[
 42438     newClass isNil ifTrue:[
 42441 	self warn:'no such class: ', newClassName.
 42439 	self warn:'no such class: ', newClassName.
 42442 	^ self
 42440 	^ self
 42443     ].
 42441     ].
 42444 
 42442 
 42536     LastNewProtocols notEmptyOrNil ifTrue:[
 42534     LastNewProtocols notEmptyOrNil ifTrue:[
 42537 	suggestion := LastNewProtocols first.
 42535 	suggestion := LastNewProtocols first.
 42538     ].
 42536     ].
 42539 
 42537 
 42540 "/    allMethodCategories := Set new.
 42538 "/    allMethodCategories := Set new.
 42541 "/    Smalltalk allBehaviorsDo:[:eachClass |
 42539 "/    environment allBehaviorsDo:[:eachClass |
 42542 "/        allMethodCategories addAll:eachClass categories
 42540 "/        allMethodCategories addAll:eachClass categories
 42543 "/    ].
 42541 "/    ].
 42544 "/
 42542 "/
 42545     SharedMethodCategoryCache isNil ifTrue:[
 42543     SharedMethodCategoryCache isNil ifTrue:[
 42546 	SharedMethodCategoryCache := MethodCategoryCache new
 42544 	SharedMethodCategoryCache := MethodCategoryCache new
 42688     ].
 42686     ].
 42689     someCategories := someCategories asOrderedCollection sort.
 42687     someCategories := someCategories asOrderedCollection sort.
 42690     someCategories notEmpty ifTrue:[
 42688     someCategories notEmpty ifTrue:[
 42691 	someCategories add:''.
 42689 	someCategories add:''.
 42692     ].
 42690     ].
 42693     someCategories addAll:(Smalltalk allMethodCategories select:[:cat | (someCategories includes:cat) not]) asOrderedCollection sort.
 42691     someCategories addAll:(environment allMethodCategories reject:[:cat | (someCategories includes:cat) ]) asOrderedCollection sort.
 42694 
 42692 
 42695     newCategory := self
 42693     newCategory := self
 42696 			askForMethodCategory:msg
 42694 			askForMethodCategory:msg
 42697 			title:'Rename MethodCategory'
 42695 			title:'Rename MethodCategory'
 42698 			okLabel:'Rename'
 42696 			okLabel:'Rename'
 42805     pattern := Dialog request:'Match pattern for protocols:' initialAnswer:(self theSingleSelectedProtocol ? '').
 42803     pattern := Dialog request:'Match pattern for protocols:' initialAnswer:(self theSingleSelectedProtocol ? '').
 42806     pattern size == 0 ifTrue:[^ self].
 42804     pattern size == 0 ifTrue:[^ self].
 42807     pattern := pattern string.
 42805     pattern := pattern string.
 42808 
 42806 
 42809     matchingProtocols := Set new.
 42807     matchingProtocols := Set new.
 42810     Smalltalk allClassesAndMetaclassesDo:[:eachClass |
 42808     environment allClassesAndMetaclassesDo:[:eachClass |
 42811 	eachClass isLoaded ifTrue:[
 42809 	eachClass isLoaded ifTrue:[
 42812 	    eachClass categories do:[:cat |
 42810 	    eachClass categories do:[:cat |
 42813 		(pattern match:cat) ifTrue:[
 42811 		(pattern match:cat) ifTrue:[
 42814 		    matchingProtocols add:cat.
 42812 		    matchingProtocols add:cat.
 42815 		]
 42813 		]
 42866 				protocols := protocolList.
 42864 				protocols := protocolList.
 42867 				"/ protocols := (brwsr selectedProtocols value) ? protocolList.
 42865 				"/ protocols := (brwsr selectedProtocols value) ? protocolList.
 42868 
 42866 
 42869 				all := protocols includes:(BrowserList nameListEntryForALL).
 42867 				all := protocols includes:(BrowserList nameListEntryForALL).
 42870 				self withWaitCursorDo:[
 42868 				self withWaitCursorDo:[
 42871 				    Smalltalk allClassesAndMetaclassesDo:[:eachClass |
 42869 				    environment allClassesAndMetaclassesDo:[:eachClass |
 42872 					eachClass categories do:[:cat |
 42870 					eachClass categories do:[:cat |
 42873 					    (all or:[protocols includes:cat]) ifTrue:[
 42871 					    (all or:[protocols includes:cat]) ifTrue:[
 42874 						whatToDo value:eachClass value:cat.
 42872 						whatToDo value:eachClass value:cat.
 42875 					    ]
 42873 					    ]
 42876 					]
 42874 					]
 42998 
 42996 
 42999     singleClass ifTrue:[
 42997     singleClass ifTrue:[
 43000 	className includesMatchCharacters ifFalse:[
 42998 	className includesMatchCharacters ifFalse:[
 43001 	    currentNamespace := self currentNamespace.
 42999 	    currentNamespace := self currentNamespace.
 43002 
 43000 
 43003 	    aliases := Smalltalk
 43001 	    aliases := environment
 43004 			keysAndValuesSelect:[:nm :val | (nm sameAs:classNameArg) ]
 43002 			keysAndValuesSelect:[:nm :val | (nm sameAs:classNameArg) ]
 43005 			thenCollect:[:nm :val | val isNil
 43003 			thenCollect:[:nm :val | val isNil
 43006 						    ifTrue:[ nil ]
 43004 						    ifTrue:[ nil ]
 43007 						    ifFalse:[
 43005 						    ifFalse:[
 43008 							val isBehavior
 43006 							val isBehavior
 43086 	].
 43084 	].
 43087 	^ self.
 43085 	^ self.
 43088     ].
 43086     ].
 43089 
 43087 
 43090     className includesMatchCharacters ifFalse:[
 43088     className includesMatchCharacters ifFalse:[
 43091 	class := Smalltalk at:className asSymbol.
 43089 	class := environment at:className asSymbol.
 43092 	class isBehavior ifTrue:[
 43090 	class isBehavior ifTrue:[
 43093 	    classes := IdentitySet with:class
 43091 	    classes := IdentitySet with:class
 43094 	]
 43092 	]
 43095     ] ifTrue:[
 43093     ] ifTrue:[
 43096 	classes := Smalltalk allClasses select:[:each | className match:each name] as:IdentitySet.
 43094 	classes := environment allClasses select:[:each | className match:each name] as:IdentitySet.
 43097     ].
 43095     ].
 43098     classes size == 0 ifTrue:[
 43096     classes size == 0 ifTrue:[
 43099 	^ self warn:'No className matches'.
 43097 	^ self warn:'No className matches'.
 43100     ].
 43098     ].
 43101 
 43099 
 43349 	    |searchPattern matchingSelectors|
 43347 	    |searchPattern matchingSelectors|
 43350 
 43348 
 43351 	    searchPattern := box contents.
 43349 	    searchPattern := box contents.
 43352 	    searchPattern includesMatchCharacters ifTrue:[
 43350 	    searchPattern includesMatchCharacters ifTrue:[
 43353 		matchingSelectors := Set new.
 43351 		matchingSelectors := Set new.
 43354 		Smalltalk allMethodsWithSelectorDo:[:eachMethod :eachSelector |
 43352 		environment allMethodsWithSelectorDo:[:eachMethod :eachSelector |
 43355 		    (searchPattern match:eachSelector) ifTrue:[
 43353 		    (searchPattern match:eachSelector) ifTrue:[
 43356 			matchingSelectors add:eachSelector.
 43354 			matchingSelectors add:eachSelector.
 43357 		    ].
 43355 		    ].
 43358 		].
 43356 		].
 43359 		box list:(matchingSelectors asOrderedCollection sort).
 43357 		box list:(matchingSelectors asOrderedCollection sort).
 43370 	    box topView withWaitCursorDo:[
 43368 	    box topView withWaitCursorDo:[
 43371 		s := contents withoutSpaces.
 43369 		s := contents withoutSpaces.
 43372 		s includesMatchCharacters ifTrue:[
 43370 		s includesMatchCharacters ifTrue:[
 43373 		    matchBlock value
 43371 		    matchBlock value
 43374 		] ifFalse:[
 43372 		] ifFalse:[
 43375 		    what := Smalltalk selectorCompletion:s.
 43373 		    what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:environment.
 43376 		    longest := what first.
 43374 		    longest := what first.
 43377 		    matching := what last.
 43375 		    matching := what last.
 43378 		    box list:matching.
 43376 		    box list:matching.
 43379 		    box contents:longest.
 43377 		    box contents:longest.
 43380 		    matching size ~~ 1 ifTrue:[
 43378 		    matching size ~~ 1 ifTrue:[
 43433 	box contents size > 0 ifTrue:[
 43431 	box contents size > 0 ifTrue:[
 43434 	    entryCompletionBlock value:(box contents).
 43432 	    entryCompletionBlock value:(box contents).
 43435 	].
 43433 	].
 43436 	box showAtPointer.
 43434 	box showAtPointer.
 43437     ] valueWithRestart
 43435     ] valueWithRestart
       
 43436 
       
 43437     "Modified: / 04-09-2013 / 17:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 43438 !
 43438 !
 43439 
 43439 
 43440 searchMenuFindResponseTo
 43440 searchMenuFindResponseTo
 43441     self
 43441     self
 43442 	askForSelector:'Goto implementation of (if sent to instances of selected class):\(the list below represents the full protocol)' withCRs
 43442 	askForSelector:'Goto implementation of (if sent to instances of selected class):\(the list below represents the full protocol)' withCRs
 43494 	m := self anySelectedMethod.
 43494 	m := self anySelectedMethod.
 43495 	currentClass := m mclass.
 43495 	currentClass := m mclass.
 43496     ].
 43496     ].
 43497 
 43497 
 43498     LastMethodMoveOrCopyTargetClass notNil ifTrue:[
 43498     LastMethodMoveOrCopyTargetClass notNil ifTrue:[
 43499 	initial := Smalltalk classNamed:LastMethodMoveOrCopyTargetClass.
 43499 	initial := environment classNamed:LastMethodMoveOrCopyTargetClass.
 43500 	initial notNil ifTrue:[
 43500 	initial notNil ifTrue:[
 43501 	    (currentClass notNil and:[currentClass theNonMetaclass name = initial name]) ifTrue:[
 43501 	    (currentClass notNil and:[currentClass theNonMetaclass name = initial name]) ifTrue:[
 43502 		initial := nil
 43502 		initial := nil
 43503 	    ]
 43503 	    ]
 43504 	].
 43504 	].
 44078 
 44078 
 44079     self rememberLastProjectMoveTo:newProject.
 44079     self rememberLastProjectMoveTo:newProject.
 44080 
 44080 
 44081     classesChanged do:[:eachClass |
 44081     classesChanged do:[:eachClass |
 44082 	eachClass changed:#projectOrganization.
 44082 	eachClass changed:#projectOrganization.
 44083 	Smalltalk changed:#projectOrganization with:(Array with:eachClass theNonMetaclass with:(methods select:[:m | m mclass == eachClass])).
 44083 	environment changed:#projectOrganization with:(Array with:eachClass theNonMetaclass with:(methods select:[:m | m mclass == eachClass])).
 44084     ].
 44084     ].
 44085 
 44085 
 44086     "Created: / 17-02-2000 / 23:04:45 / cg"
 44086     "Created: / 17-02-2000 / 23:04:45 / cg"
 44087     "Modified: / 23-11-2006 / 17:02:10 / cg"
 44087     "Modified: / 23-11-2006 / 17:02:10 / cg"
 44088 !
 44088 !
 44266 !
 44266 !
 44267 
 44267 
 44268 renameMethod:oldSelector in:aClass
 44268 renameMethod:oldSelector in:aClass
 44269     |newSelector tree dialog args newArgs map refactoring rslt
 44269     |newSelector tree dialog args newArgs map refactoring rslt
 44270      renameSelectedMethodsOnly renameOnly rewriteLocalSendersOnly
 44270      renameSelectedMethodsOnly renameOnly rewriteLocalSendersOnly
       
 44271      rewritePackageLocalSendersOnly
 44271      affectedClasses classesOfSelectedMethods suggestion|
 44272      affectedClasses classesOfSelectedMethods suggestion|
 44272 
 44273 
 44273     RBParser isNil ifTrue:[
 44274     RBParser isNil ifTrue:[
 44274 	Dialog warn:'Missing class: RBParser'.
 44275 	Dialog warn:'Missing class: RBParser'.
 44275 	^ self
 44276 	^ self
 44317     LastRenamedNew := newSelector.
 44318     LastRenamedNew := newSelector.
 44318 
 44319 
 44319     renameSelectedMethodsOnly := dialog isRenameSelectedMethodsOnly.
 44320     renameSelectedMethodsOnly := dialog isRenameSelectedMethodsOnly.
 44320     renameOnly := dialog isRenameOnly.
 44321     renameOnly := dialog isRenameOnly.
 44321     rewriteLocalSendersOnly := dialog isRewritingLocalSendersOnly.
 44322     rewriteLocalSendersOnly := dialog isRewritingLocalSendersOnly.
       
 44323     rewritePackageLocalSendersOnly := dialog isRewritingPackageLocalSendersOnly.
 44322 
 44324 
 44323     refactoring := RenameMethodRefactoring
 44325     refactoring := RenameMethodRefactoring
 44324 				renameMethod: oldSelector
 44326 				renameMethod: oldSelector
 44325 				in: aClass
 44327 				in: aClass
 44326 				to: newSelector
 44328 				to: newSelector
 44327 				permuation: map.
 44329 				permuation: map.
 44328     refactoring suppressRewriteOfSenders:renameOnly.
 44330     refactoring suppressRewriteOfSenders:renameOnly.
 44329 
 44331 
 44330     renameOnly ifFalse:[
 44332     renameOnly ifFalse:[
 44331 	affectedClasses := rewriteLocalSendersOnly
 44333 	affectedClasses := rewriteLocalSendersOnly
 44332 				ifTrue:[ Smalltalk allClasses ]
 44334 				ifTrue:[ environment allClasses ]
 44333 				ifFalse:[ aClass withAllSubclasses ].
 44335 				ifFalse:[
       
 44336 				    rewritePackageLocalSendersOnly
       
 44337 					ifTrue:[ environment allClassesInPackage:aClass package ]
       
 44338 					ifFalse:[ aClass withAllSubclasses ]].
 44334 	"/ ask if so many methods should be rewritten; give chance to cancel
 44339 	"/ ask if so many methods should be rewritten; give chance to cancel
 44335 	"/ JV: but not if refactorings are confimed anyway in performRefactoring:...
       
 44336 	UserPreferences current confirmRefactorings ifFalse:[
       
 44337 	(self findSendersOf:oldSelector in:affectedClasses andConfirmRefactoring:refactoring) ifFalse:[ ^ self ].
 44340 	(self findSendersOf:oldSelector in:affectedClasses andConfirmRefactoring:refactoring) ifFalse:[ ^ self ].
 44338 	].
       
 44339     ].
 44341     ].
 44340 
 44342 
 44341     renameSelectedMethodsOnly ifTrue:[
 44343     renameSelectedMethodsOnly ifTrue:[
 44342 	(self selectedMethodsValue collect:[:m | m selector] as:Set) size == 1 ifFalse:[
 44344 	(self selectedMethodsValue collect:[:m | m selector] as:Set) size == 1 ifFalse:[
 44343 	    Dialog warn:'Multiple different selectors selected'.
 44345 	    Dialog warn:'Multiple different selectors selected'.
 44377     dialog browseChangedMethodsHolder value ifTrue:[
 44379     dialog browseChangedMethodsHolder value ifTrue:[
 44378 	self spawnMethodImplementorsBrowserFor:(Array with:newSelector) match:false in:#newBrowser
 44380 	self spawnMethodImplementorsBrowserFor:(Array with:newSelector) match:false in:#newBrowser
 44379     ].
 44381     ].
 44380 
 44382 
 44381     "Modified: / 28-02-2012 / 16:28:12 / cg"
 44383     "Modified: / 28-02-2012 / 16:28:12 / cg"
 44382     "Modified: / 10-05-2012 / 13:06:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 44383 !
 44384 !
 44384 
 44385 
 44385 selectVariableForMoveMethod
 44386 selectVariableForMoveMethod
 44386     self halt:'not yet needed'.
 44387     self halt:'not yet needed'.
 44387     ^ nil.
 44388     ^ nil.
 45812 
 45813 
 45813     "/ a good default is the grand majority of other implementations (works often)
 45814     "/ a good default is the grand majority of other implementations (works often)
 45814     "/ majority is defined: more than 2/3 of the other impls are in a particular package:
 45815     "/ majority is defined: more than 2/3 of the other impls are in a particular package:
 45815     projectsOfOtherImplementations := affectedMethods
 45816     projectsOfOtherImplementations := affectedMethods
 45816 					collectAll:[:eachMethod |
 45817 					collectAll:[:eachMethod |
 45817 					    (Smalltalk allImplementorsOf:eachMethod selector)
 45818 					    (environment allImplementorsOf:eachMethod selector)
 45818 						collect:[:cls | (cls compiledMethodAt:eachMethod selector) package]
 45819 						collect:[:cls | (cls compiledMethodAt:eachMethod selector) package]
 45819 					] as: Bag.
 45820 					] as: Bag.
 45820 
 45821 
 45821     "/ Transcript show:'all: '; show:projectsOfOtherImplementations size; show:' this: '; showCR:projectsOfOtherImplementations sortedCounts first.
 45822     "/ Transcript show:'all: '; show:projectsOfOtherImplementations size; show:' this: '; showCR:projectsOfOtherImplementations sortedCounts first.
 45822     (projectsOfOtherImplementations notEmpty
 45823     (projectsOfOtherImplementations notEmpty
 45924 	    initialAnswer := 'testing'.
 45925 	    initialAnswer := 'testing'.
 45925 	].
 45926 	].
 45926     ].
 45927     ].
 45927 
 45928 
 45928     "/ add actual categories of selected methods
 45929     "/ add actual categories of selected methods
 45929     (SystemBrowser findImplementorsOfAny:selectors in:(Smalltalk allClasses) ignoreCase:false)
 45930     (SystemBrowser findImplementorsOfAny:selectors in:(environment allClasses) ignoreCase:false)
 45930     do:[:otherMethod |
 45931     do:[:otherMethod |
 45931 	|cat|
 45932 	|cat|
 45932 
 45933 
 45933 	(methodSelection includesIdentical:otherMethod) ifFalse:[
 45934 	(methodSelection includesIdentical:otherMethod) ifFalse:[
 45934 	    cat := otherMethod category.
 45935 	    cat := otherMethod category.
 46343 
 46344 
 46344     methodsToRemove := self selectedMethodsValue copy.
 46345     methodsToRemove := self selectedMethodsValue copy.
 46345 
 46346 
 46346     self withSearchCursorDo:[
 46347     self withSearchCursorDo:[
 46347 	"/ search through all of the system
 46348 	"/ search through all of the system
 46348 	Smalltalk allMethodsDo:[:mthd |
 46349 	environment allMethodsDo:[:mthd |
 46349 	    |sent resources newFound any|
 46350 	    |sent resources newFound any|
 46350 
 46351 
 46351 	    any := false.
 46352 	    any := false.
 46352 	    mthd literalsDo:[:eachLiteral |
 46353 	    mthd literalsDo:[:eachLiteral |
 46353 		 (selectorsToRemove includes:eachLiteral) ifTrue:[any := true].
 46354 		 (selectorsToRemove includes:eachLiteral) ifTrue:[any := true].
 46709 	    |methodListGenerator generator theMethodList|
 46710 	    |methodListGenerator generator theMethodList|
 46710 
 46711 
 46711 	    searchBlock := [:whichMethod |
 46712 	    searchBlock := [:whichMethod |
 46712 				| sentMessages |
 46713 				| sentMessages |
 46713 				sentMessages := whichMethod messagesSent.
 46714 				sentMessages := whichMethod messagesSent.
 46714 				self class findImplementorsOfAny:sentMessages in:(Smalltalk allClasses) ignoreCase:false.
 46715 				self class findImplementorsOfAny:sentMessages in:(environment allClasses) ignoreCase:false.
 46715 			   ].
 46716 			   ].
 46716 
 46717 
 46717 	    generator := Iterator on:[:whatToDo |
 46718 	    generator := Iterator on:[:whatToDo |
 46718 					    theMethodList isNil ifTrue:[
 46719 					    theMethodList isNil ifTrue:[
 46719 						theMethodList := searchBlock value:aMethod.
 46720 						theMethodList := searchBlock value:aMethod.
 47132 
 47133 
 47133     self
 47134     self
 47134 	spawnMethodImplementorsBrowserFor:aSelectorCollection
 47135 	spawnMethodImplementorsBrowserFor:aSelectorCollection
 47135 	match:doMatch
 47136 	match:doMatch
 47136 	in:openHow
 47137 	in:openHow
 47137 	classes:Smalltalk allClasses
 47138 	classes:environment allClasses
 47138 	label:'Implementors'
 47139 	label:'Implementors'
 47139 
 47140 
 47140     "Modified: / 05-09-2006 / 11:07:20 / cg"
 47141     "Modified: / 05-09-2006 / 11:07:20 / cg"
 47141 !
 47142 !
 47142 
 47143 
 47168 						    ignoreCase:false
 47169 						    ignoreCase:false
 47169 						)
 47170 						)
 47170 				] ifFalse:[
 47171 				] ifFalse:[
 47171 				    list addAll:(self class
 47172 				    list addAll:(self class
 47172 						    findImplementorsOf:aSelector
 47173 						    findImplementorsOf:aSelector
 47173 						    in:Smalltalk allClasses
 47174 						    in:environment allClasses
 47174 						    ignoreCase:false
 47175 						    ignoreCase:false
 47175 						)
 47176 						)
 47176 				].
 47177 				].
 47177 			    ].
 47178 			    ].
 47178 			    list := list asOrderedCollection
 47179 			    list := list asOrderedCollection
 47314     "open a new browser or add a buffer showing the selected methods senders only"
 47315     "open a new browser or add a buffer showing the selected methods senders only"
 47315 
 47316 
 47316     self
 47317     self
 47317 	spawnMethodSendersBrowserFor:aSelectorCollection
 47318 	spawnMethodSendersBrowserFor:aSelectorCollection
 47318 	in:openHow
 47319 	in:openHow
 47319 	classes:Smalltalk allClasses
 47320 	classes:environment allClasses
 47320 	label:'Senders'
 47321 	label:'Senders'
 47321 
 47322 
 47322     "Modified: / 13-02-2012 / 13:17:20 / cg"
 47323     "Modified: / 13-02-2012 / 13:17:20 / cg"
 47323 !
 47324 !
 47324 
 47325 
 47414 			    cachedList notNil ifTrue:[
 47415 			    cachedList notNil ifTrue:[
 47415 				l := cachedList.
 47416 				l := cachedList.
 47416 				cachedList := nil
 47417 				cachedList := nil
 47417 			    ] ifFalse:[
 47418 			    ] ifFalse:[
 47418 				l := OrderedCollection new.
 47419 				l := OrderedCollection new.
 47419 				Smalltalk allClasses
 47420 				environment allClasses
 47420 				    do:[:eachClass |
 47421 				    do:[:eachClass |
 47421 					l addAll:(eachClass extensions
 47422 					l addAll:(eachClass extensions
 47422 						    select:[:extensionMethod |
 47423 						    select:[:extensionMethod |
 47423 							(packages includes:extensionMethod package)])
 47424 							(packages includes:extensionMethod package)])
 47424 				    ].
 47425 				    ].
 47491 	    searchBlock := [:whichMethod | |selector|
 47492 	    searchBlock := [:whichMethod | |selector|
 47492 				selector := whichMethod selector.
 47493 				selector := whichMethod selector.
 47493 				selector isNil ifTrue:[
 47494 				selector isNil ifTrue:[
 47494 				    #()
 47495 				    #()
 47495 				] ifFalse:[
 47496 				] ifFalse:[
 47496 				    self class allCallsOn:selector in:(Smalltalk allClasses) ignoreCase:false match:false.
 47497 				    self class allCallsOn:selector in:(environment allClasses) ignoreCase:false match:false.
 47497 				].
 47498 				].
 47498 			   ].
 47499 			   ].
 47499 
 47500 
 47500 	    generator := Iterator on:[:whatToDo |
 47501 	    generator := Iterator on:[:whatToDo |
 47501 					    theMethodList isNil ifTrue:[
 47502 					    theMethodList isNil ifTrue:[
 47624     classes := self classesToSearchForVariable.
 47625     classes := self classesToSearchForVariable.
 47625 
 47626 
 47626     varType == #poolVarNames ifTrue:[
 47627     varType == #poolVarNames ifTrue:[
 47627 	"/ also check classes which refer to that pool
 47628 	"/ also check classes which refer to that pool
 47628 	copyOfClasses := IdentitySet withAll:classes.
 47629 	copyOfClasses := IdentitySet withAll:classes.
 47629 	Smalltalk allClassesDo:[:someOtherClass |
 47630 	environment allClassesDo:[:someOtherClass |
 47630 	    (someOtherClass sharedPools includesAny:copyOfClasses) ifTrue:[
 47631 	    (someOtherClass sharedPools includesAny:copyOfClasses) ifTrue:[
 47631 		classes add:someOtherClass.
 47632 		classes add:someOtherClass.
 47632 	    ]
 47633 	    ]
 47633 	].
 47634 	].
 47634     ].
 47635     ].
 48663 		instCount := instCount + 1.
 48664 		instCount := instCount + 1.
 48664 	    ] ifFalse:[
 48665 	    ] ifFalse:[
 48665 		subInstCount := subInstCount + 1
 48666 		subInstCount := subInstCount + 1
 48666 	    ]
 48667 	    ]
 48667 	].
 48668 	].
 48668 	classes := classes collect:[:eachName | Smalltalk classNamed:eachName].
 48669 	classes := classes collect:[:eachName | environment classNamed:eachName].
 48669 
 48670 
 48670 	(instCount == 0 and:[subInstCount == 0]) ifTrue:[
 48671 	(instCount == 0 and:[subInstCount == 0]) ifTrue:[
 48671 	    self warn:(resources
 48672 	    self warn:(resources
 48672 			string:'There are currently no instances or subInstances of %1.'
 48673 			string:'There are currently no instances or subInstances of %1.'
 48673 			with:currentClass name allBold).
 48674 			with:currentClass name allBold).
 49574 
 49575 
 49575 		itemLabel := self historyMenuItemLabelFor:entry.
 49576 		itemLabel := self historyMenuItemLabelFor:entry.
 49576 		item := MenuItem label:itemLabel.
 49577 		item := MenuItem label:itemLabel.
 49577 		item itemValue:#'switchToFindHistoryEntry:' argument:entry.
 49578 		item itemValue:#'switchToFindHistoryEntry:' argument:entry.
 49578 		m addItem:item.
 49579 		m addItem:item.
 49579 		(Smalltalk classNamed:(entry className ? '?')) isBehavior ifFalse:[
 49580 		(environment classNamed:(entry className ? '?')) isBehavior ifFalse:[
 49580 		    item enabled:false.
 49581 		    item enabled:false.
 49581 		    item label:(LabelAndIcon icon:(ToolbarIconLibrary erase16x16Icon2) string:itemLabel)
 49582 		    item label:(LabelAndIcon icon:(ToolbarIconLibrary erase16x16Icon2) string:itemLabel)
 49582 		].
 49583 		].
 49583 	    ].
 49584 	    ].
 49584 	].
 49585 	].
 49616     self selectedMethodsDo:[:m |
 49617     self selectedMethodsDo:[:m |
 49617 	m literalsDo:[:lit |
 49618 	m literalsDo:[:lit |
 49618 	    |cls ns|
 49619 	    |cls ns|
 49619 
 49620 
 49620 	    lit isSymbol ifTrue:[
 49621 	    lit isSymbol ifTrue:[
 49621 		(((cls := Smalltalk at:lit) notNil and:[ cls isBehavior ])
 49622 		(((cls := environment at:lit) notNil and:[ cls isBehavior ])
 49622 		"JV@2011-11-25: Added check if the nameSpace is really a namespace, it may be
 49623 		"JV@2011-11-25: Added check if the nameSpace is really a namespace, it may be
 49623 		 a class if m mclass is a privateClass...
 49624 		 a class if m mclass is a privateClass...
 49624 		 ---------------------------------------------v"
 49625 		 ---------------------------------------------v"
 49625 		or:[ m mclass notNil
 49626 		or:[ m mclass notNil
 49626 		     and:[ (ns := m mclass nameSpace) notNil
 49627 		     and:[ (ns := m mclass nameSpace) notNil
 49649 	m addItem:item.
 49650 	m addItem:item.
 49650     ].
 49651     ].
 49651     ^ m
 49652     ^ m
 49652 
 49653 
 49653     "Created: / 26-10-2011 / 18:15:01 / cg"
 49654     "Created: / 26-10-2011 / 18:15:01 / cg"
 49654     "Modified (comment): / 25-11-2011 / 21:57:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 49655     "Modified: / 09-09-2012 / 13:17:27 / cg"
 49655     "Modified: / 09-09-2012 / 13:17:27 / cg"
       
 49656     "Modified: / 04-09-2013 / 17:43:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 49656 !
 49657 !
 49657 
 49658 
 49658 goBackInGlobalHistoryMenu
 49659 goBackInGlobalHistoryMenu
 49659     <resource: #programMenu>
 49660     <resource: #programMenu>
 49660 
 49661 
 51205 
 51206 
 51206     |classes sel box theClassName|
 51207     |classes sel box theClassName|
 51207 
 51208 
 51208     classes := OrderedCollection new.
 51209     classes := OrderedCollection new.
 51209     (sel := aSelectorString asSymbolIfInterned) notNil ifTrue:[
 51210     (sel := aSelectorString asSymbolIfInterned) notNil ifTrue:[
 51210 	Smalltalk allClassesDo:[:aClass |
 51211 	environment allClassesDo:[:aClass |
 51211 	    (aClass includesSelector:sel) ifTrue:[
 51212 	    (aClass includesSelector:sel) ifTrue:[
 51212 		classes add:aClass.
 51213 		classes add:aClass.
 51213 	    ].
 51214 	    ].
 51214 	    (aClass class includesSelector:sel) ifTrue:[
 51215 	    (aClass class includesSelector:sel) ifTrue:[
 51215 		classes add:aClass class.
 51216 		classes add:aClass class.
 51490 !
 51491 !
 51491 
 51492 
 51492 switchToClassNameMatching:aMatchString
 51493 switchToClassNameMatching:aMatchString
 51493     |className class|
 51494     |className class|
 51494 
 51495 
 51495     class := Smalltalk classNamed:aMatchString.
 51496     class := environment classNamed:aMatchString.
 51496 
 51497 
 51497     class notNil ifTrue:[
 51498     class notNil ifTrue:[
 51498 	self switchToClass:class
 51499 	self switchToClass:class
 51499     ] ifFalse:[
 51500     ] ifFalse:[
 51500 	className := self askForClassNameMatching:aMatchString.
 51501 	className := self askForClassNameMatching:aMatchString.
 51512     aMatchString isEmptyOrNil ifTrue:[
 51513     aMatchString isEmptyOrNil ifTrue:[
 51513 	^ self.
 51514 	^ self.
 51514     ].
 51515     ].
 51515 
 51516 
 51516     aMatchString knownAsSymbol ifTrue:[
 51517     aMatchString knownAsSymbol ifTrue:[
 51517 	class := Smalltalk classNamed:aMatchString.
 51518 	class := environment classNamed:aMatchString.
 51518 	class notNil ifTrue:[
 51519 	class notNil ifTrue:[
 51519 	    self switchToClass:class.
 51520 	    self switchToClass:class.
 51520 	    ^ self.
 51521 	    ^ self.
 51521 	].
 51522 	].
 51522 	classesMatchingCaseless := Smalltalk keys select:[:nm | nm sameAs:aMatchString].
 51523 	classesMatchingCaseless := environment keys select:[:nm | nm sameAs:aMatchString].
 51523 "/        matchStringLowercase := aMatchString asLowercase.
 51524 "/        matchStringLowercase := aMatchString asLowercase.
 51524 "/        classesWithPrefixCaseless := Smalltalk keys select:[:nm | nm asLowercase startsWith:aMatchString].
 51525 "/        classesWithPrefixCaseless := environment keys select:[:nm | nm asLowercase startsWith:aMatchString].
 51525 
 51526 
 51526 "/        impl := Smalltalk allImplementorsOf:aMatchString asSymbol.
 51527 "/        impl := environment allImplementorsOf:aMatchString asSymbol.
 51527 "/        impl notEmptyOrNil ifTrue:[
 51528 "/        impl notEmptyOrNil ifTrue:[
 51528 "/        ].
 51529 "/        ].
 51529 	(aMatchString first isLetter not
 51530 	(aMatchString first isLetter not
 51530 	 or:[ aMatchString first isLowercase]) ifTrue:[
 51531 	 or:[ aMatchString first isLowercase]) ifTrue:[
 51531 	    implementors := SystemBrowser findImplementorsMatching:aMatchString in:(Smalltalk allClasses) ignoreCase:true.
 51532 	    implementors := SystemBrowser findImplementorsMatching:aMatchString in:(environment allClasses) ignoreCase:true.
 51532 	    implementors size > 0 ifTrue:[
 51533 	    implementors size > 0 ifTrue:[
 51533 		(classesMatchingCaseless isEmpty and:[implementors size == 1]) ifTrue:[
 51534 		(classesMatchingCaseless isEmpty and:[implementors size == 1]) ifTrue:[
 51534 		    answer := Dialog
 51535 		    answer := Dialog
 51535 			confirm:(resources
 51536 			confirm:(resources
 51536 					stringWithCRs:'No class named "%1".\But "%2" implements it. Go there ?'
 51537 					stringWithCRs:'No class named "%1".\But "%2" implements it. Go there ?'
 51576 		answer == #browseAllImplementors ifTrue:[
 51577 		answer == #browseAllImplementors ifTrue:[
 51577 		    self
 51578 		    self
 51578 			spawnMethodBrowserForSearch:[
 51579 			spawnMethodBrowserForSearch:[
 51579 				SystemBrowser
 51580 				SystemBrowser
 51580 				    findImplementorsOf:aMatchString
 51581 				    findImplementorsOf:aMatchString
 51581 				    in:Smalltalk allClasses
 51582 				    in:environment allClasses
 51582 				    ignoreCase:false.
 51583 				    ignoreCase:false.
 51583 			    ]
 51584 			    ]
 51584 			sortBy:#class
 51585 			sortBy:#class
 51585 			in:#newBuffer
 51586 			in:#newBuffer
 51586 			label:(resources string:'Implementors of %1' string with:aMatchString).
 51587 			label:(resources string:'Implementors of %1' string with:aMatchString).
 51587 		    ^ self
 51588 		    ^ self
 51588 		].
 51589 		].
 51589 		answer ~~ #searchClass ifTrue:[
 51590 		answer ~~ #searchClass ifTrue:[
 51590 		    answer isSymbol ifTrue:[
 51591 		    answer isSymbol ifTrue:[
 51591 			self switchToClass:(Smalltalk classNamed:answer).
 51592 			self switchToClass:(environment classNamed:answer).
 51592 		    ] ifFalse:[
 51593 		    ] ifFalse:[
 51593 			self switchToClass:(answer mclass) selector:(answer selector).
 51594 			self switchToClass:(answer mclass) selector:(answer selector).
 51594 		    ].
 51595 		    ].
 51595 		    ^ self.
 51596 		    ^ self.
 51596 		].
 51597 		].
 51597 	    ].
 51598 	    ].
 51598 	].
 51599 	].
 51599     ].
 51600     ].
 51600 
 51601 
 51601     "Look for Java class..."
       
 51602     (JAVA notNil and:[aMatchString includes: $.]) ifTrue:[
       
 51603 	| javaClass |
       
 51604 
       
 51605 	javaClass := Java at: aMatchString.
       
 51606 	javaClass notNil ifTrue:[
       
 51607 	    self switchToClass: javaClass.
       
 51608 	    ^self
       
 51609 	].
       
 51610     ].
       
 51611 
       
 51612     className := self askForClassNameMatching:aMatchString.
 51602     className := self askForClassNameMatching:aMatchString.
 51613     className notNil ifTrue:[
 51603     className notNil ifTrue:[
 51614 	self switchToClassNamed:className.
 51604 	self switchToClassNamed:className.
 51615     ]
 51605     ]
 51616 
 51606 
 51617     "Modified: / 04-07-2006 / 18:48:25 / fm"
 51607     "Modified: / 04-07-2006 / 18:48:25 / fm"
 51618     "Modified (comment): / 07-03-2012 / 12:05:07 / cg"
 51608     "Modified (comment): / 07-03-2012 / 12:05:07 / cg"
 51619     "Modified: / 20-04-2012 / 19:44:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 51620 !
 51609 !
 51621 
 51610 
 51622 switchToClassNamed:aString
 51611 switchToClassNamed:aString
 51623     |str theClass|
 51612     |str theClass|
 51624 
 51613 
 51655 
 51644 
 51656     |cls|
 51645     |cls|
 51657 
 51646 
 51658     entry isNil ifTrue:[^ self].
 51647     entry isNil ifTrue:[^ self].
 51659 
 51648 
 51660     cls := Smalltalk at:entry className.
 51649     cls := environment at:entry className.
 51661     cls isNil ifTrue:[
 51650     cls isNil ifTrue:[
 51662 	self warn:'Oops - class is gone'.
 51651 	self warn:'Oops - class is gone'.
 51663 	^ self
 51652 	^ self
 51664     ].
 51653     ].
 51665     entry meta ifTrue:[
 51654     entry meta ifTrue:[
 53333      or a block, or a pair containing class- and methodlist search selectors.
 53322      or a block, or a pair containing class- and methodlist search selectors.
 53334 
 53323 
 53335      searchWhat is a symbol such as #selector, #code etc.
 53324      searchWhat is a symbol such as #selector, #code etc.
 53336     "
 53325     "
 53337 
 53326 
 53338     |restart dialog|
 53327     |dialog|
 53339 
 53328 
 53340     dialog := SearchDialog new
 53329     dialog := SearchDialog new
 53341 	showMetaFilter:true;
 53330 	showMetaFilter:true;
 53342 	setupToAskForMethodSearchTitle:title
 53331 	setupToAskForMethodSearchTitle:title
 53343 	forBrowser:self
 53332 	forBrowser:self
 53349 	allowFind:(self navigationState isMethodBrowser)
 53338 	allowFind:(self navigationState isMethodBrowser)
 53350 	allowBuffer:true
 53339 	allowBuffer:true
 53351 	allowBrowser:true
 53340 	allowBrowser:true
 53352 	withTextEntry:withTextEntry.
 53341 	withTextEntry:withTextEntry.
 53353 
 53342 
 53354     restart := Signal new.
 53343     [:restart|
 53355     restart
 53344 	dialog askThenDo:[
 53356 	handle:[:ex |
 53345 	    |classes string ignoreCase openHow match methods isMethod searchAction|
 53357 	    ex restart
 53346 
 53358 	]
 53347 	    classes := dialog classesToSearch.
 53359 	do:[
 53348 	    string := dialog selectorToSearch.
 53360 	    dialog askThenDo:[
 53349 	    ignoreCase := dialog searchIgnoringCase.
 53361 		|classes string ignoreCase openHow match methods isMethod searchAction|
 53350 	    openHow := dialog openHow.
 53362 
 53351 	    match := dialog searchWithMatch.
 53363 		classes := dialog classesToSearch.
 53352 	    methods := dialog methodsToSearch.
 53364 		string := dialog selectorToSearch.
 53353 	    isMethod := dialog matchMethods.
 53365 		ignoreCase := dialog searchIgnoringCase.
 53354 
 53366 		openHow := dialog openHow.
 53355 	    self withSearchCursorDo:[
 53367 		match := dialog searchWithMatch.
 53356 		|initialList list newBrowser numFound label
 53368 		methods := dialog methodsToSearch.
 53357 		 selector entities arguments numArgs answer
 53369 		isMethod := dialog matchMethods.
 53358 		 alternativeSelector question altArguments t|
 53370 
 53359 
 53371 		self withSearchCursorDo:[
 53360 		aSelectorOrBlock isArray ifTrue:[
 53372 		    |initialList list newBrowser numFound label
 53361 		    classes notNil ifTrue:[
 53373 		     selector entities arguments numArgs answer
 53362 			selector := aSelectorOrBlock first.
 53374 		     alternativeSelector question altArguments t|
 53363 			entities := classes.
 53375 
 53364 		    ] ifFalse:[
 53376 		    aSelectorOrBlock isArray ifTrue:[
 53365 			selector := aSelectorOrBlock second.
 53377 			classes notNil ifTrue:[
 53366 			entities := methods.
 53378 			    selector := aSelectorOrBlock first.
 53367 		    ].
 53379 			    entities := classes.
 53368 		    numArgs := selector numArgs.
       
 53369 		] ifFalse:[
       
 53370 		    entities := classes.
       
 53371 		    aSelectorOrBlock isSymbol ifTrue:[
       
 53372 			selector := aSelectorOrBlock.
       
 53373 		    ] ifFalse:[
       
 53374 			selector := nil
       
 53375 		    ].
       
 53376 		    numArgs := aSelectorOrBlock numArgs.
       
 53377 		].
       
 53378 		(selector notNil
       
 53379 		and:[ (selector numArgs == 1)
       
 53380 		and:[ (selector endsWith:'In:') or:[ selector endsWith:'inMethods:' ]]]) ifTrue:[
       
 53381 		    arguments := Array with:entities
       
 53382 		] ifFalse:[
       
 53383 		    arguments := (Array
       
 53384 					with:string
       
 53385 					with:entities
       
 53386 					with:((selector notNil and:[selector endsWith:'isMethod:']) ifTrue:[isMethod] ifFalse:[ignoreCase])
       
 53387 					with:match
       
 53388 				  ) copyTo:numArgs.
       
 53389 		].
       
 53390 
       
 53391 		searchAction :=
       
 53392 		    [
       
 53393 			|result moreResults extensionMethods arguments2|
       
 53394 
       
 53395 			selector notNil ifTrue:[
       
 53396 			    result := self class perform:selector withArguments:arguments.
 53380 			] ifFalse:[
 53397 			] ifFalse:[
 53381 			    selector := aSelectorOrBlock second.
 53398 			    result := aSelectorOrBlock valueWithArguments:arguments
 53382 			    entities := methods.
       
 53383 			].
 53399 			].
 53384 			numArgs := selector numArgs.
 53400 			"/ sorry for this special case: when searching in a package,
 53385 		    ] ifFalse:[
 53401 			"/ also search extensionMethods
 53386 			entities := classes.
 53402 			dialog searchAreaSelected == #currentPackage ifTrue:[
 53387 			aSelectorOrBlock isSymbol ifTrue:[
 53403 			    aSelectorOrBlock isArray ifTrue:[
 53388 			    selector := aSelectorOrBlock.
 53404 				"/ findSendersOf:inMethods:ignoreCase:match:
       
 53405 				extensionMethods := environment allExtensionsForPackage:(dialog currentPackage).
       
 53406 				arguments2 := arguments copy.
       
 53407 				arguments2 at:2 put:extensionMethods.
       
 53408 				moreResults := self class perform:(aSelectorOrBlock at:2) withArguments:arguments2.
       
 53409 				result := result , moreResults.
       
 53410 			    ]
       
 53411 			].
       
 53412 			dialog metaclassesOnly ifTrue:[
       
 53413 			    result := result select:[:m | m mclass isMeta]
 53389 			] ifFalse:[
 53414 			] ifFalse:[
 53390 			    selector := nil
 53415 			    dialog classesOnly ifTrue:[
 53391 			].
 53416 				result := result reject:[:m | m mclass isMeta]
 53392 			numArgs := aSelectorOrBlock numArgs.
       
 53393 		    ].
       
 53394 		    (selector notNil
       
 53395 		    and:[ (selector numArgs == 1)
       
 53396 		    and:[ (selector endsWith:'In:') or:[ selector endsWith:'inMethods:' ]]]) ifTrue:[
       
 53397 			arguments := Array with:entities
       
 53398 		    ] ifFalse:[
       
 53399 			arguments := (Array
       
 53400 					    with:string
       
 53401 					    with:entities
       
 53402 					    with:((selector notNil and:[selector endsWith:'isMethod:']) ifTrue:[isMethod] ifFalse:[ignoreCase])
       
 53403 					    with:match
       
 53404 				      ) copyTo:numArgs.
       
 53405 		    ].
       
 53406 
       
 53407 		    searchAction :=
       
 53408 			[
       
 53409 			    |result moreResults extensionMethods arguments2|
       
 53410 
       
 53411 			    selector notNil ifTrue:[
       
 53412 				result := self class perform:selector withArguments:arguments.
       
 53413 			    ] ifFalse:[
       
 53414 				result := aSelectorOrBlock valueWithArguments:arguments
       
 53415 			    ].
       
 53416 			    "/ sorry for this special case: when searching in a package,
       
 53417 			    "/ also search extensionMethods
       
 53418 			    dialog searchAreaSelected == #currentPackage ifTrue:[
       
 53419 				aSelectorOrBlock isArray ifTrue:[
       
 53420 				    "/ findSendersOf:inMethods:ignoreCase:match:
       
 53421 				    extensionMethods := Smalltalk allExtensionsForPackage:(dialog currentPackage).
       
 53422 				    arguments2 := arguments copy.
       
 53423 				    arguments2 at:2 put:extensionMethods.
       
 53424 				    moreResults := self class perform:(aSelectorOrBlock at:2) withArguments:arguments2.
       
 53425 				    result := result , moreResults.
       
 53426 				]
       
 53427 			    ].
       
 53428 			    dialog metaclassesOnly ifTrue:[
       
 53429 				result := result select:[:m | m mclass isMeta]
       
 53430 			    ] ifFalse:[
       
 53431 				dialog classesOnly ifTrue:[
       
 53432 				    result := result select:[:m | m mclass isMeta not]
       
 53433 				].
       
 53434 			    ].
       
 53435 			    result
       
 53436 			].
       
 53437 
       
 53438 		    t := TimeDuration toRun:
       
 53439 			[
       
 53440 			    false "classes size > 1" ifTrue:[
       
 53441 				self
       
 53442 				    showMessage:'Searching...'
       
 53443 				    while:[
       
 53444 					initialList := searchAction value.
       
 53445 				    ]
       
 53446 			    ] ifFalse:[
       
 53447 				initialList := searchAction value.
       
 53448 			    ].
 53417 			    ].
 53449 			].
 53418 			].
 53450 
 53419 			result
 53451 		    label := labelHolderOrBlock value.
 53420 		    ].
 53452 
 53421 
 53453 		    numFound := initialList size.
 53422 		t := TimeDuration toRun:
 53454 		    numFound == 0 ifTrue:[
 53423 		    [
 53455 			question := resources stringWithCRs:label with:((string ? '') allBold colorizeAllWith:Color red darkened).
 53424 			false "classes size > 1" ifTrue:[
 53456 			question := question , (resources string:' - none found.').
 53425 			    self
 53457 
 53426 				showMessage:'Searching...'
 53458 			((selector == #findImplementors:in:ignoreCase:match:)
 53427 				while:[
 53459 			and:[ (arguments first numArgs == 0)
 53428 				    initialList := searchAction value.
 53460 			and:[
 53429 				]
 53461 				string := ((arguments at:1),':') asSymbol.
       
 53462 				altArguments := arguments copy.
       
 53463 				altArguments at:1 put:string.
       
 53464 				initialList := self class perform:selector withArguments:altArguments.
       
 53465 				numFound := initialList size.
       
 53466 				numFound ~~ 0
       
 53467 			]]) ifTrue:[
       
 53468 			    question := question,(resources stringWithCRs:'\\But there are %1 implementations of %2 (with colon).\Browse those ?' with:numFound with:(altArguments first)).
       
 53469 			    answer := Dialog
       
 53470 				confirmWithCancel:question
       
 53471 				labels:(resources array:#('Cancel' 'Search Again' 'Yes'))
       
 53472 				default:2.
       
 53473 
       
 53474 			    answer isNil ifTrue:[
       
 53475 				^ self
       
 53476 			    ].
       
 53477 			    answer ifFalse:[
       
 53478 				restart raiseRequest
       
 53479 			    ].
       
 53480 			    arguments := altArguments.
       
 53481 
       
 53482 			] ifFalse:[
 53430 			] ifFalse:[
 53483 			    answer := Dialog
 53431 			    initialList := searchAction value.
 53484 				confirm:question
       
 53485 				yesLabel:(resources string:'Search Again')
       
 53486 				noLabel:(resources string:'Cancel').
       
 53487 			    answer ifFalse:[
       
 53488 				^ self
       
 53489 			    ].
       
 53490 			    restart raiseRequest
       
 53491 			].
 53432 			].
 53492 		    ].
 53433 		    ].
 53493 
 53434 
 53494 		    (initialList asSet = self selectedMethodsValue asSet)
 53435 		label := labelHolderOrBlock value.
 53495 		    "/ (numFound == 1 and:[initialList first == self theSingleSelectedMethod])
 53436 
 53496 		    ifTrue:[
 53437 		numFound := initialList size.
       
 53438 		numFound == 0 ifTrue:[
       
 53439 		    question := resources stringWithCRs:label with:((string ? '') allBold colorizeAllWith:Color red darkened).
       
 53440 		    question := question , (resources string:' - none found.').
       
 53441 
       
 53442 		    ((selector == #findImplementors:in:ignoreCase:match:)
       
 53443 		    and:[ (arguments first numArgs == 0)
       
 53444 		    and:[
       
 53445 			    string := ((arguments at:1),':') asSymbol.
       
 53446 			    altArguments := arguments copy.
       
 53447 			    altArguments at:1 put:string.
       
 53448 			    initialList := self class perform:selector withArguments:altArguments.
       
 53449 			    numFound := initialList size.
       
 53450 			    numFound ~~ 0
       
 53451 		    ]]) ifTrue:[
       
 53452 			question := question,(resources stringWithCRs:'\\But there are %1 implementations of %2 (with colon).\Browse those ?' with:numFound with:(altArguments first)).
 53497 			answer := Dialog
 53453 			answer := Dialog
 53498 			    confirmWithCancel:((resources stringWithCRs:label with:(string ? 'messages') allBold)
 53454 			    confirmWithCancel:question
 53499 					       , '.\\' withCRs
 53455 			    labels:(resources array:#('Cancel' 'Search Again' 'Yes'))
 53500 					       , (resources stringWithCRs:'Only the selected method(s) found.\Browse anyway ?'))
       
 53501 			    labels:(resources array:#('Cancel' 'Search Again' 'Yes' ))
       
 53502 			    values:#(nil #again true)
       
 53503 			    default:2.
 53456 			    default:2.
 53504 
 53457 
 53505 			answer == nil ifTrue:[
 53458 			answer isNil ifTrue:[
 53506 			    ^ self
 53459 			    ^ self
 53507 			].
 53460 			].
 53508 			answer == #again ifTrue:[
 53461 			answer ifFalse:[
 53509 			    restart raiseRequest
 53462 			    restart value.
 53510 			]
 53463 			].
       
 53464 			arguments := altArguments.
       
 53465 
       
 53466 		    ] ifFalse:[
       
 53467 			answer := Dialog
       
 53468 			    confirm:question
       
 53469 			    yesLabel:(resources string:'Search Again')
       
 53470 			    noLabel:(resources string:'Cancel').
       
 53471 			answer ifFalse:[
       
 53472 			    ^ self
       
 53473 			].
       
 53474 			restart value.
 53511 		    ].
 53475 		    ].
 53512 
 53476 		].
 53513 		    newBrowser := self
 53477 
 53514 				    spawnMethodBrowserForSearch:[
 53478 		(initialList asSet = self selectedMethodsValue asSet)
 53515 					    initialList notNil ifTrue:[
 53479 		"/ (numFound == 1 and:[initialList first == self theSingleSelectedMethod])
 53516 						list := initialList.
 53480 		ifTrue:[
 53517 						initialList := nil
 53481 		    answer := Dialog
 53518 					    ] ifFalse:[
 53482 			confirmWithCancel:((resources stringWithCRs:label with:(string ? 'messages') allBold)
 53519 						list := searchAction value
 53483 					   , '.\\' withCRs
 53520 					    ].
 53484 					   , (resources stringWithCRs:'Only the selected method(s) found.\Browse anyway ?'))
 53521 					    list
 53485 			labels:(resources array:#('Cancel' 'Search Again' 'Yes' ))
 53522 					]
 53486 			values:#(nil #again true)
 53523 				    sortBy:#class
 53487 			default:2.
 53524 				    in:openHow
 53488 
 53525 				    label:(resources string:label string with:string).
 53489 		    answer == nil ifTrue:[
 53526 
 53490 			^ self
 53527 		    setSearchPatternAction notNil ifTrue:[
       
 53528 			setSearchPatternAction value:newBrowser value:string value:((selector notNil and:[selector endsWith:'isMethod:']) ifTrue:[isMethod] ifFalse:[ignoreCase]) value:match.
       
 53529 		    ].
 53491 		    ].
 53530 		    t > 5 seconds ifTrue:[
 53492 		    answer == #again ifTrue:[
 53531 			newBrowser methodListApp autoUpdateOnChange: false.
 53493 			restart value.
 53532 		    ].
 53494 		    ]
 53533 		    ^ newBrowser.
       
 53534 		].
 53495 		].
       
 53496 
       
 53497 		newBrowser := self
       
 53498 				spawnMethodBrowserForSearch:[
       
 53499 					initialList notNil ifTrue:[
       
 53500 					    list := initialList.
       
 53501 					    initialList := nil
       
 53502 					] ifFalse:[
       
 53503 					    list := searchAction value
       
 53504 					].
       
 53505 					list
       
 53506 				    ]
       
 53507 				sortBy:#class
       
 53508 				in:openHow
       
 53509 				label:(resources string:label string with:string).
       
 53510 
       
 53511 		setSearchPatternAction notNil ifTrue:[
       
 53512 		    setSearchPatternAction value:newBrowser value:string value:((selector notNil and:[selector endsWith:'isMethod:']) ifTrue:[isMethod] ifFalse:[ignoreCase]) value:match.
       
 53513 		].
       
 53514 		t > 5 seconds ifTrue:[
       
 53515 		    newBrowser methodListApp autoUpdateOnChange: false.
       
 53516 		].
       
 53517 		^ newBrowser.
 53535 	    ].
 53518 	    ].
 53536 	].
 53519 	].
       
 53520     ] valueWithRestart.
 53537 
 53521 
 53538     "Modified: / 20-08-2012 / 13:26:06 / cg"
 53522     "Modified: / 20-08-2012 / 13:26:06 / cg"
       
 53523     "Modified: / 04-09-2013 / 17:39:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 53539 !
 53524 !
 53540 
 53525 
 53541 askForMethodAndSpawnSearchTitle:title browserLabel:labelHolderOrBlock searchWith:aSelectorOrBlock searchWhat:searchWhat searchArea:whereDefault
 53526 askForMethodAndSpawnSearchTitle:title browserLabel:labelHolderOrBlock searchWith:aSelectorOrBlock searchWhat:searchWhat searchArea:whereDefault
 53542     withCaseIgnore:withCaseIgnore withTextEntry:withTextEntry withMethodList:withMethodList setSearchPattern:setSearchPatternAction
 53527     withCaseIgnore:withCaseIgnore withTextEntry:withTextEntry withMethodList:withMethodList setSearchPattern:setSearchPatternAction
 53543     "convenient helper method: setup an enterBox with text from codeView or selected
 53528     "convenient helper method: setup an enterBox with text from codeView or selected
 53602 	best := what first.
 53587 	best := what first.
 53603 	box contents:best.
 53588 	box contents:best.
 53604 	idx := shownCategories findFirst:[:l | l startsWith:best].
 53589 	idx := shownCategories findFirst:[:l | l startsWith:best].
 53605 	idx == 0 ifTrue:[
 53590 	idx == 0 ifTrue:[
 53606 	    allMethodCategories isNil ifTrue:[
 53591 	    allMethodCategories isNil ifTrue:[
 53607 		allMethodCategories := Smalltalk allMethodCategories asArray sort.
 53592 		allMethodCategories := environment allMethodCategories asArray sort.
 53608 	    ].
 53593 	    ].
 53609 	    box list:allMethodCategories.
 53594 	    box list:allMethodCategories.
 53610 	    shownCategories := allMethodCategories.
 53595 	    shownCategories := allMethodCategories.
 53611 	    idx := shownCategories findFirst:[:l | l startsWith:best].
 53596 	    idx := shownCategories findFirst:[:l | l startsWith:best].
 53612 	].
 53597 	].
 53705     "helper for move-class-to-project and move-method-to-ptoject;
 53690     "helper for move-class-to-project and move-method-to-ptoject;
 53706      Ask for the new project (package-id)"
 53691      Ask for the new project (package-id)"
 53707 
 53692 
 53708     |offered already allProjects classesProjects selectedClasses selectedMethods|
 53693     |offered already allProjects classesProjects selectedClasses selectedMethods|
 53709 
 53694 
 53710     allProjects := Smalltalk allProjectIDs.
 53695     allProjects := environment allProjectIDs.
 53711 
 53696 
 53712     selectedClasses := self selectedClassesValue.
 53697     selectedClasses := self selectedClassesValue.
 53713     selectedClasses notNil ifTrue:[
 53698     selectedClasses notNil ifTrue:[
 53714 	classesProjects := selectedClasses
 53699 	classesProjects := selectedClasses
 53715 			    collectAll:[:cls |
 53700 			    collectAll:[:cls |
 53803     box entryCompletionBlock:[:contents |
 53788     box entryCompletionBlock:[:contents |
 53804 	|s what longest matching|
 53789 	|s what longest matching|
 53805 
 53790 
 53806 	box topView withWaitCursorDo:[
 53791 	box topView withWaitCursorDo:[
 53807 	    s := contents withoutSpaces.
 53792 	    s := contents withoutSpaces.
 53808 	    what := Smalltalk selectorCompletion:s.
 53793 	    what := DoWhatIMeanSupport selectorCompletion:s inEnvironment:environment .
 53809 	    longest := what first.
 53794 	    longest := what first.
 53810 	    matching := what last.
 53795 	    matching := what last.
 53811 	    box list:matching.
 53796 	    box list:matching.
 53812 	    box contents:longest.
 53797 	    box contents:longest.
 53813 	    matching size ~~ 1 ifTrue:[
 53798 	    matching size ~~ 1 ifTrue:[
 53848 	aBlock value:selector asSymbol value:openHow
 53833 	aBlock value:selector asSymbol value:openHow
 53849     ].
 53834     ].
 53850     ^ selector
 53835     ^ selector
 53851 
 53836 
 53852     "Modified (comment): / 29-08-2013 / 12:16:12 / cg"
 53837     "Modified (comment): / 29-08-2013 / 12:16:12 / cg"
       
 53838     "Modified: / 04-09-2013 / 17:40:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 53853 !
 53839 !
 53854 
 53840 
 53855 askIfModified
 53841 askIfModified
 53856     "if codeView was modified, return the answer from asking question;
 53842     "if codeView was modified, return the answer from asking question;
 53857      otherwise, return true"
 53843      otherwise, return true"
 54181 
 54167 
 54182 classIfValidNonMetaClassName:aClassName
 54168 classIfValidNonMetaClassName:aClassName
 54183     |class selectedClass ns|
 54169     |class selectedClass ns|
 54184 
 54170 
 54185     aClassName isNil ifTrue:[^ nil].
 54171     aClassName isNil ifTrue:[^ nil].
 54186     class := Smalltalk classNamed:aClassName.
 54172     class := environment classNamed:aClassName.
 54187     class isNil ifTrue:[
 54173     class isNil ifTrue:[
 54188 	selectedClass := self theSingleSelectedClass.
 54174 	selectedClass := self theSingleSelectedClass.
 54189 	selectedClass notNil ifTrue:[
 54175 	selectedClass notNil ifTrue:[
 54190 	    selectedClass isPrivate ifTrue:[
 54176 	    selectedClass isPrivate ifTrue:[
 54191 		class := (selectedClass owningClass privateClassesAt:aClassName).
 54177 		class := (selectedClass owningClass privateClassesAt:aClassName).
 54328 
 54314 
 54329     currentNamespace := self theSingleSelectedNamespace.
 54315     currentNamespace := self theSingleSelectedNamespace.
 54330 listOfNamespaces := self selectedNamespaces value.
 54316 listOfNamespaces := self selectedNamespaces value.
 54331 
 54317 
 54332     currentNamespace = (BrowserList nameListEntryForALL) ifTrue:[
 54318     currentNamespace = (BrowserList nameListEntryForALL) ifTrue:[
 54333 	(cls := Smalltalk at:nameSym) notNil ifTrue:[
 54319 	(cls := environment at:nameSym) notNil ifTrue:[
 54334 	    meta ifTrue:[^ cls class].
 54320 	    meta ifTrue:[^ cls class].
 54335 	    ^ cls
 54321 	    ^ cls
 54336 	]
 54322 	]
 54337     ].
 54323     ].
 54338     ("(Array with:Smalltalk) ," (self listOfNamespaces)) do:[:aNamespace |
 54324     ("(Array with:Smalltalk) ," (self listOfNamespaces)) do:[:aNamespace |
 54342 		^ cls
 54328 		^ cls
 54343 	    ]
 54329 	    ]
 54344 	]
 54330 	]
 54345     ].
 54331     ].
 54346     currentNamespace ~= (BrowserList nameListEntryForALL) ifTrue:[
 54332     currentNamespace ~= (BrowserList nameListEntryForALL) ifTrue:[
 54347 	(cls := Smalltalk at:nameSym) notNil ifTrue:[
 54333 	(cls := environment at:nameSym) notNil ifTrue:[
 54348 	    meta ifTrue:[^ cls class].
 54334 	    meta ifTrue:[^ cls class].
 54349 	    ^ cls
 54335 	    ^ cls
 54350 	]
 54336 	]
 54351     ].
 54337     ].
 54352 
 54338 
 54353     (nm startsWith:'Smalltalk::') ifTrue:[
 54339     (nm startsWith:'Smalltalk::') ifTrue:[
 54354 	cls := Smalltalk classNamed:(nm copyFrom:'Smalltalk::' size + 1).
 54340 	cls := environment classNamed:(nm withoutPrefix:'Smalltalk::').
 54355 	cls notNil ifTrue:[
 54341 	cls notNil ifTrue:[
 54356 	    meta ifTrue:[^ cls class].
 54342 	    meta ifTrue:[^ cls class].
 54357 	    ^ cls
 54343 	    ^ cls
 54358 	]
 54344 	]
 54359     ].
 54345     ].
 54360 
       
 54361     "JV@2012-07-30: Search for Java class as well"
       
 54362     (JAVA notNil and:[nm includes: $/]) ifTrue:[
       
 54363 	"/Try primordial class loader...
       
 54364 	cls := JavaVM classNamed: aClassName definedBy: nil.
       
 54365 	cls notNil ifTrue:[ ^ cls ].
       
 54366 	"/Try system class loader...
       
 54367 	cls := JavaVM classNamed: aClassName definedBy: JavaVM systemClassLoader.
       
 54368 	cls notNil ifTrue:[ ^ cls ].
       
 54369     ].
       
 54370     ^ nil
 54346     ^ nil
 54371 
 54347 
 54372     "Created: / 13-02-2000 / 21:15:29 / cg"
 54348     "Created: / 13.2.2000 / 21:15:29 / cg"
 54373     "Modified: / 24-02-2000 / 13:49:44 / cg"
 54349     "Modified: / 24.2.2000 / 13:49:44 / cg"
 54374     "Modified: / 30-07-2012 / 16:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 54375 !
 54350 !
 54376 
 54351 
 54377 findClassNamedInNameSpace:aClassName
 54352 findClassNamedInNameSpace:aClassName
 54378     "search through current namespaces for aClassName.
 54353     "search through current namespaces for aClassName.
 54379      Return the class or nil, if not found."
 54354      Return the class or nil, if not found."
 54395 
 54370 
 54396     |sel nSel mthd classes|
 54371     |sel nSel mthd classes|
 54397 
 54372 
 54398     sel := self selectionInCodeView.
 54373     sel := self selectionInCodeView.
 54399     sel notNil ifTrue:[
 54374     sel notNil ifTrue:[
 54400 	(sel knownAsSymbol and:[Smalltalk includesKey:sel asSymbol]) ifTrue:[
 54375 	(sel knownAsSymbol and:[environment includesKey:sel asSymbol]) ifTrue:[
 54401 	    ^ sel
 54376 	    ^ sel
 54402 	].
 54377 	].
 54403 
 54378 
 54404 	"/ validate
 54379 	"/ validate
 54405 	nSel := (Parser new findBestVariablesFor:sel) first.
 54380 	nSel := (Parser new findBestVariablesFor:sel) first.
 54460     "return a list of considered namespaces"
 54435     "return a list of considered namespaces"
 54461 
 54436 
 54462     |currentNamespace|
 54437     |currentNamespace|
 54463 
 54438 
 54464     currentNamespace := self currentNamespace.
 54439     currentNamespace := self currentNamespace.
 54465     currentNamespace isNil ifTrue:[
 54440     (currentNamespace isNil and:[environment == Smalltalk]) ifTrue:[
 54466 	^ Array with:Smalltalk
 54441 	^ Array with:Smalltalk
 54467     ].
 54442     ].
 54468 
 54443 
 54469     currentNamespace = (BrowserList nameListEntryForALL) ifTrue:[
 54444     currentNamespace = (BrowserList nameListEntryForALL) ifTrue:[
 54470 	^ self listOfAllNamespaces
 54445 	^ environment listOfAllNamespaces
 54471     ].
 54446     ].
 54472 
 54447 
 54473     ^ Array with:currentNamespace
 54448     ^ Array with:currentNamespace
 54474 
 54449 
 54475     "Modified: / 24.2.2000 / 13:49:20 / cg"
 54450     "Modified: / 24-02-2000 / 13:49:20 / cg"
       
 54451     "Modified: / 04-09-2013 / 17:44:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 54476 !
 54452 !
 54477 
 54453 
 54478 newBrowserOrBufferDependingOn:openHowWanted label:labelOrNil forSpec:spec setupWith:aBlock
 54454 newBrowserOrBufferDependingOn:openHowWanted label:labelOrNil forSpec:spec setupWith:aBlock
 54479     |brwsr openHow|
 54455     |brwsr openHow|
 54480 
 54456 
 54727 
 54703 
 54728     (includeChangedPseudoCategory := aCollectionOfCategories includes:(ClassCategoryList nameListEntryForChanged)) ifTrue:[
 54704     (includeChangedPseudoCategory := aCollectionOfCategories includes:(ClassCategoryList nameListEntryForChanged)) ifTrue:[
 54729 	changedClasses := ChangeSet current changedClasses collect:[:cls | cls theNonMetaclass].
 54705 	changedClasses := ChangeSet current changedClasses collect:[:cls | cls theNonMetaclass].
 54730     ].
 54706     ].
 54731 
 54707 
 54732     ^ Smalltalk allClassesForWhich:[:aClass |
 54708     ^ environment allClassesForWhich:[:aClass |
 54733 	(allCategories
 54709 	(allCategories
 54734 	    or:[(aCollectionOfCategories includes:aClass category)
 54710 	    or:[(aCollectionOfCategories includes:aClass category)
 54735 	    or:[includeChangedPseudoCategory and:[changedClasses includes:aClass]]])
 54711 	    or:[includeChangedPseudoCategory and:[changedClasses includes:aClass]]])
 54736 	and:[ (nameSpaceFilter isNil or:[nameSpaceFilter includes:aClass nameSpace name])
 54712 	and:[ (nameSpaceFilter isNil or:[nameSpaceFilter includes:aClass nameSpace name])
 54737 	and:[ (packageFilter isNil or:[packageFilter includes:aClass package]) ]].
 54713 	and:[ (packageFilter isNil or:[packageFilter includes:aClass package]) ]].
 54884 
 54860 
 54885     |selectedProjects setOfClasses allIncluded|
 54861     |selectedProjects setOfClasses allIncluded|
 54886 
 54862 
 54887     selectedProjects := self selectedProjects value.
 54863     selectedProjects := self selectedProjects value.
 54888     allIncluded := selectedProjects includes:(BrowserList nameListEntryForALL).
 54864     allIncluded := selectedProjects includes:(BrowserList nameListEntryForALL).
 54889     allIncluded ifTrue:[ ^ Smalltalk allClasses ].
 54865     allIncluded ifTrue:[ ^ environment allClasses ].
 54890 
 54866 
 54891     setOfClasses := IdentitySet new.
 54867     setOfClasses := IdentitySet new.
 54892 
 54868 
 54893     Smalltalk allClassesDo:[:aClass |
 54869     environment allClassesDo:[:aClass |
 54894 	(selectedProjects includes:aClass package) ifTrue:[
 54870 	(selectedProjects includes:aClass package) ifTrue:[
 54895 	    setOfClasses add:aClass .
 54871 	    setOfClasses add:aClass .
 54896 	]
 54872 	]
 54897     ].
 54873     ].
 54898     ^ setOfClasses
 54874     ^ setOfClasses
 54916     protocols := self selectedProtocolsValue.
 54892     protocols := self selectedProtocolsValue.
 54917     protocols := protocols collect:[:each | each string].
 54893     protocols := protocols collect:[:each | each string].
 54918     allIncluded := protocols includes:(BrowserList nameListEntryForALL).
 54894     allIncluded := protocols includes:(BrowserList nameListEntryForALL).
 54919 
 54895 
 54920     navigationState isFullProtocolBrowser ifTrue:[
 54896     navigationState isFullProtocolBrowser ifTrue:[
 54921 	targets := Smalltalk allClassesAndMetaclasses
 54897 	targets := environment allClassesAndMetaclasses
 54922     ] ifFalse:[
 54898     ] ifFalse:[
 54923 	targets := self selectedClassesValue
 54899 	targets := self selectedClassesValue
 54924     ].
 54900     ].
 54925     targets isEmptyOrNil ifTrue:[^self].
 54901     targets isEmptyOrNil ifTrue:[^self].
 54926 
 54902 
 54951     |protocols targets allIncluded|
 54927     |protocols targets allIncluded|
 54952 
 54928 
 54953     protocols := self selectedProtocolsValue.
 54929     protocols := self selectedProtocolsValue.
 54954 
 54930 
 54955     navigationState isFullProtocolBrowser ifTrue:[
 54931     navigationState isFullProtocolBrowser ifTrue:[
 54956 	targets := Smalltalk allClassesAndMetaclasses
 54932 	targets := environment allClassesAndMetaclasses
 54957     ] ifFalse:[
 54933     ] ifFalse:[
 54958 	targets := self selectedClassesValue
 54934 	targets := self selectedClassesValue
 54959     ].
 54935     ].
 54960     allIncluded := protocols includes:(BrowserList nameListEntryForALL).
 54936     allIncluded := protocols includes:(BrowserList nameListEntryForALL).
 54961 
 54937 
 55571     explainTookTooLong := false.
 55547     explainTookTooLong := false.
 55572     withTimeout ifTrue:[
 55548     withTimeout ifTrue:[
 55573 	explanation :=
 55549 	explanation :=
 55574 	    [ self explanationForCode:code short:short ]
 55550 	    [ self explanationForCode:code short:short ]
 55575 		    valueWithWatchDog:[explainTookTooLong := true]
 55551 		    valueWithWatchDog:[explainTookTooLong := true]
 55576 		    afterMilliseconds:100.
 55552 		    afterMilliseconds:200.
 55577     ] ifFalse:[
 55553     ] ifFalse:[
 55578 	explanation := self explanationForCode:code short:short
 55554 	explanation := self explanationForCode:code short:short
 55579     ].
 55555     ].
 55580 
 55556 
 55581     self activityNotification:nil.
 55557     self activityNotification:nil.
 55582     explainTookTooLong ifTrue:[
 55558     explainTookTooLong ifTrue:[
 55583 	self showInfo:'Explain took too long - cancelled.'.
 55559 	self showInfo:'Explain took too long - cancelled.'.
 55584 	^ self.
 55560 	^ self.
 55585     ].
 55561     ].
 55586 
 55562 
 55587     explanation notNil ifTrue:[
 55563     explanation notEmptyOrNil ifTrue:[
 55588 	short ifTrue:[
 55564 	short ifTrue:[
 55589 	    self showInfo:explanation
 55565 	    self showInfo:explanation
 55590 	] ifFalse:[
 55566 	] ifFalse:[
 55591 	    self information:explanation
 55567 	    self information:explanation
 55592 	].
 55568 	].
 55787 methodImplementorsInfoFor:aMethod
 55763 methodImplementorsInfoFor:aMethod
 55788     |implementors msg senders msg2|
 55764     |implementors msg senders msg2|
 55789 
 55765 
 55790     implementors := SystemBrowser
 55766     implementors := SystemBrowser
 55791 	findImplementorsOf:aMethod selector
 55767 	findImplementorsOf:aMethod selector
 55792 	in:(Smalltalk allClasses)
 55768 	in:(environment allClasses)
 55793 	ignoreCase:false.
 55769 	ignoreCase:false.
 55794 
 55770 
 55795     implementors notEmpty ifTrue:[
 55771     implementors notEmpty ifTrue:[
 55796 	msg := 'Only implemented here.'.
 55772 	msg := 'Only implemented here.'.
 55797 	implementors remove:aMethod ifAbsent:nil.
 55773 	implementors remove:aMethod ifAbsent:nil.
 55806     ].
 55782     ].
 55807 
 55783 
 55808 false ifTrue:[  "/ too slow
 55784 false ifTrue:[  "/ too slow
 55809     senders := SystemBrowser
 55785     senders := SystemBrowser
 55810 	findSendersOf:aMethod selector
 55786 	findSendersOf:aMethod selector
 55811 	in:(Smalltalk allClasses)
 55787 	in:(environment allClasses)
 55812 	ignoreCase:false.
 55788 	ignoreCase:false.
 55813     senders notEmpty ifTrue:[
 55789     senders notEmpty ifTrue:[
 55814 	msg2 := 'Sent from ' , senders size printString, ' methods.'.
 55790 	msg2 := 'Sent from ' , senders size printString, ' methods.'.
 55815     ] ifFalse:[
 55791     ] ifFalse:[
 55816 	msg2 := 'No senders.'.
 55792 	msg2 := 'No senders.'.
 56055 
 56031 
 56056     ^[:partialName| | env |
 56032     ^[:partialName| | env |
 56057     env := self theSingleSelectedNamespace ? #Smalltalk.
 56033     env := self theSingleSelectedNamespace ? #Smalltalk.
 56058     env = NavigatorModel nameListEntryForALL
 56034     env = NavigatorModel nameListEntryForALL
 56059 	ifTrue:[env := #Smalltalk].
 56035 	ifTrue:[env := #Smalltalk].
 56060     env := Smalltalk at: env.
 56036     env := environment at: env.
 56061     partialName isEmptyOrNil
 56037     partialName isEmptyOrNil
 56062 	ifTrue:
 56038 	ifTrue:
 56063 	    [#('' #())]
 56039 	    [#('' #())]
 56064 	ifFalse:
 56040 	ifFalse:
 56065 	    [partialName first isUppercase
 56041 	    [partialName first isUppercase
 56565 	    [
 56541 	    [
 56566 		syntaxColoringProcessRunning := true.
 56542 		syntaxColoringProcessRunning := true.
 56567 		cls := methodsClass.
 56543 		cls := methodsClass.
 56568 		(cls notNil and:[cls isObsolete]) ifTrue:[
 56544 		(cls notNil and:[cls isObsolete]) ifTrue:[
 56569 		    cls isMeta ifTrue:[
 56545 		    cls isMeta ifTrue:[
 56570 			cls := (Smalltalk at:cls theNonMetaclass name) class
 56546 			cls := (environment at:cls theNonMetaclass name) class
 56571 		    ] ifFalse:[
 56547 		    ] ifFalse:[
 56572 			cls := Smalltalk at:cls name
 56548 			cls := environment at:cls name
 56573 		    ].
 56549 		    ].
 56574 		].
 56550 		].
 56575 		"check after every lengthy operation if modified by user in the meantime..."
 56551 		"check after every lengthy operation if modified by user in the meantime..."
 56576 		codeView modified ifFalse:[
 56552 		codeView modified ifFalse:[
 56577 		    oldCodeList := codeView list copy.
 56553 		    oldCodeList := codeView list copy.
 57090     "/ no need to fixup here - I am always installed as subcanvas
 57066     "/ no need to fixup here - I am always installed as subcanvas
 57091     "/ (via noteBookView)
 57067     "/ (via noteBookView)
 57092 
 57068 
 57093     super postBuildWith:aBuilder.
 57069     super postBuildWith:aBuilder.
 57094 
 57070 
 57095     Smalltalk addDependent:self.
 57071     environment addDependent:self.
 57096 
 57072 
 57097     self codeInfoVisible value ifTrue:[ self codeInfoVisibilityChanged ].
 57073     self codeInfoVisible value ifTrue:[ self codeInfoVisibilityChanged ].
 57098     (self toolBarVisibleHolder value or:[self bookmarkBarVisibleHolder value])
 57074     (self toolBarVisibleHolder value or:[self bookmarkBarVisibleHolder value])
 57099 	    ifTrue:[ self toolBarOrBookmarkBarVisibilityChanged ].
 57075 	    ifTrue:[ self toolBarOrBookmarkBarVisibilityChanged ].
 57100 
 57076 
 57431 	(m := navigationState theSingleSelectedMethod) notNil ifTrue:[
 57407 	(m := navigationState theSingleSelectedMethod) notNil ifTrue:[
 57432 	    self class addToRecentlyClosedHistory:m mclass selector:m selector
 57408 	    self class addToRecentlyClosedHistory:m mclass selector:m selector
 57433 	].
 57409 	].
 57434     ].
 57410     ].
 57435 
 57411 
 57436     Smalltalk removeDependent:self.
 57412     environment removeDependent:self.
 57437     super closeRequest.
 57413     super closeRequest.
 57438 
 57414 
 57439     "Created: / 11-02-2000 / 13:23:00 / cg"
 57415     "Created: / 11-02-2000 / 13:23:00 / cg"
 57440     "Modified: / 09-09-2012 / 10:26:14 / cg"
 57416     "Modified: / 09-09-2012 / 10:26:14 / cg"
 57441 !
 57417 !
 58527 Class nameSpaceQuerySignal
 58503 Class nameSpaceQuerySignal
 58528 answer:(self currentNamespace)
 58504 answer:(self currentNamespace)
 58529 do:[
 58505 do:[
 58530 			    ("self canUseRefactoringSupport"
 58506 			    ("self canUseRefactoringSupport"
 58531 			     language isSmalltalk
 58507 			     language isSmalltalk
 58532 			     and:[(Smalltalk at:cls theNonMetaclass name)==cls
 58508 			     and:[(environment at:cls theNonMetaclass name)==cls
 58533 			     and:[cls programmingLanguage == language
 58509 			     and:[cls programmingLanguage == language
 58534 			     and:[InteractiveAddMethodChange notNil]]]
 58510 			     and:[InteractiveAddMethodChange notNil]]]
 58535 			    ) ifTrue:[
 58511 			    ) ifTrue:[
 58536 				"/ cg: Q: is the AddMethodChange prepared for languages ?
 58512 				"/ cg: Q: is the AddMethodChange prepared for languages ?
 58537 				change := InteractiveAddMethodChange compile:code in:cls classified:cat.
 58513 				change := InteractiveAddMethodChange compile:code in:cls classified:cat.
 58591 			    "/ self selectedProtocols setValue:(Array with:rslt category).
 58567 			    "/ self selectedProtocols setValue:(Array with:rslt category).
 58592 			   self selectProtocols:(Array with:lastMethodCategory).
 58568 			   self selectProtocols:(Array with:lastMethodCategory).
 58593 			]
 58569 			]
 58594 		    ].
 58570 		    ].
 58595 
 58571 
 58596 		    "Must check also for protocol as we may be accepting
 58572 		    oldSelector ~= rslt selector ifTrue:[
 58597 		     a method in '* required *' pseudo-protocol and in this case,
       
 58598 		     method category will change too!!"
       
 58599 		    (oldSelector ~= rslt selector or:[oldMethod category ~= rslt category]) ifTrue:[
       
 58600 			self selectedMethods value:(Array with:rslt).
 58573 			self selectedMethods value:(Array with:rslt).
 58601 			"/ self switchToSelector:rslt selector
 58574 			"/ self switchToSelector:rslt selector
 58602 		    ] ifFalse:[
 58575 		    ] ifFalse:[
 58603 "/                            "/ do not notify myself (to avoid scroll-to-top)
 58576 "/                            "/ do not notify myself (to avoid scroll-to-top)
 58604 "/
 58577 "/
 58628     ].
 58601     ].
 58629     ^ returnValue.
 58602     ^ returnValue.
 58630 
 58603 
 58631     "Created: / 30-12-2009 / 20:01:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 58604     "Created: / 30-12-2009 / 20:01:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 58632     "Modified: / 02-08-2012 / 09:37:29 / cg"
 58605     "Modified: / 02-08-2012 / 09:37:29 / cg"
 58633     "Modified: / 07-08-2013 / 13:00:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 58606     "Modified: / 04-09-2013 / 17:38:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 58634 !
 58607 !
 58635 
 58608 
 58636 askForInitialApplicationCodeFor:aClass
 58609 askForInitialApplicationCodeFor:aClass
 58637     |cls mcls codeAspect msg|
 58610     |cls mcls codeAspect msg|
 58638 
 58611 
 58728 	].
 58701 	].
 58729 	className = '*' ifTrue:[
 58702 	className = '*' ifTrue:[
 58730 	    ^ classes asArray.
 58703 	    ^ classes asArray.
 58731 	].
 58704 	].
 58732 
 58705 
 58733 	cls := Smalltalk at:className asSymbol.
 58706 	cls := environment at:className asSymbol.
 58734 	cls isNil ifTrue:[
 58707 	cls isNil ifTrue:[
 58735 	    self warn:'No such class - try again'.
 58708 	    self warn:'No such class - try again'.
 58736 	    ^ nil
 58709 	    ^ nil
 58737 	].
 58710 	].
 58738     ].
 58711     ].
 58760 		    with:getSelector allBold
 58733 		    with:getSelector allBold
 58761 		    with:setSelector allBold) withCRs.
 58734 		    with:setSelector allBold) withCRs.
 58762     ].
 58735     ].
 58763 
 58736 
 58764     [
 58737     [
 58765 	Smalltalk removeDependent:self.   "/ avoid update
 58738 	environment removeDependent:self.   "/ avoid update
 58766 	ClassDescription updateHistoryLineQuerySignal answer:true do:[
 58739 	ClassDescription updateHistoryLineQuerySignal answer:true do:[
 58767 	    (ClassDescription updateChangeFileQuerySignal
 58740 	    (ClassDescription updateChangeFileQuerySignal
 58768 	    , ClassDescription updateChangeListQuerySignal) answer:self suppressChangeSetUpdate not
 58741 	    , ClassDescription updateChangeListQuerySignal) answer:self suppressChangeSetUpdate not
 58769 	    do:[
 58742 	    do:[
 58770 		currentClass perform:setSelector with:theCode asString string.
 58743 		currentClass perform:setSelector with:theCode asString string.
 58772 	].
 58745 	].
 58773 	codeView contents:(currentClass perform:getSelector).
 58746 	codeView contents:(currentClass perform:getSelector).
 58774 	codeView modified:false.
 58747 	codeView modified:false.
 58775 	navigationState realModifiedState:false.
 58748 	navigationState realModifiedState:false.
 58776     ] ensure:[
 58749     ] ensure:[
 58777 	Smalltalk addDependent:self.
 58750 	environment addDependent:self.
 58778     ].
 58751     ].
 58779 
 58752 
 58780     self codeAspect:aspect.
 58753     self codeAspect:aspect.
 58781 
 58754 
 58782     "Modified: / 01-03-2007 / 20:53:42 / cg"
 58755     "Modified: / 01-03-2007 / 20:53:42 / cg"
 59516     |classes names|
 59489     |classes names|
 59517 
 59490 
 59518     classes := self selectedClassesValue.
 59491     classes := self selectedClassesValue.
 59519     names := classes collect:[:cls | cls name].
 59492     names := classes collect:[:cls | cls name].
 59520     self unloadClasses:classes.
 59493     self unloadClasses:classes.
 59521     self loadClasses:(names collect:[:nm | Smalltalk classNamed:nm]).
 59494     self loadClasses:(names collect:[:nm | environment classNamed:nm]).
 59522 
 59495 
 59523     "/ to force update.
 59496     "/ to force update.
 59524     "/ (I guess, this is not needed)
 59497     "/ (I guess, this is not needed)
 59525     self selectedClasses value:(self selectedClassesValue copy).
 59498     self selectedClasses value:(self selectedClassesValue copy).
 59526 
 59499 
 60737 ! !
 60710 ! !
 60738 
 60711 
 60739 !NewSystemBrowser class methodsFor:'documentation'!
 60712 !NewSystemBrowser class methodsFor:'documentation'!
 60740 
 60713 
 60741 version
 60714 version
 60742     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1972 2013-09-02 15:16:51 cg Exp $'
 60715     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1975 2013-09-05 22:48:24 cg Exp $'
 60743 !
 60716 !
 60744 
 60717 
 60745 version_CVS
 60718 version_CVS
 60746     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1972 2013-09-02 15:16:51 cg Exp $'
 60719     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1975 2013-09-05 22:48:24 cg Exp $'
 60747 !
 60720 !
 60748 
 60721 
 60749 version_HG
 60722 version_HG
 60750 
 60723 
 60751     ^ '$Changeset: <not expanded> $'
 60724     ^ '$Changeset: <not expanded> $'
 60752 !
 60725 !
 60753 
 60726 
 60754 version_SVN
 60727 version_SVN
 60755     ^ '$Id: Tools__NewSystemBrowser.st,v 1.1972 2013-09-02 15:16:51 cg Exp $'
 60728     ^ '$Id: Tools__NewSystemBrowser.st,v 1.1975 2013-09-05 22:48:24 cg Exp $'
 60756 ! !
 60729 ! !
 60757 
 60730 
 60758 
 60731 
 60759 NewSystemBrowser initialize!
 60732 NewSystemBrowser initialize!