Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4553f50989f9ae05c3a96ba8dad02671b8dac863 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.eclipse.jst.j2ee.navigator.internal;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IResource;
import org.eclipse.jst.j2ee.project.WebUtilities;

public class WebResourcePropertyTester extends PropertyTester {

	private static final String WEB_RESOURCE = "webResource"; //$NON-NLS-1$
	
	public WebResourcePropertyTester() {
	}

	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
		if (!(receiver instanceof IResource))
			return false;
		
		IResource resource = (IResource) receiver;
		if (WEB_RESOURCE.equals(property)) {
			return WebUtilities.isWebResource(resource);
		} 
		
		return false;
	}

}

Back to the top