]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/IVariablesPage.java
Merge remote-tracking branch 'origin/svn' commit 'ccc1271c9d6657fb9dcf4cf3cb115fa0c8c...
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / IVariablesPage.java
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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.browsing.ui.swt;\r
13 \r
14 import java.util.function.Consumer;\r
15 \r
16 import org.eclipse.core.runtime.IAdaptable;\r
17 import org.eclipse.jface.viewers.ISelection;\r
18 import org.eclipse.ui.ISelectionListener;\r
19 import org.eclipse.ui.part.IPage;\r
20 \r
21 /**\r
22  * @author Tuukka Lehtonen\r
23  */\r
24 public interface IVariablesPage extends IPage, ISelectionListener {\r
25 \r
26     void setAdapter(IAdaptable adapter);\r
27 \r
28     /**\r
29      * @return current selection or <code>null</code> if no selection is\r
30      *         available\r
31      */\r
32     ISelection getSelection();\r
33 \r
34     /**\r
35      * @param forSelection the new selection for calculating the new part name\r
36      * @param updateCallback a callback that <em>can be</em> invoked by\r
37      *        getPartName if it wishes to change the part name. If the page does\r
38      *        not wish to change the part name, it does not have to invoke the\r
39      *        updateCallback. A <code>null</code> value indicates that the part\r
40      *        name should be returned to its default value.\r
41      */\r
42     void updatePartName(ISelection forSelection, Consumer<String> updateCallback);\r
43 \r
44 }\r