Integrating a custom spotter, reusing current code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Integrating a custom spotter, reusing current code

Stephan Eggermont-3
In the CodePanel demo, I now managed to add some spotter integration
by copy-pasting some code from GTSpotter and adding actLogic.

Object subclass: #CardSpotterModel
        instanceVariableNames: 'panel'
        classVariableNames: ''
        category: 'NewUI'

CardSpotterModel>>spotterImplementorsFor: aStep
        <spotterOrder: 10>
        aStep listProcessor
                title: 'Implementors';
                filter: GTFilterImplementor item: [ :filter :context |
                        SystemNavigation default allBehaviorsDo: [ :class | class methodsDo:
filter ] ];
                wantsToDisplayOnEmptyQuery: false;
                actLogic: [:item :step | step exit. panel newCardFor: item]

That is used
CodeCard>>spotImplementers
        |model|
        model := CardSpotterModel on: self panel.
       
        GTSpotterMorph new
                extent: 400@500;
                doLayout;
                spotterModel: (GTSpotter on: model);
                openCenteredInWorld.

That is ugly, as it is a duplication. Also, how do I get to a list
of the implementers/senders/references/etc of the method/class?
What is the improved and approved way to do this :) ?

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Peter Uhnak
> Also, how do I get to a list
> of the implementers/senders/references/etc of the method/class?
> What is the improved and approved way to do this :) ?

do you mean sending them #senders and #implementors? Or am I missing something?

aCompiledMethod senders.
(Morph>>#drawOn:) implementors.
Morph allCallsOn.

This will list everything. Nautilus can also filter it, because it
keeps track of the current scope, but I don't know if this is
abstracted.

Peter

Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Thierry Goubier


2015-09-22 14:02 GMT+02:00 Peter Uhnák <[hidden email]>:
> Also, how do I get to a list
> of the implementers/senders/references/etc of the method/class?
> What is the improved and approved way to do this :) ?

do you mean sending them #senders and #implementors? Or am I missing something?

aCompiledMethod senders.
(Morph>>#drawOn:) implementors.
Morph allCallsOn.

This will list everything. Nautilus can also filter it, because it
keeps track of the current scope, but I don't know if this is
abstracted.

Well, implementors refer to SystemNavigation allImplementorsOf:, and SystemNavigation has an environment instance variable which may allow for scoping...

Maybe something like

anEnvironment asSystemNavigationEnvironment implementorsOf: aCompiledMethod selector

The API for scopped use of SystemNavigation is very limited. Maybe because only Nautilus seems to have a use for it?

Thierry


 

Peter


Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Stephan Eggermont-3
In reply to this post by Peter Uhnak
On 22-09-15 14:02, Peter Uhnák wrote:
>> Also, how do I get to a list
>> of the implementers/senders/references/etc of the method/class?
>> What is the improved and approved way to do this :) ?
>
> do you mean sending them #senders and #implementors? Or am I missing something?

No, how do I get a spotter morph showing the implementors so I can
choose one. Without duplicating too much.

Stephan



Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Andrei Chis
Hi Stephan,

Right now you can just filter processors in spotter:

GTSpotterMorph new
extent: 600@700;
spotterModel: (GTSpotter 
on: Object>>#printString
withProcessors: {
CompiledMethod>>#spotterForImplementorsFor:});
openCenteredInWorld.

However this does not work if you need to override properties of a search, like actLogic.

An alternative would be also add a way to override properties of a search, like for example:

GTSpotterMorph new
extent: 600@700;
spotterModel: (GTSpotter 
on: Object>>#printString
withProcessor: {
CompiledMethod>>#spotterForImplementorsFor:}
initializedWith: [:aProcessor | aProcessor 
candidatesLimit: 100;
actLogic: [""] ]);
openCenteredInWorld



Cheers,
Andrei

On Tue, Sep 22, 2015 at 2:15 PM, Stephan Eggermont <[hidden email]> wrote:
On 22-09-15 14:02, Peter Uhnák wrote:
Also, how do I get to a list
of the implementers/senders/references/etc of the method/class?
What is the improved and approved way to do this :) ?

do you mean sending them #senders and #implementors? Or am I missing something?

No, how do I get a spotter morph showing the implementors so I can choose one. Without duplicating too much.

Stephan




Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Stephan Eggermont-3
On 23-09-15 11:30, Andrei Chis wrote:

> Hi Stephan,
>
> Right now you can just filter processors in spotter:
>
> GTSpotterMorph new
> extent: 600@700;
> spotterModel: (GTSpotter
> on: Object>>#printString
> withProcessors: {
> CompiledMethod>>#spotterForImplementorsFor:});
> openCenteredInWorld.
>
> However this does not work if you need to override properties of a search,
> like actLogic.
>
> An alternative would be also add a way to override properties of a search,
> like for example:
>
> GTSpotterMorph new
> extent: 600@700;
> spotterModel: (GTSpotter
> on: Object>>#printString
> withProcessor: {
> CompiledMethod>>#spotterForImplementorsFor:}
> initializedWith: [:aProcessor | aProcessor
> candidatesLimit: 100;
> actLogic: [""] ]);
> openCenteredInWorld

Thanks, that provides me with the right hooks.

Stephan



Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

abergel
In reply to this post by Andrei Chis
It would be great to have this accessible from the Help Browser. It is easy to write helps and really useful!

Alexandre

> On Sep 23, 2015, at 6:30 AM, Andrei Chis <[hidden email]> wrote:
>
> Hi Stephan,
>
> Right now you can just filter processors in spotter:
>
> GTSpotterMorph new
> extent: 600@700;
> spotterModel: (GTSpotter
> on: Object>>#printString
> withProcessors: {
> CompiledMethod>>#spotterForImplementorsFor:});
> openCenteredInWorld.
>
> However this does not work if you need to override properties of a search, like actLogic.
>
> An alternative would be also add a way to override properties of a search, like for example:
>
> GTSpotterMorph new
> extent: 600@700;
> spotterModel: (GTSpotter
> on: Object>>#printString
> withProcessor: {
> CompiledMethod>>#spotterForImplementorsFor:}
> initializedWith: [:aProcessor | aProcessor
> candidatesLimit: 100;
> actLogic: [""] ]);
> openCenteredInWorld
>
>
>
> Cheers,
> Andrei
>
> On Tue, Sep 22, 2015 at 2:15 PM, Stephan Eggermont <[hidden email]> wrote:
> On 22-09-15 14:02, Peter Uhnák wrote:
> Also, how do I get to a list
> of the implementers/senders/references/etc of the method/class?
> What is the improved and approved way to do this :) ?
>
> do you mean sending them #senders and #implementors? Or am I missing something?
>
> No, how do I get a spotter morph showing the implementors so I can choose one. Without duplicating too much.
>
> Stephan
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Andrei Chis
Hi Stefan,

Now when using a filter you can configure each processor individually.
Here is a full example of an implementors browser on a method with dive in support: http://ws.stfx.eu/GK4T298XWAS8

I just added the minimum API to configure individual processors.

I added more examples that you can see by inspecting the GTSpotter class and selecting the 'Examples' presentation.

For now this only works in the latest moose image.

Cheers,
Andrei



On Wed, Sep 23, 2015 at 2:06 PM, Alexandre Bergel <[hidden email]> wrote:
It would be great to have this accessible from the Help Browser. It is easy to write helps and really useful!

Alexandre

> On Sep 23, 2015, at 6:30 AM, Andrei Chis <[hidden email]> wrote:
>
> Hi Stephan,
>
> Right now you can just filter processors in spotter:
>
> GTSpotterMorph new
>       extent: 600@700;
>       spotterModel: (GTSpotter
>               on: Object>>#printString
>               withProcessors: {
>                       CompiledMethod>>#spotterForImplementorsFor:});
>       openCenteredInWorld.
>
> However this does not work if you need to override properties of a search, like actLogic.
>
> An alternative would be also add a way to override properties of a search, like for example:
>
> GTSpotterMorph new
>       extent: 600@700;
>       spotterModel: (GTSpotter
>               on: Object>>#printString
>               withProcessor: {
>                       CompiledMethod>>#spotterForImplementorsFor:}
>               initializedWith: [:aProcessor | aProcessor
>                       candidatesLimit: 100;
>                       actLogic: [""] ]);
>       openCenteredInWorld
>
>
>
> Cheers,
> Andrei
>
> On Tue, Sep 22, 2015 at 2:15 PM, Stephan Eggermont <[hidden email]> wrote:
> On 22-09-15 14:02, Peter Uhnák wrote:
> Also, how do I get to a list
> of the implementers/senders/references/etc of the method/class?
> What is the improved and approved way to do this :) ?
>
> do you mean sending them #senders and #implementors? Or am I missing something?
>
> No, how do I get a spotter morph showing the implementors so I can choose one. Without duplicating too much.
>
> Stephan
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Integrating a custom spotter, reusing current code

Stephan Eggermont-3
On 25-09-15 11:02, Andrei Chis wrote:

> Hi Stefan,
>
> Now when using a filter you can configure each processor individually.
> Here is a full example of an implementors browser on a method with dive in
> support: http://ws.stfx.eu/GK4T298XWAS8
>
> I just added the minimum API to configure individual processors.
>
> I added more examples that you can see by inspecting the GTSpotter class
> and selecting the 'Examples' presentation.
>
> For now this only works in the latest moose image.

Excellent! Growing into a fluent interface for spotters.

Stephan