classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: DefaultListSelectionModel, BasicListUI, and BasicTable


From: Anthony Balkissoon
Subject: [cp-patches] FYI: DefaultListSelectionModel, BasicListUI, and BasicTableUI updates
Date: Tue, 18 Oct 2005 13:52:28 -0400

This patch implements the 1.5 API method
DefaultListSelectionModel.moveLeadSelectionIndex(int) and then uses that
to implement several key bindings for JLists and JTables (in BasicListUI
and BasicTableUI).  Also fixed a small bug in
DefaultListSelectionModel.setLeadSelectionIndex(int), and added JTable
bindings to BasicLookAndFeel that weren't there yet.


2005-10-18  Anthony Balkissoon  <address@hidden>

        * javax/swing/DefaultListSelectionModel.java:
        (setLeadSelectionIndex): Avoid index out of bounds error on initial
        call of this method by checking explicitly for oldLeadIndex being -1.
        Also remove unused BitSet newRange and oldRange.
        (moveLeadSelectionIndex): New API method implemented (@since 1.5).
        * javax/swing/plaf/basic/BasicListUI.java:
        (ListAction.actionPerformed): Make code more readable by declaring
        local variables for the actionCommand and for the list's
        selectionModel.  Implemented the following bindings: 
        selectLastRowChangeLead, scrollDownChangeLead, scrollUpChangeLead, 
        selectFirstRowChangeLead, selectNextRowChangeLead, 
        selectPreviousRowChangeLead, addToSelection, toggleAndAnchor, 
        extendTo.
        (MouseInputHandler.mousePressed): Made code more readable by removing
        unnecessary full qualification from variable 'list'.  Change 
        behaviour of shift-click based on whether or not the anchor index is 
        selected.
        * javax/swing/plaf/basic/BasicLookAndFeel.java:
        (initComponentDefaults): Added remaining bindings for
        Table.ancestorMap.
        * javax/swing/plaf/basic/BasicTableUI.java:
        (TableAction.actionPerformed): Made type of variables rowModel and 
        colModel more specific to avoid many casts later on (makes code more
        readable).  Also declare local variable to store the action command to 
        make the code more readable. Implemented the following bindings: 
        selectNextRowChangeLead, selectPreviousRowChangeLead, 
        selectNextColumnChangeLead, selectPreviousColumnChangeLead,
        addToSelection, extendTo, toggleAndAnchor.  Added commented-out debug 
        statement to print unimplemented bindings when used.  Added check for 
        the SPACE character to make sure it doesn't stop editing.

--Tony

Attachment: JTableJListChangeLeadKeyBindings.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]