Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Help: How can I hook the selection event in my view with PropertySheetPage
Help: How can I hook the selection event in my view with PropertySheetPage [message #41045] Tue, 27 May 2003 15:07 Go to next message
Eclipse UserFriend
Originally posted by: wgyun.hotmail.com

Hi there,
I have a TreeView SWT in my view which extends ViewPart, and I also have a
PropertySheetPage associated with the view. The intention is when I click an
item
in my view, the properties of this item(which implements IPropertySource)
would show up in the PropertySheetPage. But somehow, the selection event
seemed not to be received by
PropertySheetPage. My question is am I missing anything? Do I have to
specificly set a SelectionProvider(TreeViewer's default selection provider)
to PropertySheetPage?
Your help is greatly appreciated!
Thanks!

public class MyView extends ViewPart
{
private TreeViewer _viewer;
private PropertySheetPage _propsPage;

....

public Object getAdapter(Class key)
{
if (key.equals(ISelectionProvider.class))
{
return _viewer;
}
if (key.equals(IPropertySheetPage.class))
{
return _propsPage;
}
return super.getAdapter(key);
}
}
Re: How can I hook the selection event in my view with PropertySheetPage [message #41107 is a reply to message #41045] Tue, 27 May 2003 16:33 Go to previous message
Eclipse UserFriend
Originally posted by: wgyun.hotmail.com

Maybe I don't express it clearly, the situation is when I selected the item
in the view,
I didn't see the properties shown up. So I subclassed PropertySheetPage, and
add a trace in the function:
public void selectionChanged(IWorkbenchPart part, ISelection selection)
{
System.out.println("Selection changed.");
super.selectionChanged(part, selection);
}
And that output is never captured, so I believe that the selection event is
not transfered from the view to the property sheet page.


"Cindy Wen" <wgyun@hotmail.com> wrote in message
news:bb0c85$fme$1@rogue.oti.com...
> Hi there,
> I have a TreeView SWT in my view which extends ViewPart, and I also have a
> PropertySheetPage associated with the view. The intention is when I click
an
> item
> in my view, the properties of this item(which implements IPropertySource)
> would show up in the PropertySheetPage. But somehow, the selection event
> seemed not to be received by
> PropertySheetPage. My question is am I missing anything? Do I have to
> specificly set a SelectionProvider(TreeViewer's default selection
provider)
> to PropertySheetPage?
> Your help is greatly appreciated!
> Thanks!
>
> public class MyView extends ViewPart
> {
> private TreeViewer _viewer;
> private PropertySheetPage _propsPage;
>
> ...
>
> public Object getAdapter(Class key)
> {
> if (key.equals(ISelectionProvider.class))
> {
> return _viewer;
> }
> if (key.equals(IPropertySheetPage.class))
> {
> return _propsPage;
> }
> return super.getAdapter(key);
> }
> }
>
>
Previous Topic:Threads and Monitors view?
Next Topic:Java project directly from CVS
Goto Forum:
  


Current Time: Sat Jul 19 11:38:07 EDT 2025

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

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

Back to the top