org.merlotxml.merlot
Class XMLEditor

java.lang.Object
  extended byorg.merlotxml.merlot.XMLEditor
All Implemented Interfaces:
MerlotConstants

public class XMLEditor
extends java.lang.Object
implements MerlotConstants

This is the main class for Merlot. It provides the entry point to the application with the main static method. This starts by loading up the XMLEditorSettings which handles parsing the command line options, and reading in the application properties files. Next, this loads plugins via the PluginManager, and finally it initializes and opens up the main XMLEditorFrame.

XMLEditor is a Singleton class. Use getSharedInstance to get the singleton instance of this class.

Author:
Kelly A. Campbell
See Also:
XMLEditorSettings, PluginManager, XMLEditorFrame

Nested Class Summary
protected  class XMLEditor.DTDChooserFindFileAction
          brings up a file dialog for the user to find a dtd file if they click the "choose" button in the dtd resolver dialog
 class XMLEditor.UserEntityResolver
          custom dtd resolver which allows the user to find the dtd or specify a URL for it
 
Field Summary
protected  ValidDOMLiaison _domLiaison
          Validating DOMLiaison implementation instance
protected  XMLEditorFrame _frame
          The main frame for the application
protected  XMLEditorSettings _settings
          Global application settings
protected static XMLEditor _sharedInstance
          Singleton instance of the XMLEditor application
 
Fields inherited from interface org.merlotxml.merlot.MerlotConstants
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML
 
Constructor Summary
XMLEditor(java.lang.String[] args)
          Construct an XMLEditor based on the given command line args
XMLEditor(java.lang.String[] args, XerlinPanel xpanel)
           
 
Method Summary
 ValidDOMLiaison getDOMLiaison()
          Gets the validating dom liaison implementation for the application
 XMLEditorSettings getSettings()
          Returns the XMLEditorSettings object initialized for this editor instance
static XMLEditor getSharedInstance()
          Get the singleton instance of this class
 XerlinPanel getXerlinPanel()
           
static void main(java.lang.String[] args)
          The main method.
 void run()
          Bring up the frame for the user to start using
 void setXMLEditorFrame()
          Initialise the XMLEditorFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_frame

protected XMLEditorFrame _frame
The main frame for the application


_settings

protected XMLEditorSettings _settings
Global application settings


_sharedInstance

protected static XMLEditor _sharedInstance
Singleton instance of the XMLEditor application


_domLiaison

protected ValidDOMLiaison _domLiaison
Validating DOMLiaison implementation instance

Constructor Detail

XMLEditor

public XMLEditor(java.lang.String[] args)
          throws MerlotException
Construct an XMLEditor based on the given command line args

Parameters:
args - command line args
Throws:
MerlotException - if the plugin manager throws an exception

XMLEditor

public XMLEditor(java.lang.String[] args,
                 XerlinPanel xpanel)
          throws MerlotException
Method Detail

main

public static void main(java.lang.String[] args)
The main method. This is the entry point for the application when called on the command line with java org.merlotxml.merlot.XMLEditor

Parameters:
args - the command line arguments passed to the main method

getSharedInstance

public static XMLEditor getSharedInstance()
Get the singleton instance of this class


getXerlinPanel

public XerlinPanel getXerlinPanel()

setXMLEditorFrame

public void setXMLEditorFrame()
Initialise the XMLEditorFrame


run

public void run()
Bring up the frame for the user to start using


getSettings

public XMLEditorSettings getSettings()
Returns the XMLEditorSettings object initialized for this editor instance


getDOMLiaison

public ValidDOMLiaison getDOMLiaison()
                              throws MerlotException
Gets the validating dom liaison implementation for the application

Returns:
a DOMLiaison instance to use for parsing and writing XML
Throws:
MerlotException - if the dom liaison class specified in the properties file is not an instance of ValidDOMLiaison, or another error occurs while instanciating the DOMLiaison class