Disabled components: to popup or not to popup context menu?
Hi experts,
just noticed that Swing pops up a component menu on mouse click even if the component isn't enabled. Seems to contradict the general rule to not allow "active" interaction (vs. "passive" as f.i. still showing the tooltip, the distinction is probably freely invented but serves me well enough ;) with a disabled component.
Could half-way live with that - except that then all menu items need to be disabled individually. Another option would be to return a null componentPopup if disabled. Not generally applicable because requires subclassing. Yet another might be to force-inject a MouseListener into the rootPane: it would intercept and swallow the popup triggers if the target is disabled, otherwise delegate to the ui-installed listener.
Comments please?
Thanks
Jeanette