Ignore:
Timestamp:
2013-05-10T04:24:25+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8697 - Disable restart action with JVMs that do not provide sun.java.command system property (ex: JDK 6u24)

File:
1 edited

Legend:

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

    r5926 r5951  
    3333
    3434    public static class ButtonSpec {
    35         public String text;
    36         public Icon icon;
    37         public String tooltipText;
    38         public String helpTopic;
    39 
     35        public final String text;
     36        public final Icon icon;
     37        public final String tooltipText;
     38        public final String helpTopic;
     39        public final boolean enabled;
     40       
    4041        /**
    41          *
    42          * @param text  the button text
    43          * @param icon  the icon to display. Can be null
    44          * @param tooltipText  the tooltip text. Can be null.
     42         * Constructs a new {@code ButtonSpec}.
     43         * @param text the button text
     44         * @param icon the icon to display. Can be null
     45         * @param tooltipText the tooltip text. Can be null.
    4546         * @param helpTopic the help topic. Can be null.
    4647         */
    4748        public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic) {
     49            this(text, icon, tooltipText, helpTopic, true);
     50        }
     51
     52        /**
     53         * Constructs a new {@code ButtonSpec}.
     54         * @param text the button text
     55         * @param icon the icon to display. Can be null
     56         * @param tooltipText the tooltip text. Can be null.
     57         * @param helpTopic the help topic. Can be null.
     58         * @param enabled the enabled status
     59         * @since 5951
     60         */
     61        public ButtonSpec(String text, Icon icon, String tooltipText, String helpTopic, boolean enabled) {
    4862            this.text = text;
    4963            this.icon = icon;
    5064            this.tooltipText = tooltipText;
    5165            this.helpTopic = helpTopic;
     66            this.enabled = enabled;
    5267        }
    5368    }
     
    95110                }
    96111                b.setFocusable(true);
     112                b.setEnabled(spec.enabled);
    97113                buttons.add(b);
    98114            }
Note: See TracChangeset for help on using the changeset viewer.