2021-06-26 01:13:46 +00:00
|
|
|
package the.bytecode.club.bytecodeviewer.gui.resourcesearch;
|
|
|
|
|
|
|
|
import org.objectweb.asm.tree.ClassNode;
|
|
|
|
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
|
|
|
import the.bytecode.club.bytecodeviewer.gui.MainViewerGUI;
|
|
|
|
import the.bytecode.club.bytecodeviewer.searching.BackgroundSearchThread;
|
|
|
|
import the.bytecode.club.bytecodeviewer.searching.RegexInsnFinder;
|
2021-07-04 07:03:40 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.searching.impl.RegexSearch;
|
2021-06-26 01:13:46 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.searching.SearchResultNotifier;
|
More Translations
Most components should be translated. All of the components that were hardcoded for English now work with translations.
All of the translations now include any missing translation keys.
Added translations for: Farsi, Finnish, Greek, Indonesian, Bengali, Italian, Korean, Dutch, Polish, Swedish, Thai, Hebrew, Turkish, Ukrainian, Hungarian, Georgian, Javanese, Hausa, Swahili, Norwegian & Vietnamese
2021-07-08 08:22:39 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
|
2021-06-26 01:13:46 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.util.FileContainer;
|
|
|
|
|
|
|
|
import javax.swing.tree.TreePath;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
import java.util.regex.PatternSyntaxException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Konloch
|
|
|
|
* @since 6/25/2021
|
|
|
|
*/
|
|
|
|
class PerformSearch extends BackgroundSearchThread
|
|
|
|
{
|
|
|
|
private final SearchBoxPane searchBoxPane;
|
|
|
|
private final SearchResultNotifier srn;
|
|
|
|
|
|
|
|
public PerformSearch(SearchBoxPane searchBoxPane, SearchResultNotifier srn)
|
|
|
|
{
|
|
|
|
this.searchBoxPane = searchBoxPane;
|
|
|
|
this.srn = srn;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-07-04 07:03:40 +00:00
|
|
|
public void search()
|
2021-06-26 01:13:46 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Pattern.compile(RegexInsnFinder.processRegex(RegexSearch.searchText.getText()), Pattern.MULTILINE);
|
|
|
|
}
|
|
|
|
catch (PatternSyntaxException ex)
|
|
|
|
{
|
|
|
|
BytecodeViewer.showMessage("You have an error in your regex syntax.");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (FileContainer container : BytecodeViewer.files)
|
2021-07-10 16:05:08 +00:00
|
|
|
for (ClassNode c : container.resourceClasses.values())
|
2021-06-26 01:13:46 +00:00
|
|
|
searchBoxPane.searchType.details.search(container, c, srn, searchBoxPane.exact.isSelected());
|
|
|
|
|
|
|
|
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search.setEnabled(true);
|
More Translations
Most components should be translated. All of the components that were hardcoded for English now work with translations.
All of the translations now include any missing translation keys.
Added translations for: Farsi, Finnish, Greek, Indonesian, Bengali, Italian, Korean, Dutch, Polish, Swedish, Thai, Hebrew, Turkish, Ukrainian, Hungarian, Georgian, Javanese, Hausa, Swahili, Norwegian & Vietnamese
2021-07-08 08:22:39 +00:00
|
|
|
Objects.requireNonNull(MainViewerGUI.getComponent(SearchBoxPane.class)).search.setText(TranslatedStrings.SEARCH.getText());
|
2021-06-26 01:13:46 +00:00
|
|
|
|
|
|
|
searchBoxPane.tree.expandPath(new TreePath(searchBoxPane.tree.getModel().getRoot()));
|
|
|
|
searchBoxPane.tree.updateUI();
|
|
|
|
}
|
|
|
|
}
|