Problem with refreshing an OutlinePage [message #459722] |
Wed, 06 December 2006 18:50  |
Eclipse User |
|
|
|
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 #459868 is a reply to message #459826] |
Thu, 07 December 2006 20:50  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02620 seconds