@Test public void getTextForMultipleSelection() { @SuppressWarnings("rawtypes") TreeView treeView = (TreeView) getPrimaryStage().getScene().getRoot().lookup(".tree-view"); LoggingRecorder lr = new LoggingRecorder(); List<String> text = new ArrayList<>(); Platform.runLater(new Runnable() { @Override public void run() { RFXTreeView rTreeView = new RFXTreeView(treeView, null, null, lr); @SuppressWarnings("rawtypes") MultipleSelectionModel selectionModel = treeView.getSelectionModel(); selectionModel.setSelectionMode(SelectionMode.MULTIPLE); selectionModel.selectIndices(2, 3); rTreeView.focusLost(new RFXTreeView(null, null, null, null)); text.add(rTreeView.getAttribute("text")); } }); new Wait("Waiting for tree text.") { @Override public boolean until() { return text.size() > 0; } }; AssertJUnit.assertEquals("[\"/Root node/Child Node 2\",\"/Root node/Child Node 3\"]", text.get(0)); }
@Test public void getTextForMultipleSelection() { ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view"); LoggingRecorder lr = new LoggingRecorder(); List<String> text = new ArrayList<>(); Platform.runLater(new Runnable() { @Override public void run() { MultipleSelectionModel<?> selectionModel = listView.getSelectionModel(); selectionModel.setSelectionMode(SelectionMode.MULTIPLE); selectionModel.selectIndices(2, 8); RFXListView rfxListView = new RFXListView(listView, null, null, lr); rfxListView.focusLost(new RFXListView(null, null, null, lr)); text.add(rfxListView.getAttribute("text")); } }); new Wait("Waiting for list text.") { @Override public boolean until() { return text.size() > 0; } }; AssertJUnit.assertEquals("[\"Long Row 3\",\"Row 9\"]", text.get(0)); }
@Test public void selectMultipleItemSelection() { ListView<?> listView = (ListView<?>) getPrimaryStage().getScene().getRoot().lookup(".list-view"); LoggingRecorder lr = new LoggingRecorder(); Platform.runLater(new Runnable() { @Override public void run() { MultipleSelectionModel<?> selectionModel = listView.getSelectionModel(); selectionModel.setSelectionMode(SelectionMode.MULTIPLE); selectionModel.selectIndices(2, 6); RFXListView rfxListView = new RFXListView(listView, null, null, lr); rfxListView.focusLost(new RFXListView(null, null, null, lr)); } }); List<Recording> recordings = lr.waitAndGetRecordings(1); Recording recording = recordings.get(0); AssertJUnit.assertEquals("recordSelect", recording.getCall()); AssertJUnit.assertEquals("[\"Long Row 3\",\"Row 7\"]", recording.getParameters()[0]); }
@Override @FXThread protected @NotNull ObservableBooleanValue buildAdditionalDisableCondition() { final VirtualResourceTree<C> resourceTree = getResourceTree(); final MultipleSelectionModel<TreeItem<VirtualResourceElement<?>>> selectionModel = resourceTree.getSelectionModel(); final ReadOnlyObjectProperty<TreeItem<VirtualResourceElement<?>>> selectedItemProperty = selectionModel.selectedItemProperty(); final Class<C> type = getObjectsType(); final BooleanBinding typeCondition = new BooleanBinding() { @Override protected boolean computeValue() { final TreeItem<VirtualResourceElement<?>> treeItem = selectedItemProperty.get(); return treeItem == null || !type.isInstance(treeItem.getValue().getObject()); } @Override public Boolean getValue() { return computeValue(); } }; return Bindings.or(selectedItemProperty.isNull(), typeCondition); }
@Override @FXThread protected void processOk() { super.processOk(); final VirtualResourceTree<C> resourceTree = getResourceTree(); final MultipleSelectionModel<TreeItem<VirtualResourceElement<?>>> selectionModel = resourceTree.getSelectionModel(); final TreeItem<VirtualResourceElement<?>> selectedItem = selectionModel.getSelectedItem(); if (selectedItem == null) { hide(); return; } final VirtualResourceElement<?> element = selectedItem.getValue(); final Object object = element.getObject(); final Class<C> type = getObjectsType(); if (type.isInstance(object)) { getConsumer().accept(type.cast(object)); } }
@Override @FXThread protected void processOk() { super.processOk(); final ResourceTree resourceTree = getResourceTree(); final MultipleSelectionModel<TreeItem<ResourceElement>> selectionModel = resourceTree.getSelectionModel(); final TreeItem<ResourceElement> selectedItem = selectionModel.getSelectedItem(); if (selectedItem == null) { hide(); return; } processOpen(selectedItem.getValue()); }
/** * Fill a list of app states. * * @param sceneNode the scene node */ public void fill(@NotNull final SceneNode sceneNode) { final ListView<EditableSceneAppState> listView = getListView(); final MultipleSelectionModel<EditableSceneAppState> selectionModel = listView.getSelectionModel(); final EditableSceneAppState selected = selectionModel.getSelectedItem(); final ObservableList<EditableSceneAppState> items = listView.getItems(); items.clear(); final List<SceneAppState> appStates = sceneNode.getAppStates(); appStates.stream().filter(EditableSceneAppState.class::isInstance) .map(EditableSceneAppState.class::cast) .forEach(items::add); if (selected != null && appStates.contains(selected)) { selectionModel.select(selected); } }
/** * Fill a list of filters. * * @param sceneNode the scene node */ public void fill(@NotNull final SceneNode sceneNode) { final MultipleSelectionModel<EditableSceneFilter> selectionModel = listView.getSelectionModel(); final EditableSceneFilter selected = selectionModel.getSelectedItem(); final ObservableList<EditableSceneFilter> items = listView.getItems(); items.clear(); final List<SceneFilter> filters = sceneNode.getFilters(); filters.stream().filter(EditableSceneFilter.class::isInstance) .map(EditableSceneFilter.class::cast) .forEach(items::add); if (selected != null && filters.contains(selected)) { selectionModel.select(selected); } }
protected static HashSet<Point> getSelected(final Wrap<? extends Control> testedControl) { return new GetAction<HashSet<Point>>() { @Override public void run(Object... parameters) throws Exception { HashSet<Point> selected = new HashSet<Point>(); final Control control = testedControl.getControl(); MultipleSelectionModel model; if (control instanceof TreeView) { model = ((TreeView) control).getSelectionModel(); } else { model = ((TreeTableView) control).getSelectionModel(); } for (Object obj : model.getSelectedIndices()) { Integer pos = (Integer) obj; selected.add(new Point(-1, pos)); } setResult(selected); } }.dispatch(Root.ROOT.getEnvironment()); }
private boolean checkInput() { if (traces.isEmpty()) { new Alert(AlertType.INFORMATION, Messages.AddAnnotation_NoTraces).showAndWait(); return false; } final MultipleSelectionModel<Trace<XTYPE>> seletion = trace_list.getSelectionModel(); final Trace<XTYPE> item = seletion.isEmpty() ? traces.get(0) : seletion.getSelectedItem(); final String content = text.getText().trim(); if (content.isEmpty()) { new Alert(AlertType.WARNING, Messages.AddAnnotation_NoContent).showAndWait(); return false; } plot.addAnnotation(item, content); return true; }
/** Called by selection handler when selected widgets have changed, or on new model * @param widgets Widgets to select in tree */ public void setSelectedWidgets(final List<Widget> widgets) { if (! active.compareAndSet(false, true)) return; try { final MultipleSelectionModel<TreeItem<WidgetOrTab>> selection = tree_view.getSelectionModel(); selection.clearSelection(); for (Widget widget : widgets) selection.select(widget2tree.get(widget)); } finally { active.set(false); } }
@Override public void initialize(URL url, ResourceBundle rb) { LOG.info("Start initializing"); headerLabel.setText(ClientConfigConstants.APP_NAME); copyrightLabel.setText(ClientConfigConstants.APP_COPYRIGHT); MultipleSelectionModel<String> model = sliceListView.getSelectionModel(); ObservableList<String> selectedItems = model.getSelectedItems(); selectedItems.addListener(new ListChangeListener<String>() { @Override public void onChanged(Change<? extends String> change) { selectSliceName = change.getList().get(0); doReadSliceTask(MloClient.getInstance()); } }); scrollPane.setContent(sliceFlowsDispVBox); setUpView(); LOG.info("End initializing"); }
@Override public void initialize(URL location, ResourceBundle resources) { loadRegistrations(); this.registrationList.selectionModelProperty().addListener( new ChangeListener<MultipleSelectionModel<Registration>>() { @Override public void changed( ObservableValue<? extends MultipleSelectionModel<Registration>> observable, MultipleSelectionModel<Registration> oldValue, MultipleSelectionModel<Registration> newValue) { if (registrationList.getItems().size() == 0) { btModifyRegistration.setDisable(true); } else { btModifyRegistration.setDisable(false); } } }); }
@Override public void handle(ActionEvent event) { MultipleSelectionModel<ClassPathElement> selectionModel = classPathListView.getSelectionModel(); ObservableList<ClassPathElement> items = classPathListView.getItems(); int selectedIndex = selectionModel.getSelectedIndex(); ClassPathElement selectedItem = selectionModel.getSelectedItem(); items.remove(selectedItem); if (shouldMoveUp) { items.add(selectedIndex - 1, selectedItem); } else { items.add(selectedIndex + 1, selectedItem); } selectionModel.clearAndSelect(items.indexOf(selectedItem)); }
@Override public void handle(ActionEvent event) { MultipleSelectionModel<JSONObject> selectionModel = historyView.getSelectionModel(); ObservableList<JSONObject> items = historyView.getItems(); int selectedIndex = selectionModel.getSelectedIndex(); JSONObject selectedItem = selectionModel.getSelectedItem(); items.remove(selectedItem); if (shouldMoveUp) { items.add(selectedIndex - 1, selectedItem); } else { items.add(selectedIndex + 1, selectedItem); } selectionModel.select(selectedItem); TestRunnerHistory.getInstance().rewrite("favourites", items); }
private VBox createListView() { listViewBox = new VBox(5); classPathListView = new ListView<ClassPathElement>(classPathListItems); classPathListView.setPrefHeight(Node.BASELINE_OFFSET_SAME_AS_HEIGHT); classPathListView.setId("ClassPathList"); classPathListView.setCellFactory((e) -> { ClassPathCell classPathCell = new ClassPathCell(); classPathCell.setId("ClassPathCell"); return classPathCell; }); if (!isSingleSelection()) { classPathListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); } classPathListView.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> { MultipleSelectionModel<ClassPathElement> selectionModel = classPathListView.getSelectionModel(); int itemCount = classPathListItems.size(); int selectedIndex = selectionModel.getSelectedIndex(); setButtonState(deleteButton, selectedIndex != -1); boolean enable = selectedIndex != 0 && selectedIndex != -1 && itemCount > 1; setButtonState(upButton, enable); enable = selectedIndex != itemCount - 1 && selectedIndex != -1 && itemCount > 1; setButtonState(downButton, enable); }); listViewBox.getChildren().add(classPathListView); HBox.setHgrow(listViewBox, Priority.ALWAYS); VBox.setVgrow(classPathListView, Priority.ALWAYS); return listViewBox; }
@Override @FXThread protected @NotNull ObservableBooleanValue buildAdditionalDisableCondition() { final ResourceTree resourceTree = getResourceTree(); final MultipleSelectionModel<TreeItem<ResourceElement>> selectionModel = resourceTree.getSelectionModel(); final ReadOnlyObjectProperty<TreeItem<ResourceElement>> selectedItemProperty = selectionModel.selectedItemProperty(); return selectedItemProperty.isNull(); }
/** * Create components of this component. */ private void createComponents() { listView = new ListView<>(); listView.setCellFactory(param -> new AppStateListCell(this)); listView.setEditable(false); listView.setFocusTraversable(true); listView.prefHeightProperty().bind(heightProperty()); listView.prefWidthProperty().bind(widthProperty()); listView.setFixedCellSize(FXConstants.LIST_CELL_HEIGHT); final MultipleSelectionModel<EditableSceneAppState> selectionModel = listView.getSelectionModel(); selectionModel.selectedItemProperty().addListener((observable, oldValue, newValue) -> selectHandler.accept(newValue)); final Button addButton = new Button(); addButton.setGraphic(new ImageView(Icons.ADD_12)); addButton.setOnAction(event -> addAppState()); final Button removeButton = new Button(); removeButton.setGraphic(new ImageView(Icons.REMOVE_12)); removeButton.setOnAction(event -> removeAppState()); removeButton.disableProperty().bind(selectionModel.selectedItemProperty().isNull()); final HBox buttonContainer = new HBox(addButton, removeButton); FXUtils.addToPane(listView, this); FXUtils.addToPane(buttonContainer, this); FXUtils.addClassTo(buttonContainer, CSSClasses.DEF_HBOX); FXUtils.addClassTo(addButton, CSSClasses.BUTTON_WITHOUT_RIGHT_BORDER); FXUtils.addClassTo(removeButton, CSSClasses.BUTTON_WITHOUT_LEFT_BORDER); FXUtils.addClassTo(listView, CSSClasses.TRANSPARENT_LIST_VIEW); DynamicIconSupport.addSupport(addButton, removeButton); }
/** * Handle removing an old app state. */ private void removeAppState() { final MultipleSelectionModel<EditableSceneAppState> selectionModel = getListView().getSelectionModel(); final EditableSceneAppState appState = selectionModel.getSelectedItem(); final SceneNode sceneNode = changeConsumer.getCurrentModel(); changeConsumer.execute(new RemoveAppStateOperation(appState, sceneNode)); }
/** * Create components of this component. */ private void createComponents() { listView = new ListView<>(); listView.setCellFactory(param -> new FilterListCell(this)); listView.setEditable(false); listView.setFocusTraversable(true); listView.prefHeightProperty().bind(heightProperty()); listView.prefWidthProperty().bind(widthProperty()); listView.setFixedCellSize(FXConstants.LIST_CELL_HEIGHT); final MultipleSelectionModel<EditableSceneFilter> selectionModel = listView.getSelectionModel(); selectionModel.selectedItemProperty().addListener((observable, oldValue, newValue) -> selectHandler.accept(newValue)); final Button addButton = new Button(); addButton.setGraphic(new ImageView(Icons.ADD_12)); addButton.setOnAction(event -> addFilter()); final Button removeButton = new Button(); removeButton.setGraphic(new ImageView(Icons.REMOVE_12)); removeButton.setOnAction(event -> removeFilter()); removeButton.disableProperty().bind(selectionModel.selectedItemProperty().isNull()); final HBox buttonContainer = new HBox(addButton, removeButton); FXUtils.addToPane(listView, this); FXUtils.addToPane(buttonContainer, this); FXUtils.addClassTo(buttonContainer, CSSClasses.DEF_HBOX); FXUtils.addClassTo(addButton, CSSClasses.BUTTON_WITHOUT_RIGHT_BORDER); FXUtils.addClassTo(removeButton, CSSClasses.BUTTON_WITHOUT_LEFT_BORDER); FXUtils.addClassTo(listView, CSSClasses.TRANSPARENT_LIST_VIEW); DynamicIconSupport.addSupport(addButton, removeButton); }
/** * Handle removing an old filter. */ private void removeFilter() { final MultipleSelectionModel<EditableSceneFilter> selectionModel = listView.getSelectionModel(); final EditableSceneFilter filter = selectionModel.getSelectedItem(); final SceneNode sceneNode = changeConsumer.getCurrentModel(); changeConsumer.execute(new RemoveSceneFilterOperation(filter, sceneNode)); }
private void setupChannelList() { final MultipleSelectionModel<IChannel> selectionModel = this.channelListView.getSelectionModel(); selectionModel.setSelectionMode(SelectionMode.SINGLE); this.selectedChannelProperty.bind(selectionModel.selectedItemProperty()); this.channelListView.itemsProperty().bind(this.channelListProperty); this.channelListView.setCellFactory(listView -> new ChannelCell()); }
public static <T> MultipleSelectionModel<T> createEmptySelectionModel() { return new EmptySelectionModel<>(); }
private void addTableAndListView() { FilteredList<Movie> filteredList = new FilteredList<>(database.getMovies()); filteredList.predicateProperty().bind(getSkinnable().filterPredicateProperty()); SortedList<Movie> tableViewSortedList = new SortedList<>(filteredList); TableView<Movie> tableView = new MovieTableView(); tableViewSortedList.comparatorProperty().bind(tableView.comparatorProperty()); tableView.setItems(tableViewSortedList); TableViewSelectionModel<Movie> tableViewSelectionModel = tableView.getSelectionModel(); tableViewSelectionModel.selectedItemProperty().addListener(it -> getSkinnable().setSelectedMovie(tableViewSelectionModel.getSelectedItem())); PrettyListView<Movie> listView = new PrettyListView<>(); listView.setItems(filteredList); MultipleSelectionModel<Movie> listViewSelectionModel = listView.getSelectionModel(); listViewSelectionModel.selectedItemProperty().addListener(it -> getSkinnable().setSelectedMovie(listViewSelectionModel.getSelectedItem())); listView.setOnMouseClicked(evt -> { if (evt.getButton() == MouseButton.PRIMARY && evt.getClickCount() == 2) { showTrailer(); } }); getSkinnable().useListViewCellFactoryProperty().addListener(it -> { if (getSkinnable().isUseListViewCellFactory()) { listView.setCellFactory(view -> new MovieCell(getSkinnable())); } else { listView.setCellFactory(view -> new ListCell<Movie>() { @Override protected void updateItem(Movie item, boolean empty) { super.updateItem(item, empty); if (item != null) { setText(item.toString()); } } }); } }); getSkinnable().selectedMovieProperty().addListener(it -> { tableViewSelectionModel.select(getSkinnable().getSelectedMovie()); listViewSelectionModel.select(getSkinnable().getSelectedMovie()); }); FlipPanel flipPanel = new FlipPanel(); flipPanel.setFlipDirection(Orientation.HORIZONTAL); flipPanel.getFront().getChildren().add(tableView); flipPanel.getBack().getChildren().add(listView); getSkinnable().useListViewProperty().addListener(it -> { if (getSkinnable().isUseListView()) { flipPanel.flipToBack(); if (getSkinnable().isUseListViewCellFactory()) { listView.setCellFactory(view -> new MovieCell(getSkinnable())); } } else { flipPanel.flipToFront(); } }); GridPane.setVgrow(flipPanel, Priority.ALWAYS); container.add(flipPanel, 1, 2); }
/** * Clear selection. */ public void clearSelection() { final MultipleSelectionModel<EditableSceneAppState> selectionModel = getListView().getSelectionModel(); selectionModel.select(null); }
/** * Clear selection. */ public void clearSelection() { final MultipleSelectionModel<EditableSceneFilter> selectionModel = listView.getSelectionModel(); selectionModel.select(null); }
public MultipleSelectionModel<TreeItem<RaxItem>> getSelectionModel() { return raxTreeView.getSelectionModel(); }
public void selectItem(String item) { suggestionList.scrollTo(item); MultipleSelectionModel<String> selectionModel = suggestionList.getSelectionModel(); selectionModel.clearSelection(); selectionModel.select(item); }
private void synchronizeSelectionModelToTree(final ListChangeListener.Change<? extends TreeItem<PathObject>> change) { if (synchronizingTreeToModel) return; boolean ownsChanges = !synchronizingModelToTree; try { synchronizingModelToTree = true; PathObjectSelectionModel model = getHierarchySelectionModel(); if (model == null) { return; } // Check - was anything removed? boolean removed = false; while (change.next()) removed = removed | change.wasRemoved(); MultipleSelectionModel<TreeItem<PathObject>> treeModel = treeView.getSelectionModel(); List<TreeItem<PathObject>> selectedItems = treeModel.getSelectedItems(); // If we just have no selected items, and something was removed, then clear the selection if (selectedItems.isEmpty() && removed) { model.clearSelection(); return; } // If we just have one selected item, and also items were removed from the selection, then only select the one item we have if (selectedItems.size() == 1 && removed) { model.setSelectedObject(selectedItems.get(0).getValue(), false); return; } // If we have multiple selected items, we need to ensure that everything in the tree matches with everything in the selection model Set<PathObject> currentSelections = model.getSelectedObjects(); Set<PathObject> toDeselect = new HashSet<>(); Set<PathObject> toSelect = new HashSet<>(); int n = treeView.getExpandedItemCount(); for (int i = 0; i < n; i++) { PathObject temp = treeView.getTreeItem(i).getValue(); if (treeModel.isSelected(i)) { if (!currentSelections.contains(temp)) toSelect.add(temp); } else { if (currentSelections.contains(temp)) toDeselect.add(temp); } } model.deselectObjects(toDeselect); model.selectObjects(toSelect); // Ensure that we have the main selected object TreeItem<PathObject> mainSelection = treeView.getFocusModel().getFocusedItem(); if (mainSelection != null && model.isSelected(mainSelection.getValue())) model.setSelectedObject(mainSelection.getValue(), true); } finally { if (ownsChanges) synchronizingModelToTree = false; } }
private void synchronizeTreeToSelectionModel() { if (synchronizingModelToTree) return; boolean ownsChanges = !synchronizingTreeToModel; try { synchronizingTreeToModel = true; PathObjectSelectionModel model = getHierarchySelectionModel(); MultipleSelectionModel<TreeItem<PathObject>> treeModel = treeView.getSelectionModel(); if (model == null || model.noSelection()) { treeModel.clearSelection(); return; } if (model.singleSelection()) { selectSingleObject(model.getSelectedObject()); return; } // Loop through all possible selections, and select them if they should be selected (and not if they shouldn't) int n = treeView.getExpandedItemCount(); PathObject mainSelectedObject = model.getSelectedObject(); int mainObjectInd = -1; for (int i = 0; i < n; i++) { TreeItem<PathObject> item = treeView.getTreeItem(i); if (item == null) { treeModel.clearSelection(i); continue; } PathObject temp = item.getValue(); if (temp == mainSelectedObject) mainObjectInd = i; if (model.isSelected(temp)) { // Only select if necessary, or if this is the main selected object if (!treeModel.isSelected(i)) treeModel.select(i); } else treeModel.clearSelection(i); } // Ensure that the main object is focused & its node expanded if (mainObjectInd >= 0) { treeModel.select(mainObjectInd); treeView.scrollTo(mainObjectInd); } } finally { if (ownsChanges) synchronizingTreeToModel = false; } }
@Override public void selectedPathObjectChanged(final PathObject pathObjectSelected, final PathObject previousObject) { if (!Platform.isFxApplicationThread()) { Platform.runLater(() -> selectedPathObjectChanged(pathObjectSelected, previousObject)); return; } changingSelection = true; // tableModel.setPathObject(pathObjectSelected); // TODO: Find a more robust way to do this - the check for the creation of a new object is rather hack-ish if (pathObjectSelected != null && pathObjectSelected.getParent() == null && !pathObjectSelected.isRootObject() && pathObjectSelected.getPathClass() == null && PathPrefs.getAutoSetAnnotationClass()) { PathClass pathClass = getSelectedPathClass(); if (pathClass != null) pathObjectSelected.setPathClass(pathClass); } // Determine the objects to select MultipleSelectionModel<PathObject> model = listAnnotations.getSelectionModel(); List<PathObject> selected = new ArrayList<>(); for (PathObject pathObject : hierarchy.getSelectionModel().getSelectedObjects()) { if (pathObject == null) logger.warn("Selected object is null!"); else if (pathObject.isAnnotation()) selected.add(pathObject); } if (selected.isEmpty()) { model.clearSelection(); changingSelection = false; return; } // Check if we're making changes List<PathObject> currentlySelected = model.getSelectedItems(); if (selected.size() == currentlySelected.size() && (hierarchy.getSelectionModel().getSelectedObjects().containsAll(currentlySelected))) { changingSelection = false; listAnnotations.refresh(); return; } // System.err.println("Setting " + currentlySelected + " to " + selected); int[] inds = new int[selected.size()]; int i = 0; model.clearSelection(); boolean firstInd = true; for (PathObject temp : selected) { int idx = listAnnotations.getItems().indexOf(temp); if (idx >= 0 && firstInd) { Arrays.fill(inds, idx); firstInd = false; } inds[i] = idx; i++; } if (inds.length == 1 && hierarchy.getSelectionModel().getSelectedObject() instanceof PathAnnotationObject) listAnnotations.scrollTo(hierarchy.getSelectionModel().getSelectedObject()); if (firstInd) { changingSelection = false; return; } model.selectIndices(inds[0], inds); changingSelection = false; }
/*************************************************************************** * * * Private implementation * * * **************************************************************************/ @Override protected MultipleSelectionModel<TreeItem<T>> getSelectionModel() { return getCellContainer().getSelectionModel(); }
public MultipleSelectionModel<ItemType> getAvailableItemsSelectionModel() { return availableList.getSelectionModel(); }
public MultipleSelectionModel<ItemType> getSelectionModel() { return popupList.getSelectionModel(); }
/******************************** * 작성일 : 2016. 7. 14. 작성자 : KYJ * * 트리에 선택된 모델 리턴. * * @return ********************************/ public final MultipleSelectionModel<TreeItem<JavaProjectFileWrapper>> getTreeProjectFileSelectionModel() { return treeProjectFile.getSelectionModel(); }
/** * The SelectionModel provides the API through which it is possible to * select single or multiple items within a ListView, as well as inspect * which items have been selected by the user. Note that it has a generic * type that must match the type of the ListView itself. * * @return the selection model property. */ public final ObjectProperty<MultipleSelectionModel<T>> selectionModelProperty() { return this.getWrappedControl().selectionModelProperty(); }
/** * Sets the MultipleSelectionModel to be used in the ListView. Despite a * ListView requiring a MultipleSelectionModel, it is possible to configure * it to only allow single selection (see * MultipleSelectionModel.setSelectionMode * (javafx.scene.control.SelectionMode) for more information). * * @param value * the selection model. */ public final void setSelectionModel(MultipleSelectionModel<T> value) { this.getWrappedControl().setSelectionModel(value); }