Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6381513

Since 1.5.0_05, interval selection is broken if table's celleditor is not null

XMLWordPrintable

    • b80
    • x86
    • windows_xp

        FULL PRODUCT VERSION :
        java version "1.5.0_06"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
        Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Windows XP

        A DESCRIPTION OF THE PROBLEM :
        Since 1.5.0_05, interval selection is broken if table's celleditor is not null.

        After some painful debugging, it is found that since at least _05, looking at _06 src at the moment, that in:

        javax.swing.plaf.basic.BasicTableUI.Handler.mouseDragged(), it only checks for Table's CellEditor being null and then returns if it is non-null. Previously, code would check for null && see if edit.shouldSelectCell(e) before returning.

        Code Snipplet:

        _06:

                    // Check isFileList:
                    // Until we support drag-selection, dragging should not change
                    // the selection (act like single-select).
                    if (isFileList || table.getCellEditor() != null) {
                        return;
                    }

        _04:

                    CellEditor editor = table.getCellEditor();
                    if (editor == null || editor.shouldSelectCell(e)) {

        We have a table with an editor that previously allow for interval selection is now broken, would be greatful if you can put this small fix in.

        -Alex


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        I believe any JTable returning a non-null CellEditor in getCellEditor() will reproduce this problem.

        After making our getCellEditor() return null, interval selection by mouse drag is ok again.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        interval selection being broken
        ACTUAL -
        interval selection being broken

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------

        In:
        javax.swing.plaf.basic.BasicTableUI.Handler.mouseDragged()


        _06:

                    // Check isFileList:
                    // Until we support drag-selection, dragging should not change
                    // the selection (act like single-select).
                    if (isFileList || table.getCellEditor() != null) {
                        return;
                    }

        _04:

                    CellEditor editor = table.getCellEditor();
                    if (editor == null || editor.shouldSelectCell(e)) {
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        none so far, since overriding getCellEditor to return null breaks our editor

              shickeysunw Shannon Hickey (Inactive)
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: