move a method

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

move a method

Hans Schueren
Good morning fellows ,

i want to move a method in a different class.

Therefore i can see two options in the Package Browser. (context menue
of method)

1. move to trait  (e)

2. move to package.


The option one is ok. But i only can see there the message :  "New Trait"

No existing classes and protocolls to choose.


Normally i klick  MOVE  and then i type the location in with
Classname>Protokollname

Want to move it to an existing protocol from a class.


How can i do that.


Thanks.


Hans

Reply | Threaded
Open this post in threaded view
|

Re: move a method

kilon.alios
I see no move to trait, I am assuming you talk about system browser , system browser has no means to move methods. At least not in menus. Move to package is for the class. 

I usually just copy paste the method and then remove it from the original. Of course if you want to move more than one then it would be better to just subclass the class. 

I dont like the menus of System Browser they are not context sensitive. We need to fix this at some point.

Trait is basically a method that can be shared amongst many classes, so you dont want to mess with traits just yet.  

On Thu, Oct 23, 2014 at 12:45 PM, Hans Schueren <[hidden email]> wrote:
Good morning fellows ,

i want to move a method in a different class.

Therefore i can see two options in the Package Browser. (context menue of method)

1. move to trait  (e)

2. move to package.


The option one is ok. But i only can see there the message :  "New Trait"

No existing classes and protocolls to choose.


Normally i klick  MOVE  and then i type the location in with Classname>Protokollname

Want to move it to an existing protocol from a class.


How can i do that.


Thanks.


Hans


Reply | Threaded
Open this post in threaded view
|

Re: move a method

[CH] Aliaksei Syrel
In reply to this post by Hans Schueren

Hi,

Does drag and drop not work for you? That's how I usually move methods between classes if I need to. Just press on the method name in the list and drag it to another class. (Works in Moose, should also work in Pharo).

Cheers,
Alex

On Oct 23, 2014 11:45 AM, "Hans Schueren" <[hidden email]> wrote:
Good morning fellows ,

i want to move a method in a different class.

Therefore i can see two options in the Package Browser. (context menue of method)

1. move to trait  (e)

2. move to package.


The option one is ok. But i only can see there the message :  "New Trait"

No existing classes and protocolls to choose.


Normally i klick  MOVE  and then i type the location in with Classname>Protokollname

Want to move it to an existing protocol from a class.


How can i do that.


Thanks.


Hans