@Deprecated void addSublist(JFXListView<?> subList, int index) { if (!sublistsProperty.get().contains(subList)) { sublistsProperty.get().add(subList); sublistsIndices.put(index, subList); subList.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> { if (newVal.intValue() != -1) { updateOverAllSelectedIndex(); } }); } }
private void updateOverAllSelectedIndex() { if (this.getSelectionModel().getSelectedIndex() != -1) { int selectedIndex = this.getSelectionModel().getSelectedIndex(); Iterator<Map.Entry<Integer, JFXListView<?>>> itr = sublistsIndices.entrySet().iterator(); int preItemsSize = 0; while (itr.hasNext()) { Map.Entry<Integer, JFXListView<?>> entry = itr.next(); if (entry.getValue().getSelectionModel().getSelectedIndex() != -1) { selectedList.add(entry.getKey()); .getSelectionModel() .getSelectedIndex()); } else {
@FXML private void submit() { if (toolbarPopupList.getSelectionModel().getSelectedIndex() == 1) { Platform.exit(); } } }
private void clearSelection(JFXListView<?> selectedList) { if (allowClear) { allowClear = false; if (this != selectedList) { this.getSelectionModel().clearSelection(); } for (int i = 0; i < sublistsProperty.get().size(); i++) { if (sublistsProperty.get().get(i) != selectedList) { sublistsProperty.get().get(i).getSelectionModel().clearSelection(); } } allowClear = true; } }
if (c.wasAdded() || c.wasUpdated() || c.wasReplaced()) { if (sublistsProperty.get().size() == 1) { this.getSelectionModel() .selectedItemProperty() .addListener((o, oldVal, newVal) -> clearSelection(this)); .forEach(item -> item.getSelectionModel() .selectedItemProperty() .addListener((o, oldVal, newVal) -> clearSelection(item))); this.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> { if (newVal.intValue() != -1) { updateOverAllSelectedIndex();
FlowHandler contentFlowHandler = (FlowHandler) context.getRegisteredObject("ContentFlowHandler"); sideList.propagateMouseEventsToParent(); sideList.getSelectionModel().selectedItemProperty().addListener((o, oldVal, newVal) -> { new Thread(()->{ Platform.runLater(()->{
@Deprecated void addSublist(JFXListView<?> subList, int index) { if (!sublistsProperty.get().contains(subList)) { sublistsProperty.get().add(subList); sublistsIndices.put(index, subList); subList.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> { if (newVal.intValue() != -1) { updateOverAllSelectedIndex(); } }); } }
private void updateOverAllSelectedIndex() { if (this.getSelectionModel().getSelectedIndex() != -1) { int selectedIndex = this.getSelectionModel().getSelectedIndex(); Iterator<Map.Entry<Integer, JFXListView<?>>> itr = sublistsIndices.entrySet().iterator(); int preItemsSize = 0; while (itr.hasNext()) { Map.Entry<Integer, JFXListView<?>> entry = itr.next(); if (entry.getValue().getSelectionModel().getSelectedIndex() != -1) { selectedList.add(entry.getKey()); .getSelectionModel() .getSelectedIndex()); } else {
private void clearSelection(JFXListView<?> selectedList) { if (allowClear) { allowClear = false; if (this != selectedList) { this.getSelectionModel().clearSelection(); } for (int i = 0; i < sublistsProperty.get().size(); i++) { if (sublistsProperty.get().get(i) != selectedList) { sublistsProperty.get().get(i).getSelectionModel().clearSelection(); } } allowClear = true; } }
if (c.wasAdded() || c.wasUpdated() || c.wasReplaced()) { if (sublistsProperty.get().size() == 1) { this.getSelectionModel() .selectedItemProperty() .addListener((o, oldVal, newVal) -> clearSelection(this)); .forEach(item -> item.getSelectionModel() .selectedItemProperty() .addListener((o, oldVal, newVal) -> clearSelection(item))); this.getSelectionModel().selectedIndexProperty().addListener((o, oldVal, newVal) -> { if (newVal.intValue() != -1) { updateOverAllSelectedIndex();