|
|
|
Re: Filter and Search with separate text box [message #1246393 is a reply to message #1076335] |
Sat, 15 February 2014 02:01 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
Am 31.07.2013 09:36, schrieb Dirk Fauth:
> 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.
|
|
|
|
Re: Filter and Search with separate text box [message #1247975 is a reply to message #1247757] |
Sun, 16 February 2014 21:04 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
Am 16.02.2014 16:20, schrieb Dirk Fauth:
> 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.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02470 seconds