Custom MatcherEditor?

View: New views
2 Messages — Rating Filter:   Alert me  

Custom MatcherEditor?

by Eric Jönsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

So I've got an EventList that consists of something resembling (simplified, of course) this:

class Foo {
  public boolean property;
}

From this list, I need to filter out the objects of this list that has this property set, and for that I've written a Matcher:

class FooMatcher implements Matcher {
  public boolean matches (Foo f) {
    return f.property;
  }
}

However, the list changes frequently and so I'd like to do it dynamically. I understand I need to write a MatcherEditor, (extending AbstractMatcherEditor perhaps) but I've no idea how to do so. I can't use the UI-related TextComponentMatcherEditor (as seen in the online tutorial) as this list will change "under the hood".

I've read the docs, browsed the tutorial, search the mailing list and.. I just don't get it. Someone please explain to me how I write a MatcherEditor.

Parent Message unknown Re: Custom MatcherEditor?

by Holger Brands :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Eric,

you only need a MatcherEditor, if the filter criteria changes.

If I understand your question correctly, you just want to react to
list changes like inserts, deletions and updates.
For inserts and deletions the filtering should work automatically.
You only have to take care of the updates, e.g. when the property values
of Foo objects change.
An ObservableElementList can help here, if you refactor your bean
according to the conventions of the JavaBeans specification.
(fire a property change event when the property value changes)
Please have a look at the screencasts here:
http://www.publicobject.com/glazedlistsdeveloper/

Hope this helps,
Holger

>
> Hello.
>
> So I've got an EventList that consists of something resembling (simplified,
> of course) this:
>
> class Foo {
>   public boolean property;
> }
>
> From this list, I need to filter out the objects of this list that has this
> property set, and for that I've written a Matcher:
>
> class FooMatcher implements Matcher {
>   public boolean matches (Foo f) {
>     return f.property;
>   }
> }
>
> However, the list changes frequently and so I'd like to do it dynamically. I
> understand I need to write a MatcherEditor, (extending AbstractMatcherEditor
> perhaps) but I've no idea how to do so. I can't use the UI-related
> TextComponentMatcherEditor (as seen in the online tutorial) as this list
> will change "under the hood".
>
> I've read the docs, browsed the tutorial, search the mailing list and.. I
> just don't get it. Someone please explain to me how I write a MatcherEditor.
> --
> View this message in context: http://www.nabble.com/Custom-MatcherEditor--tp25253216p25253216.html
> Sent from the GlazedLists - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>


________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...