Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Bégaudeau2016-10-12 07:53:23 +0000
committerStéphane Bégaudeau2016-10-12 08:06:17 +0000
commite7103532d3a5f2bc3bf6b109aa7c5705548452c9 (patch)
treed19701ffd2c26c152f2391e069502d2c18c957b9
parent3378fa3fa93c006b15d5da03080ead4480afaeca (diff)
downloadorg.eclipse.eef-e7103532d3a5f2bc3bf6b109aa7c5705548452c9.tar.gz
org.eclipse.eef-e7103532d3a5f2bc3bf6b109aa7c5705548452c9.tar.xz
org.eclipse.eef-e7103532d3a5f2bc3bf6b109aa7c5705548452c9.zip
[505757] Add documentation for the new extension points
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=505757 Change-Id: Ib01096abc915997b17d83cc3696f79312045647e Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
-rw-r--r--doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.html86
-rw-r--r--doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.textile89
2 files changed, 174 insertions, 1 deletions
diff --git a/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.html b/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.html
index f20e80d35..52d94e975 100644
--- a/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.html
+++ b/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.html
@@ -173,5 +173,91 @@ public class SampleTabDescriptorProvider implements IEEFTabDescriptorProvider {
<li>org.eclipse.ui.workbench</li>
<li>org.eclipse.jface</li>
</ul>
+ <h3 id="eeftabdescriptorfilter">IEEFTabDescriptorFilter</h3>
+ <p>This extension point allows to filter tabs contributed to the EEF tabbed property sheet page by implementing org.eclipse.eef.properties.ui.api.IEEFTabDescriptorFilter.</p>
+ <pre><code>&lt;extension
+ point="org.eclipse.eef.properties.ui.eefTabDescriptorFilter"&gt;
+ &lt;descriptor
+ class="org.eclipse.eef.sample.internal.extensions.SampleTabDescriptorFilter"
+ description="Provides EEF Tab filter"
+ id="org.eclipse.eef.sample.eefTabDescriptorFilter"
+ label="EEF Sample Tab Descriptor Filter"&gt;
+ &lt;/descriptor&gt;
+&lt;/extension&gt;
+</code></pre>
+ <p>Example of IEEFTabDescriptorFilter contribution. In this example, we are providing a contribution used to filter legacy tabs to the Properties view created by EEF.</p>
+ <pre><code>import org.eclipse.eef.properties.ui.api.IEEFTabDescriptor;
+import org.eclipse.eef.properties.ui.api.IEEFTabDescriptorFilter;
+
+public class SampleTabDescriptorFilter implements IEEFTabDescriptorFilter {
+
+ @Override
+ public boolean filter(IEEFTabDescriptor tabDescriptor) {
+ // Write here a useful condition
+ return false;
+ }
+
+}
+</code></pre>
+ <p>This example requires at least the following dependencies:</p>
+ <ul>
+ <li>org.eclipse.eef.common</li>
+ <li>org.eclipse.eef.properties.ui</li>
+ </ul>
+ <h3 id="eefextreferenceviewerfilterprovider">IEEFExtReferenceViewerFilterProvider</h3>
+ <p>This extension point allows the contribution of an org.eclipse.eef.ide.ui.ext.widgets.reference.api.IEEFExtReferenceViewerFilterProvider which can be used to filter the content of the tree viewers used to display the objects that can be selected and where an object can be created using the reference widget.</p>
+ <pre><code>&lt;extension
+ point="org.eclipse.eef.ide.ui.ext.widgets.reference.eefExtReferenceViewerFilterProvider"&gt;
+ &lt;descriptor
+ class="org.eclipse.sirius.ui.properties.ext.widgets.reference.internal.EEFExtReferenceViewerFilterProvider"
+ description="%viewerFilterProvider.Description"
+ id="org.eclipse.sirius.ui.properties.ext.widgets.reference.viewerFilterProvider"
+ label="%viewerFilterProvider.Label"&gt;
+ &lt;/descriptor&gt;
+&lt;/extension&gt;
+</code></pre>
+ <p>Example of the contribution of a viewer filter provider. This contribution will let a plugin filter the content displayed in the tree viewers used to show where a new value can be created and which value can be selected for a reference. Eclipse Sirius provides the following basic implementation which is used to filter everything not contained in a semantic resource:</p>
+ <pre><code>import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.eef.ide.ui.ext.widgets.reference.api.IEEFExtReferenceViewerFilterProvider;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.sirius.business.api.session.Session;
+import org.eclipse.sirius.business.api.session.SessionManager;
+
+
+public class EEFExtReferenceViewerFilterProvider implements IEEFExtReferenceViewerFilterProvider {
+
+ @Override
+ public List&lt;ViewerFilter&gt; getViewerFilters(ContextKind contextKind) {
+ List&lt;ViewerFilter&gt; viewerFilters = new ArrayList&lt;&gt;();
+
+ ViewerFilter viewFilter = new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ // Used to filter aird, odesign, etc
+ if (element instanceof Resource) {
+ Session session = SessionManager.INSTANCE.getSession((Resource) element);
+ return session != null;
+ }
+ return true;
+ }
+ };
+
+ viewerFilters.add(viewFilter);
+ return viewerFilters;
+ }
+
+}
+</code></pre>
+ <p>This example requires at least the following dependencies:</p>
+ <ul>
+ <li>org.eclipse.eef.ide.ui.ext.widgets.reference</li>
+ <li>org.eclipse.emf.ecore</li>
+ <li>org.eclipse.jface.viewers</li>
+ <li>org.eclipse.sirius</li>
+ </ul>
</body>
</html> \ No newline at end of file
diff --git a/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.textile b/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.textile
index 9734b8e01..18bd8bd30 100644
--- a/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.textile
+++ b/doc/org.eclipse.eef.documentation/pages/developerguide/extensionpoints.textile
@@ -157,4 +157,91 @@ p. This example requires at least the following dependencies:
* org.eclipse.eef.ide.ui.properties
* org.eclipse.eef.properties.ui
* org.eclipse.ui.workbench
-* org.eclipse.jface \ No newline at end of file
+* org.eclipse.jface
+
+
+h3(#eeftabdescriptorfilter). IEEFTabDescriptorFilter
+
+This extension point allows to filter tabs contributed to the EEF tabbed property sheet page by implementing org.eclipse.eef.properties.ui.api.IEEFTabDescriptorFilter.
+
+bc.. <extension
+ point="org.eclipse.eef.properties.ui.eefTabDescriptorFilter">
+ <descriptor
+ class="org.eclipse.eef.sample.internal.extensions.SampleTabDescriptorFilter"
+ description="Provides EEF Tab filter"
+ id="org.eclipse.eef.sample.eefTabDescriptorFilter"
+ label="EEF Sample Tab Descriptor Filter">
+ </descriptor>
+</extension>
+p. Example of IEEFTabDescriptorFilter contribution. In this example, we are providing a contribution used to filter legacy tabs to the Properties view created by EEF.
+
+bc.. import org.eclipse.eef.properties.ui.api.IEEFTabDescriptor;
+import org.eclipse.eef.properties.ui.api.IEEFTabDescriptorFilter;
+
+public class SampleTabDescriptorFilter implements IEEFTabDescriptorFilter {
+
+ @Override
+ public boolean filter(IEEFTabDescriptor tabDescriptor) {
+ // Write here a useful condition
+ return false;
+ }
+
+}
+p. This example requires at least the following dependencies:
+* org.eclipse.eef.common
+* org.eclipse.eef.properties.ui
+
+h3(#eefextreferenceviewerfilterprovider). IEEFExtReferenceViewerFilterProvider
+
+This extension point allows the contribution of an org.eclipse.eef.ide.ui.ext.widgets.reference.api.IEEFExtReferenceViewerFilterProvider which can be used to filter the content of the tree viewers used to display the objects that can be selected and where an object can be created using the reference widget.
+
+bc.. <extension
+ point="org.eclipse.eef.ide.ui.ext.widgets.reference.eefExtReferenceViewerFilterProvider">
+ <descriptor
+ class="org.eclipse.sirius.ui.properties.ext.widgets.reference.internal.EEFExtReferenceViewerFilterProvider"
+ description="%viewerFilterProvider.Description"
+ id="org.eclipse.sirius.ui.properties.ext.widgets.reference.viewerFilterProvider"
+ label="%viewerFilterProvider.Label">
+ </descriptor>
+</extension>
+p. Example of the contribution of a viewer filter provider. This contribution will let a plugin filter the content displayed in the tree viewers used to show where a new value can be created and which value can be selected for a reference. Eclipse Sirius provides the following basic implementation which is used to filter everything not contained in a semantic resource:
+
+bc.. import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.eef.ide.ui.ext.widgets.reference.api.IEEFExtReferenceViewerFilterProvider;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.sirius.business.api.session.Session;
+import org.eclipse.sirius.business.api.session.SessionManager;
+
+
+public class EEFExtReferenceViewerFilterProvider implements IEEFExtReferenceViewerFilterProvider {
+
+ @Override
+ public List<ViewerFilter> getViewerFilters(ContextKind contextKind) {
+ List<ViewerFilter> viewerFilters = new ArrayList<>();
+
+ ViewerFilter viewFilter = new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ // Used to filter aird, odesign, etc
+ if (element instanceof Resource) {
+ Session session = SessionManager.INSTANCE.getSession((Resource) element);
+ return session != null;
+ }
+ return true;
+ }
+ };
+
+ viewerFilters.add(viewFilter);
+ return viewerFilters;
+ }
+
+}
+p. This example requires at least the following dependencies:
+* org.eclipse.eef.ide.ui.ext.widgets.reference
+* org.eclipse.emf.ecore
+* org.eclipse.jface.viewers
+* org.eclipse.sirius \ No newline at end of file

Back to the top