2021-06-26 01:13:46 +00:00
|
|
|
package the.bytecode.club.bytecodeviewer.gui.resourcesearch;
|
|
|
|
|
2021-08-26 21:59:07 +00:00
|
|
|
import java.util.regex.Pattern;
|
|
|
|
import java.util.regex.PatternSyntaxException;
|
|
|
|
import javax.swing.tree.TreePath;
|
2021-06-26 01:13:46 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
2021-08-26 21:59:07 +00:00
|
|
|
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
|
2021-06-26 01:13:46 +00:00
|
|
|
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;
|
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
|
|
|
|
2021-07-24 02:25:51 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
|
|
|
|
* Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2021-06-26 01:13:46 +00:00
|
|
|
/**
|
|
|
|
* @author Konloch
|
|
|
|
* @since 6/25/2021
|
|
|
|
*/
|
|
|
|
class PerformSearch extends BackgroundSearchThread
|
|
|
|
{
|
|
|
|
private final SearchBoxPane searchBoxPane;
|
|
|
|
|
2021-07-30 02:32:32 +00:00
|
|
|
public PerformSearch(SearchBoxPane searchBoxPane)
|
2021-06-26 01:13:46 +00:00
|
|
|
{
|
|
|
|
this.searchBoxPane = searchBoxPane;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-07-04 07:03:40 +00:00
|
|
|
public void search()
|
2021-06-26 01:13:46 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2021-07-30 02:32:32 +00:00
|
|
|
if(RegexSearch.searchText != null)
|
|
|
|
Pattern.compile(RegexInsnFinder.processRegex(RegexSearch.searchText.getText()), Pattern.MULTILINE);
|
2021-06-26 01:13:46 +00:00
|
|
|
}
|
|
|
|
catch (PatternSyntaxException ex)
|
|
|
|
{
|
|
|
|
BytecodeViewer.showMessage("You have an error in your regex syntax.");
|
|
|
|
}
|
|
|
|
|
2021-07-27 10:17:57 +00:00
|
|
|
for (ResourceContainer container : BytecodeViewer.resourceContainers.values())
|
2021-07-30 02:32:32 +00:00
|
|
|
container.resourceClasses.forEach((key,cn)->{
|
|
|
|
searchBoxPane.searchType.panel.search(container, key, cn, searchBoxPane.exact.isSelected());
|
|
|
|
});
|
2021-06-26 01:13:46 +00:00
|
|
|
|
2021-07-11 09:17:46 +00:00
|
|
|
BytecodeViewer.viewer.searchBoxPane.search.setEnabled(true);
|
2021-07-17 20:51:00 +00:00
|
|
|
BytecodeViewer.viewer.searchBoxPane.search.setText(TranslatedStrings.SEARCH.toString());
|
2021-06-26 01:13:46 +00:00
|
|
|
|
|
|
|
searchBoxPane.tree.expandPath(new TreePath(searchBoxPane.tree.getModel().getRoot()));
|
|
|
|
searchBoxPane.tree.updateUI();
|
|
|
|
}
|
|
|
|
}
|