Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4415678
Votes 0
Synopsis ColorChooserPanels need the ability to specify a mnemonic
Category java:classes_swing
Reported Against merlin-beta
Release Fixed 1.4(merlin-beta)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs
Submit Date 15-FEB-2001
Description
Typically AbstractColorChooserPanels are rendered in a JTabbedPane. It would be great if they had the ability of providing a mnemonic to facilitate keyboard navigation.
Work Around
N/A
Evaluation
This can be accomodated by adding the following API to AbstractColorChooserPanel:

    /**
     * Provides a hint to the look and feel as to which character in
     * <code>getDisplayName</code> should be the mnemonic. A value of -1
     * indicates there is no mnemonic.
     * <p>
     * The return value here is a hint, it is ultimately up to the look
     * and feel to honor the return value. For example, a look and 
     * feel may wish to render each <code>AbstractColorChooserPanel</code>
     * in a <code>JTabbedPane</code>, and further use this return value in
     * combination with <code>getDisplayName</code> to set the mnemonic
     * on the <code>JTabbedPane</code>.
     * <p>
     * This implementation returns -1, indicating the
     * <code>AbstractColorChooserPanel</code> does not support a mnemonic,
     * subclasses wishing a mnemonic will need to override this.
     *
     * @return Character index to render mnemonic for; -1 for no mnemonic
     * @since 1.4
     */
    public int getDisplayedMnemonicIndex();


DefaultRGBChooserPanel, DefaultHSBChooserPanel and DefaultSwatchesPanel will all override this.
  xxxxx@xxxxx   2001-02-15

As there is no way to map from a character to the KeyEvent, this has been changed to:
    /**
     * Provides a hint to the look and feel as to the
     * <code>KeyEvent.VK</code> constant that can be used as a mnemonic to
     * access the panel. A return value <= 0 indicates there is no mnemonic.
     * <p>
     * The return value here is a hint, it is ultimately up to the look
     * and feel to honor the return value in some meaningful way.
     * <p>
     * This implementation returns 0, indicating the
     * <code>AbstractColorChooserPanel</code> does not support a mnemonic,
     * subclasses wishing a mnemonic will need to override this.
     *
     * @return KeyEvent.VK constant identifying the mnemonic; <= 0 for no
     *         mnemonic
     * @see #getDisplayedMnemonicIndex
     * @since 1.4
     */
    public int getMnemonic();

    /**
     * Provides a hint to the look and feel as to the index of the character in
     * <code>getDisplayName</code> that should be visually identified as the
     * mnemonic. The look and feel should only use this if
     * <code>getMnemonic</code> returns a value > 0.
     * <p>
     * The return value here is a hint, it is ultimately up to the look
     * and feel to honor the return value in some meaningful way. For example,
     * a look and feel may wish to render each
     * <code>AbstractColorChooserPanel</code> in a <code>JTabbedPane</code>,
     * and further use this return value to underline a character in
     * the <code>getDisplayName</code>.
     * <p>
     * This implementation returns -1, indicating the
     * <code>AbstractColorChooserPanel</code> does not support a mnemonic,
     * subclasses wishing a mnemonic will need to override this.
     *
     * @return Character index to render mnemonic for; -1 to provide no
     *                   visual identifier for this panel.
     * @see #getMnemonic
     * @since 1.4
     */
    public int getDisplayedMnemonicIndex();

  xxxxx@xxxxx   2001-06-27
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang