mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
Set Equate: show all matching names in each enum
This commit is contained in:
parent
42ca00b35d
commit
1da1c9fef3
2 changed files with 19 additions and 5 deletions
|
@ -210,11 +210,8 @@ public class SetEquateDialog extends DialogComponentProvider {
|
|||
.stream()
|
||||
.filter(dt -> dt instanceof Enum)
|
||||
.map(Enum.class::cast)
|
||||
.filter(enoom -> enoom.getName(scalar.getValue()) != null)
|
||||
.forEach(enoom -> {
|
||||
String name = enoom.getName(scalar.getValue());
|
||||
entries.add(new EquateRowObject(name, enoom));
|
||||
});
|
||||
.flatMap(enoom -> Arrays.stream(enoom.getNames(scalar.getValue())).map(name -> new EquateRowObject(name, enoom)))
|
||||
.forEach(entries::add);
|
||||
//@formatter:on
|
||||
|
||||
return entries;
|
||||
|
|
|
@ -162,6 +162,23 @@ class EnumDB extends DataTypeDB implements Enum {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getNames(long value) {
|
||||
lock.acquire();
|
||||
try {
|
||||
checkIsValid();
|
||||
initializeIfNeeded();
|
||||
List<String> list = valueMap.get(value);
|
||||
if (list == null) {
|
||||
return new String[0];
|
||||
}
|
||||
return list.toArray(new String[0]);
|
||||
}
|
||||
finally {
|
||||
lock.release();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLanguageDependantLength() {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue