How to get TreeViewer selection to show in PropertiesView [message #393117] |
Fri, 27 May 2005 10:09 |
Eclipse User |
|
|
|
Originally posted by: bencomo.us.ibm.com
Hi,
I've created a ViewPart that contains a TreeViewer which is displaying the
contents of my EMF model. I have set the viewer as a Selection provider,
getViewSite().setSelectionProvider(treeViewer), and added the
IPartListener and the getAdapter(Class key) and getPropertySheetPage()
methods (copied shamelessly from the generated editor). However, the
Property View is updated only when my view regains focus from another part
(i.e. when I switch between Navigator and my view), never when it is
activated for the first time.
Thanks in advance,
Al.-
|
|
|
|
Re: How to get TreeViewer selection to show in PropertiesView [message #393145 is a reply to message #393123] |
Fri, 27 May 2005 18:17 |
Eclipse User |
|
|
|
Originally posted by: bencomo.us.ibm.com
Hey Ed,
Thank you for your reply. I am setting the selection in the PartListener
when the view is activated (see below). Do I have to set it up in any
other place?
protected IPartListener partListener = new IPartListener()
{
public void partActivated(IWorkbenchPart p)
{
if (p == ERUPConfigurationView.this)
{
treeViewer.setSelection(treeViewer.getSelection(), true);
}
}
Thanks,
Al.-
|
|
|
Re: How to get TreeViewer selection to show in PropertiesView [message #393146 is a reply to message #393145] |
Fri, 27 May 2005 18:18 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Al,
I wonder if this gets called when the part is being created? Maybe
during initial construction the selection is being set before the
listener is hooked up... One could always do a delayed selection using
Display.asyncExec.
Al Bencomo wrote:
> Hey Ed,
>
> Thank you for your reply. I am setting the selection in the
> PartListener when the view is activated (see below). Do I have to set
> it up in any other place?
>
> protected IPartListener partListener = new IPartListener()
> {
> public void partActivated(IWorkbenchPart p)
> {
> if (p == ERUPConfigurationView.this)
> {
> treeViewer.setSelection(treeViewer.getSelection(), true);
> }
> }
>
> Thanks,
> Al.-
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03238 seconds