Defaulting a comboBox's buttonCell to the cellFactory

Jonathan Giles jonathan.giles at
Fri Jun 1 14:32:51 PDT 2012

So, in summary, Urs and I would appreciate votes on option A or option B:

Option A: the ComboBox buttonCell by default uses a cell from the 
provided cell factory.

Option B: The ComboBox buttonCell DOES NOT use a cell from the provided 
cell factory, and instead requires the user to manually create a cell 
and set it in the buttonCell property.

Option A is consistent with the approach used in JavaFX 2.1, whereas 
Option B is the current approach used in JavaFX 2.2.

The answer to this question largely comes down to the more common use 
case when using the cell factory: do we expect users to want to use the 
same cell in the button and the list, or do we expect them to want to 
have different cells (and perhaps the default cell in the button area).

I'm totally not against changing this, so I welcome your votes on this 

-- Jonathan

On 1/06/2012 5:39 p.m., Urs Reupke wrote:
> Hi all,
> back in April, Jonathan proposed a change to comboBoxes that allowed
> to separate the button's rendering from the list's rendering.[1]
> In the JIRA issue accompanying that discussion [2], he also mentioned
> ways to render the button when the new buttonCell property is not set:
> "If this is not set, there are two options:
> 1) Use a cell from the ComboBox.cellFactory
> 2) Not style the button at all, and use a default cell from the skin"
> Now, in FX2.2b10, the buttonCell is rendered as toString if the
> property is not set.
> I believe that his option 1) would be a great improvement to the
> behaviour, and Jonathan asked me to make that proposal public.
> My reasoning is that those who need the buttonCell to be rendered
> differently can do it, whereas those whose buttons and listcells look
> alike don't need to think about it. From my experience, the latter
> should be the majority.
> I appreciate your feedback on the matter.
> Thank you
> -Urs
> [1]
> [2]

More information about the openjfx-dev mailing list