GT-3485 - fixed a few miscellaneous problems relating to recent action

context changes
This commit is contained in:
ghidravore 2020-03-16 13:55:49 -04:00
parent 42db5154f9
commit b66577c4dc
4 changed files with 5 additions and 15 deletions

View file

@ -110,15 +110,9 @@ public abstract class AbstractNextPreviousAction extends CodeViewerContextAction
void setDirection(boolean isForward) {
this.isForward = isForward;
getMenuBarData().setMenuItemName(getMenuName());
setDescription(getDescription());
}
private String getMenuName() {
String prefix = isForward ? "Next " : "Previous ";
return prefix + getNavigationTypeName();
}
private String getDescriptionString() {
String prefix = isForward ? "Go To Next " : "Go To Previous ";
return prefix + getNavigationTypeName();

View file

@ -141,7 +141,6 @@ public class NextPrevCodeUnitPlugin extends Plugin {
@Override
public void actionPerformed(NavigatableActionContext context) {
isForward = !isForward;
getMenuBarData().setIcon(isForward ? forwardIcon : backwardIcon);
getToolBarData().setIcon(isForward ? forwardIcon : backwardIcon);
updateActions(isForward);
}

View file

@ -227,15 +227,9 @@ public class NextPreviousBookmarkAction extends MultiStateDockingAction<String>
public void setDirection(boolean isForward) {
this.isForward = isForward;
getMenuBarData().setMenuItemName(getMenuName());
setDescription(getDescription());
}
private String getMenuName() {
String prefix = isForward ? "Next " : "Previous ";
return prefix + getNavigationTypeName();
}
private String getNavigationTypeName() {
return "Bookmark";
}

View file

@ -98,8 +98,11 @@ public abstract class AbstractDecompilerAction extends DockingAction {
HighSymbol highSymbol = null;
if (variable == null) {
// Token may be from a variable reference, in which case we have to dig to find the actual symbol
Address storageAddress =
getStorageAddress(token, highFunction.getFunction().getProgram());
Function function = highFunction.getFunction();
if (function == null) {
return null;
}
Address storageAddress = getStorageAddress(token, function.getProgram());
if (storageAddress == null) {
return null;
}