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
@@ -110,15 +110,9 @@ public abstract class AbstractNextPreviousAction extends CodeViewerContextAction
void setDirection(boolean isForward) { void setDirection(boolean isForward) {
this.isForward = isForward; this.isForward = isForward;
getMenuBarData().setMenuItemName(getMenuName());
setDescription(getDescription()); setDescription(getDescription());
} }
private String getMenuName() {
String prefix = isForward ? "Next " : "Previous ";
return prefix + getNavigationTypeName();
}
private String getDescriptionString() { private String getDescriptionString() {
String prefix = isForward ? "Go To Next " : "Go To Previous "; String prefix = isForward ? "Go To Next " : "Go To Previous ";
return prefix + getNavigationTypeName(); return prefix + getNavigationTypeName();
@@ -141,7 +141,6 @@ public class NextPrevCodeUnitPlugin extends Plugin {
@Override @Override
public void actionPerformed(NavigatableActionContext context) { public void actionPerformed(NavigatableActionContext context) {
isForward = !isForward; isForward = !isForward;
getMenuBarData().setIcon(isForward ? forwardIcon : backwardIcon);
getToolBarData().setIcon(isForward ? forwardIcon : backwardIcon); getToolBarData().setIcon(isForward ? forwardIcon : backwardIcon);
updateActions(isForward); updateActions(isForward);
} }
@@ -227,15 +227,9 @@ public class NextPreviousBookmarkAction extends MultiStateDockingAction<String>
public void setDirection(boolean isForward) { public void setDirection(boolean isForward) {
this.isForward = isForward; this.isForward = isForward;
getMenuBarData().setMenuItemName(getMenuName());
setDescription(getDescription()); setDescription(getDescription());
} }
private String getMenuName() {
String prefix = isForward ? "Next " : "Previous ";
return prefix + getNavigationTypeName();
}
private String getNavigationTypeName() { private String getNavigationTypeName() {
return "Bookmark"; return "Bookmark";
} }
@@ -98,8 +98,11 @@ public abstract class AbstractDecompilerAction extends DockingAction {
HighSymbol highSymbol = null; HighSymbol highSymbol = null;
if (variable == null) { if (variable == null) {
// Token may be from a variable reference, in which case we have to dig to find the actual symbol // Token may be from a variable reference, in which case we have to dig to find the actual symbol
Address storageAddress = Function function = highFunction.getFunction();
getStorageAddress(token, highFunction.getFunction().getProgram()); if (function == null) {
return null;
}
Address storageAddress = getStorageAddress(token, function.getProgram());
if (storageAddress == null) { if (storageAddress == null) {
return null; return null;
} }