diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java index 56b7cb695ea..dc758469963 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java @@ -11,7 +11,6 @@ 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 @@ -67,26 +66,6 @@ public interface IProblemProfile extends IProblemElement { */ IProblem[] getProblems(); - /** - * Add a listener for profile changes - * - * @param listener - * @since 2.0 - * @deprecated use {@link IEclipsePreferences} listener instead. - */ - @Deprecated - public void addProfileChangeListener(IProblemProfileChangeListener listener); - - /** - * Remove a lister for profile changes - * - * @param listener - * @since 2.0 - * @deprecated use {@link IEclipsePreferences} listener instead. - */ - @Deprecated - public void removeProfileChangeListener(IProblemProfileChangeListener listener); - /** * Get an object associated with profile, usually the resource * diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfileChangeListener.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfileChangeListener.java deleted file mode 100644 index 9f406dec08d..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfileChangeListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 Alena Laskavaia - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Alena Laskavaia - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.core.model; - -import org.eclipse.core.runtime.preferences.IEclipsePreferences; - -/** - * A listener used to receive changes to problem profile - *
- * Clients may implement this interface. - *
- * - * @since 2.0 - * @deprecated This interface is deprecated, use {@link IEclipsePreferences} listener instead. - */ -@Deprecated -public interface IProblemProfileChangeListener { - /** - * Notification that a profile value has changed. - * The given event object describes the change details and must not - * benull
.
- *
- * @param event the event details
- * @see ProblemProfileChangeEvent
- * @see IProblemProfile#addProfileChangeListener(IProblemProfileChangeListener)
- * @see IProblemProfile#removeProfileChangeListener(IProblemProfileChangeListener)
- */
- public void profileChange(ProblemProfileChangeEvent event);
-}
\ No newline at end of file
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java
index a00d1a373e5..ddb976e29dc 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java
@@ -14,7 +14,6 @@ import org.eclipse.cdt.codan.core.model.CodanSeverity;
import org.eclipse.cdt.codan.core.model.IProblemMultiple;
import org.eclipse.cdt.codan.core.model.IProblemReporter;
import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy;
-import org.eclipse.cdt.codan.core.model.ProblemProfileChangeEvent;
import org.eclipse.cdt.codan.core.param.IProblemPreference;
import org.eclipse.cdt.codan.internal.core.CheckersRegistry;
@@ -84,19 +83,17 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
throw new NullPointerException();
checkSet();
this.severity = sev;
- notifyChanged(ProblemProfileChangeEvent.PROBLEM_KEY);
}
@Override
public void setEnabled(boolean checked) {
checkSet();
this.enabled = checked;
- notifyChanged(ProblemProfileChangeEvent.PROBLEM_KEY);
}
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#clone()
*/
@Override
@@ -114,7 +111,6 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
if (value == null)
throw new NullPointerException();
rootPreference = value;
- notifyChanged(ProblemProfileChangeEvent.PROBLEM_PREF_KEY);
}
@Override
@@ -124,7 +120,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblem#getMessagePattern()
*/
@Override
@@ -144,7 +140,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblem#getDescription()
*/
@Override
@@ -154,7 +150,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.codan.core.model.IProblemWorkingCopy#setDescription(java
* .lang.String)
@@ -167,7 +163,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblem#getMarkerType()
*/
@Override
@@ -177,7 +173,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/**
* Sets the marker id for the problem.
- *
+ *
* @param markerType
*/
public void setMarkerType(String markerType) {
@@ -187,7 +183,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblemMultiple#isMultiple()
*/
@Override
@@ -197,7 +193,7 @@ public class CodanProblem extends CodanProblemElement implements IProblemWorking
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblemMultiple#isOriginal()
*/
@Override
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemElement.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemElement.java
index d0b0cf165a9..f43a81dcf79 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemElement.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemElement.java
@@ -86,14 +86,4 @@ public class CodanProblemElement implements IProblemElement {
protected boolean isFrozen() {
return frozen;
}
-
- /**
- * @param problemKey
- */
- @Deprecated
- protected void notifyChanged(String key) {
- if (getProfile() instanceof ProblemProfile) {
- ((ProblemProfile) getProfile()).fireProfileChangeEvent(key, null, this);
- }
- }
}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java
index 21e533e5fcb..d7b609a5d8d 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java
@@ -16,11 +16,6 @@ import java.util.Collection;
import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.model.IProblemCategory;
import org.eclipse.cdt.codan.core.model.IProblemProfile;
-import org.eclipse.cdt.codan.core.model.IProblemProfileChangeListener;
-import org.eclipse.cdt.codan.core.model.ProblemProfileChangeEvent;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
/**
* @author Alena
@@ -28,7 +23,6 @@ import org.eclipse.core.runtime.SafeRunner;
public class ProblemProfile implements IProblemProfile, Cloneable {
private CodanProblemCategory rootCategory;
private Object resource;
- private ListenerList preferenceChangeListeners;
/**
* @param resource
@@ -108,51 +102,6 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
return getRoot();
}
- @Override
- @Deprecated
- public void addProfileChangeListener(IProblemProfileChangeListener listener) {
- if (preferenceChangeListeners == null)
- preferenceChangeListeners = new ListenerList();
- preferenceChangeListeners.add(listener);
- }
-
- @Override
- @Deprecated
- public void removeProfileChangeListener(IProblemProfileChangeListener listener) {
- if (preferenceChangeListeners == null)
- return;
- preferenceChangeListeners.remove(listener);
- if (preferenceChangeListeners.isEmpty())
- preferenceChangeListeners = null;
- }
-
- /**
- * Convenience method for notifying preference change listeners.
- */
- @Deprecated
- protected void fireProfileChangeEvent(String key, Object oldValue, Object newValue) {
- if (preferenceChangeListeners == null)
- return;
- Object[] listeners = preferenceChangeListeners.getListeners();
- final ProblemProfileChangeEvent event =
- new ProblemProfileChangeEvent(this, this.resource, key, oldValue, newValue);
- for (int i = 0; i < listeners.length; i++) {
- final IProblemProfileChangeListener listener = (IProblemProfileChangeListener) listeners[i];
- ISafeRunnable job = new ISafeRunnable() {
- @Override
- public void handleException(Throwable exception) {
- // already logged in Platform#run()
- }
-
- @Override
- public void run() throws Exception {
- listener.profileChange(event);
- }
- };
- SafeRunner.run(job);
- }
- }
-
@Override
public Object getResource() {
return resource;