Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Mick Miralas is currently offline Mick MiralasFriend
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 #1701597 is a reply to message #1701428] Tue, 14 July 2015 11:06 Go to previous messageGo to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
Really nobody? Sad
Re: Some issues with layout and searching/filtering in a virtual table [message #1702417 is a reply to message #1701597] Wed, 22 July 2015 08:56 Go to previous messageGo to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 13
Registered: June 2015
Junior Member
Any kind of feedback would be much appreciated.
It should be clear, but even if you could answer only one question, this would be OK.

Very strange that no one has an answer in the official forum...
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 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
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. Wink

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 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
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
Re: Some issues with layout and searching/filtering in a virtual table [message #1707378 is a reply to message #1702654] Fri, 04 September 2015 11:41 Go to previous messageGo to next message
Mick Miralas is currently offline Mick MiralasFriend
Messages: 16
Registered: July 2015
Junior Member
Hello Dirk,

thank you very much for your reply and for your help.
I had to do a lot of writing, so I didn't manage to answer.
Currently I'm trying to use NatTable in a prototype application that gets data from an application server each time a user cklicks on the button. Furthermore, a user can influence the SQL queries by typing text into a text widget, i.e. the results can vary.
In order to employ NatTable I'm studying your example "FilterRowGridExample".

My problem: I don't know how to implement the event handler of my button in order to feed the GlazedList of the DataLayer with the new data each time a user clicks on the button.

Could you help me, please?

Thank you very much!

Regards,
Mick
Re: Some issues with layout and searching/filtering in a virtual table [message #1707484 is a reply to message #1707378] Sat, 05 September 2015 09:35 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
You need to operate on the GlazedLists instance directly in such a case. NatTable is only for visualization and does not support full data management.
If you operate on the GlazedLists instance the GlazedListsEventLayer will ensure to update the NatTable on list changes.
Previous Topic:SWT widget issue on Debian Jessie
Next Topic:programmatically fire Tab key press event
Goto Forum:
  


Current Time: Tue Mar 19 14:06:13 GMT 2024

Powered by FUDForum. Page generated in 0.04174 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top