1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.support.action.support;
14
15 import java.beans.PropertyChangeListener;
16 import java.beans.PropertyChangeSupport;
17
18 import com.eviware.soapui.model.ModelItem;
19 import com.eviware.soapui.support.action.SoapUIMultiAction;
20
21 /***
22 * Abstract SoapUIAction for extension
23 *
24 * @author ole.matzura
25 */
26
27 public abstract class AbstractSoapUIMultiAction<T extends ModelItem> implements SoapUIMultiAction
28 {
29 private PropertyChangeSupport propertySupport;
30 private String name;
31 private String description;
32 private boolean enabled = true;
33 private String id;
34
35 public AbstractSoapUIMultiAction( String id )
36 {
37 this.id = id;
38 propertySupport = new PropertyChangeSupport( this );
39 }
40
41 public AbstractSoapUIMultiAction( String name, String description )
42 {
43 this( null, name, description );
44 id = getClass().getSimpleName();
45 }
46
47 public AbstractSoapUIMultiAction( String id, String name, String description )
48 {
49 this.id = id;
50 this.name = name;
51 this.description = description;
52
53 propertySupport = new PropertyChangeSupport( this );
54 }
55
56 public String getId()
57 {
58 return id;
59 }
60
61 public String getDescription()
62 {
63 return description;
64 }
65
66 public void setEnabled( boolean enabled )
67 {
68 if( enabled == this.enabled )
69 return;
70
71 boolean oldEnabled = this.enabled;
72 this.enabled = enabled;
73
74 propertySupport.firePropertyChange( ENABLED_PROPERTY, oldEnabled, enabled );
75 }
76
77 public boolean isDefault()
78 {
79 return false;
80 }
81
82 public String getName()
83 {
84 return name;
85 }
86
87 public boolean isEnabled()
88 {
89 return enabled;
90 }
91
92 public void addPropertyChangeListener( String propertyName, PropertyChangeListener listener )
93 {
94 propertySupport.addPropertyChangeListener( propertyName, listener );
95 }
96
97 public void addPropertyChangeListener( PropertyChangeListener listener )
98 {
99 propertySupport.addPropertyChangeListener( listener );
100 }
101
102 public void removePropertyChangeListener( PropertyChangeListener listener )
103 {
104 propertySupport.removePropertyChangeListener( listener );
105 }
106
107 public void removePropertyChangeListener( String propertyName, PropertyChangeListener listener )
108 {
109 propertySupport.removePropertyChangeListener( propertyName, listener );
110 }
111
112 public void perform( ModelItem target, Object param )
113 {
114 }
115 }