Changeset 7407 in josm for trunk/src


Ignore:
Timestamp:
2014-08-15T22:50:14+02:00 (5 years ago)
Author:
Don-vip
Message:

fix focus issues (regression from r7401)

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r7401 r7407  
    8888    private Icon icon;
    8989    private boolean modal;
     90    private boolean focusOnDefaultButton = false;
    9091
    9192    /** true, if the dialog should include a help button */
     
    278279            getRootPane().setDefaultButton(defaultButton);
    279280        }
    280         fixFocus();
     281        // Don't focus the "do not show this again" check box, but the default button.
     282        if (toggleable || focusOnDefaultButton) {
     283            requestFocusToDefaultButton();
     284        }
    281285        setVisible(true);
    282286        toggleSaveState();
     
    558562
    559563    /**
    560      * Always makes sure the default button has initial focus.
    561      */
    562     protected void fixFocus() {
     564     * Makes default button request initial focus or not.
     565     * @param focus {@code true} to make default button request initial focus
     566     * @since 7407
     567     */
     568    public void setFocusOnDefaultButton(boolean focus) {
     569        focusOnDefaultButton = focus;
     570    }
     571
     572    private void requestFocusToDefaultButton() {
    563573        if (defaultButton != null) {
    564574            GuiHelper.runInEDT(new Runnable() {
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r7401 r7407  
    106106                        }
    107107                        ed.setContent(pnl);
     108                        ed.setFocusOnDefaultButton(true);
    108109                        ed.showDialog();
    109110                        if (cbSuppress != null && cbSuppress.isSelected()) {
Note: See TracChangeset for help on using the changeset viewer.