Skip to content

Commit

Permalink
Implement filter-based table viewer via the new FilterTable class
Browse files Browse the repository at this point in the history
This moves the viewer-agnostic components of the FilterTree widget into
an AbstractFilteredStructuredViewer base class, which is then used to
implement the FilterTable widget.

The base class has been moved to org.eclipse.jface.text together with
the TextMatcher, to allow it to be used together with both an E3 and E4
workbench.

For the AbstractFilteredStructuredViewer, following methods have been
added to support this abstraction:
- isShowFilterControls()
- isQuickSelectionMode()
- init(int)

For the FilteredTree, following fields and methods have been marked as
for-removal:
- filterToolBar
- clearButtonControl
- updateToolbar(boolean)

To avoid code-duplication as a result of bug 260664, the code of
clearText() has been moved to a separate doClearText() method, so that
the same code can be invoked inside the listeners, without having to
worry about clearText() being overridden by subclasses.

This change adds a dependency from org.eclipse.jface.text to
org.eclipse.ui.workbench.
  • Loading branch information
ptziegler committed Jan 20, 2025
1 parent 3eaaeb6 commit e78984c
Show file tree
Hide file tree
Showing 20 changed files with 1,678 additions and 4 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,12 @@ public boolean isElementVisible(Viewer viewer, Object element) {
* text
*/
protected boolean isParentMatch(Viewer viewer, Object element) {
Object[] children = ((ITreeContentProvider) ((AbstractTreeViewer) viewer)
.getContentProvider()).getChildren(element);
if (viewer instanceof AbstractTreeViewer
&& ((AbstractTreeViewer) viewer).getContentProvider() instanceof ITreeContentProvider) {
Object[] children = ((ITreeContentProvider) ((AbstractTreeViewer) viewer).getContentProvider())
.getChildren(element);

if ((children != null) && (children.length > 0)) {
return isAnyVisible(viewer, element, children);
return children != null && children.length > 0 && isAnyVisible(viewer, element, children);
}
return false;
}
Expand Down
Loading

0 comments on commit e78984c

Please sign in to comment.