SO I was looking at the ensemble example and it goes like this.
listView.setCellFactory((ListView<java.lang.Number> list) -> new ListCell());
now normally when I use Lambda it's
.someMethod((event) -> {});
or another param.
now when I look at the Cell Factory in ListView I get this
cellFactory
public final ObjectProperty<Callback<ListView<T>,ListCell<T>>> cellFactoryProperty
Setting a custom cell factory has the effect of deferring all cell creation, allowing for total customization of the cell. Internally, the ListView is responsible for reusing ListCells - all that is necessary is for the custom cell factory to return from this function a ListCell which might be usable for representing any item in the ListView.
Refer to the Cell class documentation for more detail.
See Also:
getCellFactory(), setCellFactory(Callback)
http://docs.oracle.com/javafx/2/api/javafx/scene/control/ListView.html#cellFactoryProperty
http://docs.oracle.com/javafx/2/api/javafx/util/Callback.html I'm not 100% sure what CallBack is used for, but it seems like anything that needs an update uses it.
Now I was googling Lambda and ListCells and got this article from Oracle
it says
Adding a Cell Factory
ListView list = new ListView(customers);
list.setCellFactory(theList -> new MyCustomCell());
i'm not really sure what "The List" is but I'm assuming it's ListView<blahbla>
So again I want to know do I have to do "new class" each time, or can do I it right inside the parameters like using ((event) -> {});
With the callback it might be necessary to call the class(or maybe there is a way around it, but I kept getting errors late last night).
Any thoughts?