On Tue, Mar 18, 2008 at 10:59 AM, David Röthlisberger <[EMAIL PROTECTED]> 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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners