Problems with restricting property tester by using the type attribute [message #698521] |
Tue, 19 July 2011 11:33  |
Eclipse User |
|
|
|
I posted this issue in the PDE subforums but I noticed that this one is more active. Sorry if I did something wrong with re-posting it here.
My main problem is that in the Package Explorer projects can be either IProject or IJavaProject objects. I know that programmatically the IProject -> IJavaProject conversion is possible through the IAdaptable interface. But sometimes you just can't use this.
In my case I created my own PropertyTester. Here's how I defined it in my plugin.xml:
<extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
id="my.plugin.MyPropertyTester"
type="org.eclipse.core.resources.IProject"
namespace="my.plugin"
properties="isProject"
class="my.plugin.MyPropertyTester">
</propertyTester>
</extension>
The problem here is that the type attribute restricts when the property tester is called. So if a project in the package explorer is an IProject object there's no problem but my property tester is not called when it's an IJavaProject. I could use java.lang.Object instead of org.eclipse.core.resources.IProject but the property tester would run on every object in the UI that way.
I can't find a way to define two different types as restriction for a property tester or any other solution.
Any ideas or do somebody know how to do this properly?
Thank you.
[Updated on: Tue, 19 July 2011 11:35] by Moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04198 seconds