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