EditpolicyProvider and affected EditParts [message #192314] |
Thu, 12 June 2008 13:19 |
Youmm P. Messages: 140 Registered: July 2009 |
Senior Member |
|
|
Hello,
I used the extension point
"org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders" to register my
EditPolicy, roughly like that:
<editpolicyProvider
class="com.xyz.MyProvider">
<Priority name="Lowest"/>
<object
class="com.xyz.SomeEditPart"
id="SomeEditPartID" />
<context editparts="SomeEditPartID" />
</editpolicyProvider>
In the class MyProvider, createEditPolicies is called not only for
SomeEditPart but for all EditParts.
If I take the Eclipsecon example (the class is EditPolicyProvider), they
also filter the editParts with the provides operation:
public boolean provides(IOperation operation) {
if (operation instanceof CreateEditPoliciesOperation) {
CreateEditPoliciesOperation cepOper =
(CreateEditPoliciesOperation)operation;
if (cepOper.getEditPart() instanceof ResourceEditPart)
return true;
else if (cepOper.getEditPart() instanceof TutorialEditPart)
return true;
}
return false;
}
So my question is:
what is the goal of the class attribute if the createEditPolicies is
called for all EditParts?
|
|
|
Powered by
FUDForum. Page generated in 0.03494 seconds