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.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: private final PropertyChangeSupport propertySupport;
29: private String title;
30: private String description;
31: private boolean enabled;
32: private XmlEditor editor;
33:
34: protected AbstractXmlInspector(String title, String description,
35: boolean enabled) {
36: this .title = title;
37: this .description = description;
38: this .enabled = enabled;
39:
40: propertySupport = new PropertyChangeSupport(this );
41: }
42:
43: public void addPropertyChangeListener(
44: PropertyChangeListener listener) {
45: propertySupport.addPropertyChangeListener(listener);
46: }
47:
48: public void removePropertyChangeListener(
49: PropertyChangeListener listener) {
50: propertySupport.removePropertyChangeListener(listener);
51: }
52:
53: public String getDescription() {
54: return description;
55: }
56:
57: public String getTitle() {
58: return title;
59: }
60:
61: public void setDescription(String description) {
62: String oldDescription = this .description;
63: this .description = description;
64: propertySupport.firePropertyChange(DESCRIPTION_PROPERTY,
65: oldDescription, description);
66: }
67:
68: public void setTitle(String title) {
69: String oldTitle = this .title;
70: this .title = title;
71: propertySupport.firePropertyChange(TITLE_PROPERTY, oldTitle,
72: title);
73: }
74:
75: public boolean isEnabled() {
76: return enabled;
77: }
78:
79: public void setEnabled(boolean enabled) {
80: boolean oldEnabled = this .enabled;
81: this .enabled = enabled;
82: propertySupport.firePropertyChange(ENABLED_PROPERTY,
83: oldEnabled, enabled);
84: }
85:
86: public void init(XmlEditor editor) {
87: this .editor = editor;
88: }
89:
90: public XmlEditor getEditor() {
91: return editor;
92: }
93:
94: public void release() {
95: }
96: }
|