Search in sources :

Example 1 with SearchResult

use of com.android.tools.perflib.vmtrace.SearchResult in project android by JetBrains.

the class TraceViewPanel method searchTextChanged.

private void searchTextChanged(@Nullable String pattern) {
    if (StringUtil.isEmpty(pattern)) {
        myTraceViewCanvas.setHighlightMethods(null);
        myResultsLabel.setText("");
        return;
    }
    ThreadInfo thread = (ThreadInfo) myThreadCombo.getSelectedItem();
    SearchResult results = myTraceData.searchFor(pattern, thread);
    myTraceViewCanvas.setHighlightMethods(results.getMethods());
    String result = String.format("%1$d %2$s, %3$d %4$s", results.getMethods().size(), StringUtil.pluralize("method", results.getMethods().size()), results.getInstances().size(), StringUtil.pluralize("instance", results.getInstances().size()));
    myResultsLabel.setText(result);
}
Also used : ThreadInfo(com.android.tools.perflib.vmtrace.ThreadInfo) SearchResult(com.android.tools.perflib.vmtrace.SearchResult)

Aggregations

SearchResult (com.android.tools.perflib.vmtrace.SearchResult)1 ThreadInfo (com.android.tools.perflib.vmtrace.ThreadInfo)1