mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-0: Fix complaint about anonymous listener.
This commit is contained in:
parent
6ce87eaf58
commit
2c571117c4
1 changed files with 30 additions and 24 deletions
|
@ -290,6 +290,35 @@ public class DebuggerListingProvider extends CodeViewerProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected class ForListingClipboardProvider extends CodeBrowserClipboardProvider {
|
||||||
|
protected ForListingClipboardProvider() {
|
||||||
|
super(DebuggerListingProvider.this.tool, DebuggerListingProvider.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValidContext(ActionContext context) {
|
||||||
|
if (!(context instanceof DebuggerListingActionContext)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return context.getComponentProvider() == componentProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPaste(DataFlavor[] availableFlavors) {
|
||||||
|
if (controlService == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Trace trace = current.getTrace();
|
||||||
|
if (trace == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!controlService.getCurrentMode(trace).canEdit(current)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return super.canPaste(availableFlavors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private final DebuggerListingPlugin plugin;
|
private final DebuggerListingPlugin plugin;
|
||||||
|
|
||||||
//@AutoServiceConsumed via method
|
//@AutoServiceConsumed via method
|
||||||
|
@ -773,30 +802,7 @@ public class DebuggerListingProvider extends CodeViewerProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected CodeBrowserClipboardProvider newClipboardProvider() {
|
protected CodeBrowserClipboardProvider newClipboardProvider() {
|
||||||
return new CodeBrowserClipboardProvider(tool, this) {
|
return new ForListingClipboardProvider();
|
||||||
@Override
|
|
||||||
public boolean isValidContext(ActionContext context) {
|
|
||||||
if (!(context instanceof DebuggerListingActionContext)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return context.getComponentProvider() == componentProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPaste(DataFlavor[] availableFlavors) {
|
|
||||||
if (controlService == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Trace trace = current.getTrace();
|
|
||||||
if (trace == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!controlService.getCurrentMode(trace).canEdit(current)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return super.canPaste(availableFlavors);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createActions() {
|
protected void createActions() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue