Defining a new command

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

Defining a new command

Bergel, Alexandre
Dear all,

I just defined a new command for Omnibrowser, however, how can I make  
it appear on the method menu list ?
There should be a magic invocation i guess :-)

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.software-artist.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Defining a new command

Damien Cassou-3
Hi Alexandre,

just create a method whose name starts with 'cmd' and put in your
browser class. This method must return a command class or a command
class collection. For example:

OBCodeBrowser>>cmdNewTraitTemplate
  ^ OBCmdNewTraitTemplate


Bye

2007/4/24, Bergel, Alexandre <[hidden email]>:

> Dear all,
>
> I just defined a new command for Omnibrowser, however, how can I make
> it appear on the method menu list ?
> There should be a magic invocation i guess :-)
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.software-artist.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>


--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Defining a new command

David Röthlisberger
In reply to this post by Bergel, Alexandre
Hi Alex,

> I just defined a new command for Omnibrowser, however, how can I make it
> appear on the method menu list ?
> There should be a magic invocation i guess :-)

You must add a method starting with 'cmd' to class OBCodeBrowser and place it in the
method protocol 'commands'. This method answers the class of your new command.
Every method following this convention is executed at start up of a browser and every
returned command is collected in the list of available commands for this browser.

David


Reply | Threaded
Open this post in threaded view
|

Re: Defining a new command

Damien Cassou-3
2007/4/24, David Röthlisberger <[hidden email]>:

> Hi Alex,
>
> > I just defined a new command for Omnibrowser, however, how can I make it
> > appear on the method menu list ?
> > There should be a magic invocation i guess :-)
>
> You must add a method starting with 'cmd' to class OBCodeBrowser and place it in the
> method protocol 'commands'. This method answers the class of your new command.
> Every method following this convention is executed at start up of a browser and every
> returned command is collected in the list of available commands for this browser.
Putting the method in the 'commands' protocol is not required to let
developers write class extensions. The method can return a collection
of classes instead of just one if it fits your need.


--
Damien Cassou


Reply | Threaded
Open this post in threaded view
|

Re: Defining a new command

Bergel, Alexandre
Excellent!
thanks to both of you!

Alexandre


On 24 Apr 2007, at 11:17, Damien Cassou wrote:

> 2007/4/24, David Röthlisberger <[hidden email]>:
>> Hi Alex,
>>
>> > I just defined a new command for Omnibrowser, however, how can I  
>> make it
>> > appear on the method menu list ?
>> > There should be a magic invocation i guess :-)
>>
>> You must add a method starting with 'cmd' to class OBCodeBrowser  
>> and place it in the
>> method protocol 'commands'. This method answers the class of your  
>> new command.
>> Every method following this convention is executed at start up of  
>> a browser and every
>> returned command is collected in the list of available commands  
>> for this browser.
>
> Putting the method in the 'commands' protocol is not required to let
> developers write class extensions. The method can return a collection
> of classes instead of just one if it fits your need.
>
>
> --
> Damien Cassou
>

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