/** * Factory method for creating an "export" button that -upon execution- calls * the methods {@link #storeToCsvFile(File, Object)} or * {@link #storeToHtmlFile(File, Object)}. * * @return an "export" button, with keyboard shortcuts enabled, never * <code>null</code>. */ public static JButton createExportButton( final ExportAware<?> aToolDialog ) { final ExportAction action = new ExportAction( aToolDialog ); final JButton exportButton = new JButton( action ); SwingComponentUtils.registerKeystroke( exportButton, action, "EXPORT" ); return exportButton; }
/** * Creates new ExportAction instance. */ public ExportAction( final ExportAware<?> aToolDialog ) { super( "Export" ); this.toolDialog = aToolDialog; putValue( SHORT_DESCRIPTION, "Exports the analysis results to file" ); putValue( ACCELERATOR_KEY, SwingComponentUtils.createMenuKeyMask( KeyEvent.VK_E ) ); setEnabled( false ); }