Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 56b7cb695eaf5a66619826e268f580112e499b77 (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
/*******************************************************************************
 * 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.cdt.codan.internal.core.CheckersRegistry;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

/**
 * Problem Profile contains tree of categories and problems. For the user
 * the profile is quick way to switch between problem sets depending on the
 * task he is doing (i.e. find real bugs, vs doing code style report)
 * User can set different profiles for different projects.
 * Profiles can have different categories and different problem sets,
 * problems with the same id can have different severities/enablement in
 * different profiles.
 * Category tree can have few reference to a same problem, but only instance of
 * Problem
 * 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.
 */
public interface IProblemProfile extends IProblemElement {
	/**
	 * @return root category in profile
	 */
	IProblemCategory getRoot();

	/**
	 * Find and return problem by id if it contained in this profile
	 *
	 * @param id
	 *        - problem id
	 * @return problem instance
	 */
	IProblem findProblem(String id);

	/**
	 * Find and return category by id if it is contained in this profile
	 *
	 * @param id
	 *        - category id
	 * @return category instance
	 */
	IProblemCategory findCategory(String id);

	/**
	 * 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
	 */
	public Object getResource();
}

Back to the top