How to file out all the methods in a message list window?

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

How to file out all the methods in a message list window?

askoh
Administrator
When I right click 'sender of' I get a message list window of methods. How do I file out all the methods in that message list window into one *.st file?

Thanks,
Aik-Siong Koh
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] How to file out all the methods in a message list window?

Bert Freudenberg

Am 21.06.2008 um 12:53 schrieb askoh:

>
> When I right click 'sender of' I get a message list window of  
> methods. How do
> I file out all the methods in that message list window into one *.st  
> file?


File out each method, concatenate to one file.

But - why would you want to do this? It is such an unusual request  
that nobody thought of adding this feature.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] How to file out all the methods in a message list window?

Edgar J. De Cleene
In reply to this post by askoh



El 6/21/08 7:53 AM, "askoh" <[hidden email]> escribió:

>
> When I right click 'sender of' I get a message list window of methods. How do
> I file out all the methods in that message list window into one *.st file?
>
> Thanks,
> Aik-Siong Koh

You could do:
Click on window for having halo, select debug, select model.
You should have a inspector labelled MessageSet.
On lower pane if you type self messageList , could see a new inspector with
a OrderedCollection of MethodReference.
I like do the object way, so not save a .st.
If in this OrderedCollection inspector you type in the lower pane self
saveOnFile, you got a Window asking which name you like for this.
I always use some like "MyMethods.obj", and in SqueakLightII have how to
read this.
Drag and drop the .obj and you open a inspector in a different image.
Off course , is not magic and could not work if you try to save very complex
objects or objects with references to classes not in the target image.

Curious.
WHY  you need this?

Edgar



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] How to file out all the methods in a message list window?

askoh
Administrator
I am porting freeCAD code from VisualWorks to Squeak. The class ColorValue is not present in Squeak and needs to be changed to Color. I want to file out all the squeak methods that refer to the undeclared ColorValue, edit the file and file it in again so that Color is used instead.

If there is a better solution, please tell me.

All the best,
Aik-Siong
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] How to file out all the methods in a message list window?

Scott Wallace-3
In reply to this post by askoh
On Jun 21, 2008, at 3:53 AM, askoh wrote:

> When I right click 'sender of' I get a message list window of methods. How do
> I file out all the methods in that message list window into one *.st file?


The basic unit for creating fileouts is the change-set.  So a way to approach this is to create a new change-set and get all the messages in your message-list to be in that change-set; then file-out the change-set.  This will give you precisely what you want.

But how to get all the methods that re in your message-list into the change-set?  Here are four possibilities:

(1)  Select, in turn, each method in your message-list window; after each one is selected, type a space followed by a backspace (thus marking the method as "changed" without really changing it), then accept ("save") the method afresh.  After you've done that to all methods in your method-list, the fresh change-set you created will bear precisely that method-list as its list of changes, so you can file out the change-set (using a change-sorter) and you'll have what you want.

(2)  Bring up, and "pin up', the shifted selector-list menu for the message-list in question.  Find the item "add to current change set" there.  Now, in turn, select each item in the message list, then hit that "add to current change-set" item.  This places the method in the current change-set without actually modifying it.

(3)  If you have a big message list, both of the above may be too labor-intensive.  So instead, you can open an Inspector on the model of the message list. In the bottom pane of that Inspector, type and then evaluate the following expression:

    self messageList do:
        [:mr | ChangeSet current adoptSelector: mr methodSymbol forClass: mr actualClass]


(4)  Finally, if you have a frequent need for such a feature, it would be a very simple matter to add a menu item to the selector-list menu to carry out the work described in alternative (3).


HTH,

-- Scott