public QueryControllerQuery addQuery ( String queryStr , String queryId ) { int position = getElementPosition ( queryId ) ; QueryControllerQuery query = new QueryControllerQuery ( queryId ) ; query . setQuery ( queryStr ) ; if ( position == - 1 ) { // add to the collection for a new query. entities . add ( query ) ; fireElementAdded ( query ) ; } else { entities . set ( position , query ) ; fireElementChanged ( query ) ; } return query ; }
Creates a new query and adds it to the vector QueryControllerEntity .