Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2016-01-11 13:38:50 -0500
committerGerrit Code Review @ Eclipse.org2016-01-11 21:47:57 -0500
commit082dae21c3417362209c7f038a50cbae999649d0 (patch)
treea67bc72c8fc0bded66e5047ea81444db9345d17e /codan/org.eclipse.cdt.codan.core
parentd310621847669fbbdb4126542e5072e87b4c895d (diff)
downloadorg.eclipse.cdt-082dae21c3417362209c7f038a50cbae999649d0.tar.gz
org.eclipse.cdt-082dae21c3417362209c7f038a50cbae999649d0.tar.xz
org.eclipse.cdt-082dae21c3417362209c7f038a50cbae999649d0.zip
codan - deprecating IProblemProfileChangeListener
deprecated IProblemProfileChangeListener in favor of eclipse preference event listener mechanism Change-Id: Ie89999f3baeed56a4c13f3ba70a92b59213ae43f
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core')
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java23
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfileChangeListener.java10
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfileChangeEvent.java18
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemElement.java5
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java3
5 files changed, 38 insertions, 21 deletions
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 f719cec3c5..e530d834d9 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Alena Laskavaia
+ * Copyright (c) 2009, 2011 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
@@ -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
@@ -25,12 +26,12 @@ import org.eclipse.cdt.codan.internal.core.CheckersRegistry;
* with the same id can exist in the same profile (i.e. two category can have
* same problem listed in both,
* but they both should point to the same problem instance).
- *
+ *
* To obtain read-only profile use method
* {@link CheckersRegistry#getResourceProfile},
* {@link CheckersRegistry#getDefaultProfile()} or
* {@link CheckersRegistry#getWorkspaceProfile()}
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -42,7 +43,7 @@ public interface IProblemProfile extends IProblemElement {
/**
* Find and return problem by id if it contained in this profile
- *
+ *
* @param id
* - problem id
* @return problem instance
@@ -51,7 +52,7 @@ public interface IProblemProfile extends IProblemElement {
/**
* Find and return category by id if it is contained in this profile
- *
+ *
* @param id
* - category id
* @return category instance
@@ -61,30 +62,34 @@ public interface IProblemProfile extends IProblemElement {
/**
* Get all problems defined in this profile (if problem duplicated in a
* category tree, it returns only one instance of each)
- *
+ *
* @return array of problems defined in profile
*/
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
- *
+ *
* @return resource of another object associated with this profile
* @since 2.0
*/
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
index fc9d8de34b..2be6ba1521 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Alena Laskavaia
+ * Copyright (c) 2009, 2011 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
@@ -10,20 +10,24 @@
*******************************************************************************/
package org.eclipse.cdt.codan.core.model;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+
/**
* A listener used to receive changes to problem profile
* <p>
* Clients may implement this interface.
* </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.
* The given event object describes the change details and must not
* be <code>null</code>.
- *
+ *
* @param event the event details
* @see ProblemProfileChangeEvent
* @see IProblemProfile#addProfileChangeListener(IProblemProfileChangeListener)
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfileChangeEvent.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfileChangeEvent.java
index 02b0af7f57..982b00a26f 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfileChangeEvent.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfileChangeEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Alena Laskavaia
+ * Copyright (c) 2009, 2011 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
@@ -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
@@ -35,7 +39,7 @@ public final class ProblemProfileChangeEvent extends EventObject {
/**
* Constructor for a new profile change event. The node and the
* key must not be <code>null</code>.
- *
+ *
* @param profile the profile on which the change occurred
* @param resource the resource for which profile changes occurred
* @param key the preference key
@@ -54,7 +58,7 @@ public final class ProblemProfileChangeEvent extends EventObject {
/**
* Return the resource on which the change occurred.
* Must not be <code>null</code>.
- *
+ *
* @return the node
*/
public Object getResource() {
@@ -71,7 +75,7 @@ public final class ProblemProfileChangeEvent extends EventObject {
/**
* Return the key of the preference which was changed.
* Must not be <code>null</code>.
- *
+ *
* @return the preference key
*/
public String getKey() {
@@ -82,7 +86,7 @@ public final class ProblemProfileChangeEvent extends EventObject {
* Return the new value for the preference encoded as a
* <code>String</code>, or <code>null</code> if the
* preference was removed.
- *
+ *
* @return the new value or <code>null</code>
*/
public Object getNewValue() {
@@ -93,7 +97,7 @@ public final class ProblemProfileChangeEvent extends EventObject {
* Return the old value for the preference encoded as a
* <code>String</code>, or <code>null</code> if the
* preference was removed or if it cannot be determined.
- *
+ *
* @return the old value or <code>null</code>
*/
public Object getOldValue() {
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 749e3f3513..6e7121c9f0 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
@@ -24,7 +24,7 @@ public class CodanProblemElement implements IProblemElement {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblemElement#getProfile()
*/
@Override
@@ -34,7 +34,7 @@ public class CodanProblemElement implements IProblemElement {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.codan.core.model.IProblemElement#getCategory()
*/
@Override
@@ -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);
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 3952b46590..dd8abf70a2 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
@@ -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;

Back to the top