Search in sources :

Example 1 with CodeUsageInfo

use of jadx.gui.utils.CodeUsageInfo in project jadx by skylot.

the class UsageDialog method performSearch.

private synchronized void performSearch() {
    resultsModel.clear();
    CodeUsageInfo usageInfo = cache.getUsageInfo();
    if (usageInfo == null) {
        return;
    }
    resultsModel.addAll(usageInfo.getUsageList(node));
    // TODO: highlight only needed node usage
    highlightText = null;
    resultsTable.updateTable();
}
Also used : CodeUsageInfo(jadx.gui.utils.CodeUsageInfo)

Example 2 with CodeUsageInfo

use of jadx.gui.utils.CodeUsageInfo in project jadx by skylot.

the class IndexJob method runJob.

protected void runJob() {
    JNodeCache nodeCache = cache.getNodeCache();
    final TextSearchIndex index = new TextSearchIndex(nodeCache);
    final CodeUsageInfo usageInfo = new CodeUsageInfo(nodeCache);
    cache.setTextIndex(index);
    cache.setUsageInfo(usageInfo);
    for (final JavaClass cls : wrapper.getClasses()) {
        addTask(new Runnable() {

            @Override
            public void run() {
                try {
                    index.indexNames(cls);
                    CodeLinesInfo linesInfo = new CodeLinesInfo(cls);
                    List<StringRef> lines = splitLines(cls);
                    usageInfo.processClass(cls, linesInfo, lines);
                    if (Utils.isFreeMemoryAvailable()) {
                        index.indexCode(cls, linesInfo, lines);
                    } else {
                        index.classCodeIndexSkipped(cls);
                    }
                } catch (Exception e) {
                    LOG.error("Index error in class: {}", cls.getFullName(), e);
                }
            }
        });
    }
}
Also used : CodeUsageInfo(jadx.gui.utils.CodeUsageInfo) JavaClass(jadx.api.JavaClass) List(java.util.List) JNodeCache(jadx.gui.utils.JNodeCache) TextSearchIndex(jadx.gui.utils.search.TextSearchIndex) CodeLinesInfo(jadx.gui.utils.CodeLinesInfo)

Aggregations

CodeUsageInfo (jadx.gui.utils.CodeUsageInfo)2 JavaClass (jadx.api.JavaClass)1 CodeLinesInfo (jadx.gui.utils.CodeLinesInfo)1 JNodeCache (jadx.gui.utils.JNodeCache)1 TextSearchIndex (jadx.gui.utils.search.TextSearchIndex)1 List (java.util.List)1