in browseIt:
if selection is of the form class >> selector, immediately switch to that selector
--- a/Workspace.st Fri Mar 21 18:20:39 2003 +0100
+++ b/Workspace.st Fri Mar 21 19:06:44 2003 +0100
@@ -903,12 +903,23 @@
browseIt
"evaluate the code and open a browser on the resulting class (if it evaluates to one),
- or the class of the resulting object (if it does not evaluate to a class)"
+ or the class of the resulting object (if it does not evaluate to a class).
+
+ Added feature: if selection is of the form class >> selector, immediately switch to that selector."
+
+ |codeToEvaluate idx selector|
+
+ codeToEvaluate := self selection asString withoutSeparators.
+ idx := codeToEvaluate indexOfSubCollection:'>>'.
+ idx ~~ 0 ifTrue:[
+ selector := codeToEvaluate copyFrom:idx+2.
+ codeToEvaluate := codeToEvaluate copyTo:idx-1.
+ ].
^ self
- do:(self selection)
+ do:codeToEvaluate
withValueDo:[:result | result isBehavior ifTrue:[
- result browserClass openInClass:result selector:nil
+ result browserClass openInClass:result selector:selector
] ifFalse:[
result class browserClass openInClass:(result class) selector:nil
]
@@ -1146,5 +1157,5 @@
!Workspace class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.121 2003-02-12 13:06:12 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.122 2003-03-21 18:06:44 cg Exp $'
! !