01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * 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: /**
23: * Adapter for XmlDocument implementations/sources
24: *
25: * @author ole.matzura
26: */
27:
28: public class XmlDocumentAdapter implements XmlDocument {
29: private String xml;
30: private SchemaTypeSystem typeSystem;
31: private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
32: this );
33:
34: public SchemaTypeSystem getTypeSystem() {
35: return typeSystem;
36: }
37:
38: public void setTypeSystem(SchemaTypeSystem typeSystem) {
39: this .typeSystem = typeSystem;
40: }
41:
42: public String getXml() {
43: return xml;
44: }
45:
46: public boolean hasTypeSystem() {
47: return typeSystem != null;
48: }
49:
50: public void setXml(String xml) {
51: String oldXml = this .xml;
52: this .xml = xml;
53:
54: propertyChangeSupport.firePropertyChange(XML_PROPERTY, oldXml,
55: xml);
56: }
57:
58: public void addPropertyChangeListener(String propertyName,
59: PropertyChangeListener listener) {
60: propertyChangeSupport.addPropertyChangeListener(propertyName,
61: listener);
62: }
63:
64: public void addPropertyChangeListener(
65: PropertyChangeListener listener) {
66: propertyChangeSupport.addPropertyChangeListener(listener);
67: }
68:
69: public void removePropertyChangeListener(
70: PropertyChangeListener listener) {
71: propertyChangeSupport.removePropertyChangeListener(listener);
72: }
73:
74: public void removePropertyChangeListener(String propertyName,
75: PropertyChangeListener listener) {
76: propertyChangeSupport.removePropertyChangeListener(
77: propertyName, listener);
78: }
79:
80: public void release() {
81: typeSystem = null;
82: }
83: }
|