Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » EditPolicyProvider is not called for DiagramEditPart on first open
EditPolicyProvider is not called for DiagramEditPart on first open [message #120970] Fri, 20 April 2007 05:28 Go to next message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

I'm using GMF 1.0.1 and my diagram has PageEditPart as the canvas
(subclass of DiagramEditPart)


I'm making use of the EditPolicyProvider extension to override some
default EditPolicies for all EditParts in my project, including the
PageEditPart, and have noticed the following behavior:

When first opening a diagram after a restart of the workbench
the method IEditPolicyProvider.createEditPolicies(EditPart editPart)
is called for every EditPart EXCEPT the PageEditPart.

Now if the editor is closed then reopened (without restarting the
workbench) the same method is called for every EditPart INCLUDING
the PageEditPart. This remains true as long as the workbench is not
restarted.

This means that when first opening a diagram the EditPolicies for
PageEditPart are not overridden.

As a workaround I've directly overridden the particular EditPolicies
for the PageEditPart by modifying createDefaultEditPolicies() in
PageEditPart itself.


Q1. Is the EditPolicyProvider extension intended to also be used for
the DiagramEditPart

Q2. Is the behavior outlined above by design?


Thank you for any info.

-- Khai --
Re: EditPolicyProvider is not called for DiagramEditPart on first open [message #121235 is a reply to message #120970] Mon, 23 April 2007 08:06 Go to previous messageGo to next message
Eclipse UserFriend
Hello Khai,

AFAIKSee EditPolicyService.getInstance().createEditPolicies(this); always
called from GraphicalEditPart.createEditPolicies() method, so corresponding
provider should be called for the DiagramEditPart as well..

-----------------
Alex Shatalin
Re: EditPolicyProvider is not called for DiagramEditPart on first open [message #121484 is a reply to message #121235] Tue, 24 April 2007 06:56 Go to previous message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

Thanks for the reply, Alex.
You are right about the code and from what I can see it should
also apply to the first loading of DiagramEditPart. Unfortunately,
I still clearly see it not calling
EditPolicyProvider.createEditPolicies() on first load for
DiagramEditPart.

I have an extensively customized project so it could be due to some
'related' customization in my code; even though I have not specifically
modified the way EditPolicies are handled.

Thanks again for the help. I have a workaround now so I'm going with
that; when there's time I'll revisit this and will narrow down to the
specific cause. I'll repost if the cause is not in my own code.

-- Khai --


Alex Shatalin wrote:
> Hello Khai,
>
> AFAIKSee EditPolicyService.getInstance().createEditPolicies(this);
> always called from GraphicalEditPart.createEditPolicies() method, so
> corresponding provider should be called for the DiagramEditPart as well..
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Creating links between links
Next Topic:Question on Commands and Connections
Goto Forum:
  


Current Time: Thu May 08 03:20:02 EDT 2025

Powered by FUDForum. Page generated in 0.04286 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top