eclipse-platform / eclipse-platform/eclipse.platform

Provide an @RequireWorkspace and a coresponding condition for the Workspace service

Open
#881 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
165
Forks
174
Avg merge
2d 8h
Merged PRs (30d)
22

Description

Currently a component that requires the workspace can already use

```
@Reference
IWorkspace workspace;
```

But sometimes one wants a workspace more indirectly e.g. see https://github.com/eclipse/ecf/issues/83, or maybe even conceptually (because the component interacts with the UI).

Even though the same approach can be used this will generate an unused warning and there is some risk one want to remove unused references.

SCR 1.5 spec has a new concept called the [Satisfying Condition](https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.component.html#service.component-satisfying.condition) that could be used instead in such a case what has a more semantic way to express this and do not require even to access the resource bundle (what would trigger its activation).

So the goal here is:

1. Together with the `IWorkspace` service register also a `Condition`
2. Provide a `@RequireWorkspace` annotation that inherits the condition target for easy usage

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.