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.request.components.editor.support;
14  
15  import java.beans.PropertyChangeListener;
16  import java.beans.PropertyChangeSupport;
17  
18  import com.eviware.soapui.impl.wsdl.panels.request.components.editor.XmlDocument;
19  
20  public abstract class AbstractXmlDocument implements XmlDocument
21  {
22     private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport( this );
23  	
24     public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
25     {
26        propertyChangeSupport.addPropertyChangeListener( propertyName, listener );
27     }
28  
29     public void addPropertyChangeListener(PropertyChangeListener listener)
30     {
31        propertyChangeSupport.addPropertyChangeListener( listener );
32     }
33  
34     public void removePropertyChangeListener(PropertyChangeListener listener)
35     {
36        propertyChangeSupport.removePropertyChangeListener( listener );
37     }
38     
39     public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
40  	{
41     	propertyChangeSupport.removePropertyChangeListener( propertyName, listener );
42  	}
43     
44     protected void fireXmlChanged( String oldValue, String newValue )
45     {
46     	propertyChangeSupport.firePropertyChange( XML_PROPERTY, oldValue, newValue );
47     }
48  }