| Summary: | Make default auto edit strategy configurable via preferences | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Henrik Lindberg <henrik.lindberg> | ||||||||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||||||||
| Status: | NEW --- | QA Contact: | |||||||||||
| Severity: | enhancement | ||||||||||||
| Priority: | P3 | CC: | dtn-eclipsebugs, moritz.eysholdt, sebastian.zarnekow, sven.efftinge | ||||||||||
| Version: | unspecified | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Henrik Lindberg
Created attachment 202467 [details]
preference page
Created attachment 202468 [details]
constants
Created attachment 202469 [details]
helper
Created attachment 202470 [details]
overriding edit strategy provider
The PPEditStrategyProvider is the "messy" part, that wraps strategies in a wrapper that is aware of preferences. The complexity is because I wanted to reuse the default implementation. Taking over all the responsibility would be much cleaner.
Cleanest API compatible implementation is probably to: - use separate preference keys for the different strategies - use a wrapper that knows about the preference key per strategy - make the abstract edit strategy aware that strategies may be wrapped (like in the overriding implementation that is attached). Or (breaking API) Add an Supplier<Boolean> enabler parameter to the edit strategies themselves (then there is no need for a wrapper). The strategies simply need to call get() on the Supplier to know if they are enabled or not. Since some auto edit strategies depend on others I'd expect surprising behavior if I disable some of them. Didn't you face such situations? (In reply to comment #6) > Since some auto edit strategies depend on others I'd expect surprising behavior > if I disable some of them. Didn't you face such situations? No, seems to work just fine - I disable all strategies for a particular character pair. Anything in particular you think should be tested to verify that there is no negative effect? Unfortunately we didn't find the time to review the attached implemetation for 2.1. Is that a worthy addition for 2.1.1? I think so. We should at least review it. *** Bug 391639 has been marked as a duplicate of this bug. *** |