Skip to main content



      Home
Home » Eclipse Projects » GEF » AbstractEditPart.refreshChildren refreshes one level only
AbstractEditPart.refreshChildren refreshes one level only [message #165103] Fri, 21 January 2005 15:40 Go to next message
Eclipse UserFriend
Originally posted by: kevinlouisnospam.hotmail.com

Hi,

I read the codes of the AbstractEditPart.refreshChildren, it just refreshes
the children of next level only. Should it refresh all grandChildren too?
I expect this function should be called for each editParts down to all
levels (but refreshChildren is protected, may need to call refresh to do
it).

What do you think?
Re: AbstractEditPart.refreshChildren refreshes one level only [message #165144 is a reply to message #165103] Fri, 21 January 2005 17:21 Go to previous messageGo to next message
Eclipse UserFriend
No. In most cases, the changes would be localized so that not everything
would need to be refreshed. The parts that would need to be refreshed would
be notified of the property change individually. If you have a case where a
change effects all parts and don't want each part to be notified of this
change, you can write a helper method that refreshes all parts. You can
look at the PaletteViewer as an example. When the palette's font or layout
is changed by the user all the parts would have to be notified. Instead of
having each of the edit parts listen for the preference change, only the
viewer listens for it and refreshes all parts when need be. Look at
PaletteViewer.PreferenceListener#refreshAllEditParts().

"Kevin" <kevinlouisnospam@hotmail.com> wrote in message
news:csrpcq$l3v$1@www.eclipse.org...
> Hi,
>
> I read the codes of the AbstractEditPart.refreshChildren, it just
refreshes
> the children of next level only. Should it refresh all grandChildren too?
> I expect this function should be called for each editParts down to all
> levels (but refreshChildren is protected, may need to call refresh to do
> it).
>
> What do you think?
>
>
Re: AbstractEditPart.refreshChildren refreshes one level only [message #165177 is a reply to message #165144] Fri, 21 January 2005 18:58 Go to previous message
Eclipse UserFriend
Originally posted by: kevinlouisnospam.hotmail.com

Yes, you are right. In the normal case, each level of the editPart should
listen the event from its corresponding model and refresh its own children
only.

Thanks a lot.

"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:csrv9s$l1g$1@www.eclipse.org...
> No. In most cases, the changes would be localized so that not everything
> would need to be refreshed. The parts that would need to be refreshed
would
> be notified of the property change individually. If you have a case where
a
> change effects all parts and don't want each part to be notified of this
> change, you can write a helper method that refreshes all parts. You can
> look at the PaletteViewer as an example. When the palette's font or
layout
> is changed by the user all the parts would have to be notified. Instead
of
> having each of the edit parts listen for the preference change, only the
> viewer listens for it and refreshes all parts when need be. Look at
> PaletteViewer.PreferenceListener#refreshAllEditParts().
>
> "Kevin" <kevinlouisnospam@hotmail.com> wrote in message
> news:csrpcq$l3v$1@www.eclipse.org...
> > Hi,
> >
> > I read the codes of the AbstractEditPart.refreshChildren, it just
> refreshes
> > the children of next level only. Should it refresh all grandChildren
too?
> > I expect this function should be called for each editParts down to all
> > levels (but refreshChildren is protected, may need to call refresh to do
> > it).
> >
> > What do you think?
> >
> >
>
>
Previous Topic:Problem Scrolling in FigureCanvas
Next Topic:Help with my version of flowEditor
Goto Forum:
  


Current Time: Sun Jun 15 15:49:50 EDT 2025

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

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

Back to the top