package Ġcom . github . han se ter . json . query engine . fx . query U is Ċ Ċ import Ġjavafx . scene . control . Title d Pane Ċ import Ġjavafx . scene . Node Ċ import Ġcom . github . han se ter . json . query engine . And Query . And QueryBuilder Ċ import Ġcom . github . han se ter . json . query engine . And Query Ċ import Ġcom . github . han se ter . json . query engine . QueryBuilder Ċ import Ġjavafx . beans . property . Simple Boolean Property Ċ import Ġjavafx . beans . property . ReadOnly Boolean Property Ċ import Ġjavafx . beans . binding . Boolean Binding Ċ import Ġjavafx . beans . binding . Bindings Ċ import Ġjavafx . beans . binding . Boolean Expression Ċ import Ġjavafx . scene . control . ListView Ċ import Ġjavafx . scene . control . List Cell Ċ import Ġcom . github . han se ter . json . query engine . fx . Drag And Drop Manager . Drag able Query Ċ import Ġjavafx . scene . control . Button Ċ import Ġjavafx . scene . layout . V Box Ċ import Ġjavafx . scene . layout . Priority Ċ import Ġjavafx . scene . control . Label Ċ import Ġjavafx . collections . List ChangeListener . Change Ċ import Ġcom . github . han se ter . json . query engine . fx . Drag And Drop Manager Ċ import Ġcom . github . han se ter . json . query engine . fx . QueryBuilder Ui Ċ Ċ class ĠAnd Query Ui ( d nd Manager : ĠDrag And Drop Manager ) Ġ: ĠTitle d Pane (), ĠQuery Builder Ui < And Query > Ġ{ Ċ ĉ private Ġval Ġquery Builder Ġ= ĠAnd QueryBuilder () Ċ ĉ private Ġval Ġis Complete Ġ= ĠSimple Boolean Property ( false ) Ċ ĉ private Ġval Ġquery View Ġ= Ġd nd Manager . create Target List () ĊĊ ĉ init Ġ{ Ċĉ ĉ setText (" AND ") Ċĉ ĉ query View . getItems (). addListener Ġ{ Ġchange : ĠChange < out ĠDrag able Query > Ġ-> Ċĉĉ ĉ is Complete . bind ( create Sub Queries Complete Binding ( change . getList ())) Ċĉĉ ĉ query Builder . set Sub Queries ( change . getList (). map Ġ{ Ġit . query . get QueryBuilder () Ġ}) Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ private Ġfun Ġcreate Sub Queries Complete Binding ( sub Queries : ĠList < Drag able Query >): ĠBoolean Expression Ġ= Ċĉ ĉ if Ġ( sub Queries . isEmpty ()) Ġ{ Ċĉĉ ĉ Simple Boolean Property ( false ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ sub Queries . map Ġ{ Ġit . query . is Complete () Ġas ĠBoolean Expression Ġ}. reduce Ġ{ Ġa , Ġb Ġ-> Ġa . and ( b ) Ġ} Ċĉ ĉ } ĊĊ ĉ override Ġfun ĠgetNode (): ĠNode Ġ= Ġthis ĊĊ ĉ override Ġfun Ġget QueryBuilder (): ĠQuery Builder < And Query > Ġ= Ġquery Builder ĊĊ ĉ override Ġfun Ġis Complete (): ĠReadOnly Boolean Property Ġ= Ġis Complete ĊĊ ĉ override Ġfun Ġset Preview ( preview : ĠBoolean ) Ġ{ Ċĉ ĉ this . set Disabled ( preview ) Ċĉ ĉ if Ġ( preview ) Ġ Ġ{ Ċĉĉ ĉ setContent ( null ) Ċĉ ĉ } Ġelse Ġ{ ĊĉĉĠĠĠ Ġset Content ( query View ) Ċĉ ĉ } Ċ ĉ } Ċ }