Sunday, January 8, 2012

Changing the Query Mode of a search region during Runtime

Changing the Search Mode at Runtime:
  QueryOperationEvent queryOperationEvent = new QueryOperationEvent(getQueryRegion(),
                                                                              QueryOperationEvent.Operation.MODE_CHANGE,
                                                                              getQueryRegion().getValue());
   queryOperationEvent.getDescriptor().changeMode(QueryDescriptor.QueryMode.ADVANCED);

Note: getQueryRegion() retrives the bindings of the search region In the above code, the mode is set to ADVANCED. if one wants to swap the modes, create the QueryOperationEvent as in line 1 and broadcast the event.

No comments: