Omnibrowser - browsing a class outside OB

Cédrick Béler cbeler at enit.fr
Wed Jun 27 17:01:04 UTC 2007


Damien Cassou a écrit :
> 2007/6/27, Cédrick Béler <cbeler at enit.fr>:
>> Oh and last request,  when OB is enabled by default,   hitting the
>> browse shortcut on a class name (in a worspace for instace) doens't work
>> for me. The browser is opening with nothing selected.
>> This is calling the following code wich reproduces for me the same
>> problem (opens a browser with no class selected):
>> OTToolset browse: WAComponent selector: nil.
>>
>> Is it normal (maybe I don't have the last version) because browsing a
>> class (alt+b) inside OB works... ?
>
>
> I have the same problem. If you have a fix, please commit it to
> http://source.wiresong.ca/ob/
>
I don't really know where to publish, so I made a fileout of the fixes. 
Of course, I'm not sure it's very good. Try it and tell me please 
(OBSystemBrowserAdaptor is the default browser).

The problem comes from 2 places.

First, when selecting a class in say a workspace, then press cmd+b, in 
debugging, we see that it calls 
OTToolset browse: Object selector: nil. Because of nil, which is not a 
selector, it opens an empty browser. And this is because in:
OBColumnPanel>>selectAncestorsOf: aNode, ... current childAncestorOf: 
aNode becomes nil as the method node is nil... and therefore the path 
becomes nil...  It's propably better to correct this method but to be 
quick, I changed:
OBSystemBrowser>>openOnClass: aClass selector: aSelector
to test if aSelector is nil... (see OBSystemBrowser class.st)

Second, in an object explorer, right click then browse on a node also 
gives an "empty" browser. Here it comes from:
StringHolder>>browseMethodFull (*Tools). I changed:
Browser fullOnClass: myClass selector: self selectedMessageName   
with:
ToolSet browse: myClass selector: self selectedMessageName. (see 
StringHolder-browser.st)

Can you tell me if it's correct and where to publish the last fix?

Cédrick


-------------- next part --------------
'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 27 June 2007 at 6:18:14 pm'!

!StringHolder methodsFor: '*Tools' stamp: 'cb 6/27/2007 18:18'!
browseMethodFull
	"Create and schedule a full Browser and then select the current class and message."

	| myClass |
	(myClass := self selectedClassOrMetaClass) ifNotNil:
		[ToolSet browse: myClass selector: self selectedMessageName.]! !
-------------- next part --------------
'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 27 June 2007 at 6:41:42 pm'!

!OBSystemBrowser class methodsFor: 'opening' stamp: 'cb 6/27/2007 18:41'!
openOnClass: aClass selector: aSelector
	aSelector ifNil: [^ (self onClass: aClass) open].
	^ (self onClass: aClass selector: aSelector) open! !


More information about the Squeak-dev mailing list