GP-5565 - Decompiler - Updated the edit label dialog to pick the correct

namespace for an existing symbol
This commit is contained in:
dragonmacher 2025-04-04 19:25:22 -04:00
parent 8441563165
commit 812b02652d
2 changed files with 21 additions and 16 deletions

View file

@ -190,7 +190,7 @@ public class AddEditDialog extends ReusableDialogComponentProvider {
boolean isCurrentlyEntryPoint = false;
boolean isCurrentlyPinned = false;
CompoundCmd cmd = new CompoundCmd(symbol == null ? "Add Label" : "Edit Label");
CompoundCmd<Program> cmd = new CompoundCmd<>(symbol == null ? "Add Label" : "Edit Label");
if (symbol == null) {
cmd.add(new AddLabelCmd(addr, symbolName, parent, SourceType.USER_DEFINED));
}
@ -205,7 +205,7 @@ public class AddEditDialog extends ReusableDialogComponentProvider {
return;
}
cmd = new CompoundCmd(symbol == null ? "Add Label" : "Edit Label");
cmd = new CompoundCmd<>(symbol == null ? "Add Label" : "Edit Label");
if (primaryCheckBox.isEnabled() && primaryCheckBox.isSelected()) {
cmd.add(new SetLabelPrimaryCmd(addr, symbolName, parent));
}
@ -245,7 +245,8 @@ public class AddEditDialog extends ReusableDialogComponentProvider {
"You have removed the label text--would you like to remove the existing label?");
if (choice == OptionDialog.YES_OPTION) {
Command cmd = new DeleteLabelCmd(addr, symbol.getName(), symbol.getParentNamespace());
Command<Program> cmd =
new DeleteLabelCmd(addr, symbol.getName(), symbol.getParentNamespace());
if (!tool.execute(cmd, program)) {
setStatusText(cmd.getStatusMsg());
}
@ -328,18 +329,17 @@ public class AddEditDialog extends ReusableDialogComponentProvider {
private void initRecentChoices() {
labelNameChoices.removeAllItems();
Iterator<String> it = recentLabels.iterator();
while (it.hasNext()) {
labelNameChoices.addItem(it.next());
for (String recentLabel : recentLabels) {
labelNameChoices.addItem(recentLabel);
}
if (recentLabels.size() > 0) {
labelNameChoices.setSelectedIndex(-1);
}
}
// This method only gets the namespace associated with the current address
// and it's tree of namespaces. It does not walk the namespace tree of
// the symbol, which can be different than that of the address.
// This method only gets the namespace associated with the current address
// and it's tree of namespaces. It does not walk the namespace tree of
// the symbol, which can be different than that of the address.
private void initNamespaces() {
namespaceChoices.removeAllItems();