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