Merge remote-tracking branch 'origin/GP-3736-dragonmacher-dtm-action-bug'

This commit is contained in:
Ryan Kurtz 2024-06-07 14:37:04 -04:00
commit 871bf15714
3 changed files with 12 additions and 22 deletions

View File

@ -221,12 +221,9 @@ public class DataTypesProvider extends ComponentProviderAdapter {
addLocalAction(previousAction);
nextAction = new NextPreviousDataTypeAction(this, plugin.getName(), true);
addLocalAction(nextAction);
filterArraysAction = getFilterArraysAction();
addLocalAction(filterArraysAction);
filterPointersAction = getFilterPointersAction();
addLocalAction(filterPointersAction);
conflictHandlerModesAction = getConflictHandlerModesAction();
addLocalAction(conflictHandlerModesAction);
addLocalAction(getFilterArraysAction());
addLocalAction(getFilterPointersAction());
addLocalAction(getConflictHandlerModesAction());
// toolbar menu
addLocalAction(new OpenArchiveAction(plugin));
@ -318,6 +315,7 @@ public class DataTypesProvider extends ComponentProviderAdapter {
private ToggleDockingAction getFilterPointersAction() {
if (filterPointersAction == null) {
filterPointersAction = new FilterPointersAction(plugin);
archiveGTree.enablePointerFilter(filterPointersAction.isSelected());
}
return filterPointersAction;
@ -326,6 +324,7 @@ public class DataTypesProvider extends ComponentProviderAdapter {
private ToggleDockingAction getFilterArraysAction() {
if (filterArraysAction == null) {
filterArraysAction = new FilterArraysAction(plugin);
archiveGTree.enableArrayFilter(filterArraysAction.isSelected());
}
return filterArraysAction;

View File

@ -26,14 +26,11 @@ import ghidra.program.model.data.DataTypeConflictHandler;
import ghidra.program.model.data.DataTypeConflictHandler.ConflictResolutionPolicy;
import ghidra.util.HelpLocation;
public class ConflictHandlerModesAction extends
MultiStateDockingAction<DataTypeConflictHandler.ConflictResolutionPolicy> {
// private final DataTypeManagerPlugin plugin;
public class ConflictHandlerModesAction
extends MultiStateDockingAction<DataTypeConflictHandler.ConflictResolutionPolicy> {
public ConflictHandlerModesAction(DataTypeManagerPlugin plugin) {
super("Data Type Conflict Resolution Mode", plugin.getName());
// this.plugin = plugin;
setGroup("conflicts");
@ -49,27 +46,22 @@ public class ConflictHandlerModesAction extends
//@formatter:on
ActionState<DataTypeConflictHandler.ConflictResolutionPolicy> renameAndAddState =
new ActionState<>(
"Rename New or Moved Data Type", renameAndAddIcon,
new ActionState<>("Rename New or Moved Data Type", renameAndAddIcon,
DataTypeConflictHandler.ConflictResolutionPolicy.RENAME_AND_ADD);
renameAndAddState.setHelpLocation(conflictModesHelpLocation);
ActionState<DataTypeConflictHandler.ConflictResolutionPolicy> useExistingState =
new ActionState<>(
"Use Existing Data Type", useExistingIcon,
new ActionState<>("Use Existing Data Type", useExistingIcon,
DataTypeConflictHandler.ConflictResolutionPolicy.USE_EXISTING);
useExistingState.setHelpLocation(conflictModesHelpLocation);
ActionState<DataTypeConflictHandler.ConflictResolutionPolicy> replaceExistingState =
new ActionState<>(
"Replace Existing Data Type", replaceExistingIcon,
new ActionState<>("Replace Existing Data Type", replaceExistingIcon,
DataTypeConflictHandler.ConflictResolutionPolicy.REPLACE_EXISTING);
replaceExistingState.setHelpLocation(conflictModesHelpLocation);
ActionState<DataTypeConflictHandler.ConflictResolutionPolicy> replaceDefaultState =
new ActionState<>(
"Replace Empty Structures else Rename",
replaceDefaultIcon,
new ActionState<>("Replace Empty Structures else Rename", replaceDefaultIcon,
DataTypeConflictHandler.ConflictResolutionPolicy.REPLACE_EMPTY_STRUCTS_OR_RENAME_AND_ADD);
replaceDefaultState.setHelpLocation(conflictModesHelpLocation);
@ -86,7 +78,7 @@ public class ConflictHandlerModesAction extends
@Override
public void actionStateChanged(ActionState<ConflictResolutionPolicy> newActionState,
EventTrigger trigger) {
// action tracks its own state
// nothing to do; the action state is queried as needed by the client
}
}

View File

@ -388,7 +388,6 @@ public class DataTypeArchiveGTree extends GTree {
}
private class DataTypeTreeRenderer extends GTreeRenderer {
private static final int ICON_WIDTH = 24;
private static final int ICON_HEIGHT = 18;
@Override