]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.management/src/org/simantics/db/management/ISessionContextProvider.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.management / src / org / simantics / db / management / ISessionContextProvider.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2011 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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.management;\r
13 \r
14 /**\r
15  * @see ISessionContextChangedListener\r
16  * @see SessionContextChangedEvent\r
17  * @see ISessionContext\r
18  * \r
19  * @author Tuukka Lehtonen\r
20  */\r
21 public interface ISessionContextProvider {\r
22 \r
23     /**\r
24      * Adds a listener for selection changes in this selection provider.\r
25      * Has no effect if an identical listener is already registered.\r
26      *\r
27      * @param listener a session context changed listener\r
28      */\r
29     public void addContextChangedListener(ISessionContextChangedListener listener);\r
30 \r
31     /**\r
32      * Returns the current selection for this provider.\r
33      * \r
34      * @return the current session context\r
35      */\r
36     public ISessionContext getSessionContext();\r
37 \r
38     /**\r
39      * Removes the given selection change listener from this selection provider.\r
40      * Has no affect if an identical listener is not registered.\r
41      *\r
42      * @param listener a session context changed listener\r
43      */\r
44     public void removeContextChangedListener(ISessionContextChangedListener listener);\r
45 \r
46     /**\r
47      * Sets the current selection for this selection provider. The operation\r
48      * must only fire {@link ISessionContextChangedListener}s if the\r
49      * ISessionContext actually changed in the {@link #equals(Object)} sense.\r
50      * \r
51      * @param context the new session context\r
52      * @return the old ISessionContext or <code>null</code> there was no\r
53      *         previous context\r
54      */\r
55     public ISessionContext setSessionContext(ISessionContext context);\r
56 \r
57 }\r