public void setupListeners ( ) { // Getting the list of views QueryInterfaceViewsList queryInterfaceViews = ( QueryInterfaceViewsList ) this . getOWLEditorKit ( ) . get ( QueryInterfaceViewsList . class . getName ( ) ) ; if ( ( queryInterfaceViews == null ) ) { queryInterfaceViews = new QueryInterfaceViewsList ( ) ; getOWLEditorKit ( ) . put ( QueryInterfaceViewsList . class . getName ( ) , queryInterfaceViews ) ; } // Adding the new instance (this) queryInterfaceViews . add ( this ) ; // Registering the current query view with all existing query manager views QueryManagerViewsList queryManagerViews = ( QueryManagerViewsList ) this . getOWLEditorKit ( ) . get ( QueryManagerViewsList . class . getName ( ) ) ; if ( ( queryManagerViews != null ) && ( ! queryManagerViews . isEmpty ( ) ) ) { for ( QueryManagerView queryInterfaceView : queryManagerViews ) { queryInterfaceView . addListener ( this ) ; } } }
On creation of a new view we register it globally and make sure that its selector is listened by all other instances of query view in this editor kit . Also we make this new instance listen to the selection of all other query selectors in the views .