changeset 6551:d21a135c84d5

RT-36334: Clean up warnings in control component Contributed-by: Tom Schindl <tom.schindl@bestsolution.at> Reviewed-by: jgiles
author jgiles
date Tue, 25 Mar 2014 10:56:35 +1300
parents e08cbee88d7d
children f1e1491949bb
files modules/controls/src/main/java/javafx/scene/control/ListCell.java modules/controls/src/main/java/javafx/scene/control/ScrollPane.java modules/controls/src/main/java/javafx/scene/control/Separator.java modules/controls/src/main/java/javafx/scene/control/Slider.java modules/controls/src/main/java/javafx/scene/control/TableCell.java modules/controls/src/main/java/javafx/scene/control/TreeCell.java modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java modules/controls/src/main/java/javafx/scene/control/TreeTableView.java modules/controls/src/main/java/javafx/scene/control/TreeView.java
diffstat 9 files changed, 33 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/ListCell.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/ListCell.java	Tue Mar 25 10:56:35 2014 +1300
@@ -25,7 +25,9 @@
 
 package javafx.scene.control;
 
-import com.sun.javafx.scene.control.skin.ListCellSkin;
+import java.lang.ref.WeakReference;
+import java.util.List;
+
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.beans.WeakInvalidationListener;
@@ -37,16 +39,11 @@
 import javafx.collections.ListChangeListener;
 import javafx.collections.ObservableList;
 import javafx.collections.WeakListChangeListener;
-import javafx.scene.Node;
-import javafx.scene.Parent;
-import javafx.scene.Scene;
 import javafx.scene.accessibility.Action;
 import javafx.scene.accessibility.Attribute;
 import javafx.scene.accessibility.Role;
 
-import java.lang.ref.WeakReference;
-import java.util.List;
-
+import com.sun.javafx.scene.control.skin.ListCellSkin;
 
 /**
  * <p>The {@link Cell} type used within {@link ListView} instances. In addition 
--- a/modules/controls/src/main/java/javafx/scene/control/ScrollPane.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/ScrollPane.java	Tue Mar 25 10:56:35 2014 +1300
@@ -596,21 +596,6 @@
     private static final String DEFAULT_STYLE_CLASS = "scroll-pane";
 
     /**
-     * Pseudoclass indicating the fitToWidth property is {@code true}
-     */
-    private static final String PSEUDO_CLASS_FIT_TO_WIDTH = "fitToWidth";
-
-    /**
-     * Pseudoclass indicating the fitToHeight property is {@code true}
-     */
-    private static final String PSEUDO_CLASS_FIT_TO_HEIGHT = "fitToHeight";
-
-    /**
-     * Pseudoclass indicating the pannable property is {@code true}
-     */
-    private static final String PSEUDO_CLASS_PANNABLE = "pannable";
-
-    /**
      * @treatAsPrivate
      */
     private static class StyleableProperties {
--- a/modules/controls/src/main/java/javafx/scene/control/Separator.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/Separator.java	Tue Mar 25 10:56:35 2014 +1300
@@ -229,9 +229,6 @@
 
     private static final String DEFAULT_STYLE_CLASS = "separator";
 
-    private static final String PSEUDO_CLASS_VERTICAL = "vertical";
-    private static final String PSEUDO_CLASS_HORIZONTAL = "horizontal";
-
     private static class StyleableProperties {
         private static final CssMetaData<Separator,Orientation> ORIENTATION = 
                 new CssMetaData<Separator,Orientation>("-fx-orientation",
--- a/modules/controls/src/main/java/javafx/scene/control/Slider.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/Slider.java	Tue Mar 25 10:56:35 2014 +1300
@@ -648,8 +648,6 @@
      **************************************************************************/
 
     private static final String DEFAULT_STYLE_CLASS = "slider";
-    private static final String PSEUDO_CLASS_VERTICAL = "vertical";
-    private static final String PSEUDO_CLASS_HORIZONTAL = "horizontal";
 
     private static class StyleableProperties {
         private static final CssMetaData<Slider,Number> BLOCK_INCREMENT =
--- a/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Tue Mar 25 10:56:35 2014 +1300
@@ -289,8 +289,8 @@
 
     /** {@inheritDoc} */
     @Override public void startEdit() {
-        final TableView table = getTableView();
-        final TableColumn column = getTableColumn();
+        final TableView<S> table = getTableView();
+        final TableColumn<S,T> column = getTableColumn();
         if (! isEditable() ||
                 (table != null && ! table.isEditable()) ||
                 (column != null && ! getTableColumn().isEditable())) {
@@ -310,7 +310,7 @@
         super.startEdit();
         
         if (column != null) {
-            CellEditEvent editEvent = new CellEditEvent(
+            CellEditEvent<S,?> editEvent = new CellEditEvent<>(
                 table,
                 table.getEditingCell(),
                 TableColumn.editStartEvent(),
@@ -325,7 +325,7 @@
     @Override public void commitEdit(T newValue) {
         if (! isEditing()) return;
         
-        final TableView table = getTableView();
+        final TableView<S> table = getTableView();
         if (table != null) {
             // Inform the TableView of the edit being ready to be committed.
             CellEditEvent editEvent = new CellEditEvent(
@@ -364,13 +364,13 @@
     @Override public void cancelEdit() {
         if (! isEditing()) return;
 
-        final TableView table = getTableView();
+        final TableView<S> table = getTableView();
 
         super.cancelEdit();
 
         // reset the editing index on the TableView
         if (table != null) {
-            TablePosition editingCell = table.getEditingCell();
+            TablePosition<S,?> editingCell = table.getEditingCell();
             if (updateEditingIndex) table.edit(-1, null);
 
             // request focus back onto the table, only if the current focus
@@ -379,7 +379,7 @@
             // It would be rude of us to request it back again.
             ControlUtils.requestFocusOnControlOnlyIfCurrentFocusOwnerIsChild(table);
 
-            CellEditEvent editEvent = new CellEditEvent(
+            CellEditEvent<S,?> editEvent = new CellEditEvent<>(
                 table,
                 editingCell,
                 TableColumn.editCancelEvent(),
@@ -410,7 +410,7 @@
 
     /** {@inheritDoc} */
     @Override protected Skin<?> createDefaultSkin() {
-        return new TableCellSkin(this);
+        return new TableCellSkin<S,T>(this);
     }
     
 //    @Override public void dispose() {
@@ -431,12 +431,12 @@
     
     private void cleanUpTableViewListeners(TableView<S> tableView) {
         if (tableView != null) {
-            TableView.TableViewSelectionModel sm = tableView.getSelectionModel();
+            TableView.TableViewSelectionModel<S> sm = tableView.getSelectionModel();
             if (sm != null) {
                 sm.getSelectedCells().removeListener(weakSelectedListener);
             }
 
-            TableViewFocusModel fm = tableView.getFocusModel();
+            TableViewFocusModel<S> fm = tableView.getFocusModel();
             if (fm != null) {
                 fm.focusedCellProperty().removeListener(weakFocusedListener);
             }
@@ -462,8 +462,8 @@
     private int columnIndex = -1;
     
     private void updateColumnIndex() {
-        TableView tv = getTableView();
-        TableColumn tc = getTableColumn();
+        TableView<S> tv = getTableView();
+        TableColumn<S,T> tc = getTableColumn();
         columnIndex = tv == null || tc == null ? -1 : tv.getVisibleLeafIndex(tc);
         
         // update the pseudo class state regarding whether this is the last
@@ -530,7 +530,7 @@
     private void updateEditing() {
         if (getIndex() == -1 || getTableView() == null) return;
 
-        TablePosition editCell = getTableView().getEditingCell();
+        TablePosition<S,?> editCell = getTableView().getEditingCell();
         boolean match = match(editCell);
         
         if (match && ! isEditing()) {
@@ -549,7 +549,7 @@
     }
     private boolean updateEditingIndex = true;
 
-    private boolean match(TablePosition pos) {
+    private boolean match(TablePosition<S,?> pos) {
         return pos != null && pos.getRow() == getIndex() && pos.getTableColumn() == getTableColumn();
     }
 
@@ -582,9 +582,9 @@
         }
         
         // get the total number of items in the data model
-        final TableView tableView = getTableView();
-        final List<T> items = tableView == null ? FXCollections.<T>emptyObservableList() : tableView.getItems();
-        final TableColumn tableColumn = getTableColumn();
+        final TableView<S> tableView = getTableView();
+        final List<S> items = tableView == null ? FXCollections.<S>emptyObservableList() : tableView.getItems();
+        final TableColumn<S,T> tableColumn = getTableColumn();
         final int itemCount = items == null ? -1 : items.size();
         final int index = getIndex();
         final boolean isEmpty = isEmpty();
--- a/modules/controls/src/main/java/javafx/scene/control/TreeCell.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeCell.java	Tue Mar 25 10:56:35 2014 +1300
@@ -460,7 +460,7 @@
 
     /** {@inheritDoc} */
     @Override protected Skin<?> createDefaultSkin() {
-        return new TreeCellSkin(this);
+        return new TreeCellSkin<T>(this);
     }
 
     /***************************************************************************
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTableCell.java	Tue Mar 25 10:56:35 2014 +1300
@@ -248,7 +248,7 @@
                         }
                     }
 
-                    TreeTableView newTreeTableView = get();
+                    TreeTableView<S> newTreeTableView = get();
                     if (newTreeTableView != null) {
                         sm = newTreeTableView.getSelectionModel();
                         if (sm != null) {
@@ -518,7 +518,7 @@
         final TreeTableView<S> tv = getTreeTableView();
         if (getIndex() == -1 || tv == null) return;
 
-        TreeTableView.TreeTableViewFocusModel fm = tv.getFocusModel();
+        TreeTableView.TreeTableViewFocusModel<S> fm = tv.getFocusModel();
         if (fm == null) return;
 
         boolean isFocusedNow = fm != null &&
--- a/modules/controls/src/main/java/javafx/scene/control/TreeTableView.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeTableView.java	Tue Mar 25 10:56:35 2014 +1300
@@ -2248,7 +2248,7 @@
             }
             
             if (newRoot != null) {
-                weakTreeItemListener = new WeakEventHandler(treeItemListener);
+                weakTreeItemListener = new WeakEventHandler<>(treeItemListener);
                 newRoot.addEventHandler(TreeItem.<S>expandedItemCountChangeEvent(), weakTreeItemListener);
             }
         }
@@ -2386,7 +2386,7 @@
                 shiftSelection(startRow, shift, new Callback<ShiftParams, Void>() {
                     @Override public Void call(ShiftParams param) {
                         final int clearIndex = param.getClearIndex();
-                        TreeTablePosition oldTP = null;
+                        TreeTablePosition<S,?> oldTP = null;
                         if (clearIndex > -1) {
                             for (int i = 0; i < selectedCellsMap.size(); i++) {
                                 TreeTablePosition<S,?> tp = selectedCellsMap.get(i);
@@ -2399,7 +2399,7 @@
                         }
                         
                         if (oldTP != null && param.isSelected()) {
-                            TreeTablePosition<S,?> newTP = new TreeTablePosition<S,Object>(
+                            TreeTablePosition<S,?> newTP = new TreeTablePosition<>(
                                     treeTableView, param.getSetIndex(), oldTP.getTableColumn());
 
                             selectedCellsMap.add(newTP);
@@ -2719,8 +2719,8 @@
             updateSelectedIndex(maxRow);
             focus(maxRow, (TreeTableColumn<S,?>)maxColumn);
 
-            final int startChangeIndex = selectedCellsMap.indexOf(new TreeTablePosition(treeTableView, minRow, (TreeTableColumn<S,?>)minColumn));
-            final int endChangeIndex = selectedCellsMap.indexOf(new TreeTablePosition(treeTableView, maxRow, (TreeTableColumn<S,?>)maxColumn));
+            final int startChangeIndex = selectedCellsMap.indexOf(new TreeTablePosition<>(treeTableView, minRow, (TreeTableColumn<S,?>)minColumn));
+            final int endChangeIndex = selectedCellsMap.indexOf(new TreeTablePosition<>(treeTableView, maxRow, (TreeTableColumn<S,?>)maxColumn));
             handleSelectedCellsListChangeEvent(new NonIterableChange.SimpleAddChange<>(startChangeIndex, endChangeIndex + 1, selectedCellsSeq));
         }
 
--- a/modules/controls/src/main/java/javafx/scene/control/TreeView.java	Mon Mar 24 18:12:04 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/TreeView.java	Tue Mar 25 10:56:35 2014 +1300
@@ -213,7 +213,7 @@
         return (EventType<EditEvent<T>>) EDIT_ANY_EVENT;
     }
     private static final EventType<?> EDIT_ANY_EVENT =
-            new EventType(Event.ANY, "TREE_VIEW_EDIT");
+            new EventType<>(Event.ANY, "TREE_VIEW_EDIT");
 
     /**
      * An EventType used to indicate that an edit event has started within the
@@ -226,7 +226,7 @@
         return (EventType<EditEvent<T>>) EDIT_START_EVENT;
     }
     private static final EventType<?> EDIT_START_EVENT =
-            new EventType(editAnyEvent(), "EDIT_START");
+            new EventType<>(editAnyEvent(), "EDIT_START");
 
     /**
      * An EventType used to indicate that an edit event has just been canceled
@@ -240,7 +240,7 @@
         return (EventType<EditEvent<T>>) EDIT_CANCEL_EVENT;
     }
     private static final EventType<?> EDIT_CANCEL_EVENT =
-            new EventType(editAnyEvent(), "EDIT_CANCEL");
+            new EventType<>(editAnyEvent(), "EDIT_CANCEL");
 
     /**
      * An EventType that is used to indicate that an edit in a TreeView has been
@@ -255,7 +255,7 @@
         return (EventType<EditEvent<T>>) EDIT_COMMIT_EVENT;
     }
     private static final EventType<?> EDIT_COMMIT_EVENT =
-            new EventType(editAnyEvent(), "EDIT_COMMIT");
+            new EventType<>(editAnyEvent(), "EDIT_COMMIT");
     
     /**
      * Returns the number of levels of 'indentation' of the given TreeItem,