Skip to content

Commit

Permalink
Enhance the IContributionFactory to filter contributions
Browse files Browse the repository at this point in the history
Currently there is no way for filtering a contribution to the model on a
global level.

This adds a new method to IContributionFactory#isEnabled that allows
extenders to mark a given contribution as being disabled.

See eclipse-platform/eclipse.platform.ui#2217
  • Loading branch information
laeubi committed Jan 31, 2025
1 parent dba97fe commit 3a6fca6
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.osgi.framework.Bundle;

// TBD this became an utility method to create object from a bundle.
// Change it into an utility method somewhere.
/**
* {@link IContributionFactory} is responsible to create contributions and check
* if a contribution is enabled
*/
public interface IContributionFactory {

Object create(String uriString, IEclipseContext context);
Expand All @@ -26,4 +28,8 @@ public interface IContributionFactory {

Bundle getBundle(String uriString);

default boolean isEnabled(String uriString) {
return uriString != null;
}

}

0 comments on commit 3a6fca6

Please sign in to comment.