Always check PropertyChangeSupport for null
This commit is contained in:
@@ -150,10 +150,12 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
|
||||
}
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -168,16 +168,13 @@ public class BigStringEditor implements PropertyEditor {
|
||||
return m_Panel;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -472,16 +472,14 @@ implements PropertyEditor {
|
||||
public Component getCustomEditor() {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -215,17 +215,13 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -182,17 +182,13 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -199,17 +199,13 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -76,17 +76,13 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -161,17 +161,13 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -491,10 +491,12 @@ public class GenericObjectEditor implements PropertyEditor {
|
||||
m_EditorComponent.m_okBut.setEnabled(false);
|
||||
}
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
/**
|
||||
|
@@ -364,10 +364,12 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
|
||||
/********************************* java.beans.PropertyChangeListener *************************/
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
/** This will wait for the GenericObjectEditor to finish
|
||||
|
@@ -430,10 +430,12 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
|
||||
/********************************* java.beans.PropertyChangeListener *************************/
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
/** This will wait for the GenericObjectEditor to finish
|
||||
|
@@ -397,17 +397,13 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -206,17 +206,13 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
|
@@ -59,10 +59,14 @@ public class MultiLineStringEditor implements PropertyEditor {
|
||||
// This code uses the PropertyChangeSupport class to maintain a list of
|
||||
// listeners interested in the edits we make to the value.
|
||||
protected PropertyChangeSupport listeners = new PropertyChangeSupport(this);
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (listeners == null) listeners = new PropertyChangeSupport(this);
|
||||
listeners.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (listeners == null) listeners = new PropertyChangeSupport(this);
|
||||
listeners.removePropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
|
@@ -105,10 +105,12 @@ public class PropertySelectableList<T> implements java.io.Serializable {
|
||||
// }
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
|
@@ -110,18 +110,14 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
|
||||
m_support.addPropertyChangeListener(this);
|
||||
}
|
||||
|
||||
/** Adds a PropertyChangeListener.
|
||||
* @param l a value of type 'PropertyChangeListener'
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_support!=null) m_support.addPropertyChangeListener(l);
|
||||
if (m_support == null) m_support = new PropertyChangeSupport(this);
|
||||
m_support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/** Removes a PropertyChangeListener.
|
||||
* @param l a value of type 'PropertyChangeListener'
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_support!=null) m_support.removePropertyChangeListener(l);
|
||||
if (m_support == null) m_support = new PropertyChangeSupport(this);
|
||||
m_support.removePropertyChangeListener(l);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -120,16 +120,13 @@ public class StatisticsEditor implements PropertyEditor {
|
||||
return m_Panel;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
}
|
||||
|
@@ -426,10 +426,12 @@ public class PropertyCrossoverMixerEditor extends JPanel implements PropertyEdit
|
||||
/********************************* java.beans.PropertyChangeListener *************************/
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
/** This will wait for the GenericObjectEditor to finish
|
||||
|
@@ -401,10 +401,12 @@ public class PropertyMutationMixerEditor extends JPanel implements PropertyEdito
|
||||
/********************************* java.beans.PropertyChangeListener *************************/
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
/** This will wait for the GenericObjectEditor to finish
|
||||
|
@@ -41,10 +41,12 @@ public abstract class AbstractObjectEditor implements PropertyEditor, java.beans
|
||||
/********************************* java.beans.PropertyChangeListener *************************/
|
||||
|
||||
public void addPropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.addPropertyChangeListener(l);
|
||||
}
|
||||
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) {
|
||||
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
|
||||
m_Support.removePropertyChangeListener(l);
|
||||
}
|
||||
/** This will wait for the GenericObjectEditor to finish
|
||||
|
Reference in New Issue
Block a user