Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] IModelProviderEvent structure, methods and use?

Title: IModelProviderEvent structure, methods and use?


Thanks for helping me.

I am working on a new ModelProvider and I am currently working on the notifications.

I have a number of question about IModelProviderEvent and the methods provided by this class.

I have just opened a enchansment request

but I then realize that maybe I do not understand the structure of IModelProviderEvent and its use so here are my questions.

1. Why is the method public abstract void addResources(Collection<Object> someResources); with a parameter of Collection<Object>. Cant it be public abstract void addResources(Collection<? extends Object> someResources);

This way I will be able to execute

private void processAddedFiles(IModelProviderEvent modelEvent, Collection<IFile> addedFiles) throws JavaModelException {


and add the addedFiles collection directly to modelEvent.

2.What is the purpose of public abstract List<Object> getChangedResources(); If this method is for retrieving the files that this modelEvent is desribing wont it be more appropriate to name it getAffectedResources(). Since I can also have removed and added resources. Not just changedResources.

3.Why should the getChangedResources() method return a List. Since addResources is accepting Collection won`t it be more appropriate to return a Collection. Every implementation may provide a different collection for such a general class as IModelProviderEvent

4.What is the purpose of the set* and add* methods. From my point of view this methods should be part of the implenetation not from an interface since the one notified with a model event wont need to add or set a resource to the event. Only when constucting the event such functionality is needed.

I am willing to open enchansment requests and to propose patches changing the IModelProviderEvent. I will also change ModelProviderEvent which is the default empty implementation, but maybe I am missing something.

Thank you for the help.

Best Regards,

Back to the top