Bug 396271 - [Trim] Class extending WorkbenchWindowControlContribution not invoking isVisible() method in Juno
Summary: [Trim] Class extending WorkbenchWindowControlContribution not invoking isVisi...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-12-11 08:52 EST by Nihal Ahmed CLA
Modified: 2019-12-23 16:23 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nihal Ahmed CLA 2012-12-11 08:52:06 EST
Hello, 

With the migration to Juno 4.2, class extending WorkbenchWindowControlContribution isn't invoking an overridden method isVisible() {
Method inherited from class org.eclipse.jface.action.ContributionItem} which was working fine till 3.8. This is despite the fact that the javadoc for juno still enlists them as a valid method/implementation.

I am using this method to hide a custom composite (created in createControl method) to be shown/hidden in the toolbar based on the perspective. Is this an intentional change or should anything else be changed in the implementation to migrate to Juno?

Experts from Eclipse forum suggested me to open a bugzilla entry instead. 
(http://www.eclipse.org/forums/index.php/t/441135/)

Thank you for any help one can provide on this. 
Any assistance in this direction will really be appreciated. 

Regards, 
Nihal
Comment 1 Nihal Ahmed CLA 2012-12-12 01:40:38 EST
Update: 

I noticed that the isVisible method in DynamicToolBarContributionItem class is no longer present and it relies on the super implementation of this method from the class ContributionItem. 

In addition, I also noticed that this DynamicToolBarContributionItem is not getting listed as a contribution item in ToolBarManager class. :(

Can this additional information help anybody point me to what's happening here?

Regards, 
Nihal
Comment 2 Lakshmi P Shanmugam CLA 2012-12-12 02:11:28 EST
Moving to platform UI
Comment 3 Paul Webster CLA 2012-12-12 08:34:34 EST
I don't see why it shouldn't just implement setVisible(*)/isVisible(*) like the 3.8 version.

PW
Comment 4 Nihal Ahmed CLA 2012-12-13 04:43:16 EST
Hi Paul, 

Thank you very much for a quick reply. 

For a moment, I too was convinced that perhaps your suggestion could work. However, setVisible method isn't getting invoked both in 3.8 and 4.2 :(
Nevertheless, isVisible is invoked in 3.8 and not 4.2 which is why it works fine as I conditionally return true or false in this method. 

I also came across this https://bugs.eclipse.org/bugs/show_bug.cgi?id=297375
My implementation is exactly like specified in Comment 1 by Dominik G. However, this isn't related to 4.2. Am I missing out on something relevant to 4.2 for this?

Anticipating a promising reply.

Regards, 
Nihal
Comment 5 Paul Webster CLA 2012-12-13 07:57:51 EST
Those proxy methods are missing from 4.2, that's probably what causes the problem.

if you provide a patch, I'll be happy to look at it.  http://wiki.eclipse.org/Platform_UI/How_to_Contribute

PW
Comment 6 Nihal Ahmed CLA 2012-12-14 04:41:48 EST
Resolved this by appending a visibleWhen condition to the control through the plugin.xml to hide the control based on the perspective instead of pro grammatically hiding it. However, the issue of isVisible method not being invoked remains as is. :(

Thanks, 
Nihal
Comment 7 Eclipse Genie CLA 2019-12-23 16:23:51 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.