Refresh the tree displayed in Synchronize View [message #309771] |
Wed, 08 November 2006 04:38  |
Eclipse User |
|
|
|
Originally posted by: yuvraj_sawant.persistent.co.in
Hi,
On performing some operation on a file from Synchronize View I want
to decorated theselected file node with a new icon and these icons must be
seen on the tree in Synchronize View. In other words I want to refresh the
whole tree displayed in the Synchronize View. If it is possible to refresh
only the selected elements then this will help a lot as performance will
not be an issue in future. Can someone point me out on this?
TIA
Regards,
Yuvraj Sawant
|
|
|
|
|
|
|
Re: Refresh the tree displayed in Synchronize View [message #309860 is a reply to message #309832] |
Fri, 10 November 2006 09:09  |
Eclipse User |
|
|
|
For SubscriberParticipants, there's not much you can do because the tree
update code is all internal and only reacts changes in the SyncInfo
associated with a resource. About the only thing you could do is perform
an update on the viewer (see ISynchronizePage#getViewer()).
For ModelSynchronizeParticipants, if you want to refresh the decorator
of an IResource, you can just call the Viewer update method with the
resource(s) as arguments and their labels will be updated. However,
the situation is a bit complicated since the view can contain elements
from other models. Only the model provider that owns the model would
know how to update these elements. If you need label updating for
non-resource elements, I would suggest you log an enhancement request.
Michael
yuvraj wrote:
> Hi,
>
> I am using Subscriber Participant but I will also like to know how do we do
> it for Model Participant as in future I also have to provide some
> implementation on Model Participant.
>
> Regards,
> Yuvraj Sawant.
>
>
> "Michael Valenta" <Michael_Valenta@ca.ibm.com> wrote in message
> news:eivkkc$irv$1@utils.eclipse.org...
>> It depends on which participant class are you subclassing. Are you using a
>> subclass of SubscriberParticipant or ModelSynchronizeParticipant?
>>
>> Michael
>>
>> yuvraj wrote:
>>> Hi,
>>>
>>> I am the owner of Synchronize Participant and I am creating a
>>> plugin for a VCS.
>>>
>>> I have added my own label decorator in Sync. Participant using
>>> configuration.addLabelDecorator(ASyncLabelDecorator.getInsta nce()); First
>>> time the Icon associated with the files shown in sync View are decorated
>>> . The problem is they are not getting refreshed when some action is done
>>> on some elements shown in Sync View.
>>>
>>> Is the way for refreshing the Sync View same as we refresh
>>> decorator provided using an extension point. I tried to refresh Sync View
>>> in the way we refresh the view added using an extension point in
>>> plugin.xml file but ILabelDecorator implemented method " decorateImage()"
>>> is not getting called. I tried to refresh it usings the below given code
>>> snipet by calling refresh(object[] a) API from an action added in context
>>> menu of Synchroize View:
>>>
>>>
>>> public void refresh(Object[] elements) //elements is the list of
>>> elements selected and changed.
>>> {
>>> fireLabelEvent(new LabelProviderChangedEvent(this, elements));
>>> }
>>>
>>> private void fireLabelEvent(final LabelProviderChangedEvent event)
>>> {
>>> Display.getDefault().asyncExec(new Runnable()
>>> {
>>> public void run()
>>> {
>>> fireLabelProviderChanged(event);
>>> }
>>> }); // Decorate using current UI thread
>>>
>>> }
>>>
>>>
>>>
>>> This way is not working . Do I have to use a different way to refresh
>>> labels shown in a Sync. View. If yes can you please point me out to it?
>>>
>>> TIA,
>>>
>>> Regards,
>>> Yuvraj Sawant
>>>
>>>
>>>
>>>
>>> "Michael Valenta" <Michael_Valenta@ca.ibm.com> wrote in message
>>> news:eisudb$jrt$1@utils.eclipse.org...
>>>> The answer to the question depends on several factors. Are you the owner
>>>> of the Synchronize Participant (i.e. did you implement the
>>>> ISynchronizeParticipant) or are you a third party that has some
>>>> additional state you want to show? Are you using Eclipse 3.2 or later or
>>>> are you using a previous release?
>>>>
>>>> Michael
>>>>
>>>> yuvraj wrote:
>>>>> Hi,
>>>>>
>>>>> On performing some operation on a file from Synchronize View I
>>>>> want to decorated theselected file node with a new icon and these icons
>>>>> must be seen on the tree in Synchronize View. In other words I want to
>>>>> refresh the whole tree displayed in the Synchronize View. If it is
>>>>> possible to refresh only the selected elements then this will help a
>>>>> lot as performance will not be an issue in future. Can someone point me
>>>>> out on this?
>>>>>
>>>>> TIA
>>>>>
>>>>> Regards,
>>>>> Yuvraj Sawant
>
|
|
|
Powered by
FUDForum. Page generated in 0.03498 seconds