| Summary: | [Scoping] Allow to pass a filter predicate to Scopes (as well as to IContainers and IResourceDescriptions) | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sven Efftinge <sven.efftinge> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | jan |
| Version: | 2.0.0 | Flags: | sven.efftinge:
indigo+
|
| Target Milestone: | M4 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Sven Efftinge
Summarizing our discussion results:
The methods of the IScope interface are a cross product of filtering aspects (by EObject, by name, by predicate) and result type (list or single element). We should simplify that by extracting the filtering aspect into a separate interface, something like
interface IScope {
Iterable<IEObjectDescriptor> getElements(IScopeFilter filter);
IEObjectDescriptor getFirstElement(IScopeFilter filter);
}
interface IScopeFilter {
static class ByName implements IScopeFilter {..}
static class ByEObject implements IScopeFilter {..}
static class ByPredicate implements IScopeFilter {..}
}
For backward compatibility with existing clients, we should consider introducing a compatibility layer.
I also changed IResourceDescription and IContainer accordingly. pushed to master Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |