Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Some issues with layout and searching/filtering in a virtual table(virtual table, searching, filtering, layout)
Some issues with layout and searching/filtering in a virtual table [message #1701428] |
Mon, 13 July 2015 12:07 |
Mick Miralas Messages: 13 Registered: June 2015 |
Junior Member |
|
|
Hello,
I have some trouble and kindly ask for help:
1.) I am using the Grid Layout. While the design looks well (see picture 1), during runtime the GUI has the drawback that the label and text widgets move/grow to the right side. How is it possible to avoid this?
2.) Does anybody know how to prevent RCP from painting the part which is highlighted in red on the second picture?
3.) While filtering (extending class ViewerFilter) and searching (using a method getSearchTermOccurrances(searText, cellText) within the update method of StyledCellLabelProvider) worked well before I started to use a virtual table, now both functions don't work anymore.
My thoughts:
-The filtering function could be implemented through copying the ArrayList of objects that provides the data for virtual table and browse through the copy while deleting objects that have no fields matchting to the filter string. Finally, this "clean copy" is provided to the virtual table as input. If the filter is deleted, then the original ArrayList is provided to the virtual table. Does this make sense or are there any better ideas?
-The searching function troubles me, because it doesn't work with SWT.SetData Listener, since the update method is called before the handleEvent of the SWT.SetData listener and a NullPointerException is thrown. Any ideas?
Thank you very much!
Regards,
Mick
P.S. I know that these use cases cry out for NatTable, but for my master thesis I first have to deal with the basic Eclipse RCP features and explain why sth. doesn't work before I can consider other widgets.
-
Attachment: ask1.png
(Size: 16.83KB, Downloaded 162 times) -
Attachment: ask2.png
(Size: 75.67KB, Downloaded 171 times)
|
|
| | |
Re: Some issues with layout and searching/filtering in a virtual table [message #1702649 is a reply to message #1701428] |
Thu, 23 July 2015 18:09 |
Dirk Fauth Messages: 2902 Registered: July 2012 |
Senior Member |
|
|
Mick Miralas wrote on Mon, 13 July 2015 14:07Hello,
I have some trouble and kindly ask for help:
1.) I am using the Grid Layout. While the design looks well (see picture 1), during runtime the GUI has the drawback that the label and text widgets move/grow to the right side. How is it possible to avoid this?
2.) Does anybody know how to prevent RCP from painting the part which is highlighted in red on the second picture?
3.) While filtering (extending class ViewerFilter) and searching (using a method getSearchTermOccurrances(searText, cellText) within the update method of StyledCellLabelProvider) worked well before I started to use a virtual table, now both functions don't work anymore.
My thoughts:
-The filtering function could be implemented through copying the ArrayList of objects that provides the data for virtual table and browse through the copy while deleting objects that have no fields matchting to the filter string. Finally, this "clean copy" is provided to the virtual table as input. If the filter is deleted, then the original ArrayList is provided to the virtual table. Does this make sense or are there any better ideas?
-The searching function troubles me, because it doesn't work with SWT.SetData Listener, since the update method is called before the handleEvent of the SWT.SetData listener and a NullPointerException is thrown. Any ideas?
Thank you very much!
Regards,
Mick
P.S. I know that these use cases cry out for NatTable, but for my master thesis I first have to deal with the basic Eclipse RCP features and explain why sth. doesn't work before I can consider other widgets.
Sorry, I rarely look in the SWT forum. But as you asked me via email, I try to answer your questions in order to help you with your master thesis.
1. If you are using a GridLayout, it seems you have set a GridData that uses the grab attributes. If you don't specify them, they shouldn't grow. Specifying the correct GridData should solve your issues. The GridDataFactory is something to look at.
https://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html
2. It is a second part, so you have configured it somewhere. Are you using Eclipse 3.x or 4.x? Without knowing about your setup it is hard to tell. In Eclipse 4 I would suggest to look at the application model and remove the part/partstack you don't need.
3. Well the thing is that you are trying to achieve 3 transformations at once, filtering, sorting and limiting the visible items. In NatTable the virtual thing is solved using a viewport concept, which means we only handle data that would be visible. Everything else stays in memory without being handled for rendering. The combination of sorting and filtering is and multi-step transformation. For a high performance solution we are using GlazedLists, which is a list implementation that supports such transformation combination with a layer construct. So technically you are wrapping one list transformation with another list transformation to get a combination.
Natively this is not supported. Why? I'm not sure. Maybe some limitation of the OS, maybe because it is not a trivial task. Nevertheless AFAIK it is also possible to use GlazedLists in combination with SWT. So you can achieve the same using SWT tables if you add the usage of GlazedLists.
Regarding SWT.SetData, I don't know. I rarely use SWT tables if I have extended use cases.
Hope that helps!
|
|
|
Re: Some issues with layout and searching/filtering in a virtual table [message #1702654 is a reply to message #1702649] |
Thu, 23 July 2015 18:31 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
On 23.07.15 20:09, Dirk Fauth wrote:
> Mick Miralas wrote on Mon, 13 July 2015 14:07
>> Hello,
>>
>> I have some trouble and kindly ask for help:
>>
>> 1.) I am using the Grid Layout. While the design looks well (see
>> picture 1), during runtime the GUI has the drawback that the label and
>> text widgets move/grow to the right side. How is it possible to avoid
>> this?
>> 2.) Does anybody know how to prevent RCP from painting the part which
>> is highlighted in red on the second picture? 3.) While filtering
>> (extending class ViewerFilter) and searching (using a method
>> getSearchTermOccurrances(searText, cellText) within the update method
>> of StyledCellLabelProvider) worked well before I started to use a
>> virtual table, now both functions don't work anymore.
>> My thoughts:
>> -The filtering function could be implemented through copying the
>> ArrayList of objects that provides the data for virtual table and
>> browse through the copy while deleting objects that have no fields
>> matchting to the filter string. Finally, this "clean copy" is provided
>> to the virtual table as input. If the filter is deleted, then the
>> original ArrayList is provided to the virtual table. Does this make
>> sense or are there any better ideas?
>> -The searching function troubles me, because it doesn't work with
>> SWT.SetData Listener, since the update method is called before the
>> handleEvent of the SWT.SetData listener and a NullPointerException is
>> thrown. Any ideas?
>>
>> Thank you very much!
>>
>> Regards,
>> Mick
>>
>> P.S. I know that these use cases cry out for NatTable, but for my
>> master thesis I first have to deal with the basic Eclipse RCP features
>> and explain why sth. doesn't work before I can consider other widgets.
>
>
> Sorry, I rarely look in the SWT forum. But as you asked me via email, I
> try to answer your questions in order to help you with your master thesis.
>
> 1. If you are using a GridLayout, it seems you have set a GridData that
> uses the grab attributes. If you don't specify them, they shouldn't
> grow. Specifying the correct GridData should solve your issues. The
> GridDataFactory is something to look at.
> https://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html
>
>
> 2. It is a second part, so you have configured it somewhere. Are you
> using Eclipse 3.x or 4.x? Without knowing about your setup it is hard to
> tell. In Eclipse 4 I would suggest to look at the application model and
> remove the part/partstack you don't need.
>
> 3. Well the thing is that you are trying to achieve 3 transformations at
> once, filtering, sorting and limiting the visible items. In NatTable the
> virtual thing is solved using a viewport concept, which means we only
> handle data that would be visible. Everything else stays in memory
> without being handled for rendering. The combination of sorting and
> filtering is and multi-step transformation. For a high performance
> solution we are using GlazedLists, which is a list implementation that
> supports such transformation combination with a layer construct. So
> technically you are wrapping one list transformation with another list
> transformation to get a combination.
>
> Natively this is not supported. Why? I'm not sure. Maybe some limitation
> of the OS, maybe because it is not a trivial task. Nevertheless AFAIK it
> is also possible to use GlazedLists in combination with SWT. So you can
> achieve the same using SWT tables if you add the usage of GlazedLists.
>
> Regarding SWT.SetData, I don't know. I rarely use SWT tables if I have
> extended use cases. ;)
>
> Hope that helps!
Virtual-Tables can be filter sorted only if you have a none lazy content
provider. In case of a lazy content provide you can never do appropriate
sorting and filtering in memory.
Tom
|
|
| | |
Goto Forum:
Current Time: Tue Mar 19 14:06:13 GMT 2024
Powered by FUDForum. Page generated in 0.04174 seconds
|