Package jmri.util.table
Class JTableToCsvAction
java.lang.Object
javax.swing.AbstractAction
jmri.util.table.JTableToCsvAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
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:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
ConstructorsConstructorDescriptionJTableToCsvAction(String actionName, JTable jtable, TableModel model, String defaultFileName, int[] excludedCols) Create a new Save to CSV Action. -
Method Summary
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
JTableToCsvAction
public JTableToCsvAction(String actionName, JTable jtable, @Nonnull TableModel model, @Nonnull 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 Details
-
actionPerformed
-