eclipse plugin - Close an open IFile in editor if it is deleted in Project Explorer -
i have requirement close open ifile in editor if deleted in project explorer.
as understand iresourcechangelistener can used listens changes in project workspace how can perticular file has been deleted.
as event.getresource()
returns iproject being changed seems .
how can locate file has been deleted , close file in editor if open?
a resource change event contains information changes related resources. file change file, parent folders , project. getresource
method of iresourcechangeevent
returns top resource has been changed.
the iresourcedelta
returned getdelta
contains full set of resources resource change event covers:
iresourcedelta delta = event.getdelta();
you can search delta particular file with:
iresourcedelta filedelta = delta.findmember(file.getfullpath());
you can use accept
method call 'visitor' on each resource.
Comments
Post a Comment