View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.support.editor.xml.support;
14  
15  import java.beans.PropertyChangeListener;
16  import java.beans.PropertyChangeSupport;
17  
18  import org.apache.xmlbeans.SchemaTypeSystem;
19  import org.apache.xmlbeans.XmlBeans;
20  
21  import com.eviware.soapui.support.editor.xml.XmlDocument;
22  
23  /***
24   * Abstract base-class for XmlDocument implementations
25   * 
26   * @author ole.matzura
27   */
28  
29  public abstract class AbstractXmlDocument implements XmlDocument
30  {
31     private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );
32  	
33     public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
34     {
35        propertyChangeSupport.addPropertyChangeListener( propertyName, listener );
36     }
37  
38     public void addPropertyChangeListener(PropertyChangeListener listener)
39     {
40        propertyChangeSupport.addPropertyChangeListener( listener );
41     }
42  
43     public void removePropertyChangeListener(PropertyChangeListener listener)
44     {
45        propertyChangeSupport.removePropertyChangeListener( listener );
46     }
47     
48     public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
49  	{
50     	propertyChangeSupport.removePropertyChangeListener( propertyName, listener );
51  	}
52     
53     protected void fireXmlChanged( String oldValue, String newValue )
54     {
55     	propertyChangeSupport.firePropertyChange( XML_PROPERTY, oldValue, newValue );
56     }
57     
58  	public void release()
59  	{
60  	}
61  
62  	public SchemaTypeSystem getTypeSystem()
63  	{
64  		return XmlBeans.getBuiltinTypeSystem();
65  	}
66  }