How to Use the ActivablePanel

39 views
Skip to first unread message

tan

unread,
Sep 14, 2010, 3:04:51 PM9/14/10
to Firebug
Hi

Are there any information about how to use the ActivablePanel?

My guess right now is that using ActivablePanel would create a panel
that can be activated globally (Global: Activate/Disable All Panels)

My first naive try was to use this

MyPanel.prototype = extend( Firebug.ActivablePanel,
...

But I guess it needs some more configuration ;)

I have tried to look in the Fb source, but have not quite figured it
out yet.

So, the question is how do we use the Activation thing?

Thanks in advance

Best regards,
Thomas

John J Barton

unread,
Sep 14, 2010, 4:59:55 PM9/14/10
to Firebug


On Sep 14, 12:04 pm, tan <t...@enonic.com> wrote:
> Hi
>
> Are there any information about how to use the ActivablePanel?
>
> My guess right now is that using ActivablePanel would create a panel
> that can be activated globally (Global: Activate/Disable All Panels)
>
> My first naive try was to use this
>
> MyPanel.prototype = extend( Firebug.ActivablePanel,

If you implement initialize() then you need to propagate it to the
parent:
Firebug.ActivablePanel.initialize.apply(this, arguments);

And you need to register your new panel:
Firebug.registerPanel(NetPanel);

Does this help?
jjb

tan

unread,
Sep 15, 2010, 4:46:41 PM9/15/10
to Firebug
Hi again

No, it did not work

Here is an outline of the code

Thomas

FBL.ns(function() { with ( FBL ) {

function MyPanel() {}
MyPanel.prototype = extend( Firebug.ActivablePanel,
{
name : myPanel,
title : "My Panel",

initialize : function()
{
Firebug.ActivablePanel.initialize.apply( this, arguments );
},

shutdown : function()
{
Firebug.ActivableModule.shutdown.apply( this, arguments );
},

destroy : function( state )
{
Firebug.unregisterUIListener(this);
Firebug.ActivablePanel.destroy.apply( this, arguments );
},

enablePanel: function(module)
{
Firebug.ActivablePanel.enablePanel.apply( this, arguments );
},

disablePanel: function(module)
{
Firebug.ActivablePanel.disablePanel.apply( this, arguments );
}
});


Firebug.MyPanelModel = extend( Firebug.ActivableModule,
{
initialize: function()
{
Firebug.ActivableModule.initialize.apply( this, arguments );
},

initContext: function( context, persistedState )
{
Firebug.ActivableModule.initContext.apply( this, arguments );
},

showContext: function( browser, context )
{
Firebug.ActivableModule.showContext.apply( this, arguments );
},

loadedContext : function( context )
{
},

showPanel : function( browser, panel )
{
},

addStyleSheet : function( doc )
{
},

reattachContext : function( browser, context )
{
},
});


/* Domplate code */

/*
Registration
*/
Firebug.registerPanel( MyPanel );
Firebug.registerActivableModule( Firebug.MyPanelModel );

}});



On Sep 14, 10:59 pm, John J Barton <johnjbar...@johnjbarton.com>
wrote:

Pedro Simonetti Garcia

unread,
Sep 15, 2010, 4:55:10 PM9/15/10
to fir...@googlegroups.com
Hi there,

Just a small thing I have noticed:

name : myPanel,

should be

name : "myPanel",

Otherwise it seems to be correct.

Pedro Simonetti.


2010/9/15 tan <t...@enonic.com>:

> --
> You received this message because you are subscribed to the Google Groups "Firebug" group.
> To post to this group, send email to fir...@googlegroups.com.
> To unsubscribe from this group, send email to firebug+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/firebug?hl=en.
>
>

tan

unread,
Sep 15, 2010, 5:17:18 PM9/15/10
to Firebug
Yes, a typo from my side, there is also a wrongly placed comma in the
last method in MyPanelModel ;)

After removing these bugs and I run the code, the panel is created and
looks OK, but I expected the Fb tab to be disabled when I choose
Disable All Panels from the Firebug menu. This does not happen.

I may miss something here

Thomas

On Sep 15, 10:55 pm, Pedro Simonetti Garcia <pedrosimone...@gmail.com>
wrote:

John J Barton

unread,
Sep 15, 2010, 11:44:51 PM9/15/10
to Firebug
Does the panel tab mini-menu have enable/disable and does that part
work?

jjb

tan

unread,
Sep 16, 2010, 1:09:20 PM9/16/10
to Firebug
No, running the code above, the tab does not have the mini menu at
all.

Thanks for the replies here,

Thomas

tan

unread,
Sep 16, 2010, 6:22:15 PM9/16/10
to Firebug
Hi again

I have made the code to show the mini menu and the enable and disable
options
After studying the Firebug code and the Firecookie extension I found
this (Ok! It is still a bit cargo cultish ;) )

ActivablePanel - getOptionsMenuItems must be overridden, and return at
least an empty array.
ActivableModule - initialize override must set this.panelName =
"myPanel"

And offcourse the extension preference file must have:

pref("extensions.firebug.myPanel.enableSites", false);

Please comment if you see anything wrong, and again thanks for the
tips and the replies

Best regards,
Thomas

John J Barton

unread,
Sep 16, 2010, 8:59:13 PM9/16/10
to Firebug
Ok excellent! Can you suggest, based on your experience, where we
could add some documentation to make it clearer?

jjb

Honza (Jan Odvarko)

unread,
Sep 17, 2010, 8:54:18 AM9/17/10
to Firebug
I tried to summarize the APIs here:
http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-activable-panel-part-ix/

There is also an example xpi.

Honza

tan

unread,
Sep 18, 2010, 6:31:23 AM9/18/10
to Firebug
Hi John!

This group is a helpful resource and the replies has so far been
helpful and fast, but a suggestion is to update the Create Extensions
wiki page with code examples, how-to's etc.
To me, Jan Odvarko's blog posts/tutorials is a great resource for
extension development( http://www.softwareishard.com/blog/ )

Maybe these tutorials could be moved and adapted to the Create
Extension section in the wiki (together with a link to the API
reference)
With Jan's approval of course. I hope he never takes down the blog :)

I am not sure if the Fb team does this, but when/if important API
changes is being done before a release there should be an brief heads-
up for extension developers so we can validate our extensions.

I will try to update this tread as my experience expands ;)

Thanks!

Thomas

tan

unread,
Sep 18, 2010, 6:54:25 AM9/18/10
to Firebug
@Honza:

Thanks! The tutorials are really helpful for getting into Firebug
extension development!

I tried the the xpi but the activation does not work and the disable/
enable options are not added to the tab mini menu

When I add this.panelName = "myActivablePanel" to the
MyActivableModule - initialize method it works fine (using Firebug
1.5X.4)

Adding this.panelName to the initialize method:

Firebug.MyActivableModule = extend(Firebug.ActivableModule,
{
initialize: function()
{
this.panelName = "myActivablePanel";

Firebug.ActivableModule.initialize.apply(this, arguments);

if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivableModule.initialize;");
},

...

Also, getOptionsMenuItems has to be declared/overridden in the
extension.
It has to return at least an empty array/no custom menu items.
Otherwise the mini menu - enable and disable options will not be
added.

Thomas

On Sep 17, 2:54 pm, "Honza (Jan Odvarko)" <odva...@gmail.com> wrote:
> I tried to summarize the APIs here:http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug...

Honza (Jan Odvarko)

unread,
Sep 20, 2010, 3:41:57 AM9/20/10
to Firebug


On Sep 18, 12:54 pm, tan <t...@enonic.com> wrote:
> @Honza:
>
> When I add this.panelName = "myActivablePanel" to the
> MyActivableModule - initialize method it works fine (using Firebug
> 1.5X.4)
>

> Also, getOptionsMenuItems has to be declared/overridden in the
> extension.
> It has to return at least an empty array/no custom menu items.
> Otherwise the mini menu - enable and disable options will not be

Do you use Firebug 1.5.4? Does it work if you test with Firebug
1.6b1 ?

Honza

Honza (Jan Odvarko)

unread,
Sep 20, 2010, 3:40:48 AM9/20/10
to Firebug
On Sep 18, 12:31 pm, tan <t...@enonic.com> wrote:
> Hi John!
>
> This group is a helpful resource and the replies has so far been
> helpful and fast, but a suggestion is to update the Create Extensions
> wiki page with code examples, how-to's etc.
> To me, Jan Odvarko's blog posts/tutorials is a great resource for
> extension development(http://www.softwareishard.com/blog/)
>
> Maybe these tutorials could be moved and adapted to the Create
> Extension section in the wiki (together with a link to the API
> reference)
We were already discussion this some time ago. It's something
we should just do.

> With Jan's approval of course. I hope he never takes down the blog :)
I am supporting the idea. Anyway, I don't plan to shut down my blog.

> I am not sure if the Fb team does this, but when/if important API
> changes is being done before a release there should be an brief heads-
> up for extension developers so we can validate our extensions.
Also agree, we should also link it into the getfirebug.com/firstrun
Honza

tan

unread,
Sep 22, 2010, 3:17:30 PM9/22/10
to Firebug
As time goes by I found a lot of good information for developers out
there. Maybe it is me, but the information is found in various blogs,
this group, and the Firebug wiki.
A section in the wiki with links to those resources may be a start for
the beginner

I would like this to be completed ;)
http://groups.google.com/group/firebug-working-group/web/firebug-events-listeners

Thanks!

Best regards
Thomas Andersen

Honza (Jan Odvarko)

unread,
Sep 22, 2010, 5:04:16 PM9/22/10
to Firebug
On Sep 22, 9:17 pm, tan <t...@enonic.com> wrote:
> As time goes by I found a lot of good information for developers out
> there. Maybe it is me, but the  information is found in various blogs,
> this group, and the Firebug wiki.
> A section in the wiki with links to those resources may be a start for
> the beginner

Firebug Links (Firebug users):
http://getfirebug.com/wiki/index.php/Firebug_Links

Firebug Internals (Firebug developers):
http://getfirebug.com/wiki/index.php/Firebug_Internals

Firebug FAQ (for all):
http://getfirebug.com/wiki/index.php/FAQ

Honza


> I would like this to be completed ;)http://groups.google.com/group/firebug-working-group/web/firebug-even...
Reply all
Reply to author
Forward
0 new messages