[squeak-dev] FileContentsBrowser issue

Frank Shearar frank.shearar at gmail.com
Wed Jan 16 22:56:27 UTC 2013


On 16 January 2013 17:39, Bob Arning <arning315 at comcast.net> wrote:
> I'm not sure how many folks still use FileContentsBrowser, but there is a
> small issue:
>
> browseStream: aStream named: aString
>
>     | browser |
>     Cursor wait showWhile: [ | package packageDict organizer |
>         packageDict := Dictionary new.
>         browser := self new.
>         organizer := SystemOrganizer defaultList: Array new.
>         package := (FilePackage new fullName: aString; fileInFrom: aStream).
>         packageDict
>             at: package packageName
>             put: package.
>         organizer
>             classifyAll: package classes keys
>             under: package packageName.
>         (browser := self systemOrganizer: organizer)
>             packages: packageDict].
>     self
>         openBrowserView: browser createViews
>         label: 'File Contents Browser'.
>
> which soon leads to SystemOrganizer
>
> classify: element under: newCategory
>     | oldCategory class |
>     oldCategory := self categoryOfElement: element.
>     super classify: element under: newCategory.
>     class := Smalltalk at: element ifAbsent: [^ self].
>     SystemChangeNotifier uniqueInstance
>         class: class
>         recategorizedFrom: oldCategory
>         to: newCategory
>
> which causes all known classes in the file being browsed to be added to the
> current change set as having a class definition change. Perhaps it makes
> sense to do the notification only if this SystemOrganizer is actually
> SystemOrganization.

Bob, I think you're quite right. Usually Browser's systemOrganizer
isKindOf: SystemOrganization, and for a FileContentsBrowser that's
probably not right. Right now you can't (IIRC) inject your own
classOrganizer/systemOrganizer into a Browser. I've been hacking on a
Browser that can browse a remote image over HTTP, and I think - I'd
need to check, and it's late - that I had to fiddle a bit to give
Browser a nudge to pass in my own organizers.

If you raise a Mantis report over on bugs.squeak.org in the Tools
category, I'll be less likely to forget about fixing this issue.

Thanks!

frank

> Cheers,
> Bob
>
>
>


More information about the Squeak-dev mailing list