Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Changing property values in property view
Changing property values in property view [message #537926] Fri, 04 June 2010 07:56 Go to next message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
Hello all,

I am trying to change the values I have set via a IPropertySource in the
properties view.

I have set the properties initially, but I don't understand yet whether the
properties view actually listens for changes in my property descriptors, or
how I can actually update the values in the properties view.

Any tips?

Thanks heaps

Greg
Re: Changing property values in property view [message #537958 is a reply to message #537926] Fri, 04 June 2010 09:30 Go to previous messageGo to next message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
Answer from an old post that I found, sorry for the dupe:

The properties view listens for selection changed events from the workbench
page's selection service, and notifies the current property page of the
change. The default property page updates in response (as should other
implementations).

The view or editor needs to publish its selection provider via
getSite().setSelectionProvider(ISelectionProvider), and issue events to
selection listeners appropriately.

If the view or editor is implemented using a viewer, you can just set that
as the selection provider.

If properties of the selected element are changing without the selection
changing, you may need to issue a fake selection event to get the properties
view to update.

Nick



From within the


Phil Williams wrote:

I have a RCP app that uses the properties view. The properties that are
shown can be modified within editors. What event should be fired to let the
PropertySheet know that it has to update or do I have to get a handle to it
and do it myself?

Thanks,
Phil




"geejay" <gjmcknight@schlagundrahm.ch> wrote in message
news:huabk2$vg9$1@build.eclipse.org...
> Hello all,
>
> I am trying to change the values I have set via a IPropertySource in the
> properties view.
>
> I have set the properties initially, but I don't understand yet whether
> the properties view actually listens for changes in my property
> descriptors, or how I can actually update the values in the properties
> view.
>
> Any tips?
>
> Thanks heaps
>
> Greg
Re: Changing property values in property view [message #537966 is a reply to message #537958] Fri, 04 June 2010 10:59 Go to previous messageGo to next message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
Actually, this still doesn't help me enough.

I cant seem to find how to fire an event that the PropertySheet listens to.

Any tips?

"geejay" <gjmcknight@schlagundrahm.ch> wrote in message
news:huah36$s18$1@build.eclipse.org...
> Answer from an old post that I found, sorry for the dupe:
>
> The properties view listens for selection changed events from the
> workbench page's selection service, and notifies the current property page
> of the change. The default property page updates in response (as should
> other implementations).
>
> The view or editor needs to publish its selection provider via
> getSite().setSelectionProvider(ISelectionProvider), and issue events to
> selection listeners appropriately.
>
> If the view or editor is implemented using a viewer, you can just set that
> as the selection provider.
>
> If properties of the selected element are changing without the selection
> changing, you may need to issue a fake selection event to get the
> properties view to update.
>
> Nick
>
>
>
> From within the
>
>
> Phil Williams wrote:
>
> I have a RCP app that uses the properties view. The properties that are
> shown can be modified within editors. What event should be fired to let
> the PropertySheet know that it has to update or do I have to get a handle
> to it and do it myself?
>
> Thanks,
> Phil
>
>
>
>
> "geejay" <gjmcknight@schlagundrahm.ch> wrote in message
> news:huabk2$vg9$1@build.eclipse.org...
>> Hello all,
>>
>> I am trying to change the values I have set via a IPropertySource in the
>> properties view.
>>
>> I have set the properties initially, but I don't understand yet whether
>> the properties view actually listens for changes in my property
>> descriptors, or how I can actually update the values in the properties
>> view.
>>
>> Any tips?
>>
>> Thanks heaps
>>
>> Greg
>
Re: Changing property values in property view [message #539288 is a reply to message #537966] Thu, 10 June 2010 09:33 Go to previous message
Geejay is currently offline GeejayFriend
Messages: 160
Registered: February 2010
Senior Member
The main problem is that the API hides all the pages (PropertySheetPage) and
therefore viewers (PropertySheetViewer) within the properties view.

Good news is, you can tell the properties view to use a page of your desire.
So I supply the page that it would normally use by default
(PropertySheetPage), except when I supply it, I keep a reference to it
(obviously), and then you can call propertySheetPageRef.refresh() to update
the model (thankfully this method is public).

public Object getAdapter(Class adapter) {
if (adapter == IPropertySource.class) {
return resultProvider;
} else if (adapter == IPropertySheetPage.class) {
return propertySheetPage;
}
return null;
}



"geejay" <gjmcknight@schlagundrahm.ch> wrote in message
news:huamag$jj3$1@build.eclipse.org...
> Actually, this still doesn't help me enough.
>
> I cant seem to find how to fire an event that the PropertySheet listens
> to.
>
> Any tips?
>
> "geejay" <gjmcknight@schlagundrahm.ch> wrote in message
> news:huah36$s18$1@build.eclipse.org...
>> Answer from an old post that I found, sorry for the dupe:
>>
>> The properties view listens for selection changed events from the
>> workbench page's selection service, and notifies the current property
>> page of the change. The default property page updates in response (as
>> should other implementations).
>>
>> The view or editor needs to publish its selection provider via
>> getSite().setSelectionProvider(ISelectionProvider), and issue events to
>> selection listeners appropriately.
>>
>> If the view or editor is implemented using a viewer, you can just set
>> that as the selection provider.
>>
>> If properties of the selected element are changing without the selection
>> changing, you may need to issue a fake selection event to get the
>> properties view to update.
>>
>> Nick
>>
>>
>>
>> From within the
>>
>>
>> Phil Williams wrote:
>>
>> I have a RCP app that uses the properties view. The properties that
>> are shown can be modified within editors. What event should be fired to
>> let the PropertySheet know that it has to update or do I have to get a
>> handle to it and do it myself?
>>
>> Thanks,
>> Phil
>>
>>
>>
>>
>> "geejay" <gjmcknight@schlagundrahm.ch> wrote in message
>> news:huabk2$vg9$1@build.eclipse.org...
>>> Hello all,
>>>
>>> I am trying to change the values I have set via a IPropertySource in the
>>> properties view.
>>>
>>> I have set the properties initially, but I don't understand yet whether
>>> the properties view actually listens for changes in my property
>>> descriptors, or how I can actually update the values in the properties
>>> view.
>>>
>>> Any tips?
>>>
>>> Thanks heaps
>>>
>>> Greg
>>
Previous Topic:integrating maven2 artifacts into RCP applications?
Next Topic:Issue resolved
Goto Forum:
  


Current Time: Sat May 11 01:35:47 GMT 2024

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

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

Back to the top