- Timestamp:
- 2013-05-10T04:24:25+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r5904 r5951 37 37 putValue("toolbar", "action/restart"); 38 38 Main.toolbar.register(this); 39 setEnabled(isRestartSupported()); 39 40 } 40 41 … … 48 49 49 50 /** 51 * Determines if restartting the application should be possible on this platform. 52 * @return {@code true} if the mandatory system property {@code sun.java.command} is defined, {@code false} otherwise. 53 * @since 5951 54 */ 55 public static boolean isRestartSupported() { 56 return System.getProperty("sun.java.command") != null; 57 } 58 59 /** 50 60 * Restarts the current Java application 51 61 * @throws IOException 52 62 */ 53 63 public static void restartJOSM() throws IOException { 54 if ( !Main.exitJosm(false)) return;64 if (isRestartSupported() && !Main.exitJosm(false)) return; 55 65 try { 56 66 // java binary … … 108 118 ImageProvider.get("restart"), 109 119 tr("Restart the application."), 110 ht("/Action/Restart") 120 ht("/Action/Restart"), 121 isRestartSupported() 111 122 ); 112 123 } -
trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java
r5926 r5951 33 33 34 34 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 40 41 /** 41 * 42 * @param text 43 * @param icon 44 * @param tooltipText 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. 45 46 * @param helpTopic the help topic. Can be null. 46 47 */ 47 48 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) { 48 62 this.text = text; 49 63 this.icon = icon; 50 64 this.tooltipText = tooltipText; 51 65 this.helpTopic = helpTopic; 66 this.enabled = enabled; 52 67 } 53 68 } … … 95 110 } 96 111 b.setFocusable(true); 112 b.setEnabled(spec.enabled); 97 113 buttons.add(b); 98 114 }
Note:
See TracChangeset
for help on using the changeset viewer.