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.selectionview;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.jface.viewers.ISelectionProvider;
16 import org.eclipse.jface.viewers.IStructuredSelection;
17 import org.eclipse.swt.widgets.Composite;
18 import org.eclipse.swt.widgets.Control;
19 import org.simantics.db.management.ISessionContext;
22 * @author Tuukka Lehtonen
24 * @see PropertyTabAdapter
25 * @see PropertyTabContributorImpl
27 public interface IPropertyTab {
30 * Creates the SWT control for this page under the given parent
33 * Clients should not call this method (the workbench calls this method when
34 * it needs to, which may be never).
37 * @param parent the parent control
39 void createControl(Composite parent, ISessionContext context);
42 * Notifies that the container of the tab has been disposed.
45 * Note, this means that any Dispose-listeners attached to SWT controls
46 * created for this tab have been invoked before this already.
49 * Also note that there is no guarantee that
50 * {@link #createControl(Composite, ISessionContext)} has been called before
51 * this method so the control may never have been created.
57 * @return <code>true</code> if this tab has been disposed either through
58 * {@link #dispose()} or internally by the UI toolkit
63 * @return the main UI control created by this tab
68 * Must be invoked from the SWT UI thread.
70 * @param selection the new selection
71 * @param force <code>true</code> to force the resetting of the new input
72 * even if it is the same as the previous one.
74 void setInput(ISessionContext context, ISelection selection, boolean force);
77 * Returns the selection provider for this property tab. It shall provide
78 * the currently active selection for this tab. If the tab does not wish to
79 * provide its selection to external parties, <code>null</code> may be
80 * returned. The selections must be instances of
81 * {@link IStructuredSelection}.
83 * @return structured selection provider or <code>null</code> if no
84 * selection is provided
86 ISelectionProvider getSelectionProvider();
89 * Requests this property tab to transfer UI focus to itself.