Fixed Move tag to action did not remove original tag

Properly handle pins on moveto action
This commit is contained in:
Jindra Petřík
2022-11-20 22:12:19 +01:00
parent 8ac2ff192a
commit 213fd72266
9 changed files with 119 additions and 62 deletions
@@ -371,4 +371,24 @@ public class PinsPanel extends JPanel {
}
save();
}
public void replaceItem(TreeItem oldItem, TreeItem newItem) {
for (int i = 0; i < items.size(); i++) {
if (items.get(i) == oldItem) {
items.set(i, newItem);
rebuild();
break;
}
}
}
public void removeItem(TreeItem item) {
for (int i = 0; i < items.size(); i++) {
if (items.get(i) == item) {
items.remove(i);
rebuild();
break;
}
}
}
}