GP-0: Fix complaint about anonymous listener.

This commit is contained in:
Dan 2024-12-13 12:15:22 -05:00
parent 6ce87eaf58
commit 2c571117c4

View file

@ -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;
//@AutoServiceConsumed via method
@ -773,30 +802,7 @@ public class DebuggerListingProvider extends CodeViewerProvider {
@Override
protected CodeBrowserClipboardProvider newClipboardProvider() {
return new CodeBrowserClipboardProvider(tool, 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);
}
};
return new ForListingClipboardProvider();
}
protected void createActions() {