use of cbit.vcell.model.ReactionQuerySpec in project vcell by virtualcell.
the class DBReactionWizardPanel method search.
/**
* Comment
*/
private void search() {
if (getDocumentManager() != null) {
String textSearchS = getFindTextJTextField().getText();
if (textSearchS != null && textSearchS.length() == 0) {
textSearchS = null;
}
final ReactionQuerySpec reactionQuerySpec = new ReactionQuerySpec((getFindRXTextRadioButton().isSelected() ? formatLikeString(textSearchS) : null), (getKeggMoleculeJRadioButton().isSelected() ? getCurrentDBFormalSpecies() : null));
if (getSearchUserJRadioButton().isSelected()) {
searchUserReactions(reactionQuerySpec);
return;
}
final DocumentManager docManager = getDocumentManager();
final javax.swing.JList jlist = getReactionsJList();
//
final String RXDESC_VALUE_KEY = "rxDesc";
AsynchClientTask searchReactions = new AsynchClientTask("searching reactions", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
public void run(Hashtable<String, Object> hash) throws DataAccessException {
ReactionDescription[] dbfr = docManager.getDictionaryReactions(reactionQuerySpec);
if (dbfr != null && dbfr.length > 0) {
hash.put(RXDESC_VALUE_KEY, dbfr);
}
}
};
//
AsynchClientTask updateRXList = new AsynchClientTask("updateRXList", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
public void run(Hashtable<String, Object> hash) {
ReactionDescription[] dbfr = (ReactionDescription[]) hash.get(RXDESC_VALUE_KEY);
if (dbfr != null) {
jlist.setListData(dbfr);
} else {
jlist.setListData(new ReactionDescription[0]);
}
afterSearchConfigure();
}
};
//
Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
ClientTaskDispatcher.dispatch(this, hashTemp, new AsynchClientTask[] { searchReactions, updateRXList }, false);
}
}
Aggregations