Reorder child Editparts [message #210727] |
Fri, 07 November 2008 11:06 |
Eclipse User |
|
|
|
Originally posted by: d.kleinrath.inode.at
Hi,
I want to extend FlowLayoutEditPolicy so I can change the order of the
children by moving them to a new position in the container (something like
the LogicFlowEditPolicy in the logic example of GEF). I already tested my
EditPolicy with a command that removes the child EditPart from the parent
and afterwards inserts it at the new position and it seems to work but of
course this information is not stored in the model.
I think the initial order of child EditParts is determined by the order in
the notation model but I couldn't find out how to change and store this
order. I tried changing the order of the EList in my semantic model but
this didn't work. The order gets stored in the semantic model but not in
the notation model if I do this. Using a RepositionEObjectCommand on the
notation model also doesn't work because the EList where the children are
stored returns an UnsupportedOperationException() for the move method.
Does anyone know how to change the order of children in the notation model?
Is there perhaps a better approach for achieving what I want?
Thanks for any help,
Dieter
|
|
|
Re: Reorder child Editparts [message #210734 is a reply to message #210727] |
Fri, 07 November 2008 11:26 |
Eclipse User |
|
|
|
Originally posted by: d.kleinrath.inode.at
I just found out how to solve this. I used getChildren() on the View and
tried to change its order but this doesn't work. You need to use
getPersistedChildren() instead.
Dieter
Am 07.11.2008, 12:06 Uhr, schrieb Dieter Kleinrath <d.kleinrath@inode.at>:
> Hi,
>
> I want to extend FlowLayoutEditPolicy so I can change the order of the
> children by moving them to a new position in the container (something
> like the LogicFlowEditPolicy in the logic example of GEF). I already
> tested my EditPolicy with a command that removes the child EditPart from
> the parent and afterwards inserts it at the new position and it seems to
> work but of course this information is not stored in the model.
>
> I think the initial order of child EditParts is determined by the order
> in the notation model but I couldn't find out how to change and store
> this order. I tried changing the order of the EList in my semantic model
> but this didn't work. The order gets stored in the semantic model but
> not in the notation model if I do this. Using a RepositionEObjectCommand
> on the notation model also doesn't work because the EList where the
> children are stored returns an UnsupportedOperationException() for the
> move method.
>
> Does anyone know how to change the order of children in the notation
> model?
> Is there perhaps a better approach for achieving what I want?
>
> Thanks for any help,
>
> Dieter
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03468 seconds