mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-22 14:16:20 +00:00
Add class to default package, correct prefilled class name
This commit is contained in:
@@ -45,14 +45,23 @@ public class AS3Package extends AS3ClassTreeItem {
|
||||
private List<ScriptPack> sortedScripts;
|
||||
|
||||
private boolean flat;
|
||||
|
||||
private boolean defaultPackage;
|
||||
|
||||
public AS3Package(String packageName, SWF swf, boolean flat) {
|
||||
public AS3Package(String packageName, SWF swf, boolean flat, boolean defaultPackage) {
|
||||
super(packageName, "", null);
|
||||
this.flat = flat;
|
||||
this.swf = swf;
|
||||
this.packageName = packageName;
|
||||
this.defaultPackage = defaultPackage;
|
||||
}
|
||||
|
||||
public boolean isDefaultPackage() {
|
||||
return defaultPackage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public SWF getSwf() {
|
||||
return swf;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel
|
||||
public ClassesListTreeModel(SWF swf, boolean flat) {
|
||||
super(null, null, null);
|
||||
this.flat = flat;
|
||||
root = new AS3Package(null, swf, flat);
|
||||
root = new AS3Package(null, swf, flat, false);
|
||||
this.swf = swf;
|
||||
this.list = swf.getAS3Packs();
|
||||
setFilter(null);
|
||||
@@ -117,12 +117,14 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel
|
||||
private AS3Package ensurePackage(DottedChain packageStr) {
|
||||
if (flat) {
|
||||
String fullName = packageStr.toPrintableString(true);
|
||||
boolean defaultPackage = false;
|
||||
if (fullName.length() == 0) {
|
||||
fullName = AppResources.translate("package.default");
|
||||
defaultPackage = true;
|
||||
}
|
||||
AS3Package pkg = root.getSubPackage(fullName);
|
||||
if (pkg == null) {
|
||||
pkg = new AS3Package(fullName, swf, true);
|
||||
pkg = new AS3Package(fullName, swf, true, defaultPackage);
|
||||
root.addSubPackage(pkg);
|
||||
}
|
||||
return pkg;
|
||||
@@ -132,7 +134,7 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel
|
||||
String pathElement = packageStr.get(i);
|
||||
AS3Package pkg = parent.getSubPackage(pathElement);
|
||||
if (pkg == null) {
|
||||
pkg = new AS3Package(pathElement, swf, false);
|
||||
pkg = new AS3Package(pathElement, swf, false, false);
|
||||
parent.addSubPackage(pkg);
|
||||
}
|
||||
|
||||
|
||||
@@ -1551,6 +1551,9 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
if (path[p] instanceof ClassesListTreeModel) {
|
||||
break;
|
||||
}
|
||||
if (((AS3Package) path[p]).isDefaultPackage()) {
|
||||
break;
|
||||
}
|
||||
preselected = ((AS3Package) path[p]).packageName + "." + preselected;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user