ASM panel is empty after switching caching mode: fixed (selected methodbody was not cleared, but the text was cleared => no refresh)

This commit is contained in:
Honfika
2013-11-25 21:56:29 +01:00
parent abfc07ca59
commit ae3b124b37
5 changed files with 11 additions and 5 deletions
@@ -3097,7 +3097,7 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
break;
}
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setCode("");
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.clear();
abcPanel.navigator.setABC(abcList, scriptLeaf.abc);
abcPanel.navigator.setClassIndex(classIndex, scriptLeaf.scriptIndex);
abcPanel.setAbc(scriptLeaf.abc);
@@ -525,7 +525,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr
switchAbc(listIndex);
decompiledTextArea.clearScriptCache();
decompiledTextArea.reloadClass();
detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(-1, abc, decompiledTextArea.getCurrentTrait());
detailPanel.methodTraitPanel.methodCodePanel.clear();
}
@Override
@@ -246,6 +246,12 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi
setCaretPosition(0);
}
public void clear() {
setText("");
bodyIndex = -1;
setCaretPosition(0);
}
public void selectInstruction(int pos) {
String text = getText();
int lineCnt = 1;
@@ -143,7 +143,7 @@ public final class ClassesListTree extends JTree implements TreeSelectionListene
abcPanel.decompiledTextArea.setScript(scriptLeaf, abcList);
abcPanel.decompiledTextArea.setClassIndex(classIndex);
abcPanel.decompiledTextArea.setNoTrait();
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setCode("");
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.clear();
Main.stopWork();
}
}).start();
@@ -78,8 +78,8 @@ public class MethodCodePanel extends JPanel implements ActionListener {
return sourceTextArea.bodyIndex;
}
public void setCode(String text) {
sourceTextArea.setText(text);
public void clear() {
sourceTextArea.clear();
}
public boolean save(ConstantPool constants) {