MaterialFX icon indicating copy to clipboard operation
MaterialFX copied to clipboard

MFXListView getSelectIndex

Open KunMinX opened this issue 2 years ago • 1 comments

JavaFx has listView.getSelectionModel().getSelectedIndex(), but MaterialFX doesn't have, could it provide getSelectedIndex method?

I tried that listView.getSelectionModel().getSelectedValues().get(0) can do, but it seems strange to write like this

KunMinX avatar Aug 16 '22 17:08 KunMinX

JavaFX's models are unnecessary complicated, utter garbage I'd say

In MaterialFX SingleSelecionModel and MultipleSelectionModel are separate interfaces. Lists by default use the latter one which will of course return a list or a map of the selected values. Which means that if you set it to sigle selection you'll have to extract it with get(0);

What I could do is to add a method to "hide" this operation, I'll think about this

palexdev avatar Aug 16 '22 18:08 palexdev