|How to update the property view when properties change [message #632503]
||Wed, 13 October 2010 05:02
Registered: July 2009
I have an object that use IAdapterFactory to provide the IPropertySource interface. The
IPropertySource instances are used by the standard property view when selection change in
the Project Explorer view. It works correctly but I need to know what is the best way to
update the content of the property view when object properties change.
For example, imagine that the object is a file, and one of the property shown by the
property view is its file's size. When I detect that the file size change, I would like to
update the property view, but only if the view display this object.
1- I didn't find any method to know which item are selected in the property view, so it is
difficult to update the property view at the good time...
2- My first approach was to add listeners to the IPropertySource instance and refresh the
property view when my listener receive event but It doesn't work because I didn't find a
good way to unregister my listener when the property view change its input selection.
3- Also note that I found another way to do it using the AdapterFactory but it doesn't
work well for multiple selection or multiple property view instance. My idea was to keep a
reference to the adaptObject that was passed to the AdapterFactory when the getAdapter
method is called, and register and unregister my listeners at this point when a new
IProperySource is requested (and supposing that there is only one IPropertySource instance
used at a time.
Any help will be appreciate.
Powered by FUDForum
. Page generated in 0.01538 seconds