diff --git a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java --- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java @@ -235,7 +235,7 @@ if (menu != null && menu.isShowing()) return; if (header.getTableHeaderRow().isReordering() && header.isColumnReorderingEnabled()) { header.columnReorderingComplete(me); - } else { + } else if (me.isStillSincePress()) { TableColumnHeader.sortColumn( header.getTableViewSkin().getSortOrder(), tableColumn, @@ -685,6 +685,8 @@ private int newColumnPos; private void columnReorderingStarted(MouseEvent me) { + if (! column.impl_isReorderable()) return; + // Used to ensure the column ghost is positioned relative to where the // user clicked on the column header dragOffset = me.getX(); @@ -695,6 +697,8 @@ } private void columnReordering(MouseEvent me) { + if (! column.impl_isReorderable()) return; + // this is for handling the column drag to reorder columns. // It shows a line to indicate where the 'drop' will be. @@ -778,6 +782,8 @@ } protected void columnReorderingComplete(MouseEvent me) { + if (! column.impl_isReorderable()) return; + // Move col from where it is now to the new position. moveColumn(getTableColumn(), newColumnPos); diff --git a/javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java b/javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java --- a/javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java +++ b/javafx-ui-controls/src/javafx/scene/control/TableColumnBase.java @@ -478,6 +478,39 @@ } + + // --- Reorderable + private BooleanProperty reorderable; + /** + * @treatAsPrivate implementation detail + * @deprecated This is an internal API that is not intended for use and will be removed in the next version + */ + @Deprecated + public final BooleanProperty impl_reorderableProperty() { + if (reorderable == null) { + reorderable = new SimpleBooleanProperty(this, "reorderable", true); + } + return reorderable; + } + /** + * @treatAsPrivate implementation detail + * @deprecated This is an internal API that is not intended for use and will be removed in the next version + */ + @Deprecated + public final void impl_setReorderable(boolean value) { + impl_reorderableProperty().set(value); + } + /** + * @treatAsPrivate implementation detail + * @deprecated This is an internal API that is not intended for use and will be removed in the next version + */ + @Deprecated + public final boolean impl_isReorderable() { + return reorderable == null ? false : reorderable.get(); + } + + + // --- Comparator /** * Comparator function used when sorting this table column. The two Objects