Skip to main content



      Home
Home » Eclipse Projects » GEF » Change in the model would create a different EditPart in the EditPartFactory
Change in the model would create a different EditPart in the EditPartFactory [message #156095] Fri, 29 October 2004 08:38 Go to next message
Eclipse UserFriend
Originally posted by: mschuhma.ftisoft.at

Hi All,

I'm currently facing the following problem:

My EditPartFactory decides which EditPart to create based on certain
conditions in the model object.

Now - if I change my model using the properties view it might be necessary
to create a different editpart.

Calling refresh() on the editpart or parent edit-part obviously does not
solve my problem since it always reuses the existing editpart.

Creating a new model object instead of changing the old one introduces even
more problems since the object that was just changed in the properties view
ceases to exist!! (when the framework tries to restore the selection on the
edit part I get a lot of ugly exceptions)

Can anybody please give me some hints of how to solve this?

Thanks a lot,
Martin.
Re: Change in the model would create a different EditPart in the EditPartFactory [message #156467 is a reply to message #156095] Mon, 01 November 2004 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Perhaps this might work: the parent editpart could first invoke
removeChild(childEditPart), before invoking refreshChildren().

"Martin Schuhmayer" <mschuhma@ftisoft.at> wrote in message
news:cltdkg$bk2$1@eclipse.org...
> Hi All,
>
> I'm currently facing the following problem:
>
> My EditPartFactory decides which EditPart to create based on certain
> conditions in the model object.
>
> Now - if I change my model using the properties view it might be necessary
> to create a different editpart.
>
> Calling refresh() on the editpart or parent edit-part obviously does not
> solve my problem since it always reuses the existing editpart.
>
> Creating a new model object instead of changing the old one introduces
even
> more problems since the object that was just changed in the properties
view
> ceases to exist!! (when the framework tries to restore the selection on
the
> edit part I get a lot of ugly exceptions)
>
> Can anybody please give me some hints of how to solve this?
>
> Thanks a lot,
> Martin.
>
>
Re: Change in the model would create a different EditPart in the EditPartFactory [message #156928 is a reply to message #156467] Fri, 05 November 2004 01:04 Go to previous message
Eclipse UserFriend
Originally posted by: mschuhma.ftisoft.at

Thanks for that!
It worked.

"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:cm6052$epb$1@eclipse.org...
> Perhaps this might work: the parent editpart could first invoke
> removeChild(childEditPart), before invoking refreshChildren().
>
> "Martin Schuhmayer" <mschuhma@ftisoft.at> wrote in message
> news:cltdkg$bk2$1@eclipse.org...
> > Hi All,
> >
> > I'm currently facing the following problem:
> >
> > My EditPartFactory decides which EditPart to create based on certain
> > conditions in the model object.
> >
> > Now - if I change my model using the properties view it might be
necessary
> > to create a different editpart.
> >
> > Calling refresh() on the editpart or parent edit-part obviously does not
> > solve my problem since it always reuses the existing editpart.
> >
> > Creating a new model object instead of changing the old one introduces
> even
> > more problems since the object that was just changed in the properties
> view
> > ceases to exist!! (when the framework tries to restore the selection on
> the
> > edit part I get a lot of ugly exceptions)
> >
> > Can anybody please give me some hints of how to solve this?
> >
> > Thanks a lot,
> > Martin.
> >
> >
>
>
Previous Topic:Overview Woes - snap shot of the canvas
Next Topic:Gef Rich Text
Goto Forum:
  


Current Time: Sat May 03 12:08:37 EDT 2025

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

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

Back to the top