I need some help, guys: The thing is that I want ListView> component to show .toString (or something similar) of the class of underlying dataModel (ObservableList> tests = FXCollections.observableList(list))
so in Java:
public class KinderNonStandard extends SeleneseTestCase {
@Before
public ... {}
@Test
public ... {}
@After
public ... {}
@Override
public String toString() {
return "I want this string to be shown at presentation layer of listView<T>";
}
}
then I have:
public class TestWindowController implements Initializable{
@FXML private ListView<Class<? extends SeleneseTestCase>> availableTests;
@Override
public void initialize(URL location, ResourceBundle resources) {
//list contains classes like KinderNonStandard (extends SeleneseTestCase...)
ObservableList<Class<? extends SeleneseTestCase>> tests = Collections.observableList(list);
availableTests.setItems(tests);
}
}
And finally, when I run an application, in ListView I see something like "class package.subpackage.KinderNonStandard" instead of what was overriden in toString of that class. Well, Im not quite comfortable with using maps and working with keys as Strings and values as Underlying datamodel classes. So can I somehow manage it to show that overriden toString method?
Thanks for help!