Skip to main content



      Home
Home » Eclipse Projects » GEF » PropertyView driven from selections in Editor
PropertyView driven from selections in Editor [message #161043] Wed, 08 December 2004 20:04 Go to next message
Eclipse UserFriend
Hi,

I have a MultiPageEditor implementation with one of the editor being a
Swing editor (wrapped within a SWT control). In this editor as i select
various objects and i want to display their properties in the properties
view.

In the multipage editor i set my own SelectionProvider on the editor site.
Also, i create a new PropertySheetPage() in getAdapter().

In the getSelection() implementation of the ISelectionProvider, i return a
new StructuredSelection() initializing it with the model objects selected
in my editor. The model objects themselves implement IAdaptable,
IPropertySource and IWorkbenchAdapter and the getAdapter() returns the
object itself for IWorkbenchAdapter and IPropertySource classes.

The problem is the getAdapter() of my model object never gets called when
i select the object in my editor. It gets called when the workbench is
activated but the argument is always an
org.eclipse.core.resources.IResource. It never gets called with
IPropertySource.class.

Iam not sure how what's the connection between an IStructuredSelection and
IPropertySource.. Can someone please help..? I did not see much help on
using property sheets for editor selections, so i am not sure if i am
doing it right.

thanks,
-Ravi
Re: PropertyView driven from selections in Editor [message #161061 is a reply to message #161043] Thu, 09 December 2004 00:27 Go to previous messageGo to next message
Eclipse UserFriend
It was a mistake on my part. I was not firing events correctly after a
selection.

Ravi wrote:

> Hi,

> I have a MultiPageEditor implementation with one of the editor being a
> Swing editor (wrapped within a SWT control). In this editor as i select
> various objects and i want to display their properties in the properties
> view.

> In the multipage editor i set my own SelectionProvider on the editor site.
> Also, i create a new PropertySheetPage() in getAdapter().

> In the getSelection() implementation of the ISelectionProvider, i return a
> new StructuredSelection() initializing it with the model objects selected
> in my editor. The model objects themselves implement IAdaptable,
> IPropertySource and IWorkbenchAdapter and the getAdapter() returns the
> object itself for IWorkbenchAdapter and IPropertySource classes.

> The problem is the getAdapter() of my model object never gets called when
> i select the object in my editor. It gets called when the workbench is
> activated but the argument is always an
> org.eclipse.core.resources.IResource. It never gets called with
> IPropertySource.class.

> Iam not sure how what's the connection between an IStructuredSelection and
> IPropertySource.. Can someone please help..? I did not see much help on
> using property sheets for editor selections, so i am not sure if i am
> doing it right.

> thanks,
> -Ravi
Re: PropertyView driven from selections in Editor [message #162343 is a reply to message #161061] Tue, 21 December 2004 02:48 Go to previous message
Eclipse UserFriend
Hi Ravi,
I'm afraid I faced the same problem you ever encountered. If you can give
me
some advice, I'll appriciate it very much.

BR,
zbw


Ravi wrote:

> It was a mistake on my part. I was not firing events correctly after a
> selection.

> Ravi wrote:

>> Hi,

>> I have a MultiPageEditor implementation with one of the editor being a
>> Swing editor (wrapped within a SWT control). In this editor as i select
>> various objects and i want to display their properties in the properties
>> view.

>> In the multipage editor i set my own SelectionProvider on the editor site.
>> Also, i create a new PropertySheetPage() in getAdapter().

>> In the getSelection() implementation of the ISelectionProvider, i return a
>> new StructuredSelection() initializing it with the model objects selected
>> in my editor. The model objects themselves implement IAdaptable,
>> IPropertySource and IWorkbenchAdapter and the getAdapter() returns the
>> object itself for IWorkbenchAdapter and IPropertySource classes.

>> The problem is the getAdapter() of my model object never gets called when
>> i select the object in my editor. It gets called when the workbench is
>> activated but the argument is always an
>> org.eclipse.core.resources.IResource. It never gets called with
>> IPropertySource.class.

>> Iam not sure how what's the connection between an IStructuredSelection and
>> IPropertySource.. Can someone please help..? I did not see much help on
>> using property sheets for editor selections, so i am not sure if i am
>> doing it right.

>> thanks,
>> -Ravi
Previous Topic:Move the Line Figure's Z-order to bottom
Next Topic:How to add figures programmatically
Goto Forum:
  


Current Time: Mon May 05 16:18:38 EDT 2025

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

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

Back to the top