Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0245dbcc62bc312902a95c46d54b3711ecd69341 (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
/*******************************************************************************
 * Copyright (c) 2008, 2010 Nokia and others.
 * 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:
 * Nokia - Initial API and implementation
 *******************************************************************************/

package org.eclipse.cdt.debug.core.executables;

import java.util.EventListener;
import java.util.List;

/**
 * Listener interface for finding out when the list of Executable objects in the
 * workspace changes or when the objects themselves change.
 * 
 * <p>
 * Executable objects are ephemeral representations of Eclipse workspace model
 * elements. A particular executable in the workspace is typically represented
 * by many Executable objects. For example, an executable in the workspace that
 * changes twice can cause the listener's {@link #executablesChanged(List)} to
 * be called with a different Executable instance each of the two times it's invoked.
 * 
 */
public interface IExecutablesChangeListener extends EventListener {

	/**
	 * Called whenever the list of executables in the workspace changes. Many
	 * types of operations cause the list to change, for example:
	 * <ul>
	 * <li>project is built for the first time
	 * <li>project with executables already in place is open, closed, removed or
	 * cleaned
	 * <li>user deletes one or more executables
	 * </ul>
	 * 
	 * Clients can get the list by calling {@link ExecutablesManager#getExecutables()}
	 * 
	 * @since 7.0
	 */
	public void executablesListChanged();

	/**
	 * Called whenever one or more executables have changed, e.g. when a project
	 * is rebuilt. This is sometimes also called if the executable has not
	 * changed (i.e., the file on disk) but the information the Executable
	 * object provides has changed. One such case is when there's a change in
	 * the source locators, as such locators guide the Executable in finding the
	 * local path for the compile path.
	 * 
	 * <p>
	 * The Executable instances in the given list have had their caches flushed
	 * by ExecutableManager. Clients that keep references to Executable objects
	 * must keep in mind that those particular instances may no longer be
	 * managed by ExecutableManager and as such it is the client's
	 * responsibility to tell those instances to flush when this listener method
	 * is called. E.g.,
	 * 
	 * <p><pre>
	 * public void executablesChanged(List<Executable> executables) {
	 *    for (Executable e : executables) {
	 *       if (e.equals(fExecutable) {
	 *          fExecutable.setRefreshSourceFiles(true);
	 *       }
	 *    }
	 * }
	 * </pre>
	 * 
	 * <p>
	 * This is not called when an executable is added or removed
	 * 
	 * @param executables
	 * @since 7.0
	 */
	public void executablesChanged(List<Executable> executables);
}

Back to the top