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

Wrap viewer in CheckboxTablePart within a FilteredTable #1666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ptziegler
Copy link
Contributor

By using the FilteredTable, we get a quick-filter for all extending parts for free. This includes:

  • The Cross-platform page of the "Deployable features" export wizard.
  • The Update Java Classpath page of the "Update classpath..." action
  • The Selection page of the "Import Plug-ins and Fragments" wizard
  • The Update Java Classpath page of the "Plug-in from Existing JAR Archives" wizard.
  • The Template Selection page of the "Plug-in Project" page.

Together with the quick-filter comes a caching of the checked table items. Those elements remain checked, even if currently hidden by the filter and will be restored once they become visible again.

Furthermore, the PluginListPage has been adapted to use a CheckboxTablePart rather than a CheckboxTreePart (effectively reverting 4c1edad), to match the list of plugins that it displays.

Contributes to #1497

Comment on lines +74 to +82
@Override
protected void preservingSelection(Runnable updateCode) {
super.preservingSelection(updateCode);
// The super class implementation will preserve a root element's check
// mark but that can cause newly unfiltered children to become check
// marked.
// See https://github.com/eclipse-pde/eclipse.pde/issues/62
restoreCachedState();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In hindsight, I'm not really sure if this is really needed. There aren't multiple levels of children, so this issue probably can't happen here.

Comment on lines +123 to +130
<resource path="src/org/eclipse/pde/internal/ui/shared/CachedCheckboxTableViewer.java" type="org.eclipse.pde.internal.ui.shared.CachedCheckboxTableViewer">
<filter comment="Extends CheckboxTableViewer to match CachedCheckboxTreeviewer" id="571473929">
<message_arguments>
<message_argument value="CheckboxTableViewer"/>
<message_argument value="CachedCheckboxTableViewer"/>
</message_arguments>
</filter>
</resource>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether inheritance is better than composition. But otherwise it's not possible to respond to e.g. calling setAllChecked() on the viewer.

@ptziegler
Copy link
Contributor Author

Furthermore, the PluginListPage has been adapted to use a CheckboxTablePart rather than a CheckboxTreePart (effectively reverting 4c1edad), to match the list of plugins that it displays.

Note that this breaks M2E, as it extends the internal BasePluginListPage.

@ptziegler
Copy link
Contributor Author

And a side-by-side comparison of the Plugin table, which has been migrated from a tree- to a table viewer, as well as one of the tables for which the quick-filter is added due to the FilteredTable.

image
image

Copy link

github-actions bot commented Mar 7, 2025

Test Results

   285 files  +  6     285 suites  +6   47m 49s ⏱️ + 1m 24s
 3 608 tests ±  0   3 532 ✅ +  2   76 💤  -  1  0 ❌  - 1 
11 016 runs  +194  10 785 ✅ +167  231 💤 +28  0 ❌  - 1 

Results for commit 54ce71c. ± Comparison against base commit c7d99fd.

♻️ This comment has been updated with latest results.

By using the FilteredTable, we get a quick-filter for all extending
parts for free. This includes:

- The Cross-platform page of the "Deployable features" export wizard.
- The Update Java Classpath page of the "Update classpath..." action
- The Selection page of the "Import Plug-ins and Fragments" wizard
- The Update Java Classpath page of the "Plug-in from Existing JAR
  Archives" wizard.
- The Template Selection page of the "Plug-in Project" page.

Together with the quick-filter comes a caching of the checked table
items. Those elements remain checked, even if currently hidden by the
filter and will be restored once they become visible again.

Furthermore, the PluginListPage has been adapted to use a
CheckboxTablePart rather than a CheckboxTreePart (effectively reverting
4c1edad), to match the list of plugins
that it displays.

Contributes to eclipse-pde#1497
@ptziegler ptziegler force-pushed the use-filtered-table branch from 12ec3ef to 54ce71c Compare March 7, 2025 22:23
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.

1 participant