Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problem with refreshing an OutlinePage
Problem with refreshing an OutlinePage [message #459722] Wed, 06 December 2006 18:50 Go to next message
Eclipse UserFriend
Hi there,

i want to completely refresh an outlinepage and the only way that i have
found so far, is to dispose the object and readd it. So i dispose the
object, remove all listeners (the outline part becomes gray) and then
re-add it. But the part of the window, where the new outline should be
displayed, stays gray. If i now click in this gray area, i get the
message "An error has occurred when activating this view".

My code for removal and re-adding looks like this:

Method, that initiates the whole procedure:
*******************

getActionRegistry().removeAction(outlinePageAction);

removeContentOutlinePage();

outlinePageAction = new ShowActivityAction(this, getContentOutlinePage());

getActionRegistry().registerAction(outlinePageAction);

********************


removeContentOutlinePage():
***************************
if (outlinePage != null)
{
((ModelContentOutlinePage)
outlinePage).getContextMenuManager().removeMenuListener(getC ontextMenuProvider());
getSelectionSynchronizer().removeSelectionProvider(outlinePa ge);
outlinePage.dispose();
outlinePage = null;
}
***************************

getContentOutlinePage():
***************************
if (outlinePage == null)
{
outlinePage = new ModelContentOutlinePage(this);
getSelectionSynchronizer().addSelectionProvider(outlinePage) ;
((ModelContentOutlinePage) outlinePage).getContextMenuManager()
.addMenuListener(getContextMenuProvider());
}

return outlinePage;
***************************

Thanks for help!

Wolf
Re: Problem with refreshing an OutlinePage [message #459826 is a reply to message #459722] Thu, 07 December 2006 07:51 Go to previous messageGo to next message
Eclipse UserFriend
When you created your outline page, you were handed a Composite parent
in createControl(*).

Normally it's:

Composite myComposite = new Composite(parent, SWT.NONE);
myComposite.setLayout(new FillLayout()); // set appropriate layout
// add controls.

When your information changes and you add or dispose child Controls, or
update child labels, you would call myComposite.layout();

If you really want to clean it out, you can save parent in your outline
page, and the dispose and re-create myComposite.

Or is this not the behaviour you want.

Later,
PW
Re: Problem with refreshing an OutlinePage [message #459868 is a reply to message #459826] Thu, 07 December 2006 20:50 Go to previous message
Eclipse UserFriend
Hi Paul,

that helped :)

Wolf


> When you created your outline page, you were handed a Composite parent
> in createControl(*).
>
> Normally it's:
>
> Composite myComposite = new Composite(parent, SWT.NONE);
> myComposite.setLayout(new FillLayout()); // set appropriate layout
> // add controls.
>
> When your information changes and you add or dispose child Controls, or
> update child labels, you would call myComposite.layout();
>
> If you really want to clean it out, you can save parent in your outline
> page, and the dispose and re-create myComposite.
>
> Or is this not the behaviour you want.
>
> Later,
> PW
Previous Topic:Decorations on filtered items in a tree
Next Topic:What happens with my Problem View ?
Goto Forum:
  


Current Time: Mon Mar 24 15:56:11 EDT 2025

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

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

Back to the top