mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-2076 domain object event refactor
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.byteviewer;
|
||||
|
||||
import static ghidra.framework.model.DomainObjectEvent.*;
|
||||
import static ghidra.program.util.ProgramEvent.*;
|
||||
|
||||
import java.awt.event.*;
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
@@ -39,7 +42,8 @@ import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.CodeUnit;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.*;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.classfinder.ClassSearcher;
|
||||
import ghidra.util.datastruct.WeakDataStructureFactory;
|
||||
@@ -534,8 +538,7 @@ public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvi
|
||||
public void domainObjectChanged(DomainObjectChangedEvent event) {
|
||||
|
||||
if (blockSet != null) {
|
||||
if (event.containsEvent(DomainObject.DO_OBJECT_SAVED) ||
|
||||
event.containsEvent(DomainObject.DO_DOMAIN_FILE_CHANGED)) {
|
||||
if (event.contains(SAVED, FILE_CHANGED)) {
|
||||
// drop all changes
|
||||
|
||||
blockSet.setByteBlockChangeManager(newByteBlockChangeManager(blockSet, null));
|
||||
@@ -543,13 +546,8 @@ public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvi
|
||||
}
|
||||
}
|
||||
|
||||
if (event.containsEvent(DomainObject.DO_OBJECT_RESTORED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEMORY_BLOCK_CHANGED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEMORY_BLOCK_ADDED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEMORY_BLOCK_MOVED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEMORY_BLOCK_REMOVED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEMORY_BLOCKS_JOINED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEMORY_BLOCK_SPLIT)) {
|
||||
if (event.contains(RESTORED, MEMORY_BLOCK_CHANGED, MEMORY_BLOCK_ADDED, MEMORY_BLOCK_MOVED,
|
||||
MEMORY_BLOCK_REMOVED, MEMORY_BLOCKS_JOINED, MEMORY_BLOCK_SPLIT)) {
|
||||
|
||||
// call plugin to update data models
|
||||
memoryConfigurationChanged();
|
||||
@@ -557,9 +555,7 @@ public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvi
|
||||
// changeManager, so get out now.
|
||||
}
|
||||
|
||||
if (event.containsEvent(ChangeManager.DOCR_MEMORY_BYTES_CHANGED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_CODE_ADDED) ||
|
||||
event.containsEvent(ChangeManager.DOCR_MEM_REFERENCE_ADDED)) {
|
||||
if (event.contains(MEMORY_BYTES_CHANGED, CODE_ADDED, REFERENCE_ADDED)) {
|
||||
updateManager.update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user