com.japisoft.xmlappkit
Class XMLAppContainer

java.lang.Object
  extended bycom.japisoft.xmlappkit.XMLAppContainer

public class XMLAppContainer
extends java.lang.Object

Here the main component for managing XML with one or several XML Editors. Call getXMLContext for loading/saving an XML document. For adding a new editor, use the XMLEditorsModel calling the getXMLEditorsModel. Ex :

JFrame fr = new JFrame();
	XMLAppContainer container = XMLAppContainer.getInstance();

	// Add the view of the XMLAppContainer
	fr.getContentPane().add( container.getView() );
	// Add this new editor
	container.getXMLEditorsModel().addXMLEditor( 
	  new Group1Editor()
	);;
 

Look at the XMLEditor interface or the AbstractXMLEditor for commodity.

Version:
1.0
Author:
(c) 2004 JAPISoft / http://www.japisoft.com
See Also:
XMLEditor

Method Summary
 XMLEditor getInitialXMLEditor()
           
static XMLAppContainer getInstance()
           
 javax.swing.JComponent getView()
           
 com.japisoft.xmlpad.XMLContainer getXMLContainerForSource()
           
 XMLContext getXMLContext()
           
 XMLEditorsModel getXMLEditorsModel()
           
 XMLEditorsView getXMLEditorsView()
           
 SourceXMLEditor getXMLSourceEditor()
           
 boolean isAutoFormat()
           
static void main(java.lang.String[] args)
           
 void setAutoFormat(boolean autoFormat)
          This property will format automatically the source after each editor changes By default true
 void setInitialXMLEditor(XMLEditor editor)
          Select this editor as the default active editor
 void setXMLEditorsModel(XMLEditorsModel model)
          Reset the model containing all available XML Editors
 void setXMLEditorsView(XMLEditorsView view)
          Update the view containing all XML Editors.
 void synchronizeCurrentXMLEditor()
          Synchronized the source with the current XML editor changes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static XMLAppContainer getInstance()
Returns:
a common instance of this container

getView

public javax.swing.JComponent getView()
Returns:
a view of this container. This is what you must add in your interface

getXMLEditorsModel

public XMLEditorsModel getXMLEditorsModel()
Returns:
a model managing available editors. This value can't be null

setXMLEditorsModel

public void setXMLEditorsModel(XMLEditorsModel model)
Reset the model containing all available XML Editors


getXMLContext

public XMLContext getXMLContext()
Returns:
a context for loading / saving the current XML document

setAutoFormat

public void setAutoFormat(boolean autoFormat)
This property will format automatically the source after each editor changes By default true


isAutoFormat

public boolean isAutoFormat()
Returns:
true if the source is formatted after each editing changes

setInitialXMLEditor

public void setInitialXMLEditor(XMLEditor editor)
Select this editor as the default active editor


getInitialXMLEditor

public XMLEditor getInitialXMLEditor()
Returns:
the default active editor

setXMLEditorsView

public void setXMLEditorsView(XMLEditorsView view)
Update the view containing all XML Editors. If this method is not called, this is the getDefaultXMLEditorsView that gives the default view


getXMLEditorsView

public XMLEditorsView getXMLEditorsView()
Returns:
the current XMLEditors view, if the method setXMLEditorsView has not been called before, it will return the default one calling the getDefaultXMLEditorsView

getXMLSourceEditor

public SourceXMLEditor getXMLSourceEditor()
Returns:
the main source editor. This instance must be always the same !

getXMLContainerForSource

public com.japisoft.xmlpad.XMLContainer getXMLContainerForSource()
Returns:
the JXMLPad container for the source part

synchronizeCurrentXMLEditor

public void synchronizeCurrentXMLEditor()
Synchronized the source with the current XML editor changes. This method must be called once by editing. It may be useful when you want to save the current editing changes


main

public static void main(java.lang.String[] args)