Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327656

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: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jan
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: M4   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sven Efftinge CLA 2010-10-13 08:28:11 EDT
In order to query and filter the contents of each scope taking the shadowing into account, we should allow to pass a filter predicate when asking for IEObjectDescription.
Comment 1 Jan Koehnlein CLA 2010-10-14 05:44:29 EDT
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.
Comment 2 Sven Efftinge CLA 2010-11-22 07:38:20 EST
I also changed IResourceDescription and IContainer accordingly.

pushed to master
Comment 3 Karsten Thoms CLA 2017-09-19 16:52:09 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:03:27 EDT
Closing all bugs that were set to RESOLVED before Neon.0