]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.selectionview/src/org/simantics/selectionview/IPropertyTab.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.selectionview / src / org / simantics / selectionview / IPropertyTab.java
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 (file)
index 0000000..73cdc71
--- /dev/null
@@ -0,0 +1,93 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.selectionview;\r
+\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.ISelectionProvider;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.simantics.db.management.ISessionContext;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ * \r
+ * @see PropertyTabAdapter\r
+ * @see PropertyTabContributorImpl\r
+ */\r
+public interface IPropertyTab {\r
+\r
+    /**\r
+     * Creates the SWT control for this page under the given parent\r
+     * control.\r
+     * <p>\r
+     * Clients should not call this method (the workbench calls this method when\r
+     * it needs to, which may be never).\r
+     * </p>\r
+     *\r
+     * @param parent the parent control\r
+     */\r
+    void createControl(Composite parent, ISessionContext context);\r
+\r
+    /**\r
+     * Notifies that the container of the tab has been disposed.\r
+     * \r
+     * <p>\r
+     * Note, this means that any Dispose-listeners attached to SWT controls\r
+     * created for this tab have been invoked before this already.\r
+     * </p>\r
+     * <p>\r
+     * Also note that there is no guarantee that\r
+     * {@link #createControl(Composite, ISessionContext)} has been called before\r
+     * this method so the control may never have been created.\r
+     * </p>\r
+     */\r
+    void dispose();\r
+\r
+    /**\r
+     * @return <code>true</code> if this tab has been disposed either through\r
+     *         {@link #dispose()} or internally by the UI toolkit\r
+     */\r
+    boolean isDisposed();\r
+\r
+    /**\r
+     * @return the main UI control created by this tab\r
+     */\r
+    Control getControl();\r
+\r
+    /**\r
+     * Must be invoked from the SWT UI thread.\r
+     * \r
+     * @param selection the new selection\r
+     * @param force <code>true</code> to force the resetting of the new input\r
+     *        even if it is the same as the previous one.\r
+     */\r
+    void setInput(ISessionContext context, ISelection selection, boolean force);\r
+\r
+    /**\r
+     * Returns the selection provider for this property tab. It shall provide\r
+     * the currently active selection for this tab. If the tab does not wish to\r
+     * provide its selection to external parties, <code>null</code> may be\r
+     * returned. The selections must be instances of\r
+     * {@link IStructuredSelection}.\r
+     * \r
+     * @return structured selection provider or <code>null</code> if no\r
+     *         selection is provided\r
+     */\r
+    ISelectionProvider getSelectionProvider();\r
+\r
+    /**\r
+     * Requests this property tab to transfer UI focus to itself.\r
+     */\r
+    void requestFocus();\r
+\r
+}
\ No newline at end of file