Removing from MessageSet browsers, re: Tools-ul.687

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

Removing from MessageSet browsers, re: Tools-ul.687

Jakob Reschke-2
Hi,

would anybody else be interested in key mappings for "remove from this
browser" in MessageSet/MessageTrace browsers (cyan by default with
colorful windows), i.e. to only remove a method from the displayed set
instead of removing the method from its class?

Use case/user story: when exploring a system, I repeatedly invoke
senders/implementors which collects me lots of methods in such a
browser. In order to keep an overview of the control flow I would like
to tidy that up by removing unrelated matches (methods with equal
names from unrelated classes). But currently that is tedious, because
you have to go through the 2nd level ("more...") context menu for
every single method to be thus removed.

Best regards,
Jakob

2016-04-07 22:04 GMT+02:00 [hidden email]
<[hidden email]>:

> Levente Uzonyi uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-ul.687.mcz
>
> ==================== Summary ====================
>
> Name: Tools-ul.687
> Author: ul
> Time: 7 April 2016, 11:04:02.506276 pm
> UUID: 2d6efa2b-2716-439f-8c7e-e351e2e37883
> Ancestors: Tools-ul.686
>
> - removed the hard dependency on HelpBrowser
> - all browser panels respond to Cmd+x with the same behavior: remove
>
> =============== Diff against Tools-ul.686 ===============
>
> Item was changed:
>   ----- Method: Browser>>browseAllCommentsForClass (in category 'message functions') -----
>   browseAllCommentsForClass
>         "Opens a HelpBrowser on the class"
>
>         | myClass |
> +       myClass := self selectedClassOrMetaClass ifNil: [ ^self ].
> +       myClass isTrait ifTrue: [ ^self ].
> +       (Smalltalk classNamed: #HelpBrowser)
> +               ifNil: [ ^self inform: 'HelpBrowser is not available.' ]
> +               ifNotNil: [ :HelpBrowser |
> +                       HelpBrowser openOn: myClass theNonMetaClass ]
> -       ((myClass := self selectedClassOrMetaClass) isNil or: [myClass isTrait])
> -               ifFalse: [HelpBrowser openOn: myClass theNonMetaClass]
>   !
>
> Item was changed:
>   ----- Method: Browser>>buildMessageCategoryListWith: (in category 'toolbuilder') -----
>   buildMessageCategoryListWith: builder
>         | listSpec |
>         listSpec := builder pluggableListSpec new.
>         listSpec
>                 model: self;
>                 list: #messageCategoryList;
>                 getIndex: #messageCategoryListIndex;
>                 setIndex: #messageCategoryListIndex:;
>                 menu: #messageCategoryMenu:;
> +               keyPress: #messageCategoryListKey:from:.
> -               keyPress: #arrowKey:from:.
>         SystemBrowser browseWithDragNDrop ifTrue:[
>                 listSpec
>                         dropAccept: #wantsMessageCategoriesDrop:;
>                         dropItem: #dropOnMessageCategories:at:].
>         ^listSpec
>   !
>
> Item was changed:
>   ----- Method: Browser>>mainMessageCategoryMenu: (in category 'message category functions') -----
>   mainMessageCategoryMenu: aMenu
>         <messageCategoryMenu>
>         ^ aMenu addList: #(
>                         ('browse'                                               buildMessageCategoryBrowser)
>                         ('print out'                                            printOutMessageCategories)
>                         ('file out'                                             fileOutMessageCategories)
>                         -
>                         ('reorganize'                                   editMessageCategories)
>                         ('alphabetize'                                  alphabetizeMessageCategories)
>                         ('remove empty categories'      removeEmptyCategories)
>                         ('categorize all uncategorized' categorizeAllUncategorizedMethods)
>                         ('new category...'                              addCategory)
>                         -
>                         ('rename...'                                            renameCategory)
> +                       ('remove (x)'                                   removeMessageCategory));
> -                       ('remove'                                               removeMessageCategory));
>                 yourself
>   !
>
> Item was changed:
>   ----- Method: Browser>>mainSystemCategoryMenu: (in category 'system category functions') -----
>   mainSystemCategoryMenu: aMenu
>         <systemCategoryMenu>
>         ^ aMenu addList: #(
>                         ('find class... (f)'                    findClass)
>                         ('back... (b)'                          recent)
>                         -
>                         ('browse all'                   browseAllClasses)
>                         ('browse'                               buildSystemCategoryBrowser)
>                         -
>                         ('printOut'                             printOutSystemCategory)
>                         ('fileOut'                              fileOutSystemCategory)
>                         -
>                         ('reorganize'                   editSystemCategories)
>                         ('alphabetize'                  alphabetizeSystemCategories)
>                         -
>                         ('update'                               updateSystemCategories)
>                         ('add item...'                          addSystemCategory)
>                         ('rename...'                            renameSystemCategory)
> +                       ('remove (x)'                   removeSystemCategory));
> -                       ('remove'                               removeSystemCategory));
>                 yourself
>   !
>
> Item was added:
> + ----- Method: Browser>>messageCategoryListKey:from: (in category 'message category list') -----
> + messageCategoryListKey: aCharacter from: view
> +
> +       aCharacter == $x ifTrue: [ ^self removeMessageCategory ].
> +       ^self arrowKey: aCharacter from: view
> +       !
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Removing from MessageSet browsers, re: Tools-ul.687

Levente Uzonyi
Hi Jakob,

What you're looking for is the "filter message list..." menu item.
Unfortunately it's on the second page of the menu and it's a bit more
cumbersome to use than the envisioned "filter out this message" menu item.
Perhaps we should add that.

Levente

On Fri, 8 Apr 2016, Jakob Reschke wrote:

> Hi,
>
> would anybody else be interested in key mappings for "remove from this
> browser" in MessageSet/MessageTrace browsers (cyan by default with
> colorful windows), i.e. to only remove a method from the displayed set
> instead of removing the method from its class?
>
> Use case/user story: when exploring a system, I repeatedly invoke
> senders/implementors which collects me lots of methods in such a
> browser. In order to keep an overview of the control flow I would like
> to tidy that up by removing unrelated matches (methods with equal
> names from unrelated classes). But currently that is tedious, because
> you have to go through the 2nd level ("more...") context menu for
> every single method to be thus removed.
>
> Best regards,
> Jakob
>
> 2016-04-07 22:04 GMT+02:00 [hidden email]
> <[hidden email]>:
>> Levente Uzonyi uploaded a new version of Tools to project The Trunk:
>> http://source.squeak.org/trunk/Tools-ul.687.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Tools-ul.687
>> Author: ul
>> Time: 7 April 2016, 11:04:02.506276 pm
>> UUID: 2d6efa2b-2716-439f-8c7e-e351e2e37883
>> Ancestors: Tools-ul.686
>>
>> - removed the hard dependency on HelpBrowser
>> - all browser panels respond to Cmd+x with the same behavior: remove
>>
>> =============== Diff against Tools-ul.686 ===============
>>
>> Item was changed:
>>   ----- Method: Browser>>browseAllCommentsForClass (in category 'message functions') -----
>>   browseAllCommentsForClass
>>         "Opens a HelpBrowser on the class"
>>
>>         | myClass |
>> +       myClass := self selectedClassOrMetaClass ifNil: [ ^self ].
>> +       myClass isTrait ifTrue: [ ^self ].
>> +       (Smalltalk classNamed: #HelpBrowser)
>> +               ifNil: [ ^self inform: 'HelpBrowser is not available.' ]
>> +               ifNotNil: [ :HelpBrowser |
>> +                       HelpBrowser openOn: myClass theNonMetaClass ]
>> -       ((myClass := self selectedClassOrMetaClass) isNil or: [myClass isTrait])
>> -               ifFalse: [HelpBrowser openOn: myClass theNonMetaClass]
>>   !
>>
>> Item was changed:
>>   ----- Method: Browser>>buildMessageCategoryListWith: (in category 'toolbuilder') -----
>>   buildMessageCategoryListWith: builder
>>         | listSpec |
>>         listSpec := builder pluggableListSpec new.
>>         listSpec
>>                 model: self;
>>                 list: #messageCategoryList;
>>                 getIndex: #messageCategoryListIndex;
>>                 setIndex: #messageCategoryListIndex:;
>>                 menu: #messageCategoryMenu:;
>> +               keyPress: #messageCategoryListKey:from:.
>> -               keyPress: #arrowKey:from:.
>>         SystemBrowser browseWithDragNDrop ifTrue:[
>>                 listSpec
>>                         dropAccept: #wantsMessageCategoriesDrop:;
>>                         dropItem: #dropOnMessageCategories:at:].
>>         ^listSpec
>>   !
>>
>> Item was changed:
>>   ----- Method: Browser>>mainMessageCategoryMenu: (in category 'message category functions') -----
>>   mainMessageCategoryMenu: aMenu
>>         <messageCategoryMenu>
>>         ^ aMenu addList: #(
>>                         ('browse'                                               buildMessageCategoryBrowser)
>>                         ('print out'                                            printOutMessageCategories)
>>                         ('file out'                                             fileOutMessageCategories)
>>                         -
>>                         ('reorganize'                                   editMessageCategories)
>>                         ('alphabetize'                                  alphabetizeMessageCategories)
>>                         ('remove empty categories'      removeEmptyCategories)
>>                         ('categorize all uncategorized' categorizeAllUncategorizedMethods)
>>                         ('new category...'                              addCategory)
>>                         -
>>                         ('rename...'                                            renameCategory)
>> +                       ('remove (x)'                                   removeMessageCategory));
>> -                       ('remove'                                               removeMessageCategory));
>>                 yourself
>>   !
>>
>> Item was changed:
>>   ----- Method: Browser>>mainSystemCategoryMenu: (in category 'system category functions') -----
>>   mainSystemCategoryMenu: aMenu
>>         <systemCategoryMenu>
>>         ^ aMenu addList: #(
>>                         ('find class... (f)'                    findClass)
>>                         ('back... (b)'                          recent)
>>                         -
>>                         ('browse all'                   browseAllClasses)
>>                         ('browse'                               buildSystemCategoryBrowser)
>>                         -
>>                         ('printOut'                             printOutSystemCategory)
>>                         ('fileOut'                              fileOutSystemCategory)
>>                         -
>>                         ('reorganize'                   editSystemCategories)
>>                         ('alphabetize'                  alphabetizeSystemCategories)
>>                         -
>>                         ('update'                               updateSystemCategories)
>>                         ('add item...'                          addSystemCategory)
>>                         ('rename...'                            renameSystemCategory)
>> +                       ('remove (x)'                   removeSystemCategory));
>> -                       ('remove'                               removeSystemCategory));
>>                 yourself
>>   !
>>
>> Item was added:
>> + ----- Method: Browser>>messageCategoryListKey:from: (in category 'message category list') -----
>> + messageCategoryListKey: aCharacter from: view
>> +
>> +       aCharacter == $x ifTrue: [ ^self removeMessageCategory ].
>> +       ^self arrowKey: aCharacter from: view
>> +       !
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Removing from MessageSet browsers, re: Tools-ul.687

Jakob Reschke-2
In reply to this post by Jakob Reschke-2
Hi Levente,

I was referring to the menu item immediately above "filter message
list..." which is called "remove from this browser", so the feature is
already there. Only its usability is lacking for removals in numbers.

2016-04-08 0:40 GMT+02:00 Levente Uzonyi <[hidden email]>:

> Hi Jakob,
>
> What you're looking for is the "filter message list..." menu item.
> Unfortunately it's on the second page of the menu and it's a bit more
> cumbersome to use than the envisioned "filter out this message" menu item.
> Perhaps we should add that.
>
> Levente
>
> On Fri, 8 Apr 2016, Jakob Reschke wrote:
>
>> Hi,
>>
>> would anybody else be interested in key mappings for "remove from this
>> browser" in MessageSet/MessageTrace browsers (cyan by default with
>> colorful windows), i.e. to only remove a method from the displayed set
>> instead of removing the method from its class?
>>
>> Use case/user story: when exploring a system, I repeatedly invoke
>> senders/implementors which collects me lots of methods in such a
>> browser. In order to keep an overview of the control flow I would like
>> to tidy that up by removing unrelated matches (methods with equal
>> names from unrelated classes). But currently that is tedious, because
>> you have to go through the 2nd level ("more...") context menu for
>> every single method to be thus removed.
>>
>> Best regards,
>> Jakob
>>
>> 2016-04-07 22:04 GMT+02:00 [hidden email]
>> <[hidden email]>:
>>> Levente Uzonyi uploaded a new version of Tools to project The Trunk:
>>> http://source.squeak.org/trunk/Tools-ul.687.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Tools-ul.687
>>> Author: ul
>>> Time: 7 April 2016, 11:04:02.506276 pm
>>> UUID: 2d6efa2b-2716-439f-8c7e-e351e2e37883
>>> Ancestors: Tools-ul.686
>>>
>>> - removed the hard dependency on HelpBrowser
>>> - all browser panels respond to Cmd+x with the same behavior: remove
>>>
>>> =============== Diff against Tools-ul.686 ===============
>>>
>>> Item was changed:
>>>   ----- Method: Browser>>browseAllCommentsForClass (in category 'message functions') -----
>>>   browseAllCommentsForClass
>>>         "Opens a HelpBrowser on the class"
>>>
>>>         | myClass |
>>> +       myClass := self selectedClassOrMetaClass ifNil: [ ^self ].
>>> +       myClass isTrait ifTrue: [ ^self ].
>>> +       (Smalltalk classNamed: #HelpBrowser)
>>> +               ifNil: [ ^self inform: 'HelpBrowser is not available.' ]
>>> +               ifNotNil: [ :HelpBrowser |
>>> +                       HelpBrowser openOn: myClass theNonMetaClass ]
>>> -       ((myClass := self selectedClassOrMetaClass) isNil or: [myClass isTrait])
>>> -               ifFalse: [HelpBrowser openOn: myClass theNonMetaClass]
>>>   !
>>>
>>> Item was changed:
>>>   ----- Method: Browser>>buildMessageCategoryListWith: (in category 'toolbuilder') -----
>>>   buildMessageCategoryListWith: builder
>>>         | listSpec |
>>>         listSpec := builder pluggableListSpec new.
>>>         listSpec
>>>                 model: self;
>>>                 list: #messageCategoryList;
>>>                 getIndex: #messageCategoryListIndex;
>>>                 setIndex: #messageCategoryListIndex:;
>>>                 menu: #messageCategoryMenu:;
>>> +               keyPress: #messageCategoryListKey:from:.
>>> -               keyPress: #arrowKey:from:.
>>>         SystemBrowser browseWithDragNDrop ifTrue:[
>>>                 listSpec
>>>                         dropAccept: #wantsMessageCategoriesDrop:;
>>>                         dropItem: #dropOnMessageCategories:at:].
>>>         ^listSpec
>>>   !
>>>
>>> Item was changed:
>>>   ----- Method: Browser>>mainMessageCategoryMenu: (in category 'message category functions') -----
>>>   mainMessageCategoryMenu: aMenu
>>>         <messageCategoryMenu>
>>>         ^ aMenu addList: #(
>>>                         ('browse'                                               buildMessageCategoryBrowser)
>>>                         ('print out'                                            printOutMessageCategories)
>>>                         ('file out'                                             fileOutMessageCategories)
>>>                         -
>>>                         ('reorganize'                                   editMessageCategories)
>>>                         ('alphabetize'                                  alphabetizeMessageCategories)
>>>                         ('remove empty categories'      removeEmptyCategories)
>>>                         ('categorize all uncategorized' categorizeAllUncategorizedMethods)
>>>                         ('new category...'                              addCategory)
>>>                         -
>>>                         ('rename...'                                            renameCategory)
>>> +                       ('remove (x)'                                   removeMessageCategory));
>>> -                       ('remove'                                               removeMessageCategory));
>>>                 yourself
>>>   !
>>>
>>> Item was changed:
>>>   ----- Method: Browser>>mainSystemCategoryMenu: (in category 'system category functions') -----
>>>   mainSystemCategoryMenu: aMenu
>>>         <systemCategoryMenu>
>>>         ^ aMenu addList: #(
>>>                         ('find class... (f)'                    findClass)
>>>                         ('back... (b)'                          recent)
>>>                         -
>>>                         ('browse all'                   browseAllClasses)
>>>                         ('browse'                               buildSystemCategoryBrowser)
>>>                         -
>>>                         ('printOut'                             printOutSystemCategory)
>>>                         ('fileOut'                              fileOutSystemCategory)
>>>                         -
>>>                         ('reorganize'                   editSystemCategories)
>>>                         ('alphabetize'                  alphabetizeSystemCategories)
>>>                         -
>>>                         ('update'                               updateSystemCategories)
>>>                         ('add item...'                          addSystemCategory)
>>>                         ('rename...'                            renameSystemCategory)
>>> +                       ('remove (x)'                   removeSystemCategory));
>>> -                       ('remove'                               removeSystemCategory));
>>>                 yourself
>>>   !
>>>
>>> Item was added:
>>> + ----- Method: Browser>>messageCategoryListKey:from: (in category 'message category list') -----
>>> + messageCategoryListKey: aCharacter from: view
>>> +
>>> +       aCharacter == $x ifTrue: [ ^self removeMessageCategory ].
>>> +       ^self arrowKey: aCharacter from: view
>>> +       !
>>>
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Removing from MessageSet browsers, re: Tools-ul.687

Chris Muller-3
In reply to this post by Jakob Reschke-2
Hi Jakob, the key you seek is Command+d.  It will remove all selected
methods from the browser without deleting them from the system.

I've just added that hint to the menu, I'll commit that soon.

> Use case/user story: when exploring a system, I repeatedly invoke
> senders/implementors which collects me lots of methods in such a
> browser. In order to keep an overview of the control flow I would like
> to tidy that up by removing unrelated matches (methods with equal
> names from unrelated classes).

Congratulations.  You have absolutely grok'd how MessageTrace browser
is intended to be used where I think it has been
misunderstood a lot, before.

Also, please note the role of Command+I (capital eye) to invert the
selection within the current level.  This allows you to merely swipe
the methods you wish within the indented and press two keys in
succession:  Command+I+d to leave it at just what you selected.

Best,
  Chris

Reply | Threaded
Open this post in threaded view
|

Re: Removing from MessageSet browsers, re: Tools-ul.687

Jakob Reschke-2
In reply to this post by Jakob Reschke-2
Hi Chris,

2016-04-08 1:00 GMT+02:00 Chris Muller <[hidden email]>:
> the key you seek is Command+d.  It will remove all selected
> methods from the browser without deleting them from the system.
>
> I've just added that hint to the menu, I'll commit that soon.
> ...
> Also, please note the role of Command+I (capital eye) to invert the
> selection within the current level.  This allows you to merely swipe
> the methods you wish within the indented and press two keys in
> succession:  Command+I+d to leave it at just what you selected.

Great to hear that once again Squeak already has what I asked for. :-)
Thank you very much!

Best regards,
Jakob