tentative merge of EKIT_0_9H and custom patches
[old-projects.git] / ekit / com / hexidec / ekit / EkitCore.java
index 07df9cb..87aef09 100644 (file)
@@ -2,7 +2,7 @@
 GNU Lesser General Public License
 
 EkitCore - Base Java Swing HTML Editor & Viewer Class (Basic Version)
-Copyright (C) 2000-2003 Howard Kistler
+Copyright (C) 2000 Howard Kistler
 
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -57,6 +57,7 @@ import java.util.ResourceBundle;
 import java.util.Vector;
 import javax.swing.AbstractAction;
 import javax.swing.Action;
+import javax.swing.BorderFactory;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -68,6 +69,7 @@ import javax.swing.JDialog;
 import javax.swing.JEditorPane;
 import javax.swing.JFileChooser;
 import javax.swing.JFrame;
+import javax.swing.JLabel;
 import javax.swing.JMenu;
 import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
@@ -75,11 +77,13 @@ import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JSplitPane;
+import javax.swing.JTextArea;
 import javax.swing.JTextField;
 import javax.swing.JTextPane;
 import javax.swing.JToggleButton;
 import javax.swing.JToolBar;
 import javax.swing.KeyStroke;
+import javax.swing.border.*;
 import javax.swing.event.CaretEvent;
 import javax.swing.event.CaretListener;
 import javax.swing.event.DocumentEvent;
@@ -94,6 +98,7 @@ import javax.swing.text.DefaultEditorKit;
 import javax.swing.text.DefaultStyledDocument;
 import javax.swing.text.Document;
 import javax.swing.text.Element;
+import javax.swing.text.JTextComponent;
 import javax.swing.text.PlainDocument;
 import javax.swing.text.Position;
 import javax.swing.text.Style;
@@ -118,7 +123,7 @@ import com.hexidec.util.Translatrix;
   * Main application class for editing and saving HTML in a Java text component
   *
   * @author Howard Kistler
-  * @version 0.9g
+  * @version 0.9h
   *
   * REQUIREMENTS
   * Java 2 (JDK 1.3 or 1.4)
@@ -133,12 +138,13 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        private ExtendedHTMLEditorKit htmlKit;
        private ExtendedHTMLDocument htmlDoc;
        private StyleSheet styleSheet;
-       private JTextPane jtpSource;
+       private JTextArea jtpSource;
        private JScrollPane jspSource;
        private JToolBar jToolBar;
 
-       private JCheckBoxMenuItem jcbmiViewToolbar;
-       private JCheckBoxMenuItem jcbmiViewSource;
+       private JToolBar jToolBarMain;
+       private JToolBar jToolBarFormat;
+       private JToolBar jToolBarStyles;
 
        private JButtonNoFocus jbtnNewHTML;
        private JButtonNoFocus jbtnOpenHTML;
@@ -191,9 +197,17 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        private JMenu jMenuTable;
        private JMenu jMenuForms;
        private JMenu jMenuSearch;
+       private JMenu jMenuTools;
        private JMenu jMenuHelp;
        private JMenu jMenuDebug;
 
+       private JMenu jMenuToolbars;
+       private JCheckBoxMenuItem jcbmiViewToolbar;
+       private JCheckBoxMenuItem jcbmiViewToolbarMain;
+       private JCheckBoxMenuItem jcbmiViewToolbarFormat;
+       private JCheckBoxMenuItem jcbmiViewToolbarStyles;
+       private JCheckBoxMenuItem jcbmiViewSource;
+
        /* Constants */
        // Menu Keys
        public static final String KEY_MENU_FILE   = "file";
@@ -230,6 +244,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        public static final String KEY_TOOL_SOURCE    = "viewsource";
        public static final String KEY_TOOL_STYLES    = "styleselect";
 
+       public static final int TOOLBAR_MAIN   = 0;
+       public static final int TOOLBAR_FORMAT = 1;
+       public static final int TOOLBAR_STYLES = 2;
+
        // Menu & Tool Key Arrays
        private static Hashtable htMenus = new Hashtable();
        private static Hashtable htTools = new Hashtable();
@@ -255,6 +273,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        private boolean lastSearchTopSetting  = false;
 
        private File currentFile = null;
+       private String imageChooserStartDir = ".";
 
        private int indent = 0;
        private final int indentStep = 4;
@@ -277,7 +296,9 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          * @param sDocument         [String]  A text or HTML document to load in the editor upon startup.
          * @param sStyleSheet       [String]  A CSS stylesheet to load in the editor upon startup.
          * @param sRawDocument      [String]  A document encoded as a String to load in the editor upon startup.
+         * @param sdocSource        [StyledDocument] Optional document specification, using javax.swing.text.StyledDocument.
          * @param urlStyleSheet     [URL]     A URL reference to the CSS style sheet.
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
@@ -285,8 +306,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
          * @param base64            [boolean] Specifies whether the raw document is Base64 encoded or not.
          * @param debugMode         [boolean] Specifies whether to show the Debug menu or not.
+         * @param hasSpellChecker   [boolean] Specifies whether or not this uses the SpellChecker module
+         * @param multiBar          [boolean] Specifies whether to use multiple toolbars or one big toolbar.
          */
-       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, URL urlStyleSheet, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, String baseurl)
+       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, StyledDocument sdocSource, URL urlStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, boolean hasSpellChecker, boolean multiBar, String baseurl)
        {
                super();
 
@@ -342,10 +365,19 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                jtpMain.addKeyListener(this);
 
                /* Create the source text area */
-               jtpSource = new JTextPane();
+               if(sdocSource == null)
+               {
+                       jtpSource = new JTextArea();
+                       jtpSource.setText(jtpMain.getText());
+               }
+               else
+               {
+                       jtpSource = new JTextArea(sdocSource);
+                       jtpMain.setText(jtpSource.getText());
+               }
                jtpSource.setBackground(new Color(212, 212, 212));
                jtpSource.setSelectionColor(new Color(255, 192, 192));
-               jtpSource.setText(jtpMain.getText());
+               jtpSource.setMargin(new Insets(4, 4, 4, 4));
                jtpSource.getDocument().addDocumentListener(this);
 
                /* Add CaretListener for tracking caret location events */
@@ -505,10 +537,41 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                JMenuItem jmiSelWord = new JMenuItem((Action)actions.get(DefaultEditorKit.selectWordAction));      jmiSelWord.setText(Translatrix.getTranslationString("SelectWord"));      jMenuEdit.add(jmiSelWord);
 
                /* VIEW Menu */
-               jMenuView        = new JMenu(Translatrix.getTranslationString("View"));
+               jMenuView = new JMenu(Translatrix.getTranslationString("View"));
                htMenus.put(KEY_MENU_VIEW, jMenuView);
-               jcbmiViewToolbar = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbar"), false); jcbmiViewToolbar.setActionCommand("toggletoolbar"); jcbmiViewToolbar.addActionListener(this); jMenuView.add(jcbmiViewToolbar);
-               jcbmiViewSource  = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewSource"), false);  jcbmiViewSource.setActionCommand("viewsource");     jcbmiViewSource.addActionListener(this);  jMenuView.add(jcbmiViewSource);
+               if(includeToolBar)
+               {
+                       if(multiBar)
+                       {
+                               jMenuToolbars = new JMenu(Translatrix.getTranslationString("ViewToolbars"));
+
+                               jcbmiViewToolbarMain = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbarMain"), false);
+                                       jcbmiViewToolbarMain.setActionCommand("toggletoolbarmain");
+                                       jcbmiViewToolbarMain.addActionListener(this);
+                                       jMenuToolbars.add(jcbmiViewToolbarMain);
+
+                               jcbmiViewToolbarFormat = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbarFormat"), false);
+                                       jcbmiViewToolbarFormat.setActionCommand("toggletoolbarformat");
+                                       jcbmiViewToolbarFormat.addActionListener(this);
+                                       jMenuToolbars.add(jcbmiViewToolbarFormat);
+
+                               jcbmiViewToolbarStyles = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbarStyles"), false);
+                                       jcbmiViewToolbarStyles.setActionCommand("toggletoolbarstyles");
+                                       jcbmiViewToolbarStyles.addActionListener(this);
+                                       jMenuToolbars.add(jcbmiViewToolbarStyles);
+
+                               jMenuView.add(jMenuToolbars);
+                       }
+                       else
+                       {
+                               jcbmiViewToolbar = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewToolbar"), false);
+                                       jcbmiViewToolbar.setActionCommand("toggletoolbar");
+                                       jcbmiViewToolbar.addActionListener(this);
+
+                               jMenuView.add(jcbmiViewToolbar);
+                       }
+               }
+               jcbmiViewSource = new JCheckBoxMenuItem(Translatrix.getTranslationString("ViewSource"), false);  jcbmiViewSource.setActionCommand("viewsource");     jcbmiViewSource.addActionListener(this);  jMenuView.add(jcbmiViewSource);
 
                /* FONT Menu */
                jMenuFont              = new JMenu(Translatrix.getTranslationString("Font"));
@@ -603,9 +666,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                jMenuInsert              = new JMenu(Translatrix.getTranslationString("Insert"));
                htMenus.put(KEY_MENU_INSERT, jMenuInsert);
                jMenuInsert.add(new JMenuItem(actionInsertAnchor));
-               JMenuItem jmiBreak       = new JMenuItem(Translatrix.getTranslationString("InsertBreak"));                    jmiBreak.setActionCommand("insertbreak"); jmiBreak.addActionListener(this); jmiBreak.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, java.awt.Event.SHIFT_MASK, false)); jMenuInsert.add(jmiBreak);
-               JMenuItem jmiNBSP        = new JMenuItem(Translatrix.getTranslationString("InsertNBSP"));                     jmiNBSP.setActionCommand("insertnbsp");   jmiNBSP.addActionListener(this);  jMenuInsert.add(jmiNBSP);
-               JMenuItem jmiHRule       = new JMenuItem((Action)actions.get("InsertHR"));                                    jmiHRule.setText(Translatrix.getTranslationString("InsertHorizontalRule")); jMenuInsert.add(jmiHRule);
+               JMenuItem jmiSymbol      = new JMenuItem(Translatrix.getTranslationString("InsertSymbol")); jmiSymbol.setActionCommand("insertsymbol"); jmiSymbol.addActionListener(this);  jMenuInsert.add(jmiSymbol);
+               JMenuItem jmiBreak       = new JMenuItem(Translatrix.getTranslationString("InsertBreak"));  jmiBreak.setActionCommand("insertbreak");   jmiBreak.addActionListener(this);   jmiBreak.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, java.awt.Event.SHIFT_MASK, false)); jMenuInsert.add(jmiBreak);
+               JMenuItem jmiNBSP        = new JMenuItem(Translatrix.getTranslationString("InsertNBSP"));   jmiNBSP.setActionCommand("insertnbsp");     jmiNBSP.addActionListener(this);    jMenuInsert.add(jmiNBSP);
+               JMenuItem jmiHRule       = new JMenuItem((Action)actions.get("InsertHR"));                  jmiHRule.setText(Translatrix.getTranslationString("InsertHorizontalRule")); jMenuInsert.add(jmiHRule);
                jMenuInsert.addSeparator();
                JMenuItem jmiImageLocal  = new JMenuItem(Translatrix.getTranslationString("InsertLocalImage") + menuDialog);  jmiImageLocal.setActionCommand("insertlocalimage"); jmiImageLocal.addActionListener(this); jMenuInsert.add(jmiImageLocal);
                JMenuItem jmiImageServer = new JMenuItem(Translatrix.getTranslationString("InsertServerImage") + menuDialog); jmiImageServer.setActionCommand("insertserverimage"); jmiImageServer.addActionListener(this); jMenuInsert.add(jmiImageServer);
@@ -636,6 +700,14 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                JMenuItem jmiFormButtonSubmit = new JMenuItem(Translatrix.getTranslationString("FormButtonSubmit")); jmiFormButtonSubmit.setActionCommand("insertbuttonsubmit"); jmiFormButtonSubmit.addActionListener(this); jMenuForms.add(jmiFormButtonSubmit);
                JMenuItem jmiFormButtonReset  = new JMenuItem(Translatrix.getTranslationString("FormButtonReset"));  jmiFormButtonReset.setActionCommand("insertbuttonreset");   jmiFormButtonReset.addActionListener(this);  jMenuForms.add(jmiFormButtonReset);
 
+               /* TOOLS Menu */
+               if(hasSpellChecker)
+               {
+                       jMenuTools = new JMenu(Translatrix.getTranslationString("Tools"));
+                       htMenus.put(KEY_MENU_TOOLS, jMenuTools);
+                       JMenuItem jmiSpellcheck = new JMenuItem(Translatrix.getTranslationString("ToolSpellcheck")); jmiSpellcheck.setActionCommand("spellcheck"); jmiSpellcheck.addActionListener(this); jMenuTools.add(jmiSpellcheck);
+               }
+
                /* SEARCH Menu */
                jMenuSearch            = new JMenu(Translatrix.getTranslationString("Search"));
                htMenus.put(KEY_MENU_SEARCH, jMenuSearch);
@@ -666,38 +738,183 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                jMenuBar.add(jMenuInsert);
                jMenuBar.add(jMenuTable);
                jMenuBar.add(jMenuForms);
+               if(jMenuTools != null) { jMenuBar.add(jMenuTools); }
                jMenuBar.add(jMenuHelp);
                if(debugMode)
                {
                        jMenuBar.add(jMenuDebug);
                }
 
+               /* Create toolbar tool objects */
+               jbtnNewHTML = new JButtonNoFocus(getEkitIcon("New"));
+                       jbtnNewHTML.setToolTipText(Translatrix.getTranslationString("NewDocument"));
+                       jbtnNewHTML.setActionCommand("newdoc");
+                       jbtnNewHTML.addActionListener(this);
+                       htTools.put(KEY_TOOL_NEW, jbtnNewHTML);
+               jbtnOpenHTML = new JButtonNoFocus(getEkitIcon("Open"));
+                       jbtnOpenHTML.setToolTipText(Translatrix.getTranslationString("OpenDocument"));
+                       jbtnOpenHTML.setActionCommand("openhtml");
+                       jbtnOpenHTML.addActionListener(this);
+                       htTools.put(KEY_TOOL_OPEN, jbtnOpenHTML);
+               jbtnSaveHTML = new JButtonNoFocus(getEkitIcon("Save"));
+                       jbtnSaveHTML.setToolTipText(Translatrix.getTranslationString("SaveDocument"));
+                       jbtnSaveHTML.setActionCommand("saveas");
+                       jbtnSaveHTML.addActionListener(this);
+                       htTools.put(KEY_TOOL_SAVE, jbtnSaveHTML);
+               jbtnCut = new JButtonNoFocus(new DefaultEditorKit.CutAction());
+                       jbtnCut.setIcon(getEkitIcon("Cut"));
+                       jbtnCut.setText(null);
+                       jbtnCut.setToolTipText(Translatrix.getTranslationString("Cut"));
+                       htTools.put(KEY_TOOL_CUT, jbtnCut);
+               jbtnCopy = new JButtonNoFocus(new DefaultEditorKit.CopyAction());
+                       jbtnCopy.setIcon(getEkitIcon("Copy"));
+                       jbtnCopy.setText(null);
+                       jbtnCopy.setToolTipText(Translatrix.getTranslationString("Copy"));
+                       htTools.put(KEY_TOOL_COPY, jbtnCopy);
+               jbtnPaste = new JButtonNoFocus(new DefaultEditorKit.PasteAction());
+                       jbtnPaste.setIcon(getEkitIcon("Paste"));
+                       jbtnPaste.setText(null);
+                       jbtnPaste.setToolTipText(Translatrix.getTranslationString("Paste"));
+                       htTools.put(KEY_TOOL_PASTE, jbtnPaste);
+               jbtnBold = new JButtonNoFocus(actionFontBold);
+                       jbtnBold.setIcon(getEkitIcon("Bold"));
+                       jbtnBold.setText(null);
+                       jbtnBold.setToolTipText(Translatrix.getTranslationString("FontBold"));
+                       htTools.put(KEY_TOOL_BOLD, jbtnBold);
+               jbtnItalic = new JButtonNoFocus(actionFontItalic);
+                       jbtnItalic.setIcon(getEkitIcon("Italic"));
+                       jbtnItalic.setText(null);
+                       jbtnItalic.setToolTipText(Translatrix.getTranslationString("FontItalic"));
+                       htTools.put(KEY_TOOL_ITALIC, jbtnItalic);
+               jbtnUnderline = new JButtonNoFocus(actionFontUnderline);
+                       jbtnUnderline.setIcon(getEkitIcon("Underline"));
+                       jbtnUnderline.setText(null);
+                       jbtnUnderline.setToolTipText(Translatrix.getTranslationString("FontUnderline"));
+                       htTools.put(KEY_TOOL_UNDERLINE, jbtnUnderline);
+               jbtnStrike = new JButtonNoFocus(actionFontStrike);
+                       jbtnStrike.setIcon(getEkitIcon("Strike"));
+                       jbtnStrike.setText(null);
+                       jbtnStrike.setToolTipText(Translatrix.getTranslationString("FontStrike"));
+                       htTools.put(KEY_TOOL_STRIKE, jbtnStrike);
+               jbtnSuperscript = new JButtonNoFocus(actionFontSuperscript);
+                       jbtnSuperscript.setIcon(getEkitIcon("Super"));
+                       jbtnSuperscript.setText(null);
+                       jbtnSuperscript.setToolTipText(Translatrix.getTranslationString("FontSuperscript"));
+                       htTools.put(KEY_TOOL_SUPER, jbtnSuperscript);
+               jbtnSubscript = new JButtonNoFocus(actionFontSubscript);
+                       jbtnSubscript.setIcon(getEkitIcon("Sub"));
+                       jbtnSubscript.setText(null);
+                       jbtnSubscript.setToolTipText(Translatrix.getTranslationString("FontSubscript"));
+                       htTools.put(KEY_TOOL_SUB, jbtnSubscript);
+               jbtnUList = new JButtonNoFocus(actionListUnordered);
+                       jbtnUList.setIcon(getEkitIcon("UList"));
+                       jbtnUList.setText(null);
+                       jbtnUList.setToolTipText(Translatrix.getTranslationString("ListUnordered"));
+                       htTools.put(KEY_TOOL_ULIST, jbtnUList);
+               jbtnOList = new JButtonNoFocus(actionListOrdered);
+                       jbtnOList.setIcon(getEkitIcon("OList"));
+                       jbtnOList.setText(null);
+                       jbtnOList.setToolTipText(Translatrix.getTranslationString("ListOrdered"));
+                       htTools.put(KEY_TOOL_OLIST, jbtnOList);
+               jbtnClearFormat = new JButtonNoFocus(actionClearFormat);
+                       jbtnClearFormat.setIcon(getEkitIcon("ClearFormat"));
+                       jbtnClearFormat.setText(null);
+                       jbtnClearFormat.setToolTipText(Translatrix.getTranslationString("FormatClear"));
+                       htTools.put(KEY_TOOL_CLEAR, jbtnClearFormat);
+               jbtnAnchor = new JButtonNoFocus(actionInsertAnchor);
+                       jbtnAnchor.setIcon(getEkitIcon("Anchor"));
+                       jbtnAnchor.setText(null);
+                       jbtnAnchor.setToolTipText(Translatrix.getTranslationString("ToolAnchor"));
+                       htTools.put(KEY_TOOL_ANCHOR, jbtnAnchor);
+               jtbtnViewSource = new JToggleButtonNoFocus(getEkitIcon("Source"));
+                       jtbtnViewSource.setText(null);
+                       jtbtnViewSource.setToolTipText(Translatrix.getTranslationString("ViewSource"));
+                       jtbtnViewSource.setActionCommand("viewsource");
+                       jtbtnViewSource.addActionListener(this);
+                       jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize());
+                       jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize());
+                       jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize());
+                       htTools.put(KEY_TOOL_SOURCE, jtbtnViewSource);
+               jcmbStyleSelector = new JComboBoxNoFocus();
+                       jcmbStyleSelector.setToolTipText(Translatrix.getTranslationString("PickCSSStyle"));
+                       jcmbStyleSelector.setAction(new StylesAction(jcmbStyleSelector));
+                       htTools.put(KEY_TOOL_STYLES, jcmbStyleSelector);
+
                /* Create the toolbar */
-               jToolBar = new JToolBar(JToolBar.HORIZONTAL);
-               jToolBar.setFloatable(false);
-               jbtnNewHTML     = new JButtonNoFocus(getEkitIcon("New"));  jbtnNewHTML.setToolTipText(Translatrix.getTranslationString("NewDocument"));   jbtnNewHTML.setActionCommand("newdoc");    jbtnNewHTML.addActionListener(this);  jToolBar.add(jbtnNewHTML);  htTools.put(KEY_TOOL_NEW, jbtnNewHTML);
-               jbtnOpenHTML    = new JButtonNoFocus(getEkitIcon("Open")); jbtnOpenHTML.setToolTipText(Translatrix.getTranslationString("OpenDocument")); jbtnOpenHTML.setActionCommand("openhtml"); jbtnOpenHTML.addActionListener(this); jToolBar.add(jbtnOpenHTML); htTools.put(KEY_TOOL_OPEN, jbtnOpenHTML);
-               jbtnSaveHTML    = new JButtonNoFocus(getEkitIcon("Save")); jbtnSaveHTML.setToolTipText(Translatrix.getTranslationString("SaveDocument")); jbtnSaveHTML.setActionCommand("saveas");   jbtnSaveHTML.addActionListener(this); jToolBar.add(jbtnSaveHTML); htTools.put(KEY_TOOL_SAVE, jbtnSaveHTML);
-               jToolBar.add(new JToolBar.Separator());
-               jbtnCut         = new JButtonNoFocus(new DefaultEditorKit.CutAction());   jbtnCut.setIcon(getEkitIcon("Cut"));     jbtnCut.setText(null);   jbtnCut.setToolTipText(Translatrix.getTranslationString("Cut"));     jToolBar.add(jbtnCut);   htTools.put(KEY_TOOL_CUT, jbtnCut);
-               jbtnCopy        = new JButtonNoFocus(new DefaultEditorKit.CopyAction());  jbtnCopy.setIcon(getEkitIcon("Copy"));   jbtnCopy.setText(null);  jbtnCopy.setToolTipText(Translatrix.getTranslationString("Copy"));   jToolBar.add(jbtnCopy);  htTools.put(KEY_TOOL_COPY, jbtnCopy);
-               jbtnPaste       = new JButtonNoFocus(new DefaultEditorKit.PasteAction()); jbtnPaste.setIcon(getEkitIcon("Paste")); jbtnPaste.setText(null); jbtnPaste.setToolTipText(Translatrix.getTranslationString("Paste")); jToolBar.add(jbtnPaste); htTools.put(KEY_TOOL_PASTE, jbtnPaste);
-               jToolBar.add(new JToolBar.Separator());
-               jbtnBold        = new JButtonNoFocus(actionFontBold);        jbtnBold.setIcon(getEkitIcon("Bold"));               jbtnBold.setText(null);        jbtnBold.setToolTipText(Translatrix.getTranslationString("FontBold"));                 jToolBar.add(jbtnBold);        htTools.put(KEY_TOOL_BOLD, jbtnBold);
-               jbtnItalic      = new JButtonNoFocus(actionFontItalic);      jbtnItalic.setIcon(getEkitIcon("Italic"));           jbtnItalic.setText(null);      jbtnItalic.setToolTipText(Translatrix.getTranslationString("FontItalic"));             jToolBar.add(jbtnItalic);      htTools.put(KEY_TOOL_ITALIC, jbtnItalic);
-               jbtnUnderline   = new JButtonNoFocus(actionFontUnderline);   jbtnUnderline.setIcon(getEkitIcon("Underline"));     jbtnUnderline.setText(null);   jbtnUnderline.setToolTipText(Translatrix.getTranslationString("FontUnderline"));       jToolBar.add(jbtnUnderline);   htTools.put(KEY_TOOL_UNDERLINE, jbtnUnderline);
-               jbtnStrike      = new JButtonNoFocus(actionFontStrike);      jbtnStrike.setIcon(getEkitIcon("Strike"));           jbtnStrike.setText(null);      jbtnStrike.setToolTipText(Translatrix.getTranslationString("FontStrike"));             jToolBar.add(jbtnStrike);      htTools.put(KEY_TOOL_STRIKE, jbtnStrike);
-               jbtnSuperscript = new JButtonNoFocus(actionFontSuperscript); jbtnSuperscript.setIcon(getEkitIcon("Super"));       jbtnSuperscript.setText(null); jbtnSuperscript.setToolTipText(Translatrix.getTranslationString("FontSuperscript")); jToolBar.add(jbtnSuperscript);   htTools.put(KEY_TOOL_SUPER, jbtnSuperscript);
-               jbtnSubscript   = new JButtonNoFocus(actionFontSubscript);   jbtnSubscript.setIcon(getEkitIcon("Sub"));           jbtnSubscript.setText(null);   jbtnSubscript.setToolTipText(Translatrix.getTranslationString("FontSubscript"));     jToolBar.add(jbtnSubscript);     htTools.put(KEY_TOOL_SUB, jbtnSubscript);
-               jbtnUList       = new JButtonNoFocus(actionListUnordered);   jbtnUList.setIcon(getEkitIcon("UList"));             jbtnUList.setText(null);       jbtnUList.setToolTipText(Translatrix.getTranslationString("ListUnordered"));           jToolBar.add(jbtnUList);       htTools.put(KEY_TOOL_ULIST, jbtnUList);
-               jbtnOList       = new JButtonNoFocus(actionListOrdered);     jbtnOList.setIcon(getEkitIcon("OList"));             jbtnOList.setText(null);       jbtnOList.setToolTipText(Translatrix.getTranslationString("ListOrdered"));             jToolBar.add(jbtnOList);       htTools.put(KEY_TOOL_OLIST, jbtnOList);
-               jbtnClearFormat = new JButtonNoFocus(actionClearFormat);     jbtnClearFormat.setIcon(getEkitIcon("ClearFormat")); jbtnClearFormat.setText(null); jbtnClearFormat.setToolTipText(Translatrix.getTranslationString("FormatClear"));       jToolBar.add(jbtnClearFormat); htTools.put(KEY_TOOL_CLEAR, jbtnClearFormat);
-               jToolBar.add(new JToolBar.Separator());
-               jbtnAnchor      = new JButtonNoFocus(actionInsertAnchor); jbtnAnchor.setIcon(getEkitIcon("Anchor")); jbtnAnchor.setText(null); jbtnAnchor.setToolTipText(Translatrix.getTranslationString("ToolAnchor")); jToolBar.add(jbtnAnchor); htTools.put(KEY_TOOL_ANCHOR, jbtnAnchor);
-               jToolBar.add(new JToolBar.Separator());
-               jtbtnViewSource = new JToggleButtonNoFocus(getEkitIcon("Source")); jtbtnViewSource.setText(null); jtbtnViewSource.setToolTipText(Translatrix.getTranslationString("ViewSource")); jtbtnViewSource.setActionCommand("viewsource"); jtbtnViewSource.addActionListener(this); jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize()); jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize()); jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize()); jToolBar.add(jtbtnViewSource); htTools.put(KEY_TOOL_SOURCE, jtbtnViewSource);
-               jToolBar.add(new JToolBar.Separator());
-               jcmbStyleSelector = new JComboBoxNoFocus(); jToolBar.add(jcmbStyleSelector); jcmbStyleSelector.setAction(new StylesAction(jcmbStyleSelector)); htTools.put(KEY_TOOL_STYLES, jcmbStyleSelector);
+               if(multiBar)
+               {
+                       jToolBarMain = new JToolBar(JToolBar.HORIZONTAL);
+                       jToolBarMain.setFloatable(false);
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_NEW)));
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_OPEN)));
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_SAVE)));
+                       jToolBarMain.add(new JToolBar.Separator());
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_CUT)));
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_COPY)));
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_PASTE)));
+                       jToolBarMain.add(new JToolBar.Separator());
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_CLEAR)));
+                       jToolBarMain.add(new JToolBar.Separator());
+                       jToolBarMain.add((JButtonNoFocus)(htTools.get(KEY_TOOL_ANCHOR)));
+                       jToolBarMain.add(new JToolBar.Separator());
+                       jToolBarMain.add((JToggleButtonNoFocus)(htTools.get(KEY_TOOL_SOURCE)));
+
+                       jToolBarFormat = new JToolBar(JToolBar.HORIZONTAL);
+                       jToolBarFormat.setFloatable(false);
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_BOLD)));
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_ITALIC)));
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_UNDERLINE)));
+                       jToolBarFormat.add(new JToolBar.Separator());
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_STRIKE)));
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_SUPER)));
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_SUB)));
+                       jToolBarFormat.add(new JToolBar.Separator());
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_ULIST)));
+                       jToolBarFormat.add((JButtonNoFocus)(htTools.get(KEY_TOOL_OLIST)));
+
+                       jToolBarStyles = new JToolBar(JToolBar.HORIZONTAL);
+                       jToolBarStyles.setFloatable(false);
+                       jToolBarStyles.add(new JLabel(Translatrix.getTranslationString("SelectorToolCSSStyles")));
+                       jToolBarStyles.add((JComboBoxNoFocus)(htTools.get(KEY_TOOL_STYLES)));
+
+                       // fix the weird size preference of toggle buttons
+                       jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize());
+                       jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize());
+                       jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize());
+               }
+               else
+               {
+                       jToolBar = new JToolBar(JToolBar.HORIZONTAL);
+                       jToolBar.setFloatable(false);
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_NEW)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_OPEN)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_SAVE)));
+                       jToolBar.add(new JToolBar.Separator());
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_CUT)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_COPY)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_PASTE)));
+                       jToolBar.add(new JToolBar.Separator());
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_BOLD)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_ITALIC)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_UNDERLINE)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_STRIKE)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_SUPER)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_SUB)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_ULIST)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_OLIST)));
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_CLEAR)));
+                       jToolBar.add(new JToolBar.Separator());
+                       jToolBar.add((JButtonNoFocus)(htTools.get(KEY_TOOL_ANCHOR)));
+                       jToolBar.add(new JToolBar.Separator());
+                       jToolBar.add((JToggleButtonNoFocus)(htTools.get(KEY_TOOL_SOURCE)));
+                       jToolBar.add(new JToolBar.Separator());
+                       jToolBar.add((JComboBoxNoFocus)(htTools.get(KEY_TOOL_STYLES)));
+
+                       // fix the weird size preference of toggle buttons
+                       jtbtnViewSource.setPreferredSize(jbtnAnchor.getPreferredSize());
+                       jtbtnViewSource.setMinimumSize(jbtnAnchor.getMinimumSize());
+                       jtbtnViewSource.setMaximumSize(jbtnAnchor.getMaximumSize());
+               }
 
                /* Create the scroll area for the text pane */
                JScrollPane jspViewport = new JScrollPane(jtpMain);
@@ -730,90 +947,151 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                this.add(jspltDisplay, BorderLayout.CENTER);
        }
 
+       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, URL urlStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, boolean hasSpellChecker, boolean multiBar, String baseurl)
+       {
+               this(sDocument, sStyleSheet, sRawDocument, (StyledDocument)null, urlStyleSheet, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, debugMode, hasSpellChecker, multiBar, baseurl);
+       }
+       
+       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, URL urlStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, boolean hasSpellChecker, boolean multiBar)
+       {
+               this(sDocument, sStyleSheet, sRawDocument, (StyledDocument)null, urlStyleSheet, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, debugMode, hasSpellChecker, multiBar, "");
+       }
+
+       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, URL urlStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, String baseurl)
+       {
+               this(sDocument, sStyleSheet, sRawDocument, (StyledDocument)null, urlStyleSheet, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, debugMode, false, false, baseurl);
+       }
+
+       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, URL urlStyleSheet, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, boolean hasSpellChecker, String baseurl)
+       {
+               this(sDocument, sStyleSheet, sRawDocument, (StyledDocument)null, urlStyleSheet, true, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, debugMode, hasSpellChecker, false, baseurl);
+       }
+
+       public EkitCore(String sDocument, String sStyleSheet, String sRawDocument, URL urlStyleSheet, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean debugMode, String baseurl)
+       {
+               this(sDocument, sStyleSheet, sRawDocument, (StyledDocument)null, urlStyleSheet, true, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, debugMode, false, false, baseurl);
+       }
+
        /** Common Constructor
          * @param sDocument         [String]  A text or HTML document to load in the editor upon startup.
          * @param sStyleSheet       [String]  A CSS stylesheet to load in the editor upon startup.
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          * @param sLanguage         [String]  The language portion of the Internationalization Locale to run Ekit in.
          * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
          */
-       public EkitCore(String sDocument, String sStyleSheet, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64)
+       public EkitCore(String sDocument, String sStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, String baseurl)
        {
-               this(sDocument, sStyleSheet, null, null, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, false,"");
+               this(sDocument, sStyleSheet, null, null, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, false, baseurl);
+       }
+
+       /** StyledDocument Constructor With Spellchecker Specifier
+         * @param sdocSource        [StyledDocument] The optional StyledDocument to use as the source Document.
+         * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
+         * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
+         * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
+         * @param sLanguage         [String]  The language portion of the Internationalization Locale to run Ekit in.
+         * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
+         * @param debugMode         [boolean] Specifies whether to show the Debug menu or not.
+         * @param hasSpellChecker   [boolean] Specifies whether or not this uses the SpellChecker module
+         */
+       public EkitCore(StyledDocument sdocSource, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean debugMode, boolean hasSpellChecker, String baseurl)
+       {
+               this(null, null, null, sdocSource, null, true, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, false, debugMode, hasSpellChecker, false, baseurl);
+       }
+
+       /** StyledDocument Constructor
+         * @param sdocSource        [StyledDocument] The optional StyledDocument to use as the source Document.
+         * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
+         * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
+         * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
+         * @param sLanguage         [String]  The language portion of the Internationalization Locale to run Ekit in.
+         * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
+         * @param debugMode         [boolean] Specifies whether to show the Debug menu or not.
+         */
+       public EkitCore(StyledDocument sdocSource, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean debugMode, String baseurl)
+       {
+               this(null, null, null, sdocSource, null, true, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, false, debugMode, false, false, baseurl);
        }
 
        /** Default Language Constructor
          * @param sDocument         [String]  A text or HTML document to load in the editor upon startup.
          * @param sStyleSheet       [String]  A CSS stylesheet to load in the editor upon startup.
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          */
-       public EkitCore(String sDocument, String sStyleSheet, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, boolean base64)
+       public EkitCore(String sDocument, String sStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, boolean base64, String baseurl)
        {
-               this(sDocument, sStyleSheet, null, null, showViewSource, showMenuIcons, editModeExclusive, null, null, base64, false, "");
+               this(sDocument, sStyleSheet, null, null, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, null, null, base64, false, baseurl);
        }
 
        /** Raw/Base64 Document & Style Sheet URL Constructor (Ideal for EkitApplet)
          * @param sRawDocument      [String]  A document encoded as a String to load in the editor upon startup.
          * @param sRawDocument      [String]  A document encoded as a String to load in the editor upon startup.
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          * @param sLanguage         [String]  The language portion of the Internationalization Locale to run Ekit in.
          * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
          */
-       public EkitCore(String sRawDocument, URL urlStyleSheet, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, String baseurl)
+       public EkitCore(String sRawDocument, URL urlStyleSheet, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, boolean hasSpellChecker, boolean multiBar, String baseurl)
        {
-               this(null, null, sRawDocument, urlStyleSheet, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, false, baseurl);
+               this(null, null, sRawDocument, urlStyleSheet, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, false, hasSpellChecker, multiBar, baseurl);
        }
 
        /** Document Constructor
          * @param sRawDocument      [String]  A document encoded as a String to load in the editor upon startup.
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          * @param sLanguage         [String]  The language portion of the Internationalization Locale to run Ekit in.
          * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
          */
-       public EkitCore(String sRawDocument, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64)
+       public EkitCore(String sRawDocument, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry, boolean base64, String baseurl)
        {
-               this(null, null, sRawDocument, null, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, false,"");
+               this(null, null, sRawDocument, null, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, base64, false, baseurl);
        }
 
        /** Default Language & Document Constructor
          * @param sRawDocument      [String]  A document encoded as a String to load in the editor upon startup.
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          */
-       public EkitCore(String sRawDocument, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, boolean base64)
+       public EkitCore(String sRawDocument, boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, boolean base64, String baseurl)
        {
-               this(null, null, sRawDocument, null, showViewSource, showMenuIcons, editModeExclusive, null, null, base64, false,"");
+               this(null, null, sRawDocument, null, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, null, null, base64, false, baseurl);
        }
 
        /** Flags & Language Constructor
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          * @param sLanguage         [String]  The language portion of the Internationalization Locale to run Ekit in.
          * @param sCountry          [String]  The country portion of the Internationalization Locale to run Ekit in.
          */
-       public EkitCore(boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry)
+       public EkitCore(boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive, String sLanguage, String sCountry)
        {
-               this(null, null, null, null, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, false, false,"");
+               this(null, null, null, null, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, sLanguage, sCountry, false, false, "");
        }
 
        /** Flags Constructor
+         * @param includeToolBar    [boolean] Specifies whether the app should include the toolbar(s).
          * @param showViewSource    [boolean] Specifies whether or not to show the View Source window on startup.
          * @param showMenuIcons     [boolean] Specifies whether or not to show icon pictures in menus.
          * @param editModeExclusive [boolean] Specifies whether or not to use exclusive edit mode (recommended on).
          */
-       public EkitCore(boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive)
+       public EkitCore(boolean includeToolBar, boolean showViewSource, boolean showMenuIcons, boolean editModeExclusive)
        {
-               this(null, null, null, null, showViewSource, showMenuIcons, editModeExclusive, null, null, false, false,"");
+               this(null, null, null, null, includeToolBar, showViewSource, showMenuIcons, editModeExclusive, null, null, false, false, "");
        }
 
        /** Language & Debug Constructor
@@ -823,7 +1101,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          */
        public EkitCore(String sLanguage, String sCountry, boolean debugMode)
        {
-               this(null, null, null, null, false, true, true, sLanguage, sCountry, false, debugMode,"");
+               this(null, null, null, null, true, false, true, true, sLanguage, sCountry, false, debugMode, "");
        }
 
        /** Language Constructor
@@ -832,7 +1110,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          */
        public EkitCore(String sLanguage, String sCountry)
        {
-               this(null, null, null, null, false, true, true, sLanguage, sCountry, false, false,"");
+               this(null, null, null, null, true, false, true, true, sLanguage, sCountry, false, false, "");
        }
 
        /** Debug Constructor
@@ -840,14 +1118,14 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          */
        public EkitCore(boolean debugMode)
        {
-               this(null, null, null, null, false, true, true, null, null, false, debugMode,"");
+               this(null, null, null, null, true, false, true, true, null, null, false, debugMode, "");
        }
 
        /** Empty Constructor
          */
        public EkitCore()
        {
-               this(null, null, null, null, false, true, true, null, null, false, false,"");
+               this(null, null, null, null, true, false, true, true, null, null, false, false, "");
        }
 
        /* ActionListener method */
@@ -984,6 +1262,18 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                        {
                                jToolBar.setVisible(jcbmiViewToolbar.isSelected());
                        }
+                       else if(command.equals("toggletoolbarmain"))
+                       {
+                               jToolBarMain.setVisible(jcbmiViewToolbarMain.isSelected());
+                       }
+                       else if(command.equals("toggletoolbarformat"))
+                       {
+                               jToolBarFormat.setVisible(jcbmiViewToolbarFormat.isSelected());
+                       }
+                       else if(command.equals("toggletoolbarstyles"))
+                       {
+                               jToolBarStyles.setVisible(jcbmiViewToolbarStyles.isSelected());
+                       }
                        else if(command.equals("viewsource"))
                        {
                                toggleSourceWindow();
@@ -1030,6 +1320,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                        {
                                insertServerImage();
                        }
+                       else if(command.equals("insertsymbol"))
+                       {
+                               insertSymbol();
+                       }
                        else if(command.equals("insertnbsp"))
                        {
                                insertNonbreakingSpace();
@@ -1123,6 +1417,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                        {
                                SimpleInfoDialog sidAbout = new SimpleInfoDialog(this.getFrame(), Translatrix.getTranslationString("About"), true, Translatrix.getTranslationString("AboutMessage"), SimpleInfoDialog.INFO);
                        }
+                       else if(command.equals("spellcheck"))
+                       {
+                               checkDocumentSpelling(jtpMain.getDocument());
+                       }
                }
                catch(IOException ioe)
                {
@@ -1334,7 +1632,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        {
                if(!exclusiveEdit)
                {
-                       if(jspSource.isShowing())
+                       if(isSourceWindowActive())
                        {
                                if(de.getDocument() instanceof HTMLDocument || de.getDocument() instanceof ExtendedHTMLDocument)
                                {
@@ -1360,6 +1658,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                jtpMain.setDocument(htmlDoc);
                jtpMain.getDocument().addUndoableEditListener(new CustomUndoableEditListener());
                jtpMain.getDocument().addDocumentListener(this);
+               jtpMain.setCaretPosition(0);
                purgeUndos();
                registerDocumentStyles();
        }
@@ -1674,6 +1973,22 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                jtpMain.setCaretPosition(caretPos + 1);
        }
 
+       /** Method for inserting a symbol
+         */
+       private void insertSymbol()
+       throws IOException, BadLocationException, RuntimeException
+       {
+               int caretPos = jtpMain.getCaretPosition();
+               SymbolDialog symbolInput = new SymbolDialog(this, Translatrix.getTranslationString("SymbolDialogTitle"), true);
+               String symbol = symbolInput.getInputText();
+               symbolInput.dispose();
+               if(symbol != null)
+               {
+                       htmlDoc.insertString(caretPos, symbol, jtpMain.getInputAttributes());
+                       jtpMain.setCaretPosition(caretPos + 1);
+               }
+       }
+
        /** Method for inserting a non-breaking space ( )
          */
        private void insertNonbreakingSpace()
@@ -1785,10 +2100,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        private void doSearch(String searchFindTerm, String searchReplaceTerm, boolean bIsFindReplace, boolean bCaseSensitive, boolean bStartAtTop)
        {
                boolean bReplaceAll = false;
-               JTextPane searchPane = jtpMain;
+               JTextComponent searchPane = (JTextComponent)jtpMain;
                if(jspSource.isShowing() || jtpSource.hasFocus())
                {
-                       searchPane = jtpSource;
+                       searchPane = (JTextComponent)jtpSource;
                }
                if(searchFindTerm == null || (bIsFindReplace && searchReplaceTerm == null))
                {
@@ -1844,14 +2159,14 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          */
        private int findText(String findTerm, String replaceTerm, boolean bCaseSenstive, int iOffset)
        {
-               JTextPane jtpFindSource;
-               if(jspSource.isShowing() || jtpSource.hasFocus())
+               JTextComponent jtpFindSource;
+               if(isSourceWindowActive() || jtpSource.hasFocus())
                {
-                       jtpFindSource = jtpSource;
+                       jtpFindSource = (JTextComponent)jtpSource;
                }
                else
                {
-                       jtpFindSource = jtpMain;
+                       jtpFindSource = (JTextComponent)jtpMain;
                }
                int searchPlace = -1;
                try
@@ -1901,10 +2216,11 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        {
                if(whatImage == null)
                {
-                       whatImage = getImageFromChooser(".", extsIMG, Translatrix.getTranslationString("FiletypeIMG"));
+                       whatImage = getImageFromChooser(imageChooserStartDir, extsIMG, Translatrix.getTranslationString("FiletypeIMG"));
                }
                if(whatImage != null)
                {
+                       imageChooserStartDir = whatImage.getParent().toString();
                        int caretPos = jtpMain.getCaretPosition();
                        htmlKit.insertHTML(htmlDoc, caretPos, "<IMG SRC=\"" + whatImage + "\">", 0, 0, HTML.Tag.IMG);
                        jtpMain.setCaretPosition(caretPos + 1);
@@ -1986,6 +2302,10 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                return selectedFile;
        }
 
+       /** Empty spell check method, overwritten by spell checker extension class
+         */
+       public void checkDocumentSpelling(Document doc) { ; }
+
        /** Method for saving text as a complete HTML document
          */
        private void writeOut(HTMLDocument doc, File whatFile)
@@ -2102,6 +2422,34 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                refreshOnUpdate();
        }
 
+       /** Method for loading HTML document
+         */
+       public void loadDocument(File whatFile)
+       throws IOException, BadLocationException
+       {
+               try
+               {
+                       loadDocument(whatFile, null);
+               }
+               catch(ChangedCharSetException ccse)
+               {
+                       String charsetType = ccse.getCharSetSpec().toLowerCase();
+                       int pos = charsetType.indexOf("charset");
+                       if(pos == -1)
+                       {
+                               throw ccse;
+                       }
+                       while(pos < charsetType.length() && charsetType.charAt(pos) != '=')
+                       {
+                               pos++;
+                       }
+                       pos++; // Places file cursor past the equals sign (=)
+                       String whatEncoding = charsetType.substring(pos).trim();
+                       loadDocument(whatFile, whatEncoding);
+               }
+               refreshOnUpdate();
+       }
+
        /** Method for loading HTML document into the app, including document encoding setting
          */
        private void loadDocument(File whatFile, String whatEncoding)
@@ -2109,6 +2457,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
        {
                Reader r = null;
                htmlDoc = (ExtendedHTMLDocument)(htmlKit.createDefaultDocument());
+               htmlDoc.putProperty("com.hexidec.ekit.docsource", whatFile.toString());
                try
                {
                        if(whatEncoding == null)
@@ -2350,7 +2699,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
 
        /** Convenience method for obtaining the Source JTextPane
          */
-       public JTextPane getSourcePane()
+       public JTextArea getSourcePane()
        {
                return jtpSource;
        }
@@ -2396,45 +2745,116 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          */
        public JToolBar getToolBar(boolean isShowing)
        {
-               jcbmiViewToolbar.setState(isShowing);
-               return jToolBar;
+               if(jToolBar != null)
+               {
+                       jcbmiViewToolbar.setState(isShowing);
+                       return jToolBar;
+               }
+               return (JToolBar)null;
        }
 
-       /** Convenience method for obtaining the pre-generated toolbar
+       /** Convenience method for obtaining the pre-generated main toolbar
+         */
+       public JToolBar getToolBarMain(boolean isShowing)
+       {
+               if(jToolBarMain != null)
+               {
+                       jcbmiViewToolbarMain.setState(isShowing);
+                       return jToolBarMain;
+               }
+               return (JToolBar)null;
+       }
+
+       /** Convenience method for obtaining the pre-generated main toolbar
          */
-       public JToolBar getCustomToolBar(Vector vcTools, boolean isShowing)
+       public JToolBar getToolBarFormat(boolean isShowing)
        {
-               jcbmiViewToolbar.setState(isShowing);
-               jToolBar = new JToolBar(JToolBar.HORIZONTAL);
-               jToolBar.setFloatable(false);
+               if(jToolBarFormat != null)
+               {
+                       jcbmiViewToolbarFormat.setState(isShowing);
+                       return jToolBarFormat;
+               }
+               return (JToolBar)null;
+       }
+
+       /** Convenience method for obtaining the pre-generated main toolbar
+         */
+       public JToolBar getToolBarStyles(boolean isShowing)
+       {
+               if(jToolBarStyles != null)
+               {
+                       jcbmiViewToolbarStyles.setState(isShowing);
+                       return jToolBarStyles;
+               }
+               return (JToolBar)null;
+       }
+
+       /** Convenience method for obtaining a custom toolbar
+         */
+       public JToolBar customizeToolBar(int whichToolBar, Vector vcTools, boolean isShowing)
+       {
+               JToolBar jToolBarX = new JToolBar(JToolBar.HORIZONTAL);
+               jToolBarX.setFloatable(false);
+/*
+               jToolBarX.setMargin(new Insets(2, 2, 2, 2));
+               jToolBarX.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
+               jToolBarX.setBorderPainted(true);
+*/
                for(int i = 0; i < vcTools.size(); i++)
                {
                        String toolToAdd = ((String)(vcTools.elementAt(i))).toLowerCase();
                        if(toolToAdd.equals(KEY_TOOL_SEP))
                        {
-                               jToolBar.add(new JToolBar.Separator());
+                               jToolBarX.add(new JToolBar.Separator());
                        }
                        else if(htTools.containsKey(toolToAdd))
                        {
                                if(htTools.get(toolToAdd) instanceof JButtonNoFocus)
                                {
-                                       jToolBar.add((JButtonNoFocus)(htTools.get(toolToAdd)));
+                                       jToolBarX.add((JButtonNoFocus)(htTools.get(toolToAdd)));
                                }
                                else if(htTools.get(toolToAdd) instanceof JToggleButtonNoFocus)
                                {
-                                       jToolBar.add((JToggleButtonNoFocus)(htTools.get(toolToAdd)));
+                                       jToolBarX.add((JToggleButtonNoFocus)(htTools.get(toolToAdd)));
                                }
                                else if(htTools.get(toolToAdd) instanceof JComboBoxNoFocus)
                                {
-                                       jToolBar.add((JComboBoxNoFocus)(htTools.get(toolToAdd)));
+                                       jToolBarX.add((JComboBoxNoFocus)(htTools.get(toolToAdd)));
                                }
                                else
                                {
-                                       jToolBar.add((JComponent)(htTools.get(toolToAdd)));
+                                       jToolBarX.add((JComponent)(htTools.get(toolToAdd)));
                                }
                        }
                }
-               return jToolBar;
+               if(whichToolBar == TOOLBAR_MAIN)
+               {
+                       jToolBarMain = jToolBarX;
+                       jToolBarMain.setVisible(isShowing);
+                       jcbmiViewToolbarMain.setSelected(isShowing);
+                       return jToolBarMain;
+               }
+               else if(whichToolBar == TOOLBAR_FORMAT)
+               {
+                       jToolBarFormat = jToolBarX;
+                       jToolBarFormat.setVisible(isShowing);
+                       jcbmiViewToolbarFormat.setSelected(isShowing);
+                       return jToolBarFormat;
+               }
+               else if(whichToolBar == TOOLBAR_STYLES)
+               {
+                       jToolBarStyles = jToolBarX;
+                       jToolBarStyles.setVisible(isShowing);
+                       jcbmiViewToolbarStyles.setSelected(isShowing);
+                       return jToolBarStyles;
+               }
+               else
+               {
+                       jToolBarMain = jToolBarX;
+                       jToolBarMain.setVisible(isShowing);
+                       jcbmiViewToolbarMain.setSelected(isShowing);
+                       return jToolBarMain;
+               }
        }
 
        /** Convenience method for obtaining the current file handle
@@ -2455,7 +2875,14 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
          */
        public String getDocumentText()
        {
-               return jtpMain.getText();
+               if(isSourceWindowActive())
+               {
+                       return jtpSource.getText();
+               }
+               else
+               {
+                       return jtpMain.getText();
+               }
        }
 
        /** Convenience method for obtaining the document text
@@ -2496,7 +2923,17 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                jtpMain.setText(sText);
                ((HTMLEditorKit)(jtpMain.getEditorKit())).setDefaultCursor(new Cursor(Cursor.TEXT_CURSOR));
                jtpSource.setText(jtpMain.getText());
-               ((HTMLEditorKit)(jtpSource.getEditorKit())).setDefaultCursor(new Cursor(Cursor.TEXT_CURSOR));
+       }
+
+       /** Convenience method for setting the source document
+         */
+       public void setSourceDocument(StyledDocument sDoc)
+       {
+               jtpSource.getDocument().removeDocumentListener(this);
+               jtpSource.setDocument(sDoc);
+               jtpSource.getDocument().addDocumentListener(this);
+               jtpMain.setText(jtpSource.getText());
+               ((HTMLEditorKit)(jtpMain.getEditorKit())).setDefaultCursor(new Cursor(Cursor.TEXT_CURSOR));
        }
 
        /** Convenience method for obtaining the document text
@@ -2551,11 +2988,18 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                e.printStackTrace(System.err);
        }
 
-       /** Convenience method for toggling source window visibility
+       /** Convenience method for determining if the source window is active
+         */
+       private boolean isSourceWindowActive()
+       {
+               return (jspSource == jspltDisplay.getRightComponent());
+       }
+
+       /** Method for toggling source window visibility
          */
        private void toggleSourceWindow()
        {
-               if(!(jspSource.isShowing()))
+               if(!(isSourceWindowActive()))
                {
                        jtpSource.setText(jtpMain.getText());
                        jspltDisplay.setRightComponent(jspSource);
@@ -2569,6 +3013,7 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                                jspltDisplay.setDividerLocation(iSplitPos);
                                jspltDisplay.setEnabled(true);
                        }
+                       jtpSource.requestFocus();
                }
                else
                {
@@ -2578,8 +3023,8 @@ public class EkitCore extends JPanel implements ActionListener, KeyListener, Doc
                        jtpMain.requestFocus();
                }
                this.validate();
-               jcbmiViewSource.setSelected(jspSource.isShowing());
-               jtbtnViewSource.setSelected(jspSource.isShowing());
+               jcbmiViewSource.setSelected(isSourceWindowActive());
+               jtbtnViewSource.setSelected(isSourceWindowActive());
        }
 
        /** Searches the specified element for CLASS attribute setting