[MonoDevelop] How to Configure a Pad?

Alexandre Gomes alexmipego@hotmail.com
Tue, 30 Nov 2004 12:16:43 +0000


The addin.xml looks like this:

...
<Runtime>
    <Import assembly="CentaurusAddin.dll"/>
</Runtime>
<Extension path="/SharpDevelop/Workbench/Views">
    <Class id="CentaurusPad" class="MonoDevelop.Gui.Pads.CentaurusPad"/>
</Extension>
<Extension path="/SharpDevelop/Workbench/MainMenu">
    <MenuItem id="Centaurus" _label="Centaurus" insertafter="Help">
    <MenuItem id="MyWebSearch" _label="Test" description="test" 
class="MonoDevelop.Commands.test"/>
</MenuItem>
</Extension>
...

The files are well placed. I used two symlinks for the xml and the dll 
files. They are both loaded since the menu shows and works just fine.
I looked into mailing list and in IRC, everyone with a clue pointed me 
into SDIWorkspaceLayout where I found an array with some common Pads. I 
tryed to delete some, and they didn't appear. Then I added mine, nothing 
showed. After a few Console.WriteLines I found that in this piece of code:

foreach (string padTypeName in commonPads)
                {
                    IPadContent pad = workbench.PadContentCollection 
[padTypeName];
                    Console.WriteLine(padTypeName);
                    if (pad != null)
                    {
                        Console.WriteLine(padTypeName);
                        collection.Add (pad);
                    }
                }

The pad returned is always null, so my pad doesn't get loaded. I think 
that at the time this function is called the secondary addin.xml are not 
loaded yet!?
I tryed to move my addin.xml content into sharpdevelop.addin.xml but 
nothing different. I have done several searchs in all files but I find 
no clue...
So I used my test menu to try to load the Pad, in the hope that if it 
worked I could just create a MDService to load it. I've this piece of 
code that is executed:

            PadContentCollection con = 
MonoDevelop.Gui.WorkbenchSingleton.Workbench.PadContentCollection;
            IPadContent pad = new 
MonoDevelop.EditorBindings.Gui.Pads.CentaurusPad();
            con.Add(pad);
            MonoDevelop.Gui.WorkbenchSingleton.Workbench.ShowPad(pad);
            
MonoDevelop.Gui.WorkbenchSingleton.Workbench.WorkbenchLayout.PadContentCollection.Add(pad);
            
MonoDevelop.Gui.WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(pad);
            
MonoDevelop.Gui.WorkbenchSingleton.Workbench.WorkbenchLayout.ShowPad(pad);
            
MonoDevelop.Gui.WorkbenchSingleton.Workbench.WorkbenchLayout.RedrawAllComponents();
            Application.Run();

If is inside the menu command, and its called. The Pad constructor is 
called but yet nothing shows.... as you see I try every command possible.
Any clue?

Thanks,
Alexandre Miguel Pedro Gomes

Todd Berman wrote:

>On Mon, 2004-11-29 at 17:06 +0000, Alexandre Gomes wrote:
>  
>
>>Hi,
>>
>>I had implemented a test pad, using AbstractPadContent. I had configured 
>>the pad in the addin.xml file. After I was unsuccessful I did a litle 
>>research and found that I need to change one file, something about 
>>SDIWorkspaceLayout. I changed it where it looks like it should be but 
>>yet nothing happens. I have a Console.WriteLine in Pad's contructor but 
>>it is never called. In fact, I delected some content from that files and 
>>nothing happened too. So, can anyone give the the full instructions to 
>>implement a Pad.
>>
>>1. build the pad, implementing it using IPadContent or AbstractPadContent
>>2. add configuration into addin.xml
>>3. ???????????
>>    
>>
>
>
>Can you show what your addin.xml file looks like? And you do realize
>that you have to put that file in build/AddIns/ for make run, and get it
>installed into $prefix/lib/monodevelop/AddIns/ for the installed version
>to pick it up.
>
>Basically. First make sure your addin.xml file is being picked up by MD
>(if it is a new file) and then second, make sure your pad extension is
>"/SharpDevelop/Workbench/Views"
>
>--Todd
>
>_______________________________________________
>Monodevelop-list mailing list
>Monodevelop-list@lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
>.
>
>  
>