I think this is a reasonable expectation. Can you please file an issue and we can progress it from there?

Thanks,

-- Jonathan

On 23/06/16 7:31 AM, Tom Schindl wrote:
Hi,

Take a look at the stack below.

ComboBoxListViewSkin<T>(ComboBoxBaseSkin<T>).<init>(ComboBoxBase<T>, 
ComboBoxBaseBehavior<T>) line: 57    
ComboBoxListViewSkin<T>(ComboBoxPopupControl<T>).<init>(ComboBoxBase<T>, 
ComboBoxBaseBehavior<T>) line: 61        
ComboBoxListViewSkin<T>.<init>(ComboBox<T>) line: 113 
ComboBox<T>.createDefaultSkin() line: 420 
ComboBox<T>(Control).impl_processCSS(WritableValue<Boolean>) line: 859      
FSimpleSelectControl<T>(Parent).impl_processCSS(WritableValue<Boolean>) line: 
1280  
FSimpleSelectControl<T>(Control).impl_processCSS(WritableValue<Boolean>) line: 
855  
FlexibleGridLayoutPane$LayoutItem(Parent).impl_processCSS(WritableValue<Boolean>)
 line: 1280      
GridPane(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280       
FlexibleGridLayoutPane(Parent).impl_processCSS(WritableValue<Boolean>) line: 
1280 
VBox(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280   
ScrollPaneSkin$4(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280     
  
ScrollPaneSkin$3(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280     
  
ScrollPane(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280     
ScrollPane(Control).impl_processCSS(WritableValue<Boolean>) line: 855     
ScrollPane(Node).processCSS() line: 9056        
SimpleListCell<T>(Node).applyCss() line: 9153     
ComboBoxListViewSkin<T>(ComboBoxBaseSkin<T>).updateDisplayArea() line: 150  
ComboBoxListViewSkin<T>.updateButtonCell() line: 406 [local variables 
unavailable]        
ComboBoxListViewSkin<T>.<init>(ComboBox<T>) line: 134 
ComboBox<T>.createDefaultSkin() line: 420 
ComboBox<T>(Control).impl_processCSS(WritableValue<Boolean>) line: 859      
FSimpleSelectControl<T>(Parent).impl_processCSS(WritableValue<Boolean>) line: 
1280  
FSimpleSelectControl<T>(Control).impl_processCSS(WritableValue<Boolean>) line: 
862  
FlexibleGridLayoutPane$LayoutItem(Parent).impl_processCSS(WritableValue<Boolean>)
 line: 1280      
GridPane(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280       
FlexibleGridLayoutPane(Parent).impl_processCSS(WritableValue<Boolean>) line: 
1280 
VBox(Parent).impl_processCSS(WritableValue<Boolean>) line: 1280   
It shows you a stack where I create an instance of a ComboBox but this
code creates 2 Skin-Instance for the same ComboBox-Instance (the 2nd
iteration starts with updateDisplayArea).

I've been unable to come up with a stripped down example but I think
Control#impl_processCSS(WritableValue<Boolean>) has to ensure that no
2nd skin is created while the first initialization is not finished.

Something like that:

private boolean createSkinCreationInProgress;

@Override protected void impl_processCSS(WritableValue<Boolean> unused) {
         super.impl_processCSS(unused);

         if (getSkin() == null) {
             if( createSkinCreationInProgress ) {
                 return;
             }
             try {
               createSkinCreationInProgress = true;
                // try to create default skin
                final Skin<?> defaultSkin = createDefaultSkin();
                if (defaultSkin != null) {
                        skinProperty().set(defaultSkin);
                        super.impl_processCSS(unused);
                } else {
                        final String msg = "The -fx-skin property has not been 
defined in CSS for " + this +
                                    " and createDefaultSkin() returned null.";
                        final List<CssError> errors = StyleManager.getErrors();
                        if (errors != null) {
                                CssError error = new CssError(msg);
                                errors.add(error); // RT-19884
                        }
                        Logging.getControlsLogger().severe(msg);
                }
             } finally { createSkinCreationInProgress = false; }
         }
}

Does that make sense?

Tom


Reply via email to