|
Re: Properties not displayed in property page [message #485222 is a reply to message #484953] |
Thu, 10 September 2009 20:27 |
|
Paul Glezen wrote:
> I have an editor for which I'd like to display a few properties in the
> default property page. I was following the advice here
>
> http://wiki.eclipse.org/FAQ_How_do_I_use_property_pages%3F
>
> to get me started. My case seems simpler than most. When the user
> acquires focus in my editor, I'd like a few properties to be displayed
> in the property view.
>
> I added a clause to my editor's getAdapter method to include the case
> where the input class is IPropertySource, and returned my
> IPropertySource. I was following the model for returning an Outline
> View Page. But alas my editor's getAdapter method was never invoked
> with an IPropertySource request. After printing out what does get
> requested, I saw a few requests for IPropertySheetPage. But I was
> hoping I only needed to implement IPropertySource.
>
> I tried creating an instance of PropertySheetPage in response for
> IPropertySheetPage requests. I provided it with an
> IPropertySourceProvider which always returned my original
> IPropertySource. I can't explain the resulting behavior. I click
> around for a while and see nothing in the property view. Then, after
> about 10 seconds of clicking around, the properties appear in the
> property view with bogus values. Moreover, the properties only appear
> when clicking in my Outline View (but not at first !!).
>
> The API doc for IPropertySource recommends the client (an editor in my
> case) register an adapter factory with the adapter manager. I can do
> that. But wouldn't that be for adapting to clients that don't implement
> IAdaptable?
You have to set the object as the input on your property sheet page
for the IPropertySourceProvider to even be asked for the
corresponding IPropertySource. And if the page was just listening
for selection changes from a text editor, there are some
optoimizations in the text viewer that require you to either list to
post selection changes or change the length of the selected text to
send a notification.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Powered by
FUDForum. Page generated in 0.02017 seconds