Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add component property types for IModelProcessorContribution attributes #2396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HannesWell
Copy link
Member

These annotation simplify the specification of the 'beforefragment' and 'apply' service property for
IModelProcessorContribution implementations and makes it type-safe and more robust:

@Component(service = IModelProcessorContribution.class)
@IModelProcessorContribution.Beforefragment(true)
@IModelProcessorContribution.Apply(IModelProcessorContribution.APPLY_ALWAYS)
public class SampleContribution implements IModelProcessorContribution { 

Copy link
Contributor

github-actions bot commented Oct 13, 2024

Test Results

 1 818 files   1 818 suites   1h 31m 19s ⏱️
 7 709 tests  7 481 ✅ 228 💤 0 ❌
24 288 runs  23 541 ✅ 747 💤 0 ❌

Results for commit 02f399f.

♻️ This comment has been updated with latest results.

@HannesWell HannesWell force-pushed the add-IModelProcessorContribution-property-type-annotations branch 3 times, most recently from 60e584d to 1cab632 Compare October 14, 2024 17:57
@HannesWell
Copy link
Member Author

If there are no more remarks I plan to submit this tomorrow (European) evening.

Ideally we would also have some places within the SDK were this would be used, but I could not find any place were this is immediately possible. If I understood it correctly, in order to use it, we would have to migrate some (or all) of the org.eclipse.e4.workbench.model.processor extensions e.g. in org.eclipse.ui.workbench or org.eclipse.e4.ui.workbench.addons.swt to be OSGi declarative services?
@fipro78 is that correct? Since you contributed the possibility to define processors as OSGi DS, would you be interested in migrating the existing ones or want to give advice?

@fipro78
Copy link
Contributor

fipro78 commented Oct 15, 2024

@HannesWell
Thanks for the pointer. I have created a PR for this: #2403

The option to use DS for contributing a model processor was intended to be an option for people that don't like the extension points in their code. There was no need to migrate the platform model processors.

Also note that for the existing ones there is no need for the component property types, as the beforefragment property defaults to true if not set.

And btw the service attribute on the @Component in your snippet is not necessary, as it is derived from the implements IModelProcessorContribution. So actually the information is redundant. Just in case you wonder why I have not used it in my PR.

These annotation simplify the specification of the
'beforefragment' and 'apply' service property for
IModelProcessorContribution implementations and makes it type-safe and
more robust:
'''
@component(service = IModelProcessorContribution.class)
@IModelProcessorContribution.Beforefragment(true)
@IModelProcessorContribution.Apply(IModelProcessorContribution.APPLY_ALWAYS)
public class SampleContribution implements IModelProcessorContribution {
'''
@HannesWell HannesWell force-pushed the add-IModelProcessorContribution-property-type-annotations branch from 1cab632 to 02f399f Compare October 15, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants