예제 #1
0
  @Override
  protected void disposeOWLView() {
    this.getOWLModelManager().removeOntologyChangeListener(ontologyListener);

    QueryInterfaceViewsList queryInterfaceViews =
        (QueryInterfaceViewsList)
            this.getOWLEditorKit().get(QueryInterfaceViewsList.class.getName());
    if ((queryInterfaceViews != null)) {
      queryInterfaceViews.remove(this);
    }

    QueryManagerViewsList queryManagerViews =
        (QueryManagerViewsList) this.getOWLEditorKit().get(QueryManagerViewsList.class.getName());
    if ((queryManagerViews != null) && (!queryManagerViews.isEmpty())) {
      for (QueryManagerView queryInterfaceView : queryManagerViews) {
        queryInterfaceView.removeListener(this);
      }
    }
    obdaController.removeListener(this);
  }
예제 #2
0
  /**
   * 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.
   */
  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);

    // Registring 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);
      }
    }
  }