Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sorting to DataGrid; handle duplicate combo and other fixes #165

Closed
wants to merge 4 commits into from

Conversation

errael
Copy link
Contributor

@errael errael commented Feb 20, 2023

Three commits

Try this stuff using Example5.

This PR fixes primary issues. It does not handle the 4.x specific stuff like #12 and #8. Or new features like filtering #127, or #6 or #9. But note that Swing's sorting includes filtering capability, need an SS API.

open questions to consider during review

  • What kind of handling is required by Grid's ComboBox for null and/or unknown values coming from the database? I think getCellEditorValue() does the same thing, but I think the old behavior was inconsistent when getSelectedIndex() was -1.
  • Throw if SSDataGrid.setModel() and currently has a SSTableModel?
  • Note change to Control-X handling (my use of Ctrl-X was broken).
  • Don't give SSTableModel a JTable.
  • Why is there SSDataGrid.tableModel?
  • There's arrays in API, convert them to List<>.
  • What is the messageWindow all about?
  • The hidden columns array shows up in both table and model.
  • Why rowCount/columnCount variables in both grid/model?
  • There's a bunch of TODOs added, comments appreciated.

Incorporate swing's column sorter into SSDataGrid.
Add unsorted to sorting cycle: `ASC --> DESC --> UNSORTED -> ASC ...`
in overriding TableRowSorter.toggleSortOrder.
See the code for possible alternative behavior.

Introducte class SimpleComboListSwingModels
and add methods getSimpleComboBoxModel and getSimpleListModel
to AbstractComboBoxListSwingModel; used in SSDataGrid.

New implementation of `getSelectedColumns()`,
Fix issues with `hideColumns()`, hidden columns can now restore.
Add `List<TableColumn> getHiddenColumns()` unmodifiable list.
Add `List<TableColumn> getColumnsList()`.
Add `getSimpleListModel()` in addition to `getSimpleComboBoxModel()`.

Deprecate a variety of things; needs API redesign.
@bpangburn bpangburn deleted the branch 4.0.12-SNAPSHOT December 16, 2023 19:24
@bpangburn bpangburn closed this Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants