-
Notifications
You must be signed in to change notification settings - Fork 190
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
Implement filter-based table viewer via the new FilterTable class #2567
base: master
Are you sure you want to change the base?
Conversation
See eclipse-pde/eclipse.pde#1497 for a potential use-case. Note: This also works with virtual tables: recording.webm |
Did you also consider the FilteredTree from the E4 package? This way this class could also be used in pure e4 rcp apps. |
Not for the time being. And looking at it, it really is just a copy-paste of the E3 class. So ideally, I'd like to get some feedback on the current implementation before I repeat the same for the E4 one. |
IIRC we copied it and removed the E3 reference (IIRC the help system) and added the option to enable/ disable the filter at runtime. If it's functionality is the same I think we should only add one class ( to the E4 package so that it can be used in ide and E4 RCP). |
Test Results 1 214 files - 607 1 214 suites - 607 1h 17m 26s ⏱️ - 33m 22s Results for commit f36df7f. ± Comparison against base commit 98ff2aa. This pull request removes 6 and adds 7 tests. Note that renamed tests count towards both.
This pull request skips 5 tests.
♻️ This comment has been updated with latest results. |
Is there an E4 counterpart for the TextMatcher? Would it perhaps make sense to move it to e.g. |
I'm not aware of an e4 counterpart. Would be great to move this to an API package that everyone can use. |
By the way it is confusing to talk about E3/E4 "counterparts" here as these are completely independent from the used technique (e.g. it does not require any DI at all nor does it requires E3 extension points). So making the class somewhere more generic available would be beneficial and as it is a final class let the "old" extend the "new" should work flawlessly. |
* | ||
* @since 3.135 | ||
*/ | ||
public non-sealed class FilteredTable extends AbstractFilteredViewer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea but maybe having a JFace FilteredTableViewer
could be a better place for this so it can be used even outside of Eclipse Platform in SWT/JFace Applications.
Maybe even one can abstract the whole thing to use a StructuredViewer
then it can be used with any table/tree/grid ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea but maybe having a JFace
FilteredTableViewer
could be a better place for this so it can be used even outside of Eclipse Platform in SWT/JFace Applications.
The FilteredTable
/FilteredTree
depend on the WorkbenchJob
/BasicUIJob
, so there is an inherent dependency to the E3/E4 workbench, which effectively prevents them to be moved to JFace.
Though it might be possible to specify a plain Job in the abstract base class and then have the implementations provide their respective instances... This would at the very least avoid the code duplication.
Maybe even one can abstract the whole thing to use a
StructuredViewer
then it can be used with any table/tree/grid ...
The base class only specifies a ColumnViewer
but one could probably go even lower...
It is not, new elements which can be used in E3 and pure E4 must of have dependencies to the old workbench implementation, as the e3 initialization code does not run in pure E4. |
Them mentioned class do not have any dependencies to a (E3 or E4) workbench as far as I can see... |
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.
5ccbcda
to
763212e
Compare
In principle, the TextMatcher class should work regardless of whether an E3 or E4 workbench is used. I've therefore moved the class from org.eclipse.ui.workbench to org.eclipse.jface.text. The same is true for the abstract base class I've created for the FilteredTable/Tree, so that I don't have to duplicate the implementation for the E4 classes. Though I still have to think about how to best adapt the E4 classes... |
This pull request changes some projects for the first time in this development cycle.
An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patch
Further information are available in Common Build Issues - Missing version increments. |
Interestingly enough I found we already have |
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:
For the FilteredTree, following fields and methods have been marked as
for-removal:
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.