1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.panels.request.components.editor.inspectors;
14
15 import java.beans.PropertyChangeListener;
16 import java.beans.PropertyChangeSupport;
17
18 import com.eviware.soapui.impl.wsdl.panels.request.components.editor.XmlEditor;
19 import com.eviware.soapui.impl.wsdl.panels.request.components.editor.XmlInspector;
20
21 /***
22 * Abstract base-class to be extended by XmlInspectors
23 *
24 * @author ole.matzura
25 */
26
27 public abstract class AbstractXmlInspector implements XmlInspector
28 {
29 private final PropertyChangeSupport propertySupport;
30 private String title;
31 private String description;
32 private boolean enabled;
33 private XmlEditor editor;
34
35 protected AbstractXmlInspector( String title, String description, boolean enabled )
36 {
37 this.title = title;
38 this.description = description;
39 this.enabled = enabled;
40
41 propertySupport = new PropertyChangeSupport( this );
42 }
43
44 public void addPropertyChangeListener( PropertyChangeListener listener )
45 {
46 propertySupport.addPropertyChangeListener( listener );
47 }
48
49 public void removePropertyChangeListener( PropertyChangeListener listener )
50 {
51 propertySupport.removePropertyChangeListener( listener );
52 }
53
54 public String getDescription()
55 {
56 return description;
57 }
58
59 public String getTitle()
60 {
61 return title;
62 }
63
64 public void setDescription( String description )
65 {
66 String oldDescription = this.description;
67 this.description = description;
68 propertySupport.firePropertyChange( DESCRIPTION_PROPERTY, oldDescription, description );
69 }
70
71 public void setTitle( String title )
72 {
73 String oldTitle = this.title;
74 this.title = title;
75 propertySupport.firePropertyChange( TITLE_PROPERTY, oldTitle, title );
76 }
77
78 public boolean isEnabled()
79 {
80 return enabled;
81 }
82
83 public void setEnabled( boolean enabled )
84 {
85 boolean oldEnabled = this.enabled;
86 this.enabled = enabled;
87 propertySupport.firePropertyChange( ENABLED_PROPERTY, oldEnabled, enabled );
88 }
89
90 public void init( XmlEditor editor )
91 {
92 this.editor = editor;
93 }
94
95 public XmlEditor getEditor()
96 {
97 return editor;
98 }
99
100 public void release()
101 {
102 }
103 }