Search in sources :

Example 1 with SearchTaskFactory

use of org.cytoscape.search.internal.SearchTaskFactory in project cytoscape-impl by cytoscape.

the class EnhancedSearchPanel method doSearching.

// Do searching based on the query string from user on text-field
private void doSearching() {
    final String queryStr = tfSearchText.getText().trim();
    // Ignore if the search term is empty
    if (queryStr == null || queryStr.length() == 0)
        return;
    final CyApplicationManager appManager = serviceRegistrar.getService(CyApplicationManager.class);
    final CyNetwork currentNetwork = appManager.getCurrentNetwork();
    if (currentNetwork != null) {
        final SearchTaskFactory factory = new SearchTaskFactory(searchMgr, queryStr, serviceRegistrar);
        final DialogTaskManager taskMgr = serviceRegistrar.getService(DialogTaskManager.class);
        taskMgr.execute(factory.createTaskIterator(currentNetwork));
    } else {
        logger.error("Could not find network for search");
    }
}
Also used : CyApplicationManager(org.cytoscape.application.CyApplicationManager) SearchTaskFactory(org.cytoscape.search.internal.SearchTaskFactory) CyNetwork(org.cytoscape.model.CyNetwork) DialogTaskManager(org.cytoscape.work.swing.DialogTaskManager)

Aggregations

CyApplicationManager (org.cytoscape.application.CyApplicationManager)1 CyNetwork (org.cytoscape.model.CyNetwork)1 SearchTaskFactory (org.cytoscape.search.internal.SearchTaskFactory)1 DialogTaskManager (org.cytoscape.work.swing.DialogTaskManager)1