Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsFilter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1076187/#msg_1076187
I've build a NatTable with GlazedLists that is displayed correctly. Now I want to have a text field outside the table. While typing in this field the table should be refreshed with matching data. "Matching data" means that each cell in the underlying list is compared to the input string and if one item matches the row should be placed in the resulting list.
I've looked in GridSearchStrategy but didn't get it to work (and didn't know if it's the right place). How can I achieve this? The search fields have to be configurable, i.e. the table consists of "col1", "col2", "col3" and the search should only look through "col1" and "col3".
TIA,
Ralf.]]>Ralf Heydenreich2013-07-30T22:39:09-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1076335/#msg_1076335
For me it sound more that you want to filter. In that case you should consider using a FilterList and add a filter for your input in the text field. So you might want to have a look at the filter examples and search for informations about filtering in GlazedLists.
In short, you should add the GlazedListsEventLayer to your layer stack, use a FilterList on top of the GlazedLists stack and apply a Matcher to your FilterList everytime there is an input in your text field.]]>Dirk Fauth2013-07-31T07:36:29-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1085126/#msg_1085126
Ralf.]]>Ralf Heydenreich2013-08-12T13:39:56-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1246393/#msg_1246393
> What are you trying to achieve? Searching or filtering?
>
> For me it sound more that you want to filter. In that case you should
> consider using a FilterList and add a filter for your input in the text
> field. So you might want to have a look at the filter examples and
> search for informations about filtering in GlazedLists.
>
> In short, you should add the GlazedListsEventLayer to your layer stack,
> use a FilterList on top of the GlazedLists stack and apply a Matcher to
> your FilterList everytime there is an input in your text field.
Hi Dirk,
sorry for exhuming this old thread... The TextFilterator is the right
class, I know it now. But I can't put it all together in my SWT sample
app. This is what I have:
EventList<MyRowObject> eventList =
GlazedLists.eventList(createMyRowObjects(9));
Text filterText = new Text(panel, SWT.NONE);
GlazedListsGridLayer<MyRowObject> gridLayer = new
GlazedListsGridLayer<MyRowObject>(eventList,
columnPropertyAccessor, columnHeaderDataProvider, configRegistry,
true); gridLayer.getBodyDataLayer().setConfigLabelAccumulator(new
ColumnLabelAccumulator());
final DataLayer n6DataLayer = gridLayer.getBodyDataLayer();
MatcherEditor<MyRowObject> textMatcherEditor = new
TextWidgetMatcherEditor<MyRowObject>(
filterText, new IssueTextFilterator());
GlazedListsEventLayer<MyRowObject> evtLayer = new
GlazedListsEventLayer<MyRowObject>(n6DataLayer, eventList);
FilterList<MyRowObject> textFilteredIssues = new FilterList<MyRowObject>
(sortedIssues, textMatcherEditor);
Now, how do I put the evtLayer over the GlazedListsLayer? Do I have to
use some stuff like
GlazedListsSWT.eventTableViewerWithThreadProxyList()? Would be glad if
you could help me...
TIA,
Ralf.]]>Ralf Heydenreich2014-02-15T02:01:03-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1247757/#msg_1247757
there are several things that are not correct.
1. A GlazedListsSWT.eventTableViewerWithThreadProxyList() is creating a new viewer based on a Table. That has nothing to do with NatTable!
2. You are using the GlazedListsGridLayer which is only contained in the examples. You should never rely on something in an example project. It is there to show how to build a custom grid layer that is using GlazedLists.
3. You are adding an additional GlazedListsEventLayer on top of the DataLayer. So you are creating a new path in the layer stack next to the original one. It is not possible to attach that into the layer stack afterwards. The layer composition does not support such plugin ability.
Said that, why don't you create your own GlazedListsGridLayer that supports your use case? BTW, the GlazedListsGridLayer already contains a GlazedListsEventLayer. But it is not build on a FilterList. So you definitely need to create your own stack.
Greez,
Dirk]]>Dirk Fauth2014-02-16T15:20:52-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1247975/#msg_1247975
> Hi,
>
> there are several things that are not correct.
>
> 1. A GlazedListsSWT.eventTableViewerWithThreadProxyList() is creating a
> new viewer based on a Table. That has nothing to do with NatTable!
> 2. You are using the GlazedListsGridLayer which is only contained in the
> examples. You should never rely on something in an example project. It
> is there to show how to build a custom grid layer that is using
> GlazedLists.
> 3. You are adding an additional GlazedListsEventLayer on top of the
> DataLayer. So you are creating a new path in the layer stack next to the
> original one. It is not possible to attach that into the layer stack
> afterwards. The layer composition does not support such plugin ability.
>
> Said that, why don't you create your own GlazedListsGridLayer that
> supports your use case? BTW, the GlazedListsGridLayer already contains a
> GlazedListsEventLayer. But it is not build on a FilterList. So you
> definitely need to create your own stack.
>
> Greez,
> Dirk
Hi Dirk,
I guess I didn't fully understand the mechanics behind NatTable and
GlazedLists. But for now, it works. I've set up my own stack (and yes, I
could remove some code!). Now the filtering is working perfectly. Thanks
for your help!
Regards,
Ralf.]]>Ralf Heydenreich2014-02-16T21:04:53-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1578295/#msg_1578295
I have a grid with filters based on a FilterList. It works fine but I never added the GlazedListsEventLayer to the stack.
Why is this layer neccessary? How does filtering works without it?]]>Gal Rogozinski2015-01-22T10:03:16-00:00Re: Filter and Search with separate text box
https://www.eclipse.org/forums/index.php/mv/msg/496306/1578330/#msg_1578330
Filtering might work without it, because after applying a filter, a repaint is triggered manually. ]]>Dirk Fauth2015-01-22T10:26:11-00:00