Furthering the investigation:<ExplorePackageSelectedPlugin.st>With groups, plugins are not working at all as package doesn't exist in DynamicClassGroup etc.I fixed the plugin I was interested in but this makes for strange code as:>>packageSelected: anAnnouncement| package name |(anAnnouncement respondsTo: #package) ifTrue: [...This is because the announcement comes for a package which is not one.even if one has registered it with:registerTo: aModelaModel announceron: NautilusPackageSelected send: #packageSelected: to: selfMaybe should we have other announcements for these specific items like DynamicClassGroup (e.g. DynamicClassGroupSelected announcement)I have made a little plugin to help me explore the selected classes in the left most list.Also addingRPackage>>package^selfhelps with package selected code as without it it is hard to write:package node item packagefor both PackageTreeTagSelection and PackageTreePackageSelection
This makes the TasksPlugin code like;packageSelected: anAnnouncement| package |(anAnnouncement respondsTo: #package) ifTrue: [package := anAnnouncement package.packageifNil: [ tasks removeAll ]ifNotNil: [(package node item respondsTo: #package) ifTrue: [tasks := (self systemNavigation allCallsOn: 'flag:' asSymbol) select: [ :m | package node item package includesMethod: m selector ofClass: m methodClass ]].].] ifFalse: [tasks removeAll.].self changed: #tasks.Maybe can we get this leaner with the proposed changes to the announcements.Phil
On Fri, Mar 21, 2014 at 7:12 PM, phil@highoctane.be <phil@highoctane.be> wrote:
I have been looking at Nautilus plugins as I wanted to be able to export some classes to other formats (e.g. CSV, XML for use with other tools).Then, I started playing around with the URLPlugin with its buildString method, which proves helpful to find out about what is selected in the 'list2'.So, that's where I started drilling down the rabbit hole...So, I see that we have packages and package tags. And actions like promote as true package and demote (which kind of doesn't work and crashes, but I should test further).
One thing is that this setup breaks the PackageTasks plugin is broken at this point.We have:>>packageSelected: anAnnouncementpackage := anAnnouncement package.
...tasks := (self systemNavigation allCallsOn: 'flag:' asSymbol) select: [ :m | package includesMethod: m selector ofClass: m methodClass ] ]But with the packages and tags, it doesn't work.In fact, package is misleading as the announcement contains a PackageTreePackageSelection or a PackageTreeTagSelection.Question: how is one filtering on either the package or a given tag? Is this possible?I saw the >>node and node>>item things.I was trying to build the full path (Like "Nautilus-Plugin" from what is selected in the model).Question; Is there any method for doing that at this point? (e.g. fullTag?)Then I tried this:Object subclass: #XXXXinstanceVariableNames: ''classVariableNames: ''category: 'Nautilus-Nautilus'This gets XXXX mixed with the classes in Nautilus under the Nautilus package in the Nautilus tag.So, a tag class is mixed with the root package. Not nice.What's the underlying model? Is there a doc somewhere?Going back to the digging...TIAPhil