Commits

Anonymous committed 90bc31e

few modifications

Comments (0)

Files changed (3)

src/main/java/impl/org/controlsfx/skin/SpreadsheetViewSkin.java

             final TableView<ObservableList<SpreadsheetCell<?>>> tableView) {
         super(tableView);
         this.spreadsheetView = spreadsheetView;
-        this.tableView = tableView;
+        SpreadsheetViewSkin.tableView = tableView;
 
         tableView.setEditable(true);
 

src/main/java/org/controlsfx/control/spreadsheet/SpreadsheetCellEditor.java

             }
         };
         SpreadsheetViewSkin.getSkin().getVBar().valueProperty().addListener(editorListener);
+        //FIXME We need to REALLY find a way to stop edition when anything happen
+        // This is one way but it will need further investigation
+        spreadsheetView.disabledProperty().addListener(editorListener);
     }
 
     /***************************************************************************
         spreadsheetEditor.end();
 
         SpreadsheetViewSkin.getSkin().getVBar().valueProperty().removeListener(editorListener);
+        spreadsheetView.disabledProperty().removeListener(editorListener);
         editorListener = null;
     }
 

src/main/java/org/controlsfx/control/spreadsheet/SpreadsheetView.java

      **************************************************************************/
     
     /**
-     * Creates a default SpreadsheetView control with no content and a Gris set to null. 
+     * Creates a default SpreadsheetView control with no content and a Grid set to null. 
      */
     public SpreadsheetView() {
         this(null);
      * Return the selectionModel used by the SpreadsheetView.
      * @return {@link SpreadsheetViewSelectionModel}
      */
-    public TableViewSelectionModel getSelectionModel() {
+    public TableViewSelectionModel<ObservableList<SpreadsheetCell<?>>> getSelectionModel() {
         return tableView.getSelectionModel();
     }
 
      *                                                                         *
      **************************************************************************/
  
+    /**
+     * Verify that the grid is well-formed.
+     * Can be quite time-consuming I guess so I would like it not
+     * to be compulsory..
+     * @param grid
+     */
     private void verifyGrid(Grid grid){
     	verifyColumnSpan(grid);
     }
             }
             return getTableView().getFocusModel().getFocusedCell();
         }
-		private TableColumn<ObservableList<SpreadsheetCell<?>>, ?> getTableColumn(int pos) {
-            return getTableView().getVisibleLeafColumn(pos);
-        }
 		private TableColumn<ObservableList<SpreadsheetCell<?>>, ?> getTableColumn(TableColumn<ObservableList<SpreadsheetCell<?>>, ?> column, int offset) {
             final int columnIndex = getTableView().getVisibleLeafIndex(column);
             final int newColumnIndex = columnIndex + offset;