Bug 211127 - [registry view] Disabling/Enabling plug-in does not refresh its icon
Summary: [registry view] Disabling/Enabling plug-in does not refresh its icon
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Jacek Pospychala CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-11-27 16:03 EST by Brian Bauman CLA
Modified: 2008-02-05 16:30 EST (History)
3 users (show)

See Also:


Attachments
patch (1.43 KB, patch)
2008-01-18 20:19 EST, Jacek Pospychala CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Bauman CLA 2007-11-27 16:03:29 EST
The icons added to the registry view for bug 210971 don't refresh after the user has triggered the disable/enable event.  This leaves the UI displaying stale information to the users.
Comment 1 Chris Aniszczyk CLA 2007-11-29 21:32:57 EST
I believe we may be limited by the runtime here? I don't remember, may Tom can answer. 

I do agree the UI can be cleaner here.
Comment 2 Brian Bauman CLA 2007-11-30 10:42:32 EST
It would be nice to listen to the runtime for changes.  But if we can't, we should be refreshing the icons when the user runs our disable/enable action.
Comment 3 Thomas Watson CLA 2007-11-30 15:30:05 EST
You could be a BundleListener and listen to UNRESOLVED events.  If the bundle becomes unresolved and it has a DisabledInfo object associated with it then you could trigger the disabled icon.  Similarly you could listen for RESOLVED events to know that a bundle got enabled.
Comment 4 Jacek Pospychala CLA 2008-01-17 05:34:32 EST
I was looking into this and just to clarify:
what's described by Tom is already implemented. if there's any BundleListener event from bundle that has changed its Enabled state, icon will be refreshed. But simple Disable/Enable (or console "disableBundle"/"enableBundle") doesn't trigger BundleListener.



Comment 5 Thomas Watson CLA 2008-01-17 09:57:38 EST
Disabling a bundle does not force the bundle to become UNRESOLVED synchronously.  You must perform a refresh operation on the bundle (using PackageAdmin.refreshPackages method or the "refresh" command at the console).  Only then will the UNRESOLVED event be fired.  At that point PDE can determine why the bundle became unresolved.

Chris's comment 1 is correct in that we do not actually fire any event on each individual enable/disable call.  We want to avoid adding another event bus for that.  Currently the best thing you can do is listen to the BundleEvents RESOLVED/UNRESOLVED to update the results of being enabled/disabled when refreshPackages is called.
Comment 6 Jacek Pospychala CLA 2008-01-17 11:34:19 EST
100% agree with you Tom, it just took me 1h to figure out earlier what's the status of this bug, so I added clarification.


so what could we do to fix this bug?
What about Registry polling from time to time with refresh call? (yes, nobody likes polling:P)
Or maybe Equinox should provide higher verbosity for advanced clients like PDE? Not sure if it's worth it. But  assuming disable/enable mechanism is used in security, how security concerned components are notified that something has just got disabled?
Comment 7 Chris Aniszczyk CLA 2008-01-17 11:39:47 EST
I don't think a poll is needed. Maybe an explicit refreshPackages call when we go ahead and disable/enable bundles... that should trigger things properly I think.
Comment 8 Jacek Pospychala CLA 2008-01-17 11:58:36 EST
(In reply to comment #7)
> I don't think a poll is needed. Maybe an explicit refreshPackages call when we
> go ahead and disable/enable bundles... that should trigger things properly I
> think. 

that would assume we're only client. If someone else does disable/enable then we're dead :P
Comment 9 Brian Bauman CLA 2008-01-17 12:22:39 EST
I agree with Chris, if we handle the case where we enable/disable bundles then we cover 95% of the scenarios.  It would be great to make it work when the user disabled something from the command line, but this is not required and if it takes a lot of time, is not worth it.
Comment 10 Jacek Pospychala CLA 2008-01-17 12:28:19 EST
cool, I like simple patches :P
Comment 11 Jacek Pospychala CLA 2008-01-18 20:19:58 EST
Created attachment 87315 [details]
patch

patch
Comment 12 Chris Aniszczyk CLA 2008-01-19 14:08:22 EST
Danke!!!
Comment 13 Chris Aniszczyk CLA 2008-01-19 14:09:40 EST
nice and simple, thanks Jacek :)
Comment 14 Brian Bauman CLA 2008-02-05 16:30:14 EST
Verified on I20080204-0010