Click here to Skip to main content
13,896,960 members
Click here to Skip to main content
Add your own
alternative version


75 bookmarked
Posted 31 Jan 2006
Licenced CPOL


, 4 Apr 2006
Rate this:
Please Sign up or sign in to vote.
FireEdit - a small code editor with plugins support
FireEdit screenshot

For a binary release, go to DotNetFireball (


FireEdit is a small source code editor and is provided with basic editing functionalities. Since the idea is to extend it by the plugins system, as a basis FireEdit uses Fireball.Plugins, a class library developed for use as a base implementation for creating plugins system for any application. You can find the source of its dependencies here.

Using the Code

The objective of this article is to introduce how to implement your own plugin for FireEdit.

As an example for this article, I can use the simple plugin that adds to the HTML editor a bottom toolstrip with two buttons for switching from code to preview and vice versa.

Implementing your own plugin is very simple. You only need to inherit from FireEditPlugin, that is the base class used by FireEdit. For initializing your events and other things when the plugin is executed, you need to put this code in the Execute method by overriding it. For example, in this plugin I need to understand when a new CodeEditing window was created. See the following code:

public override bool Execute(Fireball.Plugins.PluginApplication application,
       params object[] parameters)
   ((FireEditApplication)application).MainForm.NewCodeEditor +=
       new EventHandler<NewCodeEditorEventArgs>(MainForm_NewCodeEditor);

     return true;

The function must return true for informing FireEdit that the plugin was loaded correctly. Now you are able to say when a new code editor was instanced but you need to say when the HTML language was set! See this piece of code:

void MainForm_NewCodeEditor(object sender, NewCodeEditorEventArgs e)
   e.FireEditorTabItem.LanguageChanged += new EventHandler

Now you can say when the language is changed on the FireEditorTabItem_LanguageChanged method. Next you see the code for adding the new controls on the current TabStrip.

void FireEditorTabItem_LanguageChanged(object sender, LanguageChangedEventArgs e)
     if (e.Language.Name == "HTML")
        FireEditorTabItem tabItem = (FireEditorTabItem)sender;
        ToolStrip myToolStrip = new ToolStrip();
        myToolStrip.Name = "switchBar";
        myToolStrip.Dock = DockStyle.Bottom;
        ToolStripButton btnCode = new ToolStripButton();
        btnCode.Checked = true;
        btnCode.Text = "Html Code";
        btnCode.CheckOnClick = true;
        btnCode.Click += new EventHandler(btnCode_Click);
        ToolStripButton btnPreview = new ToolStripButton();
        btnPreview.Text = "Html Preview";
        btnPreview.CheckOnClick = true;
        btnPreview.Click += new EventHandler(btnPreview_Click);
        WebBrowser browser = new WebBrowser();
        browser.Name = "preview";
        browser.Dock = DockStyle.Fill;
        browser.Visible = false;

Most of the code of this plugin is here. The rest is in the source code. I can't add it here for clarity. If you need more help or if you have created your own plugin, post a message on my forum.

N.B. To try your plugin, you need to load it from the Menu Plugins->Configure Plugins and click on Browse and Load Now. If you want the plugins to be loaded at startup, click on Load at Startup and next on Save Config. If you don't save ,the config can't be stored.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
Italy Italy
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionEhmm? Pin
Infinity82730-Dec-10 16:46
memberInfinity82730-Dec-10 16:46 
GeneralChange for running PART I Pin
ikeas6812-Jun-08 21:02
memberikeas6812-Jun-08 21:02 
Generalfireedit error Pin
nan0mit31-Mar-08 23:23
membernan0mit31-Mar-08 23:23 
GeneralCollapsible regions Pin
Enriad30-Mar-07 21:36
memberEnriad30-Mar-07 21:36 
GeneralNeed implementing it Pin
uniquekaiser12-Mar-07 21:08
memberuniquekaiser12-Mar-07 21:08 
GeneralJoin the development team Pin
delfo15-Nov-06 8:55
memberdelfo15-Nov-06 8:55 
GeneralRe: Join the development team Pin
dotnetfireball15-Nov-06 10:01
memberdotnetfireball15-Nov-06 10:01 
QuestionHELP ME Pin
beelspike12-Jul-06 8:30
memberbeelspike12-Jul-06 8:30 
GeneralBugs in Chinese language input Pin
kimble_wu20-May-06 14:09
memberkimble_wu20-May-06 14:09 
GeneralRe: Bugs in Chinese language input Pin
wyzte20052-Aug-07 4:59
memberwyzte20052-Aug-07 4:59 
GeneralAccess to content lines Pin
93Current17-Apr-06 22:56
member93Current17-Apr-06 22:56 
QuestionWhere is 'LineMarginRender' ? Pin
Ingo H. de Boer11-Apr-06 8:30
memberIngo H. de Boer11-Apr-06 8:30 
AnswerRe: Where is 'LineMarginRender' ? Pin
Omar Othman18-Apr-06 17:36
memberOmar Othman18-Apr-06 17:36 
GeneralRe: Where is 'LineMarginRender' ? Pin
Ingo H. de Boer19-Apr-06 13:42
memberIngo H. de Boer19-Apr-06 13:42 
GeneralFix for compile trouble Pin
Ingo H. de Boer20-Apr-06 9:25
memberIngo H. de Boer20-Apr-06 9:25 
GeneralFeature list Pin
david_dawkins7-Feb-06 21:12
memberdavid_dawkins7-Feb-06 21:12 
GeneralRe: Feature list Pin
dotnetfireball8-Feb-06 2:14
memberdotnetfireball8-Feb-06 2:14 
QuestionUse CAB for the UI? Pin
Daniel Cazzulino [XML MVP]7-Feb-06 1:05
memberDaniel Cazzulino [XML MVP]7-Feb-06 1:05 
AnswerRe: Use CAB for the UI? Pin
dotnetfireball7-Feb-06 3:43
memberdotnetfireball7-Feb-06 3:43 
GeneralA Question Pin
shmulik1-Feb-06 10:37
membershmulik1-Feb-06 10:37 
Generalprobably VS 2005 Standard Edition or above Pin
FTrader1-Feb-06 10:51
memberFTrader1-Feb-06 10:51 
GeneralRe: A Question Pin
dotnetfireball1-Feb-06 18:57
memberdotnetfireball1-Feb-06 18:57 
The class diagram is generated by visual studio professional

GeneralExcellent work! Pin
Dario Solera1-Feb-06 7:14
memberDario Solera1-Feb-06 7:14 
GeneralRe: Excellent work! Pin
dotnetfireball1-Feb-06 8:19
memberdotnetfireball1-Feb-06 8:19 
GeneralRe: Excellent work! Pin
Dario Solera1-Feb-06 8:55
memberDario Solera1-Feb-06 8:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.190306.1 | Last Updated 4 Apr 2006
Article Copyright 2006 by dotnetfireball
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid