From e6c024aadedc067ebef1af86d1a5d6fcb56d8d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 9 Feb 2013 14:41:41 +0100 Subject: [PATCH] AS3: comment without semicolon, clickable text while settext --- .../jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java | 7 +++++++ .../src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java index 3c0c6c9c2..67af92de8 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/treemodel/CommentTreeItem.java @@ -20,5 +20,12 @@ public class CommentTreeItem extends TreeItem { public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { return "//"+comment; } + + @Override + public boolean needsSemicolon() { + return false; + } + + } diff --git a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java index 3c6285d3f..c42662730 100644 --- a/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java +++ b/trunk/src/com/jpexs/asdec/abc/gui/DecompiledEditorPane.java @@ -121,6 +121,9 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL } public void caretUpdate(CaretEvent e) { + if(abc==null){ + return; + } if (ignoreCarret) { return; } @@ -281,10 +284,10 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL methodHighlights = bc.methodHighlights; classHighlights = bc.classHighlights; } - setText(hilightedCode); this.abc = abc; this.abcList = abcList; this.script = script; + setText(hilightedCode); } public void reloadClass() {