X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.selectionview%2Fsrc%2Forg%2Fsimantics%2Fselectionview%2FIPropertyTab.java;fp=bundles%2Forg.simantics.selectionview%2Fsrc%2Forg%2Fsimantics%2Fselectionview%2FIPropertyTab.java;h=73cdc71a8a0740d1f94b7e2de8fc5856de9d2853;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/IPropertyTab.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/IPropertyTab.java new file mode 100644 index 000000000..73cdc71a8 --- /dev/null +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/IPropertyTab.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.selectionview; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.simantics.db.management.ISessionContext; + +/** + * @author Tuukka Lehtonen + * + * @see PropertyTabAdapter + * @see PropertyTabContributorImpl + */ +public interface IPropertyTab { + + /** + * Creates the SWT control for this page under the given parent + * control. + *

+ * Clients should not call this method (the workbench calls this method when + * it needs to, which may be never). + *

+ * + * @param parent the parent control + */ + void createControl(Composite parent, ISessionContext context); + + /** + * Notifies that the container of the tab has been disposed. + * + *

+ * Note, this means that any Dispose-listeners attached to SWT controls + * created for this tab have been invoked before this already. + *

+ *

+ * Also note that there is no guarantee that + * {@link #createControl(Composite, ISessionContext)} has been called before + * this method so the control may never have been created. + *

+ */ + void dispose(); + + /** + * @return true if this tab has been disposed either through + * {@link #dispose()} or internally by the UI toolkit + */ + boolean isDisposed(); + + /** + * @return the main UI control created by this tab + */ + Control getControl(); + + /** + * Must be invoked from the SWT UI thread. + * + * @param selection the new selection + * @param force true to force the resetting of the new input + * even if it is the same as the previous one. + */ + void setInput(ISessionContext context, ISelection selection, boolean force); + + /** + * Returns the selection provider for this property tab. It shall provide + * the currently active selection for this tab. If the tab does not wish to + * provide its selection to external parties, null may be + * returned. The selections must be instances of + * {@link IStructuredSelection}. + * + * @return structured selection provider or null if no + * selection is provided + */ + ISelectionProvider getSelectionProvider(); + + /** + * Requests this property tab to transfer UI focus to itself. + */ + void requestFocus(); + +} \ No newline at end of file