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.

<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>

Example of IEEFTabDescriptorFilter contribution. In this example, we are providing a contribution used to filter legacy tabs to the Properties view created by EEF.

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;
    }

}

This example requires at least the following dependencies:

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.

<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>

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:

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;
    }

}

This example requires at least the following dependencies: