@Override protected void updateItem(T item, boolean empty) { super.updateItem(item, empty); if (!empty) { CharSequence t = this.labelExtractor.apply(item); if (t == null) { setGraphic(null); } else if (t instanceof StyledString) { StyledLabel l = new StyledLabel((StyledString) t); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item); if( g != null ) { l.setGraphic(g); } setGraphic(l); } else { Label l = new Label(t.toString()); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item); if( g != null ) { l.setGraphic(g); } setGraphic(l); } } else { setGraphic(null); } } }
@Override protected void updateItem(T item, boolean empty) { super.updateItem(item, empty); if (!empty && item != null) { CharSequence t = this.labelExtractor.apply(item); if (t == null) { setGraphic(null); } else if (t instanceof StyledString) { StyledLabel l = new StyledLabel((StyledString) t); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item); if( g != null ) { l.setGraphic(g); } setGraphic(l); } else { Label l = new Label(t.toString()); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item); if( g != null ) { l.setGraphic(g); } setGraphic(l); } } else { setGraphic(null); } } }
@Override protected void updateItem(T item, boolean empty) { super.updateItem(item, empty); if (!empty) { CharSequence t = this.labelExtractor.apply(item); if (t == null) { setGraphic(null); } else if (t instanceof StyledString) { StyledLabel l = new StyledLabel((StyledString) t); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item); if( g != null ) { l.setGraphic(g); } setGraphic(l); } else { Label l = new Label(t.toString()); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item); if( g != null ) { l.setGraphic(g); } setGraphic(l); } } else { setGraphic(null); } } }
if (t instanceof StyledString) { setText(""); //$NON-NLS-1$ StyledLabel l = new StyledLabel((StyledString) t); l.getStyleClass().addAll(this.cssClassProvider.apply(item)); Node g = this.graphicExtractor.apply(item);