View Javadoc

1   /*
2    *  soapUI, copyright (C) 2006 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of the GNU Lesser General Public License as published by the Free Software Foundation; 
6    *  either version 2.1 of the License, or (at your option) any later version.
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.impl.wsdl.panels.support;
14  
15  import java.beans.PropertyChangeListener;
16  import java.beans.PropertyChangeSupport;
17  
18  import org.apache.xmlbeans.SchemaTypeSystem;
19  
20  import com.eviware.soapui.impl.wsdl.panels.request.components.editor.XmlDocument;
21  
22  public class XmlDocumentAdapter implements XmlDocument
23  {
24  	private String xml;
25  	private SchemaTypeSystem typeSystem;
26  	private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );
27  
28  	public SchemaTypeSystem getTypeSystem()
29  	{
30  		return typeSystem;
31  	}
32  
33  	public void setTypeSystem( SchemaTypeSystem typeSystem )
34  	{
35  		this.typeSystem = typeSystem;}
36  	
37  	public String getXml()
38  	{
39  		return xml;
40  	}
41  
42  	public boolean hasTypeSystem()
43  	{
44  		return typeSystem != null;
45  	}
46  
47  	public void setXml(String xml)
48  	{
49  		String oldXml = this.xml;
50  		this.xml = xml;
51  		
52  		propertyChangeSupport.firePropertyChange( XML_PROPERTY, oldXml, xml );
53  	}
54  
55  	public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
56  	{
57  		propertyChangeSupport.addPropertyChangeListener( propertyName, listener );
58  	}
59  
60  	public void addPropertyChangeListener(PropertyChangeListener listener)
61  	{
62  		propertyChangeSupport.addPropertyChangeListener( listener );
63  	}
64  
65  	public void removePropertyChangeListener(PropertyChangeListener listener)
66  	{
67  		propertyChangeSupport.removePropertyChangeListener( listener );
68  	}
69  
70  	public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
71  	{
72  		propertyChangeSupport.removePropertyChangeListener( propertyName, listener );
73  	}
74  
75  }