11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javafx.scene.control;
27
28 import com.sun.javafx.collections.MappingChange;
29 import com.sun.javafx.collections.NonIterableChange;
30 import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;
31 import com.sun.javafx.scene.control.SelectedCellsMap;
32
33 import com.sun.javafx.scene.control.behavior.TableCellBehaviorBase;
34 import com.sun.javafx.scene.control.behavior.TreeTableCellBehavior;
35 import javafx.beans.property.DoubleProperty;
36 import javafx.css.CssMetaData;
37 import javafx.css.PseudoClass;
38
39 import com.sun.javafx.css.converters.SizeConverter;
40 import com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList;
41 import com.sun.javafx.scene.control.TableColumnComparatorBase;
42 import com.sun.javafx.scene.control.skin.TableViewSkinBase;
43
44 import javafx.css.Styleable;
45 import javafx.css.StyleableDoubleProperty;
46 import javafx.css.StyleableProperty;
47 import javafx.event.WeakEventHandler;
48
49 import com.sun.javafx.scene.control.skin.TreeTableViewSkin;
50
51 import java.lang.ref.SoftReference;
52 import java.lang.ref.WeakReference;
53 import java.util.*;
54
55 import javafx.application.Platform;
56 import javafx.beans.DefaultProperty;
57 import javafx.beans.InvalidationListener;
58 import javafx.beans.WeakInvalidationListener;
59 import javafx.beans.property.BooleanProperty;
60 import javafx.beans.property.ObjectProperty;
61 import javafx.beans.property.ObjectPropertyBase;
62 import javafx.beans.property.ReadOnlyIntegerProperty;
63 import javafx.beans.property.ReadOnlyIntegerWrapper;
64 import javafx.beans.property.ReadOnlyObjectProperty;
65 import javafx.beans.property.ReadOnlyObjectWrapper;
66 import javafx.beans.property.SimpleBooleanProperty;
67 import javafx.beans.property.SimpleObjectProperty;
68 import javafx.beans.value.ChangeListener;
69 import javafx.beans.value.WeakChangeListener;
70 import javafx.beans.value.WritableValue;
71 import javafx.collections.FXCollections;
72 import javafx.collections.ListChangeListener;
73 import javafx.collections.MapChangeListener;
1813 // TreeTablePosition's changing (which may reside in the same list
1814 // position before and after the sort). Therefore, we need to fire
1815 // a single add/remove event to cover the added and removed positions.
1816 ListChangeListener.Change<TreeTablePosition<S, ?>> c = new NonIterableChange.GenericAddRemoveChange<>(0, itemCount, removed, newState);
1817 sm.handleSelectedCellsListChangeEvent(c);
1818 }
1819 }
1820 }
1821 }
1822
1823 /**
1824 * Calling {@code refresh()} forces the TreeTableView control to recreate and
1825 * repopulate the cells necessary to populate the visual bounds of the control.
1826 * In other words, this forces the TreeTableView to update what it is showing to
1827 * the user. This is useful in cases where the underlying data source has
1828 * changed in a way that is not observed by the TreeTableView itself.
1829 *
1830 * @since JavaFX 8u60
1831 */
1832 public void refresh() {
1833 getProperties().put(TableViewSkinBase.RECREATE, Boolean.TRUE);
1834 }
1835
1836
1837
1838 /***************************************************************************
1839 * *
1840 * Private Implementation *
1841 * *
1842 **************************************************************************/
1843
1844 private boolean sortLock = false;
1845 private TableUtil.SortEventType lastSortEventType = null;
1846 private Object[] lastSortEventSupportInfo = null;
1847
1848 private void doSort(final TableUtil.SortEventType sortEventType, final Object... supportInfo) {
1849 if (sortLock) {
1850 return;
1851 }
1852
1853 this.lastSortEventType = sortEventType;
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package javafx.scene.control;
27
28 import com.sun.javafx.collections.MappingChange;
29 import com.sun.javafx.collections.NonIterableChange;
30 import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;
31 import com.sun.javafx.scene.control.Properties;
32 import com.sun.javafx.scene.control.SelectedCellsMap;
33
34 import com.sun.javafx.scene.control.behavior.TableCellBehaviorBase;
35 import com.sun.javafx.scene.control.behavior.TreeTableCellBehavior;
36 import javafx.beans.property.DoubleProperty;
37 import javafx.css.CssMetaData;
38 import javafx.css.PseudoClass;
39
40 import javafx.css.converter.SizeConverter;
41 import com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList;
42 import com.sun.javafx.scene.control.TableColumnComparatorBase;
43
44 import javafx.css.Styleable;
45 import javafx.css.StyleableDoubleProperty;
46 import javafx.css.StyleableProperty;
47 import javafx.event.WeakEventHandler;
48
49 import javafx.scene.control.skin.TreeTableViewSkin;
50
51 import java.lang.ref.SoftReference;
52 import java.lang.ref.WeakReference;
53 import java.util.ArrayList;
54 import java.util.Collection;
55 import java.util.Collections;
56 import java.util.Comparator;
57 import java.util.HashMap;
58 import java.util.LinkedHashSet;
59 import java.util.List;
60 import java.util.Map;
61 import java.util.Set;
62 import java.util.WeakHashMap;
63
64 import javafx.application.Platform;
65 import javafx.beans.DefaultProperty;
66 import javafx.beans.InvalidationListener;
67 import javafx.beans.WeakInvalidationListener;
68 import javafx.beans.property.BooleanProperty;
69 import javafx.beans.property.ObjectProperty;
70 import javafx.beans.property.ObjectPropertyBase;
71 import javafx.beans.property.ReadOnlyIntegerProperty;
72 import javafx.beans.property.ReadOnlyIntegerWrapper;
73 import javafx.beans.property.ReadOnlyObjectProperty;
74 import javafx.beans.property.ReadOnlyObjectWrapper;
75 import javafx.beans.property.SimpleBooleanProperty;
76 import javafx.beans.property.SimpleObjectProperty;
77 import javafx.beans.value.ChangeListener;
78 import javafx.beans.value.WeakChangeListener;
79 import javafx.beans.value.WritableValue;
80 import javafx.collections.FXCollections;
81 import javafx.collections.ListChangeListener;
82 import javafx.collections.MapChangeListener;
1822 // TreeTablePosition's changing (which may reside in the same list
1823 // position before and after the sort). Therefore, we need to fire
1824 // a single add/remove event to cover the added and removed positions.
1825 ListChangeListener.Change<TreeTablePosition<S, ?>> c = new NonIterableChange.GenericAddRemoveChange<>(0, itemCount, removed, newState);
1826 sm.handleSelectedCellsListChangeEvent(c);
1827 }
1828 }
1829 }
1830 }
1831
1832 /**
1833 * Calling {@code refresh()} forces the TreeTableView control to recreate and
1834 * repopulate the cells necessary to populate the visual bounds of the control.
1835 * In other words, this forces the TreeTableView to update what it is showing to
1836 * the user. This is useful in cases where the underlying data source has
1837 * changed in a way that is not observed by the TreeTableView itself.
1838 *
1839 * @since JavaFX 8u60
1840 */
1841 public void refresh() {
1842 getProperties().put(Properties.RECREATE, Boolean.TRUE);
1843 }
1844
1845
1846
1847 /***************************************************************************
1848 * *
1849 * Private Implementation *
1850 * *
1851 **************************************************************************/
1852
1853 private boolean sortLock = false;
1854 private TableUtil.SortEventType lastSortEventType = null;
1855 private Object[] lastSortEventSupportInfo = null;
1856
1857 private void doSort(final TableUtil.SortEventType sortEventType, final Object... supportInfo) {
1858 if (sortLock) {
1859 return;
1860 }
1861
1862 this.lastSortEventType = sortEventType;
|