Danny Lo
Danny Lo

Reputation: 1583

Eclipse Plug-In developement. How to set exclusion filter programmatically?

I created a source folder with following code:

Folder folder = proj.getFolder("resources");
folder.create(false, true, null);
IPackageFragmentRoot root = jproject.getPackageFragmentRoot(folder);
IClasspathEntry[] oldEntries = jproject.getRawClasspath();
IClasspathEntry[] newEntries = new IClasspathEntry[oldEntries.length + 1];
System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length);
newEntries[oldEntries.length] = JavaCore.newSourceEntry(root.getPath());
jproject.setRawClasspath(newEntries, null);
i18Resource = folder;

Now I'd like to add ** to its exclusion path like in this dialog:

enter image description here

How can I do it?

Upvotes: 0

Views: 59

Answers (1)

greg-449
greg-449

Reputation: 111218

There is a variant of JavaCore.newSourceEntry that supports this:

public static IClasspathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns,
       IPath[] exclusionPatterns, IPath specificOutputLocation, 
       IClasspathAttribute[] extraAttributes)

Upvotes: 1

Related Questions