FUEL/0.1/Plan: Difference between revisions
Jump to navigation
Jump to search
MarkFinkle (talk | contribs) No edit summary |
MarkFinkle (talk | contribs) |
||
| Line 40: | Line 40: | ||
* Handle implicit typing (true -> Boolean) | * Handle implicit typing (true -> Boolean) | ||
* Allow QueryInterface support to get nsIPrefService, nsIPrefBranch and nsIPrefBranch2 | * Allow QueryInterface support to get nsIPrefService, nsIPrefBranch and nsIPrefBranch2 | ||
* When used in certain contexts, like Extension.prefs, a branch will be automatically set | |||
** For Extension, the extension id will be the preset branch | |||
'''Example:''' | '''Example:''' | ||
| Line 45: | Line 47: | ||
Application.prefs.get("my.pref",default); | Application.prefs.get("my.pref",default); | ||
Application.prefs.set("my.pref","foo"); | Application.prefs.set("my.pref","foo"); | ||
// prefs uses the extension id as a branch | |||
Extension.prefs.set("autosave"); | |||
Latest revision as of 05:46, 12 January 2007
< FUEL/0.1
Due Date: Jan 31, 2007
Deliverable: Complete API
Toolbar Buttons
- Create a Button
- Insert relative to another button
Example:
var button = new ToolbarButton( "button_elem_id" );
var toolbar = Application.toolbars.get("nav");
toolbar.append( button );
toolbar.insert( button, null );
Event/Observer Handling
- Reliable events that extension developers understand and can use easily
- An "onload" that works
- Startup complete / shutdown eminent
- Your extension installed, updated, removed
- Handle observers seamlessly
Example:
Application.events.add( "load", function(){
Bookmarks.getAll();
});
Application.events.add( "startup/shutdown", ... );
Extension.events.add( "install/update/remove", ... );
// Ideas for extension presence detection:
Application.extensions.has("extension-id-or-guid");
Preferences
- Use current code (see bug 315277)
- Handle implicit typing (true -> Boolean)
- Allow QueryInterface support to get nsIPrefService, nsIPrefBranch and nsIPrefBranch2
- When used in certain contexts, like Extension.prefs, a branch will be automatically set
- For Extension, the extension id will be the preset branch
Example:
Application.prefs.get("my.pref",default);
Application.prefs.set("my.pref","foo");
// prefs uses the extension id as a branch
Extension.prefs.set("autosave");