modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableCellBehaviorBase.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -32,12 +32,10 @@
 import javafx.scene.control.TableFocusModel;
 import javafx.scene.control.TablePositionBase;
 import javafx.scene.control.TableSelectionModel;
 import javafx.scene.input.MouseButton;
 
-import java.util.Collections;
-
 public abstract class TableCellBehaviorBase<S, T, TC extends TableColumnBase<S, ?>, C extends IndexedCell<T>> extends CellBehaviorBase<C> {
     
     /***************************************************************************
      *                                                                         *
      * Private fields                                                          *

@@ -50,11 +48,11 @@
      * Constructors                                                            *
      *                                                                         *
      **************************************************************************/    
 
     public TableCellBehaviorBase(C control) {
-        super(control, Collections.emptyList());
+        super(control);
     }
     
     
     
     /**************************************************************************

@@ -96,11 +94,11 @@
     
     protected void doSelect(final double x, final double y, final MouseButton button,
                           final int clickCount, final boolean shiftDown, final boolean shortcutDown) {
         // Note that table.select will reset selection
         // for out of bounds indexes. So, need to check
-        final C tableCell = getControl();
+        final C tableCell = getNode();
 
         // If the mouse event is not contained within this tableCell, then
         // we don't want to react to it.
         if (! tableCell.contains(x, y)) return;
 

@@ -200,11 +198,11 @@
         }
     }
 
     protected void simpleSelect(MouseButton button, int clickCount, boolean shortcutDown) {
         final TableSelectionModel<S> sm = getSelectionModel();
-        final int row = getControl().getIndex();
+        final int row = getNode().getIndex();
         final TableColumnBase<S,T> column = getTableColumn();
         boolean isAlreadySelected = sm.isSelected(row, column);
 
         if (isAlreadySelected && shortcutDown) {
             sm.clearSelection(row, column);

@@ -231,11 +229,11 @@
     protected boolean isSelected() {
         TableSelectionModel<S> sm = getSelectionModel();
         if (sm == null) return false;
 
         if (sm.isCellSelectionEnabled()) {
-            final C cell = getControl();
+            final C cell = getNode();
             return cell.isSelected();
         } else {
             return isTableRowSelected();
         }
     }