Package jmri.util.table
Class JTableToCsvAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.util.table.JTableToCsvAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class JTableToCsvAction extends javax.swing.AbstractAction
Save a JTable or AbstractTableModel to CSV file after prompting for filename.First line contains Column Headings. Save order can replicate current JTable sort, filters, visible columns and column order. Entire Table Model can be saved by not specifying a JTable. Can exclude specific columns ( e.g. JButtons ) from the save.
- Since:
- 4.19.5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JTableToCsvAction(java.lang.String actionName, javax.swing.JTable jtable, javax.swing.table.TableModel model, java.lang.String defaultFileName, int[] excludedCols)
Create a new Save to CSV Action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
JTableToCsvAction
public JTableToCsvAction(java.lang.String actionName, javax.swing.JTable jtable, @Nonnull javax.swing.table.TableModel model, @Nonnull java.lang.String defaultFileName, @Nonnull int[] excludedCols)
Create a new Save to CSV Action.- Parameters:
actionName
- Action Namejtable
- to save the view, else null for whole table.model
- Table Model to use.defaultFileName
- File Name to use as default.excludedCols
- int Array of Table Model columns to exclude.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
-