Fixed Generic tag editor - Disallow add before/after or remove on parent field with indices

This commit is contained in:
Jindra Petřík
2023-10-12 20:44:59 +02:00
parent ae83087289
commit 15af8074b4
2 changed files with 12 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file.
- AS2 getters and setters decoding
- [#116] §§push at the end of switch branches
- Convolution matrix filter display and editing
- Generic tag editor - Disallow add before/after or remove on parent field with indices
## [19.0.0] - 2023-10-01
### Added

View File

@@ -552,7 +552,9 @@ public class GenericTagTreePanel extends GenericTagPanel {
JMenu mBegin = new JMenu(AppStrings.translate("generictag.array.insertbeginning").replace("%item%", itemStr));
p.add(mBegin);
JMenu mBefore = new JMenu(AppStrings.translate("generictag.array.insertbefore").replace("%item%", itemStr));
p.add(mBefore);
if (fnode.index > -1) {
p.add(mBefore);
}
mi = new JMenuItem(AppStrings.translate("generictag.array.remove").replace("%item%", itemStr));
mi.addActionListener(new ActionListener() {
@Override
@@ -576,9 +578,15 @@ public class GenericTagTreePanel extends GenericTagPanel {
}
}
});
p.add(mi);
if (fnode.index > -1) {
p.add(mi);
}
JMenu mAfter = new JMenu(AppStrings.translate("generictag.array.insertafter").replace("%item%", itemStr));
p.add(mAfter);
if (fnode.index > -1) {
p.add(mAfter);
}
JMenu mEnd = new JMenu(AppStrings.translate("generictag.array.insertend").replace("%item%", itemStr));
p.add(mEnd);