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