core: refactor attribute storage
This commit is contained in:
@@ -5,10 +5,10 @@ import jadx.api.IJadxArgs;
|
||||
import jadx.api.JavaClass;
|
||||
import jadx.api.JavaPackage;
|
||||
import jadx.core.utils.exceptions.DecodeException;
|
||||
import jadx.core.utils.exceptions.JadxException;
|
||||
|
||||
import javax.swing.ProgressMonitor;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@@ -29,20 +29,21 @@ public class JadxWrapper {
|
||||
this.openFile = file;
|
||||
try {
|
||||
this.decompiler.loadFile(file);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error open file: " + file, e);
|
||||
} catch (DecodeException e) {
|
||||
LOG.error("Error decode file: " + file, e);
|
||||
} catch (JadxException e) {
|
||||
LOG.error("Error open file: " + file, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void saveAll(final File dir, final ProgressMonitor progressMonitor) {
|
||||
Runnable save = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
decompiler.setOutputDir(dir);
|
||||
ThreadPoolExecutor ex = decompiler.getSaveExecutor();
|
||||
ThreadPoolExecutor ex = (ThreadPoolExecutor) decompiler.getSaveExecutor();
|
||||
ex.shutdown();
|
||||
while (ex.isTerminating()) {
|
||||
long total = ex.getTaskCount();
|
||||
|
||||
@@ -37,12 +37,16 @@ class CodePanel extends JPanel {
|
||||
add(scrollPane);
|
||||
|
||||
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK);
|
||||
Utils.addKeyBinding(codeArea, key, "SearchAction", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
searchBar.toggle();
|
||||
}
|
||||
});
|
||||
Utils.addKeyBinding(codeArea, key, "SearchAction", new SearchAction());
|
||||
}
|
||||
|
||||
private class SearchAction extends AbstractAction {
|
||||
private static final long serialVersionUID = 8650568214755387093L;
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
searchBar.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
TabbedPane getCodePanel() {
|
||||
|
||||
Reference in New Issue
Block a user