293 return manager.getDesktop(); 294 } 295 296 /** 297 * Get the help broker used to provide help for this tool. 298 * @return the help broker used to provide help for this tool 299 */ 300 public HelpBroker getHelpBroker() { 301 return manager.getDesktop().getHelpBroker(); 302 } 303 304 /** 305 * Save information about a tool in a map, so that the 306 * tool can be restored in a later invocation of JT Harness. 307 * The tool must also implement the following method 308 * <code>public static Tool restore(Map m)</code> 309 * which will be invoked to recreate the tool. 310 * @param m the map in which to store the significant state 311 * of the tool 312 */ 313 protected abstract void save(Map m); 314 315 316 /** 317 * Restore information about a tool from a map, and configure 318 * the tool according this information. 319 * @param m the map in which to store the significant state 320 * of the tool 321 */ 322 protected abstract void restore(Map m); 323 324 325 /** 326 * Get a list (if any) of the reasons why it might be inadvisable 327 * to close the tool at this point. This will normally include 328 * information about unsaved data or tasks in progress. 329 * @return a list of alerts about why the user might not want 330 * to close the tool at this time; the list may be empty or null 331 * to indicate that there are no such reasons 332 */ 333 protected String[] getCloseAlerts() { 334 return null; 335 } 336 337 338 /** 339 * Set the helpID for this component. The help 340 * will be shown if and when the focus is on this component 341 * and the standard Help key (F1) is pressed. 342 * @param helpID the ID for the help to be displayed | 293 return manager.getDesktop(); 294 } 295 296 /** 297 * Get the help broker used to provide help for this tool. 298 * @return the help broker used to provide help for this tool 299 */ 300 public HelpBroker getHelpBroker() { 301 return manager.getDesktop().getHelpBroker(); 302 } 303 304 /** 305 * Save information about a tool in a map, so that the 306 * tool can be restored in a later invocation of JT Harness. 307 * The tool must also implement the following method 308 * <code>public static Tool restore(Map m)</code> 309 * which will be invoked to recreate the tool. 310 * @param m the map in which to store the significant state 311 * of the tool 312 */ 313 protected abstract void save(Map<String, String> m); 314 315 316 /** 317 * Restore information about a tool from a map, and configure 318 * the tool according this information. 319 * @param m the map in which to store the significant state 320 * of the tool 321 */ 322 protected abstract void restore(Map<String, String> m); 323 324 325 /** 326 * Get a list (if any) of the reasons why it might be inadvisable 327 * to close the tool at this point. This will normally include 328 * information about unsaved data or tasks in progress. 329 * @return a list of alerts about why the user might not want 330 * to close the tool at this time; the list may be empty or null 331 * to indicate that there are no such reasons 332 */ 333 protected String[] getCloseAlerts() { 334 return null; 335 } 336 337 338 /** 339 * Set the helpID for this component. The help 340 * will be shown if and when the focus is on this component 341 * and the standard Help key (F1) is pressed. 342 * @param helpID the ID for the help to be displayed |