<div class="gmail_quote">On Tue, Mar 18, 2008 at 10:59 AM, David Röthlisberger &lt;<a href="mailto:squeak@c3com.ch">squeak@c3com.ch</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">First, create a subclass of OBCommand. Then you need to implement at least the<br></div>
methods #execute, #label and #isActive (have a look at eg. OBCmdNewClassTemplate).<br>
Finally, you can add a method called eg. &#39;cmdAIDATemplate&#39; to OBCodeBrowser or a<br>
subclass of it. It is important that this method starts with &#39;cmd&#39;. When you then<br>
start a new system browser, the command should be available (if #isActive answers<br>
true for the selected class).</blockquote><div><br class="webkit-block-placeholder"></div><div>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. &nbsp;I just copied the normal new class template code to execute as follows:</div>
<div><br class="webkit-block-placeholder"></div><div><div>&#39;From Squeak3.9.1 of 2 March 2008 [latest update: #7075] on 18 March 2008 at 3:58:54 pm&#39;!</div><div>OBCommand subclass: #OBCmdNewWebAppTemplate</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>instanceVariableNames: &#39;&#39;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>classVariableNames: &#39;&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>poolDictionaries: &#39;&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>category: &#39;WebAppBuilder&#39;!</div>
<div><br class="webkit-block-placeholder"></div><div>!OBCmdNewWebAppTemplate methodsFor: &#39;as yet unclassified&#39; stamp: &#39;rjriv 3/18/2008 15:58&#39;!</div><div>execute</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| class definition |</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>class := target theNonMetaClass.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>definition := (OBClassDefinition&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>environment: class environment&nbsp;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>template: (Class template: class category)).</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>requestor announce: (OBDefinitionChanged definition: definition)! !</div>
<div><br class="webkit-block-placeholder"></div><div>!OBCmdNewWebAppTemplate methodsFor: &#39;as yet unclassified&#39; stamp: &#39;rjriv 3/18/2008 15:43&#39;!</div><div>isActive</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^true.! !</div>
<div><br class="webkit-block-placeholder"></div><div>!OBCmdNewWebAppTemplate methodsFor: &#39;as yet unclassified&#39; stamp: &#39;rjriv 3/18/2008 15:36&#39;!</div><div>label</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^ &#39;new web app template&#39;! !</div>
<div><br class="webkit-block-placeholder"></div><div>Rob</div><div><br class="webkit-block-placeholder"></div></div></div>