List of usage examples for javafx.collections ObservableList toArray
<T> T[] toArray(T[] a);
From source file:org.eclipse.jubula.rc.javafx.tester.adapter.ListViewAdapter.java
/** {@inheritDoc} **/ public int[] getSelectedIndices() { return EventThreadQueuerJavaFXImpl.invokeAndWait("getSelectedIndices", //$NON-NLS-1$ new Callable<int[]>() { /** {@inheritDoc} **/ public int[] call() throws Exception { ObservableList<Integer> sIndices = getRealComponent().getSelectionModel() .getSelectedIndices(); return ArrayUtils.toPrimitive(sIndices.toArray(new Integer[0])); }/*from w ww . j a va2 s . co m*/ }); }
From source file:org.pdfsam.ui.selection.multiple.SelectionTable.java
@EventListener public void onMoveSelected(final MoveSelectedEvent event) { getSortOrder().clear();//from ww w. j a v a2 s .c o m ObservableList<Integer> selectedIndices = getSelectionModel().getSelectedIndices(); Integer[] selected = selectedIndices.toArray(new Integer[selectedIndices.size()]); int focus = getFocusModel().getFocusedIndex(); getSelectionModel().clearSelection(); SelectionAndFocus newSelection = event.getType().move(selected, getItems(), focus); if (!SelectionAndFocus.NULL.equals(newSelection)) { LOG.trace("Changing selection to {}", newSelection); getSelectionModel().selectIndices(newSelection.getRow(), newSelection.getRows()); getFocusModel().focus(newSelection.getFocus()); scrollTo(newSelection.getFocus()); } }