A project (IProject
) is a top-level unit in the workspace (IWorkspaceRoot
). These can contain resources (IResource
), which are either folder (IFolder
) or file (IFile
) objects. They can be iterated with the members()
function, but this will result in the creation of IResource
for every element processed, even if they aren't relevant. Instead, defer to the platform's internal tree by passing it a visitor that will step through each element required. Perform the following steps:
Create a class,
MinimarkVisitor
, in thecom.packtpub.e4.minimark.ui
package, that implementsIResourceProxyVisitor
andIResourceDeltaVisitor
interfaces.Implement the
visit(IResourceProxy)
method to get the name of the resource, and display a message if it finds a file whose name ends with.minimark
. It should returntrue
to allow child resources to be processed:public boolean visit(IResourceProxy proxy) throws CoreException { String name = proxy.getName(); if(name !=...