Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to remove elements from non-synchronized diagrams
How to remove elements from non-synchronized diagrams [message #195903] Mon, 07 July 2008 08:29 Go to next message
Eclipse UserFriend
Originally posted by: janiko.gmx.de

Hello everyone,
Is it possible to remove elements in a non-synchronized diagram
environment? Sylvain had the same problem in
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg12882.html
, but the solution of Jan is to generate the code with synchronized =
true, and than customize the CannonicalEditPolicy. My question is, if
this are the only way to remove elements from all diagrams of a model,
why there exist a synchronized option in the .gmfgen? Is there any
solution to remove a element from all diagrams that reference to the
same model element, without to putting synchronized on, and implement a
non synchronized behavior by my own? Because i think the "delete from
diagram" and "delete from model" options are very nice, if its works.

Thank you in advanced,
Tony
Re: How to remove elements from non-synchronized diagrams [message #195950 is a reply to message #195903] Mon, 07 July 2008 10:47 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Tony,

> true, and than customize the CannonicalEditPolicy. My question is, if
> this are the only way to remove elements from all diagrams of a model,
You can implement simple CanonicalEditPolicy and install it for all the EditParts
on all diagrams. This EditPolisy should be ratehr generic and remove corresponding
"obsolete" views if there any.

> why there exist a synchronized option in the .gmfgen? Is there any
This option allows you to not generate CanonicalEditPolicies and manage diagram
elements manually.

> solution to remove a element from all diagrams that reference to the
> same model element, without to putting synchronized on, and implement
You can listen for the corresponding notifications, load all diagrams and
remove corresponding element - just custom code managing this situation.

> non synchronized behavior by my own? Because i think the "delete from
> diagram" and "delete from model" options are very nice, if its works.
These actions works well AFAIU the problem is: you'd like to remove corresponding
elements from all other diagrams.

-----------------
Alex Shatalin
Re: How to remove elements from non-synchronized diagrams [message #195965 is a reply to message #195950] Mon, 07 July 2008 11:45 Go to previous message
Eclipse UserFriend
Originally posted by: janiko.gmx.de

Thanks a lot for your answer.
It works, i have installed a very simple CanonicalEditPolicy like this:
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new CanonicalEditPolicy(){
@Override
protected List getSemanticChildrenList() {
return Collections.EMPTY_LIST;
}
});

There are still a small problem: The "delete from diagram" action will
be grayed out, if i install a CanonicalEditPolicy. Do you know how i can
re-enable this action?

regards,
Tony

Alex Shatalin schrieb:
> Hello Tony,
>
>> true, and than customize the CannonicalEditPolicy. My question is, if
>> this are the only way to remove elements from all diagrams of a model,
> You can implement simple CanonicalEditPolicy and install it for all the
> EditParts on all diagrams. This EditPolisy should be ratehr generic and
> remove corresponding "obsolete" views if there any.
>
>> why there exist a synchronized option in the .gmfgen? Is there any
> This option allows you to not generate CanonicalEditPolicies and manage
> diagram elements manually.
>
>> solution to remove a element from all diagrams that reference to the
>> same model element, without to putting synchronized on, and implement
> You can listen for the corresponding notifications, load all diagrams
> and remove corresponding element - just custom code managing this
> situation.
>
>> non synchronized behavior by my own? Because i think the "delete from
>> diagram" and "delete from model" options are very nice, if its works.
> These actions works well AFAIU the problem is: you'd like to remove
> corresponding elements from all other diagrams.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Get Editpart from semantic element
Next Topic:Remove Compartment's top border line
Goto Forum:
  


Current Time: Thu Apr 25 15:04:41 GMT 2024

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

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

Back to the top