1 /*******************************************************************************
2 * Copyright (c) 2007, 2011 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.db.management;
15 * @see ISessionContextChangedListener
16 * @see SessionContextChangedEvent
17 * @see ISessionContext
19 * @author Tuukka Lehtonen
21 public interface ISessionContextProvider {
24 * Adds a listener for selection changes in this selection provider.
25 * Has no effect if an identical listener is already registered.
27 * @param listener a session context changed listener
29 public void addContextChangedListener(ISessionContextChangedListener listener);
32 * Returns the current selection for this provider.
34 * @return the current session context
36 public ISessionContext getSessionContext();
39 * Removes the given selection change listener from this selection provider.
40 * Has no affect if an identical listener is not registered.
42 * @param listener a session context changed listener
44 public void removeContextChangedListener(ISessionContextChangedListener listener);
47 * Sets the current selection for this selection provider. The operation
48 * must only fire {@link ISessionContextChangedListener}s if the
49 * ISessionContext actually changed in the {@link #equals(Object)} sense.
51 * @param context the new session context
52 * @return the old ISessionContext or <code>null</code> there was no
55 public ISessionContext setSessionContext(ISessionContext context);