public class KeyValueRecordSelector<RecordType>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
KeyValueRecordSelector(KeyValueFilteredTableModel<RecordType> tableModel,
javax.swing.JFrame owner,
java.lang.String title)
Constructor with default filter prompt
|
protected |
KeyValueRecordSelector(KeyValueFilteredTableModel<RecordType> tableModel,
javax.swing.JFrame owner,
java.lang.String title,
java.lang.String filterPrompt)
Primary Constructor
|
Modifier and Type | Method and Description |
---|---|
static <RecordType> |
getInstance(KeyValueFilteredTableModel<RecordType> tableModel,
javax.swing.JFrame owner,
java.lang.String title)
Get an instance of a record selector for allowing users to select records (of the specified type) from a list in a table.
|
static <RecordType> |
getInstance(java.util.List<RecordType> records,
javax.swing.JFrame owner,
java.lang.String title,
java.lang.String... keyPaths)
Get an instance of a record selector for allowing users to select records (of the specified type) from a list in a table.
|
static <RecordType> |
getInstanceWithFilterPrompt(KeyValueFilteredTableModel<RecordType> tableModel,
javax.swing.JFrame owner,
java.lang.String title,
java.lang.String filterPrompt)
Get an instance of a record selector for allowing users to select records (of the specified type) from a list in a table.
|
static <RecordType> |
getInstanceWithFilterPrompt(java.util.List<RecordType> records,
javax.swing.JFrame owner,
java.lang.String title,
java.lang.String filterPrompt,
java.lang.String... keyPaths)
Get an instance of a record selector for allowing users to select records (of the specified type) from a list in a table.
|
javax.swing.JTable |
getRecordTable()
get the table which displays the records from which to select
|
KeyValueFilteredTableModel<RecordType> |
getRecordTableModel()
get the table model for displaying the records
|
protected java.util.List<RecordType> |
getSelectedRecords()
get the list of selected records
|
java.util.List<RecordType> |
showDialog()
Show the dialog with arbitrary record selection allowed and return a list of selected records.
|
java.util.List<RecordType> |
showDialog(int selectionMode)
Show the dialog with the specified record selection mode and return a list of selected records.
|
RecordType |
showSingleSelectionDialog()
Show the dialog with single record selection allowed and return the selected record if any.
|
protected KeyValueRecordSelector(KeyValueFilteredTableModel<RecordType> tableModel, javax.swing.JFrame owner, java.lang.String title, java.lang.String filterPrompt)
protected KeyValueRecordSelector(KeyValueFilteredTableModel<RecordType> tableModel, javax.swing.JFrame owner, java.lang.String title)
public static <RecordType> KeyValueRecordSelector<RecordType> getInstance(KeyValueFilteredTableModel<RecordType> tableModel, javax.swing.JFrame owner, java.lang.String title)
tableModel
- table model supplying the records to displayowner
- the window that owns the dialog windowtitle
- the title of the dialog windowpublic static <RecordType> KeyValueRecordSelector<RecordType> getInstance(java.util.List<RecordType> records, javax.swing.JFrame owner, java.lang.String title, java.lang.String... keyPaths)
records
- the objects of the specified types to list for selectionowner
- the window that owns the dialog windowtitle
- the title of the dialog windowkeyPaths
- are the key paths applied to each record to supply the table's column datapublic static <RecordType> KeyValueRecordSelector<RecordType> getInstanceWithFilterPrompt(KeyValueFilteredTableModel<RecordType> tableModel, javax.swing.JFrame owner, java.lang.String title, java.lang.String filterPrompt)
tableModel
- table model supplying the records to displayowner
- the window that owns the dialog windowtitle
- the title of the dialog windowfilterPrompt
- the prompt to appear as a placeholder in the filter fieldpublic static <RecordType> KeyValueRecordSelector<RecordType> getInstanceWithFilterPrompt(java.util.List<RecordType> records, javax.swing.JFrame owner, java.lang.String title, java.lang.String filterPrompt, java.lang.String... keyPaths)
records
- the objects of the specified types to list for selectionowner
- the window that owns the dialog windowtitle
- the title of the dialog windowfilterPrompt
- the prompt to appear as a placeholder in the filter fieldkeyPaths
- are the key paths applied to each record to supply the table's column datapublic javax.swing.JTable getRecordTable()
public KeyValueFilteredTableModel<RecordType> getRecordTableModel()
public RecordType showSingleSelectionDialog()
public java.util.List<RecordType> showDialog()
public java.util.List<RecordType> showDialog(int selectionMode)
selectionMode
- record selection mode: ListSelectionModel.SINGLE_SELECTION, ListSelectionModel.SINGLE_INTERVAL_SELECTION or ListSelectionModel.MULTIPLE_INTERVAL_SELECTIONprotected java.util.List<RecordType> getSelectedRecords()