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

Bug 564985

Summary: Add event.mask as API to IResourceChangeListener/IWorkspace
Product: [Eclipse Project] Platform Reporter: Alex Blewitt <alex.blewitt>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: laeubi
Version: 4.17   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=564876
Whiteboard:

Description Alex Blewitt CLA 2020-07-06 13:25:39 EDT
In bug 564876 we introduced an 'event.mask' property that could be used to register services with a particular mask. This needs to be promoted to API in IResourceChangeListener or IWorkspace so that it can be documented in terms of its use and its meaning, and to allow others to programmatically refer to that key when dealing with it programatically.

This bug is to make that API change once we decide that bug 564876 is not to be backed out.
Comment 1 Alex Blewitt CLA 2020-07-06 18:01:16 EDT
There's an interesting question as to whether this should be API on IResourceChangeListener or IWorkspace. The event mask itself really belongs on the IWorkspace, since that's where the addResourceChangeListener() method lives, but it will be practically undiscoverable there, so it may be better (if slightly less correct) to add it to the IResourceChangeListener, where it's likely to be used at the point of declaration.


interface IResourceChangeListener {
  String EVENT_MASK = "event.mask";
  ...
}

// use site
IResourceChangeListener service = new IResourceChangeListener() { ... };
Hashtable properties = new Hashtable();
properties.add(IResourceChangeListener.EVENT_MASK,IResourceChangeListener.POST_BUILD);
context.registerService(IResourceChangeListener.class, service, properties);