In the eclipse documentation I've seen the following snippet (http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Fexpressions%2FPropertyTester.html):
<propertyTester
namespace="org.eclipse.jdt.core"
id="org.eclipse.jdt.core.IPackageFragmentTester"
properties="isDefaultPackage"
type="org.eclipse.jdt.core.IPackageFragment"
class="org.eclipse.demo.MyPackageFragmentTester">
</propertyTester>
with the following property tester implementation:
public class MyPackageFragmentTester extends PropertyTester {
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
IPackageFragment fragment= (IPackageFragment)receiver;
if ("isDefaultPackage".equals(property)) {
return expectedValue == null
? fragment.isDefaultPackage()
: fragment.isDefaultPackage() == ((Boolean)expectedValue).booleanValue();
}
Assert.isTrue(false);
return false;
}
}
I'm a bit wondering about the ((Boolean)expectedValue) part - because the expected value is give in the <test property="..."/> tag as string:
<test property="org.eclipse.jdt.core.isDefaultPackage" value="true" />
And whenever I implemented a property tester the value was given as a String.
So my question is: Is it possible to have an expected value that is not a String? According to the Eclipse RCP documentation it should be... but how!?