|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
25 | 25 |
|
26 | 26 | package javafx.scene.control;
|
27 | 27 |
|
28 |
| -import com.sun.javafx.collections.MappingChange; |
29 |
| -import com.sun.javafx.collections.NonIterableChange; |
30 |
| -import com.sun.javafx.scene.control.Properties; |
31 |
| -import com.sun.javafx.scene.control.SelectedCellsMap; |
32 |
| - |
33 |
| -import com.sun.javafx.scene.control.behavior.TableCellBehavior; |
34 |
| -import com.sun.javafx.scene.control.behavior.TableCellBehaviorBase; |
35 |
| -import com.sun.javafx.scene.control.behavior.TreeTableCellBehavior; |
36 |
| - |
37 |
| -import javafx.beans.property.DoubleProperty; |
38 |
| -import javafx.css.CssMetaData; |
39 |
| -import javafx.css.PseudoClass; |
40 |
| - |
41 |
| -import javafx.css.converter.SizeConverter; |
42 |
| -import com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList; |
43 |
| -import com.sun.javafx.scene.control.TableColumnComparatorBase; |
44 |
| - |
45 |
| -import javafx.css.Styleable; |
46 |
| -import javafx.css.StyleableDoubleProperty; |
47 |
| -import javafx.css.StyleableProperty; |
48 |
| -import javafx.event.WeakEventHandler; |
49 |
| - |
50 |
| -import javafx.scene.control.skin.TreeTableViewSkin; |
51 |
| - |
52 | 28 | import java.lang.ref.SoftReference;
|
53 | 29 | import java.lang.ref.WeakReference;
|
54 | 30 | import java.util.ArrayList;
|
|
69 | 45 | import javafx.beans.InvalidationListener;
|
70 | 46 | import javafx.beans.WeakInvalidationListener;
|
71 | 47 | import javafx.beans.property.BooleanProperty;
|
| 48 | +import javafx.beans.property.DoubleProperty; |
72 | 49 | import javafx.beans.property.ObjectProperty;
|
73 | 50 | import javafx.beans.property.ObjectPropertyBase;
|
74 | 51 | import javafx.beans.property.ReadOnlyIntegerProperty;
|
|
85 | 62 | import javafx.collections.MapChangeListener;
|
86 | 63 | import javafx.collections.ObservableList;
|
87 | 64 | import javafx.collections.WeakListChangeListener;
|
| 65 | +import javafx.css.CssMetaData; |
| 66 | +import javafx.css.PseudoClass; |
| 67 | +import javafx.css.Styleable; |
| 68 | +import javafx.css.StyleableDoubleProperty; |
| 69 | +import javafx.css.StyleableProperty; |
| 70 | +import javafx.css.converter.SizeConverter; |
88 | 71 | import javafx.event.Event;
|
89 | 72 | import javafx.event.EventHandler;
|
90 | 73 | import javafx.event.EventType;
|
| 74 | +import javafx.event.WeakEventHandler; |
91 | 75 | import javafx.scene.AccessibleAttribute;
|
92 | 76 | import javafx.scene.AccessibleRole;
|
93 | 77 | import javafx.scene.Node;
|
| 78 | +import javafx.scene.control.skin.TreeTableViewSkin; |
94 | 79 | import javafx.scene.layout.Region;
|
95 | 80 | import javafx.util.Callback;
|
96 | 81 |
|
| 82 | +import com.sun.javafx.collections.MappingChange; |
| 83 | +import com.sun.javafx.collections.NonIterableChange; |
| 84 | +import com.sun.javafx.scene.control.Properties; |
| 85 | +import com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList; |
| 86 | +import com.sun.javafx.scene.control.SelectedCellsMap; |
| 87 | +import com.sun.javafx.scene.control.TableColumnComparatorBase; |
| 88 | +import com.sun.javafx.scene.control.behavior.TableCellBehavior; |
| 89 | +import com.sun.javafx.scene.control.behavior.TableCellBehaviorBase; |
| 90 | +import com.sun.javafx.scene.control.behavior.TreeTableCellBehavior; |
| 91 | + |
97 | 92 | /**
|
98 | 93 | * The TreeTableView control is designed to visualize an unlimited number of rows
|
99 | 94 | * of data, broken out into columns. The TreeTableView control is conceptually
|
@@ -2129,12 +2124,17 @@ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object...
|
2129 | 2124 | */
|
2130 | 2125 | case SELECTED_ITEMS: {
|
2131 | 2126 | @SuppressWarnings("unchecked")
|
2132 |
| - ObservableList<TreeTableRow<S>> rows = (ObservableList<TreeTableRow<S>>)super.queryAccessibleAttribute(attribute, parameters); |
| 2127 | + ObservableList<TreeTableRow<S>> rows = |
| 2128 | + (ObservableList<TreeTableRow<S>>)super.queryAccessibleAttribute(attribute, parameters); |
2133 | 2129 | List<Node> selection = new ArrayList<>();
|
2134 |
| - for (TreeTableRow<S> row : rows) { |
2135 |
| - @SuppressWarnings("unchecked") |
2136 |
| - ObservableList<Node> cells = (ObservableList<Node>)row.queryAccessibleAttribute(attribute, parameters); |
2137 |
| - if (cells != null) selection.addAll(cells); |
| 2130 | + if (rows != null) { |
| 2131 | + for (TreeTableRow<S> row: rows) { |
| 2132 | + @SuppressWarnings("unchecked") |
| 2133 | + List<Node> cells = (List<Node>)row.queryAccessibleAttribute(attribute, parameters); |
| 2134 | + if (cells != null) { |
| 2135 | + selection.addAll(cells); |
| 2136 | + } |
| 2137 | + } |
2138 | 2138 | }
|
2139 | 2139 | return FXCollections.observableArrayList(selection);
|
2140 | 2140 | }
|
|
0 commit comments