1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.utils.datastructures.hints;
\r
15 * IHintTracker is an interface for tracking any hints of a single IHintContext.
\r
18 * The main purpose of this interface is to enable very easy switching of the
\r
19 * tracked hint context. Only a call to the {@link #track(IHintContext)} method
\r
20 * is required. All hint listeners registered into the tracked will
\r
21 * automatically be switched to listen to the new context instead. Hint
\r
22 * listeners can be added or removed while tracking an IHintContext.
\r
26 * Always be sure to {@link #untrack()} any IHintContext that you're tracking
\r
27 * after the tracker is no longer needed. Otherwise you will most likely have
\r
28 * invalid listeners within the tracked IHintContext resulting in erroneous
\r
32 * @author Tuukka Lehtonen
\r
34 public interface IHintTracker extends IHintObservable {
\r
37 * Start tracking the specified IHintContext with all the listeners
\r
38 * registered into this IHintObservable. Tracking of any previous
\r
39 * IHintContext will be discontinued.
\r
41 * @param ctx the new IHintContext to track
\r
43 public void track(IHintContext ctx);
\r
46 * A call to this method should have the same implications as a
\r
47 * <code>track(null)</code> call.
\r