Tooltip for disabled controls

Pavel Safrata pavel.safrata at
Tue Apr 16 02:44:55 PDT 2013

Looks like we'll need two steps anyway.

First, in Scenegraph, support delivering events to disabled nodes.
I looked at the existing event filters in Controls and If we enabled 
event filters for disabled nodes, four of the filters would need an 
isDisabled() check.
If we added the marker interface or annotation, we should be more or 
less safe (except of losing the ugly click-through behavior). This will 
require some refactoring as core event system needs to be independent of 
scene graph (and its isDisabled() property).

Second, in Controls, provide a way to tell where to show the tooltip and 
where not. I can see three options:
- boolean property (showTooltipWhenDisabled), perhaps with the 
inheriting logic proposed by Steve
- separate tooltip property (ObjectProperty<Tooltip> 
disabledTooltipProperty()) so you can define different tooltips that 
switch automatically
- somehow decide automatically (I don't really think it's possible since 
we don't know if a Pane is a tool bar or not)


On 9.4.2013 16:42, steve.x.northover at wrote:
> On 08/04/2013 3:33 PM, Pavel Safrata wrote:
>>> What events are need by the toolkit to implement tool tips?
>> moved, exited, pressed
> So it would be possible (but ugly) to only have new versions of these 
> events that fired when a control is disabled.
>>> Which controls implement tool tips?
>> All of them. The tooltipProperty is on the Control class itself.
> What I am trying to understand is whether we want tool tips to always 
> show for disabled controls or whether we just want them to show for 
> disabled items in tool bars.  My feeling is that most controls do not 
> want tool tips to show when they are disabled. Tool items are an 
> exception to the rule because hover help allows the user to identify 
> the action the tool item will perform.  I also realize that any 
> control can be a tool item.
> Tool tips are installed by default in FX for:
> * color squares in the color picker
> * numbered pages in the paginator
> Tool tips often appear for:
> * tabs items in a tab folder
> * tool items in a tool bar
> * tree/table items that are clipped (not supported in FX)
> * tree/table headers (not supported in FX)
> * menu items (not supported in FX)
> I suppose we could control whether a tooltip is displayed when a 
> control is disabled by adding a boolean property.  The value would be 
> inherited from the parent if not otherwise set.  In a toolbar, tool 
> tips would be displayed by default.  In other controls like tree or 
> table, they would not.
> Steve

More information about the openjfx-dev mailing list