Issue #1062 Editing/displaying script initializers

This commit is contained in:
Jindra Petřík
2015-10-20 16:37:39 +02:00
parent 057a12ccba
commit f143434d9e
23 changed files with 876 additions and 859 deletions

View File

@@ -37,6 +37,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
import com.jpexs.decompiler.flash.gui.AppStrings;
import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightData;
import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType;
import com.jpexs.decompiler.flash.helpers.hilight.Highlighting;
@@ -516,8 +517,8 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
Highlighting cm = Highlighting.searchPos(classHighlights, pos);
if (cm != null) {
classIndex = (int) cm.getProperties().index;
displayClass(classIndex, script.scriptIndex);
}
displayClass(classIndex, script.scriptIndex);
Highlighting tm = Highlighting.searchPos(methodHighlights, pos);
if (tm != null) {
String name = "";
@@ -594,13 +595,11 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
}
public void gotoTrait(int traitId) {
if (traitId == -1) {
return;
}
boolean isScriptInit = traitId == GraphTextWriter.TRAIT_SCRIPT_INITIALIZER;
Highlighting tc = Highlighting.searchIndex(classHighlights, classIndex);
if (tc != null) {
Highlighting th = Highlighting.searchIndex(traitHighlights, traitId, tc.startPos, tc.startPos + tc.len);
if (tc != null || isScriptInit) {
Highlighting th = Highlighting.searchIndex(traitHighlights, traitId, isScriptInit ? 0 : tc.startPos, isScriptInit ? -1 : tc.startPos + tc.len);
int pos;
if (th != null) {
if (th.len > 1) {