1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

codan - deprecating IProblemProfileChangeListener

deprecated IProblemProfileChangeListener in favor of eclipse preference
event listener mechanism

Change-Id: Ie89999f3baeed56a4c13f3ba70a92b59213ae43f
This commit is contained in:
Alena Laskavaia 2016-01-11 13:38:50 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent d310621847
commit 082dae21c3
5 changed files with 38 additions and 21 deletions

View file

@ -11,6 +11,7 @@
package org.eclipse.cdt.codan.core.model;
import org.eclipse.cdt.codan.internal.core.CheckersRegistry;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
/**
* Problem Profile contains tree of categories and problems. For the user
@ -71,7 +72,9 @@ public interface IProblemProfile extends IProblemElement {
*
* @param listener
* @since 2.0
* @deprecated use {@link IEclipsePreferences} listener instead.
*/
@Deprecated
public void addProfileChangeListener(IProblemProfileChangeListener listener);
/**
@ -79,7 +82,9 @@ public interface IProblemProfile extends IProblemElement {
*
* @param listener
* @since 2.0
* @deprecated use {@link IEclipsePreferences} listener instead.
*/
@Deprecated
public void removeProfileChangeListener(IProblemProfileChangeListener listener);
/**

View file

@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.cdt.codan.core.model;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
/**
* A listener used to receive changes to problem profile
* <p>
@ -17,7 +19,9 @@ package org.eclipse.cdt.codan.core.model;
* </p>
*
* @since 2.0
* @deprecated This interface is deprecated, use {@link IEclipsePreferences} listener instead.
*/
@Deprecated
public interface IProblemProfileChangeListener {
/**
* Notification that a profile value has changed.

View file

@ -12,13 +12,17 @@ package org.eclipse.cdt.codan.core.model;
import java.util.EventObject;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
/**
* An event object describing the details of a change to a preference
* in the preference store.
*
* @noextend This class is not intended to be extended by clients.
* @since 2.0
* @deprecated use {@link IEclipsePreferences} change listener event instead.
*/
@Deprecated
public final class ProblemProfileChangeEvent extends EventObject {
/**
* All serializable objects should have a stable serialVersionUID

View file

@ -90,6 +90,7 @@ public class CodanProblemElement implements IProblemElement {
/**
* @param problemKey
*/
@Deprecated
protected void notifyChanged(String key) {
if (getProfile() instanceof ProblemProfile) {
((ProblemProfile) getProfile()).fireProfileChangeEvent(key, null, this);

View file

@ -109,6 +109,7 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
}
@Override
@Deprecated
public void addProfileChangeListener(IProblemProfileChangeListener listener) {
if (preferenceChangeListeners == null)
preferenceChangeListeners = new ListenerList();
@ -116,6 +117,7 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
}
@Override
@Deprecated
public void removeProfileChangeListener(IProblemProfileChangeListener listener) {
if (preferenceChangeListeners == null)
return;
@ -127,6 +129,7 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
/**
* Convenience method for notifying preference change listeners.
*/
@Deprecated
protected void fireProfileChangeEvent(String key, Object oldValue, Object newValue) {
if (preferenceChangeListeners == null)
return;