blob: 982b00a26f1066cb53883ad5c01fe2db2c3554f2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
/*******************************************************************************
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
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
*/
private static final long serialVersionUID = 1L;
private String key;
private Object newValue;
private Object oldValue;
private Object resource;
private IProblemProfile profile;
public static final String PROBLEM_KEY = "problem"; //$NON-NLS-1$
public static final String PROBLEM_PREF_KEY = "problem_params"; //$NON-NLS-1$
/**
* 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
* @param oldValue the old preference value
* @param newValue the new preference value
*/
public ProblemProfileChangeEvent(IProblemProfile profile, Object resource, String key, Object oldValue, Object newValue) {
super(resource);
this.key = key;
this.newValue = newValue;
this.oldValue = oldValue;
this.profile = profile;
this.resource = resource;
}
/**
* Return the resource on which the change occurred.
* Must not be <code>null</code>.
*
* @return the node
*/
public Object getResource() {
return resource;
}
/**
* @return profile
*/
public IProblemProfile getProfile() {
return profile;
}
/**
* Return the key of the preference which was changed.
* Must not be <code>null</code>.
*
* @return the preference key
*/
public String getKey() {
return key;
}
/**
* 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() {
return newValue;
}
/**
* 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() {
return oldValue;
}
}
|