How to remove elements from non-synchronized diagrams [message #195903] |
Mon, 07 July 2008 08:29 |
Eclipse User |
|
|
|
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 #195965 is a reply to message #195950] |
Mon, 07 July 2008 11:45 |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03343 seconds