logo       

Re: Omnibrowser help: msg#00124

lang.smalltalk.squeak.beginners

Subject: Re: Omnibrowser help

On Tue, Mar 18, 2008 at 10:59 AM, David Röthlisberger <squeak@xxxxxxxx> wrote:
First, create a subclass of OBCommand. Then you need to implement at least the
methods #execute, #label and #isActive (have a look at eg. OBCmdNewClassTemplate).
Finally, you can add a method called eg. 'cmdAIDATemplate' to OBCodeBrowser or a
subclass of it. It is important that this method starts with 'cmd'. When you then
start a new system browser, the command should be available (if #isActive answers
true for the selected class).

When I do this, I get TWO menu items, and if no class is selected in the class pane, I get one all by itself.  I just copied the normal new class template code to execute as follows:

'From Squeak3.9.1 of 2 March 2008 [latest update: #7075] on 18 March 2008 at 3:58:54 pm'!
OBCommand subclass: #OBCmdNewWebAppTemplate
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'WebAppBuilder'!

!OBCmdNewWebAppTemplate methodsFor: 'as yet unclassified' stamp: 'rjriv 3/18/2008 15:58'!
execute
| class definition |
class := target theNonMetaClass.
definition := (OBClassDefinition 
environment: class environment 
template: (Class template: class category)).
requestor announce: (OBDefinitionChanged definition: definition)! !

!OBCmdNewWebAppTemplate methodsFor: 'as yet unclassified' stamp: 'rjriv 3/18/2008 15:43'!
isActive
^true.! !

!OBCmdNewWebAppTemplate methodsFor: 'as yet unclassified' stamp: 'rjriv 3/18/2008 15:36'!
label
^ 'new web app template'! !

Rob

_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise